:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --field: #10141b;
  --surface: #161b24;
  --surface-lift: #1e2532;
  --ink: #f1f3f5;
  --muted: #9ca6b5;
  --accent: #f3b63f;
  --accent-hover: #f7c562;
  --accent-ink: #0b0d10;

  /* Exact Nuvio badge tokens from src/core/badges.js */
  --badge-instant-bg: #14532d;
  --badge-instant-fg: #dcfce7;
  --badge-4k-bg: #78350f;
  --badge-4k-fg: #fef3c7;
  --badge-dual-bg: #1e3a8a;
  --badge-dual-fg: #dbeafe;
  --badge-hindi-bg: #7c2d12;
  --badge-hindi-fg: #f5f3f2;
  --badge-english-bg: #1f2937;
  --badge-english-fg: #f3f4f6;
  --badge-subbed-bg: #252269;
  --badge-subbed-fg: #e0e7ff;

  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'DM Sans', system-ui, sans-serif;

  /* Strict 5-step type scale */
  --step-small: 14px;
  --step-body: 16px;
  --step-sub: 20px;
  --step-h2: clamp(30px, 3.6vw, 48px);
  --step-h1: clamp(38px, 5vw, 72px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 28px;
  scrollbar-color: #2b3547 var(--bg);
  scrollbar-width: thin;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  caret-color: var(--accent);
  font: var(--step-body)/1.62 var(--body);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 3px;
}

button,
input {
  font: inherit;
}

button,
a,
input,
summary {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

svg {
  display: block;
}

p {
  margin: 0 0 18px;
}

.num {
  font-variant-numeric: tabular-nums;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.02;
  text-wrap: balance;
}

h1,
h2 {
  font-family: var(--display);
  font-weight: 800;
}

h1 {
  font-size: var(--step-h1);
  letter-spacing: -0.035em;
  line-height: 0.96;
}

h2 {
  font-size: var(--step-h2);
  letter-spacing: -0.03em;
}

h3 {
  font-family: var(--display);
  font-size: var(--step-sub);
  letter-spacing: -0.02em;
  font-weight: 700;
}

.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding-left: 44px;
  padding-right: 44px;
}

.site-header {
  height: 96px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--display);
  font-size: var(--step-sub);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  min-height: 44px;
}

.brand svg {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.brand-dot {
  color: var(--accent);
}

nav {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: var(--step-body);
  font-weight: 600;
}

nav > a:not(.nav-cta) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 4px;
  color: var(--muted);
  transition: color 150ms ease;
}

nav > a:not(.nav-cta):hover {
  color: var(--ink);
}

nav .nav-cta {
  background: var(--surface);
  color: var(--ink);
  border-radius: 6px;
  padding: 10px 18px;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--step-small);
  font-weight: 700;
  transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

nav .nav-cta:hover {
  background: var(--accent);
  color: var(--accent-ink);
}

@keyframes stageRise {
  from {
    opacity: 0.01;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero {
  display: grid;
  grid-template-columns: 0.96fr 1.04fr;
  align-items: center;
  gap: 52px;
  padding-top: 28px;
  padding-bottom: 104px;
}

.hero-description {
  max-width: 42ch;
  font-size: var(--step-sub);
  color: var(--ink);
  line-height: 1.5;
  margin: 26px 0 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border-radius: 6px;
  font-size: var(--step-body);
  font-weight: 700;
  line-height: 1.3;
  min-height: 48px;
  transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.button:active,
nav .nav-cta:active {
  transform: translateY(1px);
}

.primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.primary:hover {
  background: var(--accent-hover);
}

.ghost,
.secondary {
  background: var(--surface);
  color: var(--ink);
}

.ghost:hover,
.secondary:hover {
  background: var(--surface-lift);
}

.hero-note {
  font-size: var(--step-small);
  color: var(--muted);
  margin: 18px 0 0;
}

/* Colored Nuvio Badges — exact visual chips */
.nuvio-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: var(--step-small);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

.badge-instant {
  background: var(--badge-instant-bg);
  color: var(--badge-instant-fg);
}

.badge-4k {
  background: var(--badge-4k-bg);
  color: var(--badge-4k-fg);
}

.badge-dual {
  background: var(--badge-dual-bg);
  color: var(--badge-dual-fg);
}

.badge-hindi {
  background: var(--badge-hindi-bg);
  color: var(--badge-hindi-fg);
}

.badge-english {
  background: var(--badge-english-bg);
  color: var(--badge-english-fg);
}

.badge-subbed {
  background: var(--badge-subbed-bg);
  color: var(--badge-subbed-fg);
}

/* Interactive Nuvio Player Sheet (data-ui) */
[data-ui].player-stage {
  background: var(--field);
  border-radius: 12px;
  padding: 22px;
  border: 1px solid #222a38;
}

.player-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.player-window {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: var(--step-small);
  color: var(--ink);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
}

.player-mode {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  padding: 4px 10px;
  border-radius: 4px;
}

.scene-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.scene-tab {
  background: var(--surface);
  color: var(--muted);
  padding: 10px 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  min-height: 44px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color 140ms ease, color 140ms ease;
}

.scene-tab:hover {
  background: var(--surface-lift);
  color: var(--ink);
}

.scene-tab.is-active {
  background: var(--accent);
  color: var(--accent-ink);
}

.now-playing {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  padding: 0 2px;
}

.now-title {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.now-meta {
  font-size: 13px;
  color: var(--muted);
}

.stream-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

[data-ui] .stream-row {
  background: var(--surface);
  border-radius: 8px;
  padding: 14px 16px;
  border: 1px solid #202836;
  transition: background-color 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

[data-ui] .stream-row.is-highlighted {
  border-color: var(--accent);
  background: var(--surface-lift);
}

[data-ui] .stream-row.is-dimmed {
  opacity: 0.42;
}

.stream-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.stream-source {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
}

.stream-res {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

.stream-file {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
  word-break: break-word;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge-row .nuvio-badge {
  font-size: 12px;
  padding: 3px 8px;
}

.player-footer {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}

/* Section 2: Dedicated Live Badge Showcase */
.badges-section {
  background: var(--field);
  padding-top: 120px;
  padding-bottom: 120px;
}

.badges-layout {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 64px;
  align-items: start;
}

.badges-intro > p {
  margin-top: 24px;
  max-width: 40ch;
}

.muted-copy {
  color: var(--muted);
  margin-bottom: 0;
}

.inline-action {
  margin-top: 28px;
}

.badge-wall {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 36px;
}

.badge-card {
  background: transparent;
  border-radius: 8px;
  padding: 14px 16px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: background-color 150ms ease, transform 150ms ease;
}

.badge-card:hover {
  background: var(--surface);
  transform: translateY(-2px);
}

.badge-card.is-selected {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  background: var(--surface);
}

.badge-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.badge-group-name {
  font-size: var(--step-small);
  font-weight: 600;
  color: var(--muted);
}

.badge-card p {
  font-size: var(--step-small);
  line-height: 1.6;
  color: var(--ink);
  margin: 0;
}

/* Section 3: 12-Source Directory Table */
.sources-section {
  padding-top: 124px;
  padding-bottom: 124px;
}

.sources-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: end;
  margin-bottom: 48px;
}

.sources-header p {
  margin: 0;
  max-width: 50ch;
  color: var(--muted);
}

.sources-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.sources-table th {
  font-size: var(--step-small);
  font-weight: 700;
  color: var(--muted);
  padding: 14px 16px;
  border-bottom: 1px solid #222a38;
}

.sources-table td {
  padding: 18px 16px;
  border-bottom: 1px solid #19202c;
  vertical-align: middle;
  font-size: var(--step-body);
}

.sources-table tbody tr:hover {
  background: var(--field);
}

.source-name {
  font-family: var(--display);
  font-size: var(--step-sub);
  font-weight: 700;
  white-space: nowrap;
}

.source-kind {
  font-size: var(--step-small);
  color: var(--muted);
  white-space: nowrap;
}

.source-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Section 4: Client-Side Architecture */
.architecture-section {
  background: var(--field);
  padding-top: 112px;
  padding-bottom: 112px;
}

.architecture-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 64px;
  align-items: start;
}

.architecture-copy {
  max-width: 56ch;
}

/* Section 5: 2-Link Setup */
.install-section {
  padding-top: 124px;
  padding-bottom: 124px;
}

.install-layout {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 72px;
  align-items: start;
}

.install-intro {
  position: sticky;
  top: 32px;
}

.install-intro > p {
  margin-top: 22px;
  max-width: 34ch;
}

.compatibility {
  margin-top: 24px;
  padding: 18px 20px;
  background: var(--surface);
  border-radius: 8px;
  max-width: 36ch;
}

.compatibility p {
  font-size: var(--step-small);
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.compatibility strong,
.step-body strong {
  color: var(--ink);
  font-weight: 700;
}

.setup-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.setup-step {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 18px;
}

.step-num {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: var(--step-body);
}

.step-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  margin-bottom: 8px;
}

.step-pill {
  font-size: var(--step-small);
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--surface);
  color: var(--accent);
}

.step-body > p {
  margin-top: 8px;
  margin-bottom: 16px;
  max-width: 60ch;
}

.url-box {
  background: var(--surface);
  border-radius: 8px;
  padding: 14px 14px 14px 18px;
}

.url-box label {
  display: block;
  font-size: var(--step-small);
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.url-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.url-row input {
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: var(--step-small);
  font-weight: 600;
  padding: 8px 0;
  text-overflow: ellipsis;
  border-radius: 4px;
}

.copy {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 18px;
  border-radius: 6px;
  font-size: var(--step-small);
  font-weight: 700;
  min-width: 96px;
  min-height: 44px;
  transition: background-color 140ms ease, color 140ms ease;
}

.copy:hover {
  background: var(--accent-hover);
}

.copy.copied {
  background: #14532d;
  color: #dcfce7;
}

/* Section 6: FAQ */
.faq-section {
  background: var(--field);
  padding-top: 116px;
  padding-bottom: 116px;
}

.faq-layout {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 72px;
  align-items: start;
}

.faq-intro > p {
  margin-top: 20px;
  color: var(--muted);
  max-width: 32ch;
}

.questions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.questions details {
  background: var(--surface);
  border-radius: 8px;
  padding: 0 22px;
}

.questions summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  cursor: pointer;
  font-weight: 600;
  line-height: 1.5;
  font-size: var(--step-body);
  padding: 20px 0;
  min-height: 54px;
  list-style: none;
}

.questions summary::-webkit-details-marker {
  display: none;
}

.questions summary span {
  font-size: var(--step-sub);
  color: var(--accent);
  flex-shrink: 0;
  line-height: 1;
  transition: transform 150ms ease;
}

.questions details[open] summary span {
  transform: rotate(45deg);
}

.questions details p {
  font-size: var(--step-body);
  line-height: 1.68;
  color: var(--muted);
  padding-right: 20px;
  padding-bottom: 20px;
  margin: 0;
  max-width: 62ch;
}

/* Closing & Footer */
.closing {
  margin-top: 96px;
  margin-bottom: 84px;
  background: var(--surface);
  border-radius: 10px;
  padding: 44px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 28px;
}

.closing p {
  margin: 10px 0 0;
  color: var(--muted);
}

.footer {
  padding-bottom: 48px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.footer-top p {
  font-size: var(--step-small);
  color: var(--muted);
  margin: 0;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: var(--step-small);
  font-weight: 600;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 4px;
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--ink);
}

@media (prefers-reduced-motion: no-preference) {
  .hero-copy > p,
  .hero-actions {
    animation: stageRise 420ms cubic-bezier(0.22, 1, 0.36, 1) 60ms both;
  }
  .player-stage {
    animation: stageRise 480ms cubic-bezier(0.22, 1, 0.36, 1) 100ms both;
  }
  html.js-motion [data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 460ms cubic-bezier(0.22, 1, 0.36, 1), transform 460ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  html.js-motion [data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
  }
}

.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;
}

.skip {
  position: fixed;
  left: 16px;
  top: -100px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 700;
  z-index: 30;
}

.skip:focus {
  top: 16px;
}

@media (max-width: 1060px) {
  .wrap {
    padding-left: 32px;
    padding-right: 32px;
  }
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-bottom: 76px;
  }
  .badges-layout,
  .sources-header,
  .architecture-layout,
  .install-layout,
  .faq-layout {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .install-intro {
    position: static;
  }
  .badges-intro > p,
  .install-intro > p,
  .compatibility,
  .faq-intro > p {
    max-width: 58ch;
  }
}

@media (max-width: 768px) {
  .site-header {
    height: 82px;
  }
  nav > a:not(.nav-cta) {
    display: none;
  }
  .badges-section,
  .sources-section,
  .architecture-section,
  .install-section,
  .faq-section {
    padding-top: 76px;
    padding-bottom: 76px;
  }
  .badge-wall {
    grid-template-columns: 1fr;
  }
  .sources-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
  .sources-table,
  .sources-table tbody,
  .sources-table tr,
  .sources-table td {
    display: block;
    width: 100%;
  }
  .sources-table tr {
    background: transparent;
    border-radius: 0;
    padding: 18px 0;
    border-bottom: 1px solid #19202c;
  }
  .sources-table td {
    padding: 4px 0;
    border: 0;
  }
  .source-badges {
    margin-top: 8px;
  }
  .closing {
    flex-wrap: wrap;
    padding: 32px 28px;
    margin-top: 64px;
    margin-bottom: 56px;
  }
  .footer-top {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .footer-top p {
    order: 3;
    flex-basis: 100%;
  }
  .footer-links {
    margin-left: auto;
  }
}

@media (max-width: 480px) {
  .wrap {
    padding-left: 20px;
    padding-right: 20px;
  }
  .player-stage {
    padding: 16px;
  }
  .scene-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hero-actions .button {
    width: 100%;
  }
  .setup-step {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .url-row {
    flex-wrap: wrap;
    gap: 10px;
  }
  .url-row input {
    flex-basis: 100%;
  }
  .copy {
    width: 100%;
  }
  .closing {
    padding: 26px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
