/* TV Control: tvcontrol.io. One stylesheet for every page: no framework, no web fonts (the
   system font is San Francisco on Apple devices). Light by default, dark when the visitor's
   Mac is, like the app. */

/* ─── TOKENS ─── */

:root {
  color-scheme: light dark;

  --bg: #ffffff;
  --bg-tint: #f5f5f7;
  --surface: #ffffff;
  --surface-raised: #f0f1f4;
  --hairline: rgba(0, 0, 0, 0.08);

  --text: #1d1d1f;
  --text-secondary: #5e5e63;
  --text-tertiary: #6e6e73;

  /* Brand blue, from the app's selected sidebar row. */
  --accent: #1d5fd6;
  --accent-fill: #2563eb;
  --accent-fill-hover: #1d4fd0;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --glow: rgba(37, 99, 235, 0.1);

  --nav-bg: rgba(255, 255, 255, 0.92);
  --shot-shadow: 0 24px 60px rgba(15, 30, 60, 0.14), 0 0 0 0.5px rgba(0, 0, 0, 0.05);
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  --content-max: 1200px;
  --section-gap: clamp(64px, 8vw, 112px);
  --title-gap: clamp(28px, 4vw, 48px);
  --radius-card: 24px;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #05070c;
    --bg-tint: #0a0e17;
    --surface: #0e121b;
    --surface-raised: #151a25;
    --hairline: rgba(255, 255, 255, 0.09);

    --text: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-tertiary: #8e8e93;

    --accent: #6ea6ff;
    --accent-fill: #0a5fd8;
    --accent-fill-hover: #1a6ce6;
    --accent-soft: rgba(92, 155, 255, 0.14);
    --glow: rgba(60, 130, 255, 0.14);

    --nav-bg: rgba(5, 7, 12, 0.92);
    --shot-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
    --card-shadow: none;
  }
}

/* ─── BASE ─── */

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

html {
  font-family: var(--font);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Clear the sticky header when jumping to a section. */
  scroll-padding-top: 72px;
}

body {
  background: var(--bg);
  /* `clip`, not `hidden`: stops sideways scroll without breaking the sticky header. */
  overflow-x: clip;
}

a {
  color: inherit;
  text-decoration: none;
}

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

h1, h2, h3 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

img,
picture {
  display: block;
  max-width: 100%;
  height: auto;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  padding: 8px 12px;
  background: var(--text);
  color: var(--bg);
  z-index: 100;
}

.skip-link:focus {
  left: 16px;
}

/* ─── TOP NAV ───
   Sticky, on a near-opaque bar rather than a backdrop blur, which repaints on every scroll. */

.top-nav-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--hairline);
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  max-width: var(--content-max);
  min-height: 56px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.top-nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-nav-logo {
  width: 28px;
  height: 28px;
}

.top-nav-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.top-nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
  color: var(--text-secondary);
}

.top-nav-links a {
  padding: 6px 0;
  transition: color 0.15s;
}

.top-nav-links a:hover {
  color: var(--text);
}

.top-nav-links .top-nav-cta {
  color: #fff;
  background: var(--accent-fill);
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 999px;
}

.top-nav-links .top-nav-cta:hover {
  color: #fff;
  background: var(--accent-fill-hover);
}

.top-nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  background: var(--surface-raised);
  cursor: pointer;
}

.top-nav-toggle span,
.top-nav-toggle span::after {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 1px;
  background: var(--text);
  transition: transform 0.2s var(--ease-out);
}

.top-nav-toggle span {
  position: relative;
  transform: translateY(-3px);
}

.top-nav-toggle span::after {
  content: "";
  position: absolute;
  top: 6px;
}

.top-nav-toggle[aria-expanded="true"] span {
  transform: rotate(45deg);
}

.top-nav-toggle[aria-expanded="true"] span::after {
  top: 0;
  transform: rotate(-90deg);
}

/* ─── HERO ─── */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: clamp(32px, 5vw, 64px);
  max-width: var(--content-max);
  margin: 0 auto;
  padding: clamp(48px, 7vw, 96px) var(--gutter) var(--section-gap);
}

.announce {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.hero h1 {
  font-size: clamp(40px, 6vw, 68px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.035em;
  margin-bottom: 20px;
}

.hero-accent {
  display: block;
  color: var(--accent);
}

.hero-subtitle {
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--text-secondary);
  max-width: 34em;
  margin-bottom: 28px;
}

.download-buttons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 24px;
}

.app-store-badge img {
  width: 168px;
  height: auto;
}

.app-store-badge {
  transition: transform 0.15s var(--ease-out);
}

/* The badge's lettering is cut out of the black, so on a dark page it disappears. Inverted,
   it becomes Apple's white badge. */
@media (prefers-color-scheme: dark) {
  .app-store-badge img {
    filter: invert(1);
  }
}

.app-store-badge:hover {
  transform: translateY(-1px);
}

.text-link {
  color: var(--accent);
  font-size: 16px;
  font-weight: 500;
}

.text-link::after {
  content: " ›";
}

.text-link:hover {
  text-decoration: underline;
}

.hero-devices {
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-tertiary);
}

/* The menu panel, framed on the desktop wallpaper, as it appears under the menu bar. */
.hero-visual {
  position: relative;
  justify-self: center;
  width: 100%;
  max-width: 440px;
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: -10% 0;
  background: radial-gradient(closest-side, var(--glow), transparent);
  z-index: -1;
}

.hero-panel {
  width: 100%;
  border-radius: 28px;
  box-shadow: var(--shot-shadow);
}

/* ─── SECTIONS ─── */

.section {
  padding: var(--section-gap) var(--gutter);
}

.section--tint {
  background: var(--bg-tint);
}

.section-header {
  max-width: 720px;
  margin: 0 auto var(--title-gap);
  text-align: center;
}

.section-eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(30px, 4.2vw, 48px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.section-lead {
  margin-top: 16px;
  font-size: clamp(17px, 1.5vw, 19px);
  color: var(--text-secondary);
}

/* ─── FEATURE SPLIT ─── */

.feature-split {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
  max-width: var(--content-max);
  margin: 0 auto;
}

.feature-split--reverse {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
}

.feature-split--reverse .feature-shot {
  order: 2;
}

.feature-shot img {
  width: 100%;
  border-radius: 18px;
  box-shadow: var(--shot-shadow);
}

/* Window captures carry their own shadow and transparent margin, and are 1×: never frame
   them, and never show them larger than they were captured. */
.feature-shot--window {
  justify-self: center;
  width: 100%;
  max-width: 760px; /* half the 1520px 2x capture */
}

.feature-shot--window img {
  border-radius: 0;
  box-shadow: none;
}

.safeguards-shot {
  max-width: 760px;
  margin: 0 auto var(--title-gap);
}

.feature-shot--panel {
  justify-self: center;
  width: 100%;
  max-width: 300px; /* half the 600px 2x capture */
}

/* Like the Settings captures, the panel capture brings its own shadow. */
.feature-shot--panel img {
  border-radius: 0;
  box-shadow: none;
}

.feature-list {
  list-style: none;
  display: grid;
  gap: 28px;
}

.feature-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  column-gap: 16px;
}

.feature-item .icon-tile {
  grid-row: span 2;
}

.feature-item h3,
.card h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-bottom: 4px;
}

.feature-item p,
.card p {
  font-size: 16px;
  color: var(--text-secondary);
}

.icon-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}

.icon-tile svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ─── CARDS ─── */

.card-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  max-width: var(--content-max);
  margin: 0 auto;
}

.card {
  display: flex;
  flex-direction: column;
  padding: 28px;
  border-radius: var(--radius-card);
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: var(--card-shadow);
}

.card .icon-tile,
.step-number {
  margin-bottom: 18px;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--accent-fill);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
}

/* Setup window captures: 2x, with their own shadow, so unframed at half their pixel width. */
.card-shot {
  width: 100%;
  max-width: 300px;
  margin: 24px auto 0;
}

/* ─── STORY ─── */

.story-note {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.story-note p {
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.015em;
}

.story-note cite {
  display: block;
  margin-top: 18px;
  font-style: normal;
  font-size: 15px;
  color: var(--text-tertiary);
}

/* ─── FAQ ─── */

.faq {
  max-width: 760px;
  margin: 0 auto;
  border-top: 1px solid var(--hairline);
}

.faq details {
  border-bottom: 1px solid var(--hairline);
}

.faq summary {
  position: relative;
  padding: 20px 40px 20px 0;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  width: 9px;
  height: 9px;
  margin-top: -7px;
  border-right: 2px solid var(--text-tertiary);
  border-bottom: 2px solid var(--text-tertiary);
  transform: rotate(45deg);
  transition: transform 0.2s var(--ease-out);
}

.faq details[open] summary::after {
  transform: rotate(-135deg);
  margin-top: -2px;
}

.faq details p {
  padding: 0 0 22px;
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 44em;
}

.faq a,
.legal a {
  color: var(--accent);
}

.faq a:hover,
.legal a:hover {
  text-decoration: underline;
}

/* ─── FINAL CTA ─── */

.final-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--section-gap) var(--gutter);
  background: radial-gradient(60% 70% at 50% 0%, var(--glow), transparent), var(--bg-tint);
}

.final-cta-icon {
  width: 112px;
  height: 112px;
  margin-bottom: 16px;
}

.final-cta h2 {
  font-size: clamp(30px, 4.2vw, 48px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.final-cta > p {
  margin: 14px 0 28px;
  font-size: clamp(17px, 1.5vw, 19px);
  color: var(--text-secondary);
}

.final-cta .requirements {
  margin: 20px 0 0;
  font-size: 14px;
  color: var(--text-tertiary);
}

/* ─── FOOTER ─── */

.site-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 28px var(--gutter) 40px;
  font-size: 13px;
  color: var(--text-tertiary);
}

.site-footer nav {
  display: flex;
  gap: 20px;
}

.site-footer a:hover {
  color: var(--text);
}

/* ─── SIMPLE PAGES (privacy, terms, setup demo) ─── */

.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(40px, 6vw, 72px) var(--gutter) var(--section-gap);
}

.legal h1 {
  font-size: clamp(32px, 4.5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 24px;
}

.legal h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 36px 0 10px;
}

.legal p,
.legal li {
  font-size: 16px;
  color: var(--text-secondary);
}

.legal p + p {
  margin-top: 12px;
}

.legal ul {
  margin: 12px 0 12px 22px;
}

.legal li + li {
  margin-top: 6px;
}

/* ─── REVEAL ───
   Script adds .reveal-ready; without it (or with Reduce Motion) everything is simply shown. */

.reveal-ready .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.reveal-ready .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ─── RESPONSIVE ─── */

@media (max-width: 900px) {
  .hero,
  .feature-split,
  .feature-split--reverse {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-text {
    text-align: center;
  }

  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .download-buttons {
    justify-content: center;
  }

  .hero-visual {
    max-width: 440px;
  }

  .feature-split--reverse .feature-shot {
    order: 0;
  }

  .feature-list {
    max-width: 560px;
    margin: 0 auto;
  }

  .card-grid {
    grid-template-columns: minmax(0, 1fr);
    max-width: 560px;
  }
}

@media (max-width: 760px) {
  .top-nav-toggle {
    display: inline-flex;
  }

  .top-nav-links {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-bottom: 12px;
    font-size: 17px;
  }

  .top-nav-links.is-open {
    display: flex;
  }

  .top-nav-links a {
    padding: 12px 0;
    border-top: 1px solid var(--hairline);
  }

  .top-nav-links .top-nav-cta {
    margin-top: 12px;
    padding: 12px 16px;
    text-align: center;
    border-top: none;
  }

  .site-footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal-ready .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
