/* Telly Remote site. One face (Archivo, self-hosted), one ground, one ink, one accent. */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/archivo-latin.woff2") format("woff2");
}

:root {
  --bg: #f2f2f2;
  --surface: #e6e7e9;
  --ink: #1f242b;
  --muted: #505863;
  --stage: #1f242b;
  --stage-2: #2b323b;
  --stage-3: #38414c;
  --stage-ink: #f2f2f2;
  --stage-muted: #a9b0ba;
  --accent: #d92d2d;
  --accent-ink: #ffffff;
  --pop: #d92d2d;

  --radius: 4px;
  --margin: clamp(16px, 3vw, 32px);
  --gap: 24px;
  --section: clamp(96px, 12vw, 200px);

  --step-small: clamp(0.875rem, 0.85rem + 0.1vw, 0.9375rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);
  --step-display: clamp(2.5rem, 1.4rem + 4.2vw, 4.75rem);

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --t-fast: 150ms;
  --t-med: 320ms;
  --t-slow: 560ms;

  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: var(--step-body);
  font-weight: 400;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.stage :focus-visible, .tile-accent :focus-visible { outline-color: var(--stage-ink); }
::selection { background: var(--ink); color: var(--bg); }

.skip {
  position: absolute; left: var(--margin); top: -80px; z-index: 10;
  padding: 12px 16px; background: var(--ink); color: var(--bg); border-radius: var(--radius);
}
.skip:focus { top: 12px; }

/* ---------- frame ---------- */
.wrap { padding-inline: var(--margin); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); }
.section { margin-top: var(--section); }

/* ---------- type ---------- */
.display, .head, .feature-text .lead, .tile-accent .head { text-wrap: balance; }
.display { font-size: var(--step-display); line-height: 1; letter-spacing: -0.025em; font-weight: 400; }
.head { font-size: var(--step-head); line-height: 1.02; letter-spacing: -0.022em; font-weight: 400; }
.lead { font-size: var(--step-lead); line-height: 1.35; letter-spacing: -0.005em; }
.small { font-size: var(--step-small); line-height: 1.5; }
.muted { color: var(--muted); }
strong { font-weight: 600; }

/* ---------- header ---------- */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.01em; }
.brand img { width: 36px; height: 36px; border-radius: 8px; }
.nav { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 32px); font-size: var(--step-small); }
.nav a:not(.btn) { text-decoration: none; padding: 12px 2px; }
.nav a:not(.btn):hover { text-decoration: underline; text-decoration-thickness: 1px; }
.nav [aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; }

/* ---------- buttons: flat, one shape ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px; border: 0; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-ink);
  font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.btn:hover { background: #bf2323; text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn-small { min-height: 44px; padding: 0 18px; font-size: var(--step-small); }
.btn-ink { background: var(--stage); color: var(--stage-ink); }
.btn-ink:hover { background: #0f1317; }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; min-height: 44px; }

/* ---------- hero ---------- */
.hero { padding-top: clamp(32px, 6vw, 88px); align-items: stretch; row-gap: 48px; }
.hero-copy { grid-column: 1 / 7; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.hero-copy .lead { max-width: 30ch; margin-top: 28px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.hero-note { max-width: 38ch; color: var(--muted); font-size: var(--step-small); margin-top: 20px; }
.hero-stage { grid-column: 7 / 13; }

/* ---------- stage (flat dark field) ---------- */
.stage { background: var(--stage); color: var(--stage-ink); border-radius: var(--radius); }
.hero-stage .stage {
  display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 24px; align-items: start;
  padding: clamp(20px, 2.4vw, 32px);
}

/* ---------- the remote (a working fragment) ---------- */
[data-ui] { font-size: 15px; line-height: 1.35; letter-spacing: 0; }
.remote { width: 100%; max-width: 320px; background: #f2f2f2; color: #1f242b; border-radius: 40px; padding: 18px 18px 22px; display: grid; gap: 14px; justify-items: center; }
.remote button { cursor: pointer; border: 0; background: #d3d3d3; color: #1f242b; transition: background-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); -webkit-tap-highlight-color: transparent; }
.remote button:hover { background: #c4c5c7; }
.remote button:active { transform: scale(0.95); }
.remote button svg { margin: auto; }
.r-power { width: 52px; height: 52px; border-radius: 50%; background: var(--pop) !important; color: #fff !important; }
.r-power:hover { background: #d83a3a !important; }
.r-pad { position: relative; width: 212px; height: 212px; border-radius: 50%; background: #d3d3d3; }
.r-pad button { position: absolute; width: 56px; height: 56px; border-radius: 50%; background: transparent; display: grid; place-items: center; }
.r-pad button:hover { background: #c4c5c7; }
.r-up { top: 4px; left: 78px; } .r-down { bottom: 4px; left: 78px; }
.r-left { left: 4px; top: 78px; } .r-right { right: 4px; top: 78px; }
.r-ok { position: absolute; top: 50%; left: 50%; width: 72px !important; height: 72px !important; margin: -36px 0 0 -36px; border-radius: 50%; background: #f2f2f2 !important; font-weight: 600; }
.r-ok:hover { background: #fff !important; }
.r-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; }
.r-nav button { min-height: 44px; border-radius: 22px; font-weight: 600; font-size: 14px; }
.r-rockers { display: grid; grid-template-columns: 64px 1fr 64px; gap: 10px; width: 100%; align-items: center; justify-items: center; }
.r-rocker { width: 64px; background: #d3d3d3; border-radius: 32px; display: grid; grid-template-rows: 56px auto 56px; justify-items: center; align-items: center; overflow: hidden; }
.r-rocker button { width: 64px; height: 56px; background: transparent; display: grid; place-items: center; }
.r-rocker button:hover { background: #c4c5c7; }
.r-rocker span { font-size: 13px; font-weight: 600; color: #505863; }
.r-mid { display: grid; gap: 10px; }
.r-mid button { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; }
.r-mid button[aria-pressed="true"] { background: #1f242b; color: #f2f2f2; }
.r-shortcuts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; }
.r-shortcuts button { min-height: 60px; padding: 6px; border-radius: 14px; font-weight: 600; font-size: 13px; line-height: 1.15; }
.r-shortcuts button[aria-busy="true"] { background: #1f242b; color: #f2f2f2; }

/* ---------- the demo TV readout ---------- */
.tv { background: var(--stage-2); border-radius: var(--radius); padding: 22px; display: grid; gap: 18px; min-height: 100%; align-content: start; }
.tv-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tv-name { font-weight: 600; font-size: 1.0625rem; }
.tv-power { font-size: var(--step-small); color: var(--stage-muted); transition: color var(--t-med) var(--ease); }
.tv[data-on="true"] .tv-power { color: var(--stage-ink); }
.tv dl { display: grid; gap: 14px; transition: opacity var(--t-med) var(--ease); }
.tv[data-on="false"] dl { opacity: 0.4; }
.tv dl > div { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 4px 12px; align-items: center; }
.tv dt { color: var(--stage-muted); font-size: var(--step-small); }
.tv dd { font-weight: 600; font-variant-numeric: tabular-nums; }
.meter { grid-column: 2; height: 6px; background: var(--stage-3); border-radius: 3px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--stage-ink); transform-origin: left; transform: scaleX(0.24); transition: transform var(--t-med) var(--ease); }
.tv-log { display: grid; gap: 6px; color: var(--stage-muted); font-size: var(--step-small); min-height: 4.6em; align-content: start; }
.tv-log li { animation: log-in var(--t-med) var(--ease) both; }
.tv-log li:first-child { color: var(--stage-ink); }
.tv-hint { color: var(--stage-muted); font-size: var(--step-small); }
@keyframes log-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.tv-screen { position: relative; aspect-ratio: 16 / 9; background: #14181d; border-radius: var(--radius); padding: 14px; display: flex; align-items: flex-end; overflow: hidden; }
.tv-screen-input { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.1; transition: opacity var(--t-med) var(--ease); }
.tv[data-on="false"] .tv-screen-input { opacity: 0.35; }
.tv-screen-vol { position: absolute; top: 12px; right: 14px; opacity: 0; font-size: var(--step-small); font-variant-numeric: tabular-nums; transition: opacity var(--t-fast) var(--ease); }
.tv-screen-vol.show { opacity: 1; }

/* ---------- features ---------- */
.sec-head { margin-bottom: clamp(48px, 7vw, 96px); }
.feature { align-items: center; row-gap: 32px; margin-top: clamp(72px, 9vw, 144px); }
.feature-text { grid-row: 1; display: grid; gap: 20px; }
.feature-pic { grid-row: 1; }
.feature-text p:not(.lead) { max-width: 44ch; }
.feature-1 { margin-top: 0; }
.feature-1 .feature-text { grid-column: 1 / 6; }
.feature-1 .feature-pic { grid-column: 7 / 13; }
.feature-2 .feature-text { grid-column: 1 / 5; }
.feature-2 .feature-pic { grid-column: 6 / 13; }
.feature-3 .feature-pic { grid-column: 1 / 8; }
.feature-3 .feature-text { grid-column: 9 / 13; }

.tile { background: var(--surface); border-radius: var(--radius); padding: clamp(20px, 3vw, 40px); }

/* editor fragment */
.editor { background: #fff; border-radius: 16px; padding: 24px; display: grid; gap: 8px; max-width: 460px; width: 100%; margin-inline: auto; color: #1f242b; }
.editor-title { font-weight: 600; font-size: 1.25rem; margin-bottom: 8px; }
.editor-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #f2f2f2; border-radius: 10px; padding: 14px 18px; min-height: 60px; font-size: 1rem; }
.editor-row span:last-child { color: #505863; font-variant-numeric: tabular-nums; }
.editor-add { color: #505863; padding: 10px 4px 2px; }

/* lock screen fragment */
.stage-pad { background: var(--stage); color: var(--stage-ink); border-radius: var(--radius); padding: clamp(20px, 3vw, 40px); display: grid; place-items: center; }
.live { width: 100%; max-width: 420px; min-height: 220px; background: var(--stage-2); border-radius: 28px; padding: clamp(18px, 3vw, 24px); display: grid; gap: 20px; align-content: center; }
.live-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.live-top strong { font-size: 1.0625rem; }
.live-top span { color: var(--stage-muted); font-variant-numeric: tabular-nums; }
.live-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.live-btn { aspect-ratio: 1; min-height: 44px; border-radius: 50%; background: var(--stage-3); display: grid; place-items: center; color: var(--stage-ink); }
.live-btn.is-power { background: var(--pop); }
.live-time { color: var(--stage-muted); text-align: center; font-size: var(--step-small); }

/* siri fragment */
.siri { display: grid; gap: 12px; max-width: 520px; width: 100%; min-height: 220px; margin-inline: auto; align-content: center; }
.siri p { background: var(--stage); color: var(--stage-ink); padding: 16px 20px; border-radius: 22px 22px 22px 6px; width: fit-content; max-width: 100%; font-size: 1.0625rem; }
.siri p:nth-child(2) { justify-self: end; border-radius: 22px 22px 6px 22px; background: var(--ink); }
.siri p:nth-child(3) { background: var(--stage-3); }

.also { margin-top: clamp(72px, 9vw, 144px); display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--gap); }
.also-list { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--gap); }
.also-list li { padding: 16px 0; font-size: var(--step-lead); line-height: 1.25; letter-spacing: -0.005em; }

/* ---------- setup ---------- */
.setup { align-items: start; row-gap: 40px; }
.setup-head { grid-column: 1 / 6; position: sticky; top: 24px; display: grid; gap: 28px; }
.steps { grid-column: 6 / 13; display: grid; gap: 12px; counter-reset: s; }
.steps li { background: var(--surface); border-radius: var(--radius); padding: clamp(20px, 2.4vw, 32px); display: grid; gap: 8px; }
.steps li::marker { content: ""; }
.steps .lead { font-weight: 600; }
.steps p:not(.lead) { color: var(--muted); max-width: 52ch; }

/* ---------- privacy field ---------- */
.field { padding: clamp(32px, 6vw, 96px) clamp(20px, 4vw, 56px); align-items: end; row-gap: 40px; }
.field-copy { grid-column: 1 / 7; display: grid; gap: 28px; }
.field-copy p { color: var(--stage-muted); max-width: 40ch; }
.field-list { grid-column: 8 / 13; display: grid; gap: 0; font-size: var(--step-lead); line-height: 1.2; }
.field-list li { padding: 14px 0; }
.field a { color: var(--stage-ink); }
.field-link { margin-top: 16px; font-size: var(--step-small); }

/* ---------- faq ---------- */
.faq-grid { align-items: start; row-gap: 32px; }
.faq-head { grid-column: 1 / 5; position: sticky; top: 24px; }
.faq-list { grid-column: 5 / 13; display: grid; gap: 8px; }
details.q { background: var(--surface); border-radius: var(--radius); transition: background-color var(--t-med) var(--ease), color var(--t-med) var(--ease); }
details.q summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  min-height: 72px; padding: 16px 24px; font-size: 1.25rem; font-weight: 600; line-height: 1.25; letter-spacing: -0.005em;
}
details.q summary::-webkit-details-marker { display: none; }
details.q .plus { flex: none; position: relative; width: 16px; height: 16px; }
details.q .plus::before, details.q .plus::after { content: ""; position: absolute; left: 0; top: 6.5px; width: 16px; height: 3px; background: currentColor; transition: transform var(--t-med) var(--ease); }
details.q .plus::after { transform: rotate(90deg); }
details.q[open] { background: var(--accent); color: var(--accent-ink); }
details.q[open] .plus::after { transform: rotate(0deg); }
details.q .answer { padding: 0 24px 24px; max-width: 60ch; display: grid; gap: 12px; }
details.q .answer a { color: inherit; }
details.q:hover:not([open]) { background: #dcdde0; }

/* ---------- close ---------- */
.close { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; min-height: 360px; }
.tile-flat { grid-column: 1 / 3; background: var(--stage-2); border-radius: var(--radius); }
.tile-accent { grid-column: 3 / 11; background: var(--accent); color: var(--accent-ink); border-radius: var(--radius); padding: clamp(24px, 4vw, 48px); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 20px; }
.tile-accent p { max-width: 40ch; }
.tile-icon { grid-column: 11 / 13; border-radius: var(--radius); background: var(--stage) center / cover no-repeat url("/assets/icon-512.png"); }

/* ---------- footer ---------- */
.foot { margin-top: clamp(72px, 10vw, 140px); padding-block: 0 28px; font-size: var(--step-small); }
.foot-line { display: grid; grid-template-columns: 1fr auto 1fr; gap: 24px; align-items: center; }
.foot-line nav { display: flex; gap: 24px; justify-self: center; }
.foot-line > :last-child { justify-self: end; }
.foot a { text-decoration: none; padding: 12px 0; display: inline-block; }
.foot a:hover { text-decoration: underline; }
.foot-note { margin-top: 12px; color: var(--muted); max-width: 70ch; }

/* ---------- document pages (privacy, support) ---------- */
.doc { padding-top: clamp(32px, 6vw, 88px); }
.doc-title { display: grid; gap: 20px; max-width: 900px; margin-bottom: clamp(48px, 7vw, 96px); }
.doc-title .lead { max-width: 36ch; }
.doc-cols { align-items: start; row-gap: 40px; }
.doc-nav { grid-column: 1 / 5; position: sticky; top: 24px; display: grid; gap: 2px; font-size: var(--step-small); }
.doc-nav a { text-decoration: none; padding: 10px 0; }
.doc-nav a:hover { text-decoration: underline; }
.doc-body { grid-column: 6 / 13; max-width: 68ch; display: grid; gap: clamp(40px, 5vw, 64px); }
.doc-body section { display: grid; gap: 16px; scroll-margin-top: 24px; }
.doc-body h2 { font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2rem); line-height: 1.12; letter-spacing: -0.015em; font-weight: 600; }
.doc-body h3 { font-size: 1.1875rem; font-weight: 600; margin-top: 8px; }
.doc-body ul { display: grid; gap: 10px; }
.doc-body ul li { position: relative; padding-left: 22px; }
.doc-body ul li::before { content: ""; position: absolute; left: 4px; top: 0.72em; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }
.doc-body ol { display: grid; gap: 14px; counter-reset: n; }
.doc-body ol li { position: relative; padding-left: 40px; counter-increment: n; }
.doc-body ol li::before { content: counter(n); position: absolute; left: 0; top: 0; font-weight: 600; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-size: 0.875rem; }
.doc-body .faq-list { grid-column: auto; }
.callout { background: var(--surface); border-radius: var(--radius); padding: clamp(20px, 3vw, 32px); display: grid; gap: 10px; }

/* ---------- entrance ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease); transition-delay: calc(var(--i, 0) * 80ms); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* ---------- phone ---------- */
@media (max-width: 960px) {
  .hero-copy, .hero-stage, .setup-head, .steps, .field-copy, .field-list, .faq-head, .faq-list, .doc-nav, .doc-body,
  .feature .feature-text, .feature .feature-pic { grid-column: 1 / -1; grid-row: auto; }
  .feature-3 .feature-text { grid-row: 1; }
  .hero-copy { gap: 28px; }
  .setup-head, .faq-head, .doc-nav { position: static; }
  .hero-stage .stage { grid-template-columns: 1fr; justify-items: center; }
  .remote { justify-self: center; }
  .tv { width: 100%; max-width: 480px; }
  .close { grid-template-columns: repeat(2, minmax(0, 1fr)); min-height: 0; }
  .tile-accent { grid-column: 1 / -1; grid-row: 1; min-height: 300px; }
  .tile-flat, .tile-icon { grid-column: auto; min-height: 120px; }
  .stage-pad { padding: 20px; }
  .also-list { grid-template-columns: 1fr; }
  .field-list ul { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--gap); }
  .foot-line { grid-template-columns: 1fr; gap: 4px; }
  .foot-line nav, .foot-line > :last-child { justify-self: start; }
}
@media (max-width: 560px) {
  .nav .nav-wide { display: none; }
  .brand span { font-size: 1rem; }
  details.q summary { font-size: 1.125rem; min-height: 64px; padding-inline: 20px; }
  details.q .answer { padding-inline: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; transition-delay: 0ms !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}
