/* Self-hosted so first paint never waits on a third-party origin. A render
 * blocking stylesheet from fonts.googleapis.com held DOMContentLoaded for the
 * whole time that request took, which on a slow or restricted network means a
 * blank page. Both families are variable, so one file covers every weight. */
@font-face {
  font-family: Inter;
  src: url('assets/fonts/inter-latin.woff2') format('woff2');
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url('assets/fonts/space-grotesk-latin.woff2') format('woff2');
  font-weight: 500 600;
  font-style: normal;
  font-display: swap;
}

/* Brand colours are copied from viu-site/brand-kit/tokens so this page and the
 * brand kit cannot drift. Everything paints through the semantic tokens, which
 * is what lets one set of rules serve both themes. */

:root {
  --cyan: #18c7e6;
  --deep-blue: #1748c8;

  /* Light is the bare default, so a device with no preference gets it. */
  --bg: #f5f7fa;
  --raised: #fff;
  --text: #1b1f26;
  --muted: #59626f;          /* not Titanium: 2.6:1 on Cloud is under the floor */
  --line: rgba(27, 31, 38, .13);
  --accent: var(--deep-blue); /* cyan text on Cloud is 1.9:1; cyan stays a fill */
  --stage: #eceff4;
  color-scheme: light;

  --wrap: 1060px;
  --gutter: clamp(20px, 5vw, 56px);
  --gap: clamp(56px, 9vw, 112px);
  --display: "Space Grotesk", Inter, "Helvetica Neue", Arial, sans-serif;
  --body: Inter, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #080d1c; --raised: #0e1526; --text: #f5f7fa; --muted: #98a3b4;
    --line: rgba(245, 247, 250, .12); --accent: var(--cyan); --stage: #111a2e;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #080d1c; --raised: #0e1526; --text: #f5f7fa; --muted: #98a3b4;
  --line: rgba(245, 247, 250, .12); --accent: var(--cyan); --stage: #111a2e;
  color-scheme: dark;
}

* { box-sizing: border-box; }

/* A class that sets display beats the hidden attribute's UA rule. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

h1, h2 { font-family: var(--display); font-weight: 600; margin: 0; letter-spacing: -.035em; }
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row.gap { gap: 10px; justify-content: flex-end; }

.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: absolute; left: -9999px; top: 0; z-index: 30;
  background: var(--cyan); color: #080d1c; padding: 10px 16px; text-decoration: none;
}
.skip:focus { left: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ------------------------------------------------------------------ header */

/* Static, not sticky, and no backdrop blur: a blurred fixed layer repaints on
 * every scroll frame, which was most of why scrolling felt sticky. */
header { border-bottom: 1px solid var(--line); }
header .row { padding-block: 14px; }
.wordmark { line-height: 0; }
.wordmark img { height: 20px; width: auto; }
/* Scoped to .wordmark so these outrank `.wordmark img`, which would otherwise
 * win on specificity and leave both marks stacked. */
.wordmark .on-light { display: block; }
.wordmark .on-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .wordmark .on-light { display: none; }
  :root:not([data-theme="light"]) .wordmark .on-dark { display: block; }
}
:root[data-theme="dark"] .wordmark .on-light { display: none; }
:root[data-theme="dark"] .wordmark .on-dark { display: block; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  background: none; color: var(--muted);
  border: 1px solid var(--line); border-radius: 50%; cursor: pointer;
}
.icon-btn:hover { color: var(--text); }
.ti { display: none; }
#theme-toggle[data-mode="auto"] .ti-auto,
#theme-toggle[data-mode="light"] .ti-light,
#theme-toggle[data-mode="dark"] .ti-dark { display: block; }

.cta {
  background: var(--cyan); color: #080d1c;
  font-size: 13px; font-weight: 500; text-decoration: none;
  border-radius: 999px; padding: 9px 18px;
}

/* ------------------------------------------------------------------ layout */

main > section { padding-block: var(--gap); }
main > section + section { border-top: 1px solid var(--line); }

.hero h1 { font-size: clamp(38px, 6.2vw, 68px); line-height: 1.04; margin-bottom: 20px; }
.lede { color: var(--muted); max-width: 42ch; }

/* -------------------------------------------------------------------- card */

.card-section {
  display: grid; gap: clamp(28px, 5vw, 64px);
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: center;
}

.stage {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--stage);
  border-radius: 14px;
  overflow: hidden;
}
/* touch-action:none is load-bearing — without it a drag scrolls the page
 * instead of turning the card. */
#stage {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  touch-action: none; cursor: grab;
  opacity: 0; transition: opacity .4s ease;
}
#stage.ready { opacity: 1; }
#stage:active { cursor: grabbing; }

.poster {
  position: absolute; inset: 0; margin: auto;
  max-width: 74%; max-height: 74%; width: auto; height: auto;
  object-fit: contain; transition: opacity .4s ease; pointer-events: none;
}
.poster.hidden { opacity: 0; }

.ghost {
  position: absolute; bottom: 12px; right: 12px; z-index: 2;
  background: var(--raised); color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; font: inherit; font-size: 12px; cursor: pointer;
}
.ghost:hover { color: var(--text); }

.fallback {
  position: absolute; bottom: 14px; left: 14px; right: 14px; z-index: 2;
  text-align: center; font-size: 13px; color: var(--muted);
}

.chips { display: flex; gap: 6px; margin-bottom: 26px; }
.chip {
  background: none; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 15px; font: inherit; font-size: 13px; cursor: pointer;
}
.chip:hover { color: var(--text); }
.chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }

.variant-name { font-size: clamp(22px, 2.6vw, 30px); margin-bottom: 10px; }
.variant-desc { color: var(--muted); max-width: 34ch; }

/* ------------------------------------------------------------------- steps */

.steps ol {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: clamp(20px, 3vw, 40px);
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.steps li { display: grid; gap: 6px; }
.steps b { font-family: var(--display); font-weight: 600; font-size: 17px; }
.steps span { color: var(--muted); }

/* -------------------------------------------------------------------- join */

.join { text-align: center; }
.join h2 { font-size: clamp(28px, 4.2vw, 46px); line-height: 1.06; margin-bottom: 16px; }
.join .lede { margin: 0 auto 28px; }

.field {
  display: flex; gap: 8px; flex-wrap: wrap;
  max-width: 440px; margin: 0 auto;
  background: var(--raised); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px;
}
.field:focus-within { border-color: var(--accent); }
.field input {
  flex: 1 1 180px; min-width: 0;
  background: none; border: 0; color: var(--text);
  font: inherit; padding: 10px 16px;
}
.field input:focus { outline: none; }
.field button {
  background: var(--cyan); color: #080d1c; border: 0; border-radius: 999px;
  padding: 11px 22px; font: inherit; font-weight: 500; cursor: pointer;
}
.field button:disabled { opacity: .55; cursor: default; }

/* Honeypot wrapper: off screen, not display:none. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.status { min-height: 1.4em; margin-top: 12px; font-size: 14px; color: var(--muted); }
.status.ok { color: var(--accent); }
.status.bad { color: #d7263d; }
:root[data-theme="dark"] .status.bad { color: #ff9a8b; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .status.bad { color: #ff9a8b; }
}

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

footer {
  border-top: 1px solid var(--line);
  padding-block: 22px; font-size: 13px; color: var(--muted);
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

.noscript { padding: 20px var(--gutter); color: var(--muted); }

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

@media (max-width: 820px) {
  .card-section { grid-template-columns: 1fr; }
  .stage { aspect-ratio: 1 / 1; }
}
@media (max-width: 480px) {
  .chip { flex: 1 1 auto; padding-inline: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}
