/* ---------------------------------------------------------------------------
   TV App — site styles.

   The palette and type are lifted from the app's own design system
   (mobile/lib/theme.ts) so the site and the product read as one thing:
   deep-space navy, a single yellow-to-amber accent gradient, Space Grotesk for
   display type and the system face for body copy — exactly what the app does.

   Everything is token-driven so the light theme is a re-declaration of the
   tokens rather than a second set of component rules.
--------------------------------------------------------------------------- */

@font-face {
  font-family: "Space Grotesk";
  src: url("sg-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("sg-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --ground: #0b0c14;
  --surface: #141623;
  --raised: #1c1f31;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.13);
  --fg: #f4f5fa;
  --muted: #9aa0b8;
  --faint: #7a80a0;
  --accent: #fbd737;
  --accent-deep: #f5a623;
  /* Text-safe accent: the yellow itself only ever fills, never sets type on
     a light ground, where it would fall under 3:1. */
  --accent-text: #fbd737;
  --on-accent: #0b0c14;
  --ok: #4ade80;

  --display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;

  --measure: 68ch;
  --pad: clamp(20px, 5vw, 40px);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --ground: #eef0f6;
    --surface: #ffffff;
    --raised: #f7f8fc;
    --line: rgba(11, 12, 20, 0.1);
    --line-2: rgba(11, 12, 20, 0.18);
    --fg: #12141d;
    --muted: #515873;
    --faint: #646b88;
    --accent-text: #7c5300;
    color-scheme: light;
  }
}

/* The in-page theme toggle must beat the media query in both directions. */
:root[data-theme="light"] {
  --ground: #eef0f6;
  --surface: #ffffff;
  --raised: #f7f8fc;
  --line: rgba(11, 12, 20, 0.1);
  --line-2: rgba(11, 12, 20, 0.18);
  --fg: #12141d;
  --muted: #515873;
  --faint: #646b88;
  --accent-text: #7c5300;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --ground: #0b0c14;
  --surface: #141623;
  --raised: #1c1f31;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.13);
  --fg: #f4f5fa;
  --muted: #9aa0b8;
  --faint: #7a80a0;
  --accent-text: #fbd737;
  color-scheme: dark;
}

/* --------------------------------------------------------------- baseline */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--fg);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0;
}

a {
  color: var(--accent-text);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

img {
  max-width: 100%;
  display: block;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

.wrap {
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* Small uppercase section label — the app uses these above every rail. */
.eyebrow {
  font-family: var(--display);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 50;
  background: var(--accent);
  color: var(--on-accent);
  padding: 10px 16px;
  border-radius: var(--r-sm);
  font-weight: 700;
}

/* ------------------------------------------------------------------ chrome */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--fg);
  text-decoration: none;
}
.brand svg {
  width: 30px;
  height: 30px;
  flex: none;
}

.masthead nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 26px);
}
.masthead nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
}
.masthead nav a:hover {
  color: var(--fg);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--line-2);
  color: var(--muted);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: none;
}
.theme-toggle:hover {
  color: var(--fg);
  border-color: var(--faint);
}
.theme-toggle svg {
  width: 16px;
  height: 16px;
}

/* --------------------------------------------------------------- call to action */

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: var(--on-accent);
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  padding: 14px 24px;
  border-radius: 999px;
  text-decoration: none;
  border: 0;
  cursor: pointer;
}
.btn:hover {
  filter: brightness(1.06);
}
/* Without this the inline icon renders at its natural size and swamps the page. */
.btn svg {
  width: 17px;
  height: 17px;
  flex: none;
}

.cta-note {
  color: var(--faint);
  font-size: 14px;
}

/* ------------------------------------------------------------------- stage */

/* The hero is a lit product shot, so it stays dark in both themes and sets its
   own colours rather than reading from the tokens. */
.stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #07080f;
  color: #f4f5fa;
}

/* Key light, warm, from behind the device — the app's accent doing the work
   the reference photo's purple gel does. */
.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 55% at 72% 34%, rgba(251, 215, 55, 0.22), transparent 68%),
    radial-gradient(45% 40% at 88% 62%, rgba(245, 166, 35, 0.16), transparent 70%),
    radial-gradient(70% 60% at 12% 8%, rgba(58, 68, 132, 0.5), transparent 72%),
    linear-gradient(160deg, #10132a 0%, #07080f 58%);
}

/* The surface the device stands on — a soft wash the reflection sits in. No
   horizon hairline: at this height it would run straight across the device,
   which reads as a rendering fault rather than a floor. */
.stage::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 26%;
  z-index: -2;
  background: linear-gradient(to top, rgba(120, 140, 255, 0.1), transparent 78%);
}

.stage-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  padding-block: clamp(40px, 6vw, 80px) clamp(56px, 8vw, 104px);
  position: relative;
}

.hero-copy h1 {
  font-size: clamp(38px, 6.2vw, 64px);
  margin-block: 18px 0;
}
.hero-copy .lede {
  color: #a7adc6;
  font-size: clamp(17px, 2vw, 19.5px);
  max-width: 40ch;
  margin-block: 18px 0;
}
.stage .eyebrow {
  color: #8b93b4;
}
.stage .cta-note {
  color: #8b93b4;
}

/* ------------------------------------------------------------------ scene */

.scene {
  /* One number drives the device, its reflection and the scene height, so they
     can't drift apart. The screenshots are 640x1258, i.e. 1.97 tall per wide. */
  --dev-w: min(286px, 74%);
  --dev-bezel: 10px;
  --dev-radius: 42px;
  --dev-tilt: -12deg;
  position: relative;
  perspective: 1600px;
  display: grid;
  place-items: center;
}

/* The device and its reflection travel together: the reflection hangs off the
   bottom of this box, so it stays welded to the device at any width instead of
   being positioned by a magic number that only holds at one size. The tilt
   lives here too, so the two can't fall out of alignment. */
.dev-stack {
  position: relative;
  width: var(--dev-w);
  transform: rotateY(var(--dev-tilt)) rotateX(2deg);
  transform-style: preserve-3d;
}

/* The device body. The screenshot does NOT get the body's corner radius — the
   body is padded and the screen inside has its own, smaller radius, which is
   how a real handset is built and what stops the outer curve from slicing
   across the content in the screenshot's corners. */
.dev-front {
  position: relative;
  z-index: 2;
  padding: var(--dev-bezel);
  border-radius: var(--dev-radius);
  background: linear-gradient(158deg, #343a63 0%, #171b33 38%, #06070e 100%);
  box-shadow:
    /* the lit outer edge, brightest along the top-left where the key is */
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 1px 0 0 rgba(255, 255, 255, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.09),
    /* contact shadow, then the ambient one it sits in */
    0 22px 32px -22px rgba(0, 0, 0, 0.9),
    0 52px 82px -34px rgba(0, 0, 0, 0.95),
    0 0 72px -14px rgba(251, 215, 55, 0.15);
}

.dev-screen {
  /* Concentric with the body: outer radius minus the bezel it sits inside. */
  border-radius: calc(var(--dev-radius) - var(--dev-bezel));
  overflow: hidden;
  background: #05060b;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.9);
}
.dev-screen img {
  width: 100%;
  height: auto;
  display: block;
}

/* A single soft sheen across the glass. One highlight reads as a light source;
   several read as a graphic. */
.dev-glare {
  position: absolute;
  inset: var(--dev-bezel);
  border-radius: calc(var(--dev-radius) - var(--dev-bezel));
  pointer-events: none;
  background: linear-gradient(
    148deg,
    rgba(255, 255, 255, 0.14) 0%,
    rgba(255, 255, 255, 0.05) 22%,
    transparent 44%
  );
}

/* The floor reflection: the same screenshot, mirrored, faded and softened.
   Only the near third — a real reflection dies out well before it has shown
   the whole object. The mask runs `to bottom` because scaleY(-1) flips the
   masked result, so this is what dissolves the FAR end once flipped. */
.dev-reflection {
  position: absolute;
  z-index: 0;
  top: 100%;
  left: 0;
  width: 100%;
  height: 34%;
  overflow: hidden;
  /* scaleY(-1) about the default centre origin mirrors the box in place. */
  transform: scaleY(-1);
  opacity: 0.2;
  filter: blur(3px) saturate(0.7);
  -webkit-mask-image: linear-gradient(to bottom, transparent 2%, #000 88%);
  mask-image: linear-gradient(to bottom, transparent 2%, #000 88%);
  pointer-events: none;
}
/* Bottom-aligned, so the clipped box holds the bottom of the screen — the part
   of the device actually nearest the surface. */
.dev-reflection img {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: auto;
  display: block;
}

/* ----------------------------------------------------------- device frames */

/* A real screenshot in a frame, built the way the hero device is: the body is
   padded and the screen inside carries its own, smaller radius. A single
   rounded box with the screenshot flush to its edge lets the corner curve cut
   across the content, and leaves the app looking like it runs edge to edge on
   a phone that has no bezel. */
.phone {
  /* A phone screenshot must never render at container width — belt and braces
     so a missing modifier class can't blow one up to full bleed. */
  max-width: 340px;
  margin-inline: auto;
  padding: clamp(6px, 1vw, 9px);
  border-radius: clamp(24px, 3.4vw, 38px);
  background: linear-gradient(158deg, #2b3054 0%, #14172b 42%, #06070e 100%);
  box-shadow:
    /* the lit outer edge, brightest along the top-left */
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 1px 0 0 rgba(255, 255, 255, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 30px 60px -28px rgba(0, 0, 0, 0.75),
    0 2px 8px -2px rgba(0, 0, 0, 0.4);
  line-height: 0;
}
/* Concentric with the body: the outer radius minus the bezel it sits inside. */
.phone img {
  width: 100%;
  height: auto;
  border-radius: clamp(18px, 2.4vw, 29px);
  background: #0b0c14;
}

.hero-shot {
  display: grid;
  place-items: center;
  position: relative;
}
/* Warm glow behind the hero device: the app's accent, heavily diffused. */
.hero-shot::before {
  content: "";
  position: absolute;
  inset: 6% -6% 20%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 215, 55, 0.16), transparent 68%);
  filter: blur(20px);
  z-index: -1;
}
.phone-lg {
  width: min(330px, 82vw);
}

/* ----------------------------------------------------------------- gallery */

.gallery {
  padding-top: clamp(16px, 3vw, 34px);
}

/* Three across for five screenshots: 3 + 2 reads as a grid, where 4 + 1 reads
   as a mistake. It also keeps each phone large enough to be worth showing —
   five in a row would put them under 180px. */
.shots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(22px, 3.2vw, 42px);
  align-items: start;
}

.shot {
  margin: 0;
}
.shot figcaption {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.shot figcaption strong {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(17px, 1.9vw, 20px);
  letter-spacing: -0.015em;
}
.shot figcaption span {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

/* A gentle lift on pointer devices only — nothing that fires on a tap. */
@media (hover: hover) and (min-width: 760px) {
  .shot .phone {
    transition: transform 0.45s cubic-bezier(0.22, 0.7, 0.3, 1),
      box-shadow 0.45s cubic-bezier(0.22, 0.7, 0.3, 1);
  }
  .shot:hover .phone {
    transform: translateY(-8px);
    box-shadow: 0 44px 74px -30px rgba(0, 0, 0, 0.82),
      0 2px 8px -2px rgba(0, 0, 0, 0.4);
  }
}

/* -------------------------------------------------------------------- rest */

.rest {
  padding-block: clamp(40px, 6vw, 72px);
}

.chips {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chips li {
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14.5px;
  color: var(--muted);
  background: var(--surface);
}

/* ----------------------------------------------------------------- privacy */

/* The only section with its own background and rules, so it is the only one
   where missing vertical padding shows: the type sat straight on the hairlines. */
.band {
  background: var(--surface);
  border-block: 1px solid var(--line);
  padding-block: clamp(52px, 8vw, 96px);
}

.claim {
  font-size: clamp(26px, 4vw, 44px);
  /* Wide enough for "No analytics. No ads." to hold together — at 20ch it broke
     after the first "No", which reads as a mistake. */
  max-width: 28ch;
}
.claim em {
  font-style: normal;
  color: var(--muted);
}
.claim-note {
  color: var(--faint);
  margin: 22px 0 0;
  font-size: 16px;
}

/* ----------------------------------------------------------------- reveal */

/* Only hide things once we know scripting is available, so the page is fully
   readable if the script never runs. */
.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.75s cubic-bezier(0.22, 0.7, 0.3, 1),
    transform 0.75s cubic-bezier(0.22, 0.7, 0.3, 1);
  will-change: opacity, transform;
}
.js .reveal.in {
  opacity: 1;
  transform: none;
  will-change: auto;
}
/* Phones travel a little further and settle from slightly back. */
.js .hero-shot.reveal,
.js .shot.reveal {
  transform: translateY(34px) scale(0.975);
}
.js .hero-shot.reveal.in,
.js .shot.reveal.in {
  transform: none;
}

/* ----------------------------------------------------------------- closing */

.closing {
  text-align: center;
  padding-block: clamp(56px, 9vw, 104px);
}
.closing h2 {
  font-size: clamp(28px, 4.6vw, 46px);
  margin-inline: auto;
  max-width: 18ch;
}
.closing p {
  color: var(--muted);
  max-width: 52ch;
  margin: 18px auto 0;
}
.closing .cta-row {
  justify-content: center;
}

/* ------------------------------------------------------------------ footer */

footer {
  border-top: 1px solid var(--line);
  padding-block: 44px 56px;
  color: var(--faint);
  font-size: 14px;
}
footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
  margin-bottom: 26px;
}
footer nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}
footer nav a:hover {
  color: var(--fg);
  text-decoration: underline;
}
footer p {
  max-width: 78ch;
  margin: 0 0 12px;
  line-height: 1.65;
}
footer a {
  color: var(--faint);
}

/* -------------------------------------------------------- document pages */

.doc {
  padding-block: clamp(28px, 5vw, 52px) clamp(56px, 9vw, 96px);
}
.doc-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 28px;
  margin-bottom: 40px;
}
.doc-head h1 {
  font-size: clamp(32px, 5vw, 46px);
  margin-top: 14px;
}
.doc-head .meta {
  color: var(--faint);
  font-size: 14.5px;
  margin: 16px 0 0;
}

.doc article {
  max-width: var(--measure);
}
.doc article h2 {
  font-size: clamp(21px, 2.6vw, 26px);
  margin-top: 52px;
  scroll-margin-top: 24px;
}
.doc article h3 {
  font-size: 18px;
  margin-top: 34px;
}
.doc article p,
.doc article li {
  color: var(--muted);
}
.doc article p {
  margin: 16px 0;
}
.doc article strong {
  color: var(--fg);
  font-weight: 600;
}
.doc article ul,
.doc article ol {
  padding-left: 22px;
  margin: 16px 0;
}
.doc article li {
  margin: 9px 0;
}
.doc article li::marker {
  color: var(--faint);
}
.doc article hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 46px 0;
}
.doc article code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
}

/* Long legal tables must scroll inside their own box, never the page. */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin: 22px 0;
  max-width: var(--measure);
}
.doc article table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14.5px;
  min-width: 460px;
}
.doc article th,
.doc article td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  vertical-align: top;
}
.doc article th {
  font-family: var(--display);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}
.doc article tbody tr:last-child td {
  border-bottom: 0;
}

/* A pull-out for the plain-English summary at the top of each legal page. */
.summary {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  padding: 20px 22px;
  margin-bottom: 8px;
  max-width: var(--measure);
}
.summary p:first-child {
  margin-top: 0;
}
.summary p:last-child {
  margin-bottom: 0;
}

.toc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 20px 24px;
  margin: 32px 0 8px;
  max-width: var(--measure);
}
.toc p {
  margin: 0 0 12px;
}
.toc ol {
  columns: 2;
  column-gap: 30px;
  margin: 0;
  padding-left: 20px;
}
.toc li {
  margin: 5px 0;
  break-inside: avoid;
}
.toc a {
  text-decoration: none;
}
.toc a:hover {
  text-decoration: underline;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 880px) {
  .stage-inner {
    grid-template-columns: 1fr;
    padding-bottom: clamp(40px, 8vw, 64px);
  }
  /* Lead with the product, not the pitch, once the columns stack. Flatten the
     angle too — a strong rotation reads as a mistake when the device nearly
     fills the width. */
  .scene {
    --dev-w: min(258px, 66%);
    --dev-tilt: -6deg;
    order: -1;
    min-height: 0;
    margin-bottom: 14px;
  }
  .dev-reflection {
    display: none;
  }
  .shots {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px 22px;
  }
  .toc ol {
    columns: 1;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }
  .shots {
    grid-template-columns: 1fr;
    gap: 44px;
    max-width: 330px;
    margin-inline: auto;
  }
  .shot figcaption {
    margin-top: 16px;
    text-align: center;
  }
  .chips li {
    font-size: 13.5px;
    padding: 7px 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
