/* TeleStremio site.
   Layout: a signal path — channel → index → player — told left to right on wide screens and
   top to bottom on phones; the app's own three palettes theme the page and its screenshots. */
:root {
  /* Paper (light) */
  --bg: #f3f0e8; --surface: #fbf9f4; --surface-2: #eae5da; --line: #dcd5c7;
  --fg: #1d1b18; --muted: #6e685e; --accent: #b9471a; --on-accent: #ffffff; --ok: #3f7d2c;
  --glow: rgb(185 71 26 / .14);
  --display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --body: "Inter", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --r: 18px; --r-sm: 12px;
  --max: 1160px;
  color-scheme: light;
}
/* Ink (dark) follows the system unless a palette was picked. */
@media (prefers-color-scheme: dark) {
  :root:not([data-palette]) {
    --bg: #121212; --surface: #1a1a19; --surface-2: #232321; --line: #2e2d2a;
    --fg: #efece6; --muted: #8f8a82; --accent: #e9a23b; --on-accent: #1a1405; --ok: #7bb662;
    --glow: rgb(233 162 59 / .16); color-scheme: dark;
  }
}
:root[data-palette="ink"] {
  --bg: #121212; --surface: #1a1a19; --surface-2: #232321; --line: #2e2d2a;
  --fg: #efece6; --muted: #8f8a82; --accent: #e9a23b; --on-accent: #1a1405; --ok: #7bb662;
  --glow: rgb(233 162 59 / .16); color-scheme: dark;
}
:root[data-palette="paper"] {
  --bg: #f3f0e8; --surface: #fbf9f4; --surface-2: #eae5da; --line: #dcd5c7;
  --fg: #1d1b18; --muted: #6e685e; --accent: #b9471a; --on-accent: #ffffff; --ok: #3f7d2c;
  --glow: rgb(185 71 26 / .14); color-scheme: light;
}
:root[data-palette="night"] {
  --bg: #000000; --surface: #0b0b0b; --surface-2: #151515; --line: #222222;
  --fg: #e6e6e6; --muted: #7c7c7c; --accent: #8cc4ae; --on-accent: #06140f; --ok: #8cc4ae;
  --glow: rgb(140 196 174 / .14); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.6 var(--body); text-rendering: optimizeLegibility;
  transition: background-color .35s ease, color .35s ease;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.12; letter-spacing: -.02em; text-wrap: balance; margin: 0; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: .92em; }

.wrap {
  width: 100%; max-width: var(--max); margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.eyebrow { font: 600 12px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.lede { color: var(--muted); font-size: clamp(17px, 1.6vw, 19px); max-width: 60ch; }
section { padding-block: clamp(56px, 7vw, 96px); }

/* ── header ─────────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(12px); -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.top .wrap { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 18px var(--display); letter-spacing: -.01em; }
.brand svg { width: 30px; height: 30px; flex: none; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { text-decoration: none; color: var(--muted); padding: 8px 12px; border-radius: 999px; font-size: 15px; transition: color .2s, background-color .2s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--fg); background: var(--surface-2); }
.palette { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.palette button {
  all: unset; cursor: pointer; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; position: relative;
}
.palette button span { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgb(127 127 127 / .45); }
.palette button[aria-pressed="true"] { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--accent); }
.palette button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.menu-btn { display: none; }
@media (max-width: 860px) {
  .nav { display: none; }
  .nav.open { display: flex; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; padding: 12px 20px 18px; background: var(--bg); border-bottom: 1px solid var(--line); }
  .menu-btn { display: grid; place-items: center; margin-left: auto; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); cursor: pointer; }
  .palette { order: 3; }
}

/* ── buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; cursor: pointer;
  padding: 13px 22px; border-radius: 999px; font: 600 15px var(--body); border: 1px solid transparent;
  transition: transform .18s ease, background-color .2s, border-color .2s, box-shadow .25s;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 28px var(--glow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 34px var(--glow); }
.btn-ghost { border-color: var(--line); color: var(--fg); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); transform: translateY(-2px); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ── hero ───────────────────────────────────────────── */
.hero { padding-block: clamp(40px, 6vw, 80px) clamp(16px, 3vw, 32px); overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 9fr) minmax(0, 11fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero h1 { font-size: clamp(38px, 4.6vw, 60px); }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede { margin-top: 18px; }
.hero .btn-row { margin-top: 30px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 26px; color: var(--muted); font-size: 14px; }
.hero-meta b { color: var(--fg); font-weight: 600; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: minmax(0, 1fr); } }

/* App window frame around screenshots */
.window {
  border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--surface);
  box-shadow: 0 30px 80px rgb(0 0 0 / .28), 0 0 0 1px rgb(255 255 255 / .02);
  transform: perspective(1600px) rotateY(-6deg) rotateX(2deg); transition: transform .6s cubic-bezier(.2,.7,.2,1);
}
.window:hover { transform: perspective(1600px) rotateY(0) rotateX(0); }
.window-bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.window-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
.window-bar span { margin-left: 10px; font: 500 12px var(--mono); color: var(--muted); }
.shot { position: relative; aspect-ratio: 1180 / 752; background: var(--surface-2); }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .45s ease; }
.shot img.out { opacity: 0; }
@media (max-width: 900px) { .window { transform: none; } }

/* Phone frame: same screens on Android, overlapping the desktop window in the hero */
/* Corners scale with the phone's width (horizontal % / vertical %), so a small phone isn't oval. */
.phone { border-radius: 13% / 6.4%; padding: 5px; background: #0b0b0c; border: 1px solid var(--line); box-shadow: 0 28px 70px rgb(0 0 0 / .34); }
.phone-shot { position: relative; aspect-ratio: 720 / 1480; border-radius: 10.5% / 5.1%; overflow: hidden; background: var(--surface-2); }
.phone-shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .45s ease; }
.phone-shot img.out { opacity: 0; }
.devices { position: relative; padding: 0 9% 9% 0; }
.devices .phone { position: absolute; right: 0; bottom: 0; width: 25%; transform: rotate(3deg); transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.devices:hover .phone { transform: rotate(0) translateY(-6px); }

/* ── signal path ────────────────────────────────────── */
.path { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 44px; position: relative; }
.stop { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; min-width: 0; position: relative; z-index: 1; }
.stop .n { font: 600 13px var(--mono); color: var(--accent); }
.stop h3 { font-size: 21px; margin: 10px 0 8px; }
.stop p { color: var(--muted); font-size: 15px; }
.stop .sample { margin-top: 16px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--surface-2); font: 13px/1.5 var(--mono); color: var(--fg); overflow-wrap: anywhere; }
.wire { position: absolute; top: 50%; left: 8%; right: 8%; height: 2px; z-index: 0; }
.wire line { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 6 10; animation: flow 1.4s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -32; } }
@media (max-width: 860px) { .path { grid-template-columns: minmax(0, 1fr); } .wire { display: none; } }

/* ── features ───────────────────────────────────────── */
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-top: 44px; }
.feature { background: var(--bg); padding: 28px; min-width: 0; transition: background-color .25s; }
.feature:hover { background: var(--surface); }
.feature svg { width: 26px; height: 26px; color: var(--accent); }
.feature h3 { font-size: 18px; margin: 16px 0 8px; }
.feature p { color: var(--muted); font-size: 15px; }
@media (max-width: 900px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .features { grid-template-columns: minmax(0, 1fr); } }

/* ── screens ────────────────────────────────────────── */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.tab {
  all: unset; cursor: pointer; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line);
  font: 500 14px var(--body); color: var(--muted); transition: all .2s;
}
.tab:hover { color: var(--fg); border-color: var(--muted); }
.tab[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.screens { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 2.3fr) minmax(0, 3fr); gap: 28px; margin-top: 26px; align-items: start; }
.screens .window { transform: none; }
.screen-note h3 { font-size: 24px; }
.screen-note p { color: var(--muted); margin-top: 10px; }
.screen-note ul { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.screen-note li { display: flex; gap: 10px; color: var(--fg); font-size: 15px; }
.screen-note li::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: 9px; border-radius: 50%; background: var(--accent); }
@media (max-width: 1100px) { .screens { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); } .screen-note { grid-column: 1 / -1; } }
@media (max-width: 640px) { .screens { grid-template-columns: minmax(0, 1fr); } .screens .phone { width: min(64%, 260px); justify-self: center; } }

/* ── download ───────────────────────────────────────── */
.platforms { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-top: 40px; }
.platform {
  display: flex; flex-direction: column; gap: 12px; padding: 24px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line); min-width: 0;
  transition: border-color .2s, transform .2s;
}
.platform:hover { transform: translateY(-3px); border-color: var(--muted); }
.platform.you { border-color: var(--accent); box-shadow: 0 0 0 4px var(--glow); }
.platform header { display: flex; align-items: center; gap: 12px; }
.platform header svg { width: 28px; height: 28px; color: var(--fg); }
.platform h3 { font-size: 20px; }
.platform .req { color: var(--muted); font-size: 14px; }
.platform .files { font: 13px var(--mono); color: var(--muted); }
.platform .btn { margin-top: auto; justify-content: center; }
.badge-you { margin-left: auto; font: 600 11px var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }

.install-cmds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.install-cmds .codeblock { margin: 0; }
@media (max-width: 860px) { .install-cmds { grid-template-columns: minmax(0, 1fr); } }

/* ── privacy band ───────────────────────────────────── */
.band { background: var(--surface); border-block: 1px solid var(--line); }
.band .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: start; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 32px; }
.fact b { display: block; font: 600 17px var(--display); }
.fact span { color: var(--muted); font-size: 15px; }
@media (max-width: 860px) { .band .wrap, .facts { grid-template-columns: minmax(0, 1fr); } }

/* ── faq ────────────────────────────────────────────── */
.faq { margin-top: 36px; border-top: 1px solid var(--line); max-width: 820px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; padding: 20px 0; font: 600 18px var(--display); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 22px; line-height: 1; transition: transform .25s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .answer { color: var(--muted); padding: 0 0 22px; max-width: 68ch; }

/* ── footer ─────────────────────────────────────────── */
footer { border-top: 1px solid var(--line); padding-block: 36px 48px; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; }
footer nav { display: flex; flex-wrap: wrap; gap: 18px; margin-left: auto; }
footer a { text-decoration: none; } footer a:hover { color: var(--fg); }

/* ── guide page ─────────────────────────────────────── */
.guide { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 56px; padding-block: 48px 96px; align-items: start; }
.toc { position: sticky; top: 88px; display: grid; gap: 2px; font-size: 14px; }
.toc a { text-decoration: none; color: var(--muted); padding: 7px 12px; border-left: 2px solid var(--line); transition: all .2s; }
.toc a:hover { color: var(--fg); }
.toc a.active { color: var(--fg); border-left-color: var(--accent); background: var(--surface); }
.doc h1 { font-size: clamp(36px, 5vw, 54px); }
.doc > .lede { margin-top: 14px; }
.doc h2 { font-size: 30px; margin: 64px 0 14px; scroll-margin-top: 90px; }
.doc h3 { font-size: 19px; margin: 30px 0 10px; }
.doc p, .doc li { color: var(--fg); max-width: 70ch; }
.doc p + p { margin-top: 12px; }
.doc .muted { color: var(--muted); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 14px; }
.steps > li { counter-increment: s; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px; }
.steps > li::before {
  content: counter(s); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line); font: 600 13px var(--mono); color: var(--accent);
}
.callout { margin: 20px 0; padding: 16px 18px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); }
.callout p { color: var(--muted); }
.codeblock { position: relative; margin: 14px 0; }
.codeblock pre { margin: 0; padding: 16px 18px; padding-right: 86px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); overflow-x: auto; font: 13.5px/1.6 var(--mono); }
.copy { position: absolute; top: 10px; right: 10px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: 500 12px var(--body); cursor: pointer; }
.copy:hover { border-color: var(--accent); }
.os-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 6px; }
.os-panel[hidden] { display: none !important; }
.figure { margin: 20px 0; }
.figure .window { transform: none; }
.figure figcaption { color: var(--muted); font-size: 14px; margin-top: 10px; }
.kbd { font: 12.5px var(--mono); padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); }
@media (max-width: 900px) { .guide { grid-template-columns: minmax(0, 1fr); gap: 24px; } .toc { position: static; display: flex; flex-wrap: wrap; } .toc a { border-left: none; border: 1px solid var(--line); border-radius: 999px; } }

/* ── motion ─────────────────────────────────────────── */
.rise { animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
.rise.d1 { animation-delay: .08s; } .rise.d2 { animation-delay: .16s; } .rise.d3 { animation-delay: .24s; }
@keyframes rise { from { transform: translateY(14px); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .window { transform: none !important; }
}
