/*
 * handback.ai (spec 2026-10-13-landing-page.md, D-2026-10-13-04/05). The colours, type and spacing are the design
 * system's (`/tokens.css` = TOKENS_CSS, light and dark by `prefers-color-scheme`). One accent per role (colour roles
 * §2.1): teal marks the AI, amber marks people, violet only the one primary action. No card grids of equal thirds, no
 * eyebrows; body text at 65ch.
 */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 28px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
code, pre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* The marks follow the scheme: ink loop on light, white loop on dark (design system "The logo"). */
.dark-only { display: none; }
@media (prefers-color-scheme: dark) { .light-only { display: none; } .dark-only { display: block; } }

/* ── nav ── */
.nav { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.nav-row { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 19px; letter-spacing: -0.04em; }
.nav-links { display: flex; gap: 24px; }
.nav-links a { text-decoration: none; color: var(--ink-muted); font-size: 15px; font-weight: 500; }
.nav-links a:hover { color: var(--ink); }

/* ── role marks: the loop as a still glyph (colour roles §2.1 rule 1) ── */
.ai-mark, .people-mark { display: inline-block; width: 16px; height: 16px; margin-right: 10px; vertical-align: -2px; border-radius: 50%; border: 3px solid var(--ai); border-right-color: transparent; transform: rotate(-45deg); }
.people-mark { border-color: var(--people); border-right-color: transparent; }

/* ── type ── */
h1, h2, h3 { margin: 0; font-weight: 700; }
h1 { font-size: clamp(34px, 5.4vw, 64px); line-height: 1.04; letter-spacing: -0.045em; max-width: 13.5em; text-wrap: balance; }
h2 { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.1; letter-spacing: -0.035em; text-wrap: balance; }
h3 { font-size: 20px; line-height: 28px; letter-spacing: -0.02em; font-weight: 600; }
p { margin: 0; max-width: 65ch; }
.lead { margin-top: 16px; color: var(--ink-muted); font-size: 19px; line-height: 30px; }
.fine { margin-top: 16px; font-size: 14px; line-height: 20px; color: var(--ink-muted); }

/* ── buttons: one primary per view, in decision-fill (D-46) ── */
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: var(--radius-md); font: 600 16px/1 var(--font-sans); text-decoration: none; cursor: pointer; border: 1px solid transparent; white-space: nowrap; }
.button.primary { background: var(--decision-fill); color: var(--on-decision); }
.button.primary:hover { filter: brightness(1.08); }
.button.quiet { color: var(--ink); border-color: var(--line-strong); background: transparent; }
.button.quiet:hover { background: var(--fill); }
.button.copy { min-height: 40px; padding: 0 16px; background: var(--surface); color: var(--ink); border-color: var(--line-strong); font-size: 15px; }
.button.copy:hover { background: var(--fill); }

/* ── 1 · hero ── */
.hero { padding: 56px 0 72px; }
.hero-grid { display: grid; gap: 40px; }
.sub { margin-top: 20px; font-size: clamp(18px, 1.6vw, 21px); line-height: 1.5; color: var(--ink-muted); max-width: 34em; }
.outcome { margin-top: 18px; font-weight: 600; font-size: 17px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-video { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 20px; background: #0f0e16; border: 1px solid var(--line); }
@media (min-width: 900px) {
  .hero { padding: 72px 0 88px; }
  .hero-video { aspect-ratio: 16 / 9; }
}
@media (max-width: 899px) { .hero-media { max-width: 560px; } }

/* ── bands and shots ── */
.band { background: var(--surface-sunken); padding: 96px 0; }
.split, .meet, .install { padding: 96px 0; }
figure { margin: 0; }
.phone-shot img { width: 100%; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); }
.phone-shot { max-width: 340px; }
.phone-shot.small { max-width: 300px; }
.wall-shot img { width: 100%; border-radius: var(--radius-md); border: 1px solid var(--line); }

/* 2 · three ways: one wide row (the session), then two of different weight (never equal thirds) */
.starts { margin-top: 56px; display: grid; gap: 56px; }
.start p { margin-top: 10px; color: var(--ink-muted); }
.start-session { display: grid; gap: 32px; align-items: start; }
.term { margin: 24px 0 0; padding: 18px 20px; background: #16151f; color: #f2f2f7; border: 1px solid #2c2a3a; border-radius: var(--radius-md); font-size: 15px; line-height: 26px; overflow-x: auto; }
.term .prompt { color: #a3a5b3; }
.start-pair { display: grid; gap: 56px; }
.start-pair .phone-shot, .start-pair .wall-shot { margin-top: 24px; }
@media (min-width: 900px) {
  .start-session { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 64px; }
  .start-session .phone-shot { justify-self: center; max-width: 300px; }
  .start-pair { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 64px; }
}

/* 3 · anyone can answer: text, then two phones stepped */
.split-grid { display: grid; gap: 48px; align-items: center; }
.split-text p + p { margin-top: 16px; }
.split-text p { margin-top: 16px; color: var(--ink-muted); }
.split-text h2 + p { margin-top: 20px; }
.shot-stack { display: flex; gap: 20px; align-items: flex-start; }
.shot-stack .phone-shot { flex: 1 1 0; max-width: 320px; }
.shot-stack .offset { margin-top: 64px; }
@media (min-width: 900px) {
  .split-grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 72px; }
  .split.reverse .split-grid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); }
  .split.reverse .phone-shot { justify-self: center; }
}

/* 4 · the rules: plain sentences on the surface, hairlines between them */
.rules-grid { display: grid; gap: 48px; align-items: start; }
.rules { list-style: none; margin: 28px 0 0; padding: 0; max-width: 62ch; }
.rules li { padding: 18px 0; border-top: 1px solid var(--line); }
.rules li:last-child { border-bottom: 1px solid var(--line); }
@media (min-width: 900px) { .rules-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr); gap: 72px; } .rules-grid .phone-shot { justify-self: end; } }

/* 5 · meetings: the wall wide, the host's phone over its corner */
.meet-text p { margin-top: 20px; color: var(--ink-muted); }
.meet-media { position: relative; margin-top: 48px; }
.meet-media .room { width: 42%; max-width: 280px; margin: -64px 16px 0 auto; position: relative; }
.meet-media .room img { box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22); }
@media (min-width: 900px) {
  .meet-media { padding-right: 120px; }
  .meet-media .room { position: absolute; right: 0; bottom: -40px; width: 260px; margin: 0; }
}

/* 7 · install */
.install { border-top: 1px solid var(--line); }
.install > .wrap > p { margin-top: 16px; color: var(--ink-muted); }
.copybox { margin-top: 28px; display: flex; align-items: center; gap: 12px; max-width: 720px; padding: 10px 10px 10px 20px; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface-sunken); }
.copybox code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font-size: 15px; line-height: 24px; }
.install-links { margin: 28px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; color: var(--ink-muted); }
.install-links a { color: var(--ink); font-weight: 600; }
.install-links code { font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }

/* 8 · footer */
.foot { border-top: 1px solid var(--line); padding: 32px 0 48px; }
.foot-row { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
.foot-links { display: flex; flex-wrap: wrap; gap: 20px; }
.foot-links a { font-size: 14px; color: var(--ink-muted); }

@media (max-width: 599px) {
  .wrap { padding: 0 20px; }
  .hero { padding: 32px 0 56px; }
  .band, .split, .meet, .install { padding: 72px 0; }
  .shot-stack .offset { margin-top: 40px; }
  .button { padding: 0 18px; }
}

/* 404 */
.notfound { padding: 120px 24px; }
.notfound .lead { margin-top: 20px; }
@media (max-width: 599px) { h1 { font-size: 30px; line-height: 1.08; } }
/* Under 414 px the headline must still fit in two lines (spec §2 rules). */
@media (max-width: 413px) { h1 { font-size: 27px; letter-spacing: -0.04em; } }
