:root {
  color-scheme: dark;
  --ink: #061311;
  --ink-raised: #0b201d;
  --ink-soft: #102b27;
  --paper: #f4f1e8;
  --muted: #aabbb5;
  --line: rgba(217, 236, 227, 0.14);
  --mint: #91f2cd;
  --teal: #35d0b2;
  --coral: #ff896f;
  --amber: #f5c86b;
  --danger: #ff9a8b;
  --radius: 22px;
  --shadow: 0 22px 65px rgba(0, 0, 0, 0.24);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 0;
  color: var(--paper);
  background:
    radial-gradient(circle at 78% 5%, rgba(53, 208, 178, 0.14), transparent 32rem),
    var(--ink);
  line-height: 1.55;
}

button, input, select { font: inherit; }

button { color: inherit; }

button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, [tabindex="-1"]:focus-visible {
  outline: 3px solid var(--mint);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7rem 1rem;
  color: var(--ink);
  background: var(--mint);
  border-radius: 10px;
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.site-header, .site-footer, main {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  border: 0;
  background: none;
  font-weight: 760;
  font-size: 1.16rem;
  letter-spacing: -0.03em;
  cursor: pointer;
}

.brand-mark {
  width: 31px;
  height: 31px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 9px;
  color: var(--ink);
  background: var(--mint);
  transform: rotate(-4deg);
}

.brand-mark i {
  width: 3px;
  border-radius: 5px;
  background: currentColor;
}

.brand-mark i:nth-child(1) { height: 9px; }
.brand-mark i:nth-child(2) { height: 17px; }
.brand-mark i:nth-child(3) { height: 12px; }

.site-nav { display: flex; align-items: center; gap: 0.3rem; }

.nav-link {
  border: 0;
  padding: 0.65rem 0.8rem;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.nav-link:hover { color: var(--paper); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.2rem;
  border: 1px solid transparent;
  border-radius: 13px;
  color: var(--ink);
  background: var(--mint);
  font-weight: 760;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease;
}

.button:hover { transform: translateY(-2px); background: #b1f9df; }
.button:disabled { opacity: 0.55; cursor: wait; transform: none; }
.button-small { min-height: 40px; padding: 0.55rem 0.9rem; }
.button-secondary { color: var(--paper); background: transparent; border-color: var(--line); }
.button-secondary:hover { background: var(--ink-soft); }
.button-coral { background: var(--coral); }

.hero {
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(330px, 0.9fr);
  align-items: center;
  gap: clamp(3rem, 8vw, 7rem);
  padding: 5rem 0 7rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  color: var(--mint);
  font-size: 0.8rem;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow::before { content: ""; width: 20px; height: 2px; background: currentColor; }

h1, h2, h3, p { margin-top: 0; }

h1 {
  max-width: 720px;
  margin-bottom: 1.35rem;
  font-size: clamp(3.1rem, 7vw, 6.8rem);
  line-height: 0.94;
  letter-spacing: -0.068em;
}

h1 em { color: var(--coral); font-family: Georgia, serif; font-weight: 500; }

h2 { font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.03; letter-spacing: -0.045em; }
h3 { font-size: 1.18rem; letter-spacing: -0.02em; }

.lede { max-width: 620px; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.25rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 2rem 0 1.2rem; }
.fine-print { color: var(--muted); font-size: 0.86rem; }
.app-username { color: var(--muted); }
.app-username code { color: var(--mint); overflow-wrap: anywhere; word-break: break-word; }

.orbit {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.orbit::before, .orbit::after {
  content: "";
  position: absolute;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.orbit::before { inset: 16%; }
.orbit::after { inset: 33%; background: rgba(145, 242, 205, 0.04); }

.orbit-core {
  z-index: 1;
  width: 116px;
  height: 116px;
  display: grid;
  place-items: center;
  border-radius: 31px;
  color: var(--ink);
  background: var(--mint);
  font-size: 2.7rem;
  font-weight: 900;
  box-shadow: 0 0 70px rgba(145, 242, 205, 0.24);
  transform: rotate(-6deg);
}

.orbit-label {
  position: absolute;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--ink-raised);
  color: var(--muted);
  font-size: 0.82rem;
  box-shadow: var(--shadow);
}

.orbit-label:nth-of-type(1) { top: 4%; right: 18%; }
.orbit-label:nth-of-type(2) { top: 48%; right: -4%; }
.orbit-label:nth-of-type(3) { bottom: 5%; left: 23%; }
.orbit-label:nth-of-type(4) { top: 30%; left: -3%; }

.section { padding: 5rem 0; }
.section-heading { max-width: 700px; margin-bottom: 2rem; }

.promise-grid, .plan-grid, .service-grid, .onboarding-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.panel, .plan-card, .service-card, .onboarding-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(11, 32, 29, 0.76);
}

.panel { padding: 1.5rem; }
.panel p, .service-card p, .onboarding-card p { color: var(--muted); }
.panel-index { color: var(--coral); font-family: Georgia, serif; font-size: 1.7rem; }

.plans-section { scroll-margin-top: 2rem; }
.plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 840px; }
.plan-card { position: relative; padding: 2rem; }
.plan-card.featured { border-color: rgba(145, 242, 205, 0.5); }
.plan-card .tag { position: absolute; top: 1rem; right: 1rem; }
.price { display: flex; align-items: baseline; gap: 0.35rem; margin: 1.5rem 0; }
.price strong { font-size: 3rem; letter-spacing: -0.055em; }
.price span { color: var(--muted); }
.plan-card ul { padding-left: 1.2rem; color: var(--muted); }

.auth-shell {
  min-height: 680px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 500px);
  align-items: center;
  gap: clamp(2rem, 7vw, 7rem);
  padding: 4rem 0 7rem;
}

.auth-copy { max-width: 590px; }
.auth-card { padding: clamp(1.5rem, 4vw, 2.4rem); border: 1px solid var(--line); border-radius: 28px; background: var(--ink-raised); box-shadow: var(--shadow); }
.auth-card > p { color: var(--muted); }

.form-field { display: grid; gap: 0.45rem; margin: 1rem 0; }
.form-field label { font-size: 0.88rem; font-weight: 700; }
.form-field input {
  width: 100%;
  min-height: 50px;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--paper);
  background: var(--ink);
}
.form-field input::placeholder { color: #6e8580; }
.form-field input:focus { border-color: var(--mint); }
.form-actions { display: grid; gap: 0.8rem; margin-top: 1.5rem; }
.form-help { color: var(--muted); font-size: 0.82rem; }
.text-button { padding: 0; border: 0; background: none; color: var(--mint); cursor: pointer; }
.field-link { justify-self: end; font-size: 0.82rem; }

.notice { margin: 1rem 0; padding: 0.85rem 1rem; border-radius: 12px; color: var(--muted); background: rgba(145, 242, 205, 0.08); }
.notice.error { color: var(--danger); background: rgba(255, 137, 111, 0.1); }
.notice.success { color: var(--mint); }

.dashboard { padding: 4rem 0 7rem; }
.dashboard-head { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; }
.dashboard-head h1 { margin-bottom: 0.6rem; font-size: clamp(2.8rem, 6vw, 5.2rem); }
.account-chip { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--muted); }
.account-chip::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 5px rgba(145, 242, 205, 0.08); }

.status-banner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 1.6rem;
  border: 1px solid rgba(145, 242, 205, 0.28);
  border-radius: var(--radius);
  background: rgba(145, 242, 205, 0.07);
}
.status-banner p { margin-bottom: 0; color: var(--muted); }
.status-number { text-align: right; font-size: 2.1rem; font-weight: 800; letter-spacing: -0.04em; }
.status-number small { display: block; color: var(--muted); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }

.dashboard-section { margin-top: 3rem; }
.dashboard-section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.dashboard-section-head h2 { margin-bottom: 0; font-size: 1.7rem; }
.tag { display: inline-flex; padding: 0.3rem 0.55rem; border-radius: 999px; color: var(--mint); background: rgba(145, 242, 205, 0.09); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.tag.amber { color: var(--amber); background: rgba(245, 200, 107, 0.09); }
.service-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.service-card { min-height: 300px; display: flex; flex-direction: column; padding: 1.4rem; }
.service-icon { width: 44px; height: 44px; display: grid; place-items: center; margin-bottom: 1.2rem; border-radius: 13px; color: var(--ink); background: var(--coral); font-weight: 900; }
.service-card:nth-child(even) .service-icon { background: var(--mint); }
.service-card > .tag { align-self: flex-start; margin: 0 0 0.9rem; }
.service-card-footer { display: grid; gap: 0.75rem; margin-top: auto; }
.service-status { display: inline-flex; align-items: center; gap: 0.55rem; margin: 0; color: var(--muted); font-size: 0.82rem; font-weight: 750; }
.service-status > span { width: 9px; height: 9px; flex: 0 0 auto; border: 2px solid currentColor; border-radius: 50%; }
.service-status-progress { color: var(--amber); }
.service-status-ready { color: var(--mint); }
.service-status-error { color: var(--danger); }
.service-status-suspended { color: var(--amber); }
.service-action { width: 100%; }
.service-error { margin: 0; color: var(--danger) !important; font-size: 0.86rem; }
.service-load-error { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0.35rem 1rem; }
.service-load-error strong, .service-load-error span { grid-column: 1; }
.service-load-error .button { grid-column: 2; grid-row: 1 / span 2; }

.onboarding-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.onboarding-card { display: grid; grid-template-columns: auto 1fr; gap: 1rem; padding: 1.3rem; }
.check { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); }
.onboarding-card.done .check { color: var(--ink); border-color: var(--mint); background: var(--mint); }

.jellyfin-guide { padding-top: 0.5rem; }
.guide-lede { max-width: 760px; margin-bottom: 1.25rem; color: var(--muted); font-size: 1.05rem; }
.device-guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.device-guide-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(11, 32, 29, 0.76); }
.guide-art { min-height: 142px; display: grid; place-items: center; background: linear-gradient(145deg, rgba(145, 242, 205, 0.1), rgba(53, 208, 178, 0.02)); }
.guide-art svg { width: min(150px, 60%); height: auto; fill: none; stroke: var(--mint); stroke-linecap: round; stroke-linejoin: round; stroke-width: 3; }
.guide-art svg rect:first-child { fill: rgba(145, 242, 205, 0.08); }
.guide-art svg circle { fill: var(--coral); stroke: none; }
.guide-art .guide-screen-line { stroke: var(--coral); stroke-width: 2.5; }
.guide-card-copy { padding: 1.2rem 1.25rem 1.35rem; }
.guide-card-copy h3 { margin-bottom: 0.45rem; }
.guide-card-copy p { margin-bottom: 0; color: var(--muted); font-size: 0.92rem; }
.guide-card-copy code, .guide-callout code { color: var(--mint); overflow-wrap: anywhere; word-break: break-word; }
.guide-callout, .guide-note { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start; margin-top: 1rem; padding: 1.25rem; border: 1px solid rgba(145, 242, 205, 0.28); border-radius: var(--radius); background: rgba(145, 242, 205, 0.06); }
.guide-callout h3, .guide-note h3 { margin-bottom: 0.35rem; }
.guide-callout p, .guide-note p { margin-bottom: 0.7rem; color: var(--muted); }
.guide-callout p:last-child, .guide-note p:last-child { margin-bottom: 0; }
.guide-callout a { color: var(--mint); }
.guide-callout-icon, .guide-note-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; color: var(--ink); background: var(--mint); font-weight: 850; }
.guide-note { border-color: rgba(255, 137, 111, 0.3); background: rgba(255, 137, 111, 0.06); }
.guide-note-icon { color: var(--ink); background: var(--coral); font-size: 1.3rem; }
.server-address { display: inline-block; margin-bottom: 0.7rem; padding: 0.7rem 0.85rem; border: 1px solid rgba(145, 242, 205, 0.26); border-radius: 10px; background: var(--ink); font-size: 1rem; }
.guide-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; }
.guide-footer .fine-print { margin-bottom: 0; }
.guide-complete { margin: 0; color: var(--mint); font-size: 0.86rem; font-weight: 750; }

.billing-panel { display: grid; gap: 1rem; margin-top: 1.25rem; }
.payment-instructions { display: grid; gap: 1rem; padding: 1.5rem; border: 1px solid rgba(145, 242, 205, 0.35); border-radius: var(--radius); background: rgba(145, 242, 205, 0.06); }
.payment-instructions h3 { margin-bottom: 0; font-size: 1.6rem; }
.payment-instructions .eyebrow { margin-bottom: 0.5rem; }
.payment-instructions .button { justify-self: start; }
.payment-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; margin: 0; }
.payment-details div { min-width: 0; padding: 0.9rem; border: 1px solid var(--line); border-radius: 12px; background: var(--ink-soft); }
.payment-details dt { margin-bottom: 0.35rem; color: var(--muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.payment-details dd { margin: 0; overflow-wrap: anywhere; font-weight: 750; }
.billing-list { display: grid; gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.billing-list li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--ink-soft); }
.billing-list span:first-child { display: grid; gap: 0.2rem; }
.billing-list small { color: var(--muted); }

.admin-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.admin-table { width: 100%; border-collapse: collapse; background: var(--ink-raised); }
.admin-table th, .admin-table td { padding: 1rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.admin-table th { color: var(--muted); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table td > strong, .admin-table td > small { display: block; }
.admin-table td > small { margin-top: 0.2rem; color: var(--muted); }
.admin-table code { color: var(--mint); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.admin-payment-form { display: grid; grid-template-columns: minmax(7rem, 0.7fr) minmax(10rem, 1fr); gap: 0.5rem; min-width: 22rem; }
.admin-payment-form input, .admin-payment-form select { min-height: 40px; padding: 0.55rem 0.65rem; border: 1px solid var(--line); border-radius: 10px; color: var(--paper); background: var(--ink); }
.verification-check { grid-column: 1 / -1; display: flex; align-items: center; gap: 0.5rem; color: var(--muted); font-size: 0.78rem; }
.verification-check input { width: 18px; min-height: 18px; accent-color: var(--mint); }
.admin-actions { grid-column: 1 / -1; display: flex; gap: 0.5rem; }

.terms-list { margin: 1.5rem 0; padding-left: 1.3rem; color: var(--muted); }
.terms-list li { margin: 0.65rem 0; }
.checkbox-row { display: grid; grid-template-columns: auto 1fr; gap: 0.75rem; align-items: start; margin: 1.4rem 0; }
.checkbox-row input { width: 20px; height: 20px; accent-color: var(--mint); }

.site-footer { display: flex; justify-content: space-between; gap: 2rem; padding: 2.5rem 0 3rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.82rem; }
.site-footer p { margin-bottom: 0; }
.brand-text { color: var(--paper); font-weight: 800; }
.staging-note { text-align: right; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 850px) {
  .hero, .auth-shell { grid-template-columns: 1fr; }
  .hero { padding-top: 3rem; }
  .orbit { width: min(100%, 460px); margin: 0 auto; }
  .promise-grid, .service-grid, .device-guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-copy { display: none; }
}

@media (max-width: 560px) {
  .site-header { min-height: 68px; }
  .site-nav .nav-link:first-child { display: none; }
  .hero { min-height: auto; padding-bottom: 4rem; }
  h1 { font-size: clamp(3rem, 16vw, 4.4rem); }
  .orbit { width: 90%; }
  .promise-grid, .plan-grid, .service-grid, .onboarding-grid, .device-guide-grid { grid-template-columns: 1fr; }
  .payment-details { grid-template-columns: 1fr; }
  .dashboard-head, .dashboard-section-head, .site-footer { align-items: flex-start; flex-direction: column; }
  .status-banner { grid-template-columns: 1fr; }
  .service-load-error { grid-template-columns: 1fr; }
  .service-load-error .button { grid-column: 1; grid-row: auto; width: 100%; }
  .status-number { text-align: left; }
  .staging-note { text-align: left; }
  .guide-footer { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 360px) {
  .brand > span:last-child { display: none; }
  .site-nav button { white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
