/*
 * Wimmo landing page.
 *
 * ⚠️ NO COLOUR LITERAL BELONGS IN THIS FILE. Every colour is a var() from tokens.css,
 * which scripts/generate-web-tokens.mjs writes from design/tokens.json. The app
 * enforces the same rule through eslint (`no-restricted-syntax` on hex literals);
 * eslint does not read CSS, so the enforcement here is that there is nothing to
 * fork — the values simply are not in this file. scripts/check-copy.mjs fails the
 * build on a hex literal found here.
 *
 * Layout, spacing and type sizes are transcribed from the approved mockup at
 * wimmo-start.nexar-shared.chatgpt.site, read 2026-09-21. Where the mockup's own
 * palette had drifted from the tokens (#22232b for ink against the tokens' #1b1b1e,
 * #61616f for muted against #434655) the TOKEN wins — the page and the app are one
 * product or they are not.
 */

/*
 * THE APP'S OWN FONTS, served from this site (redesign, 2026-10-07). Funnel Display for
 * the wordmark and headings, Funnel Sans for everything else — the same families the app
 * ships (design/2026-10-redesign/bold-b-blue/README.md §4), here as the variable files
 * from google/fonts so the page's in-between weights (550, 650, 750) are real weights,
 * not synthesised. SIL OFL 1.1, licence beside them in assets/fonts/OFL.txt.
 * Served locally rather than from Google Fonts: one less third party a visitor's browser
 * talks to, and the CSP's font-src is 'self' only (scripts/build-web.mjs).
 */
@font-face {
  font-family: 'Funnel Display'; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url('assets/fonts/FunnelDisplay-wght.ttf') format('truetype');
}
@font-face {
  font-family: 'Funnel Sans'; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url('assets/fonts/FunnelSans-wght.ttf') format('truetype');
}

/* Semantic aliases over the raw token names, so the rules below read as design
   intent rather than as a palette lookup. */
:root {
  --page: var(--background);
  --ink: var(--on-surface);
  --muted: var(--on-surface-variant);
  --line: var(--outline-variant);
  --brand: var(--primary);
  --brand-bright: var(--primary-container);
  --wash: var(--surface-container-low);
  --wash-blue: var(--primary-fixed);
  --card: var(--surface-container-lowest);
  --display: 'Funnel Display', 'Funnel Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }

/*
 * `hidden` must win over any display rule below it. Without this the launch-day
 * store button was visible on the waitlist page, because `.button { display:
 * inline-flex }` overrides the attribute's default `display: none`. Caught by
 * rendering the page rather than by reading it — the markup was correct.
 */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 30px; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: 'Funnel Sans', system-ui, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
a { color: inherit; }
button, a, input, summary { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid var(--brand-bright);
  outline-offset: 5px;
}

.wrap { width: min(1120px, calc(100% - 96px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── header / footer brand ─────────────────────────────────────────────── */

header { height: 116px; display: flex; align-items: center; }

.brand {
  display: inline-flex; gap: 11px; align-items: center;
  text-decoration: none; font-family: var(--display); font-size: 29px; font-weight: 600; letter-spacing: -0.6px;
}
/* The real Wimmo mark. The mockup drew a letter W in a tile; this is the artwork the
   app ships, rendered from the same assets/logo-source.svg the icons come from. */
.mark { width: 41px; height: 41px; border-radius: 12px; display: block; }

/* ── 1. hero ───────────────────────────────────────────────────────────── */

.hero {
  display: grid; grid-template-columns: 1.15fr 1fr; align-items: center;
  min-height: 665px; gap: 40px; padding-top: 26px; padding-bottom: 73px;
}
h1 {
  font-family: var(--display); font-size: clamp(44px, 4.5vw, 64px); line-height: 1.1; letter-spacing: -1.6px;
  font-weight: 500; margin: 0; max-width: 560px;
}
h1 span { color: var(--brand); }
.intro { color: var(--muted); font-size: 18px; line-height: 1.8; max-width: 470px; margin: 27px 0 33px; }

.waitlist { display: flex; gap: 10px; max-width: 515px; scroll-margin-top: 90px; }
input {
  min-width: 0; width: 100%; height: 56px;
  border: 1px solid var(--outline); border-radius: 14px;
  background: transparent; padding: 0 17px; color: var(--ink); font-size: 14px;
}
input::placeholder { color: var(--outline); }
input[aria-invalid='true'] { border-color: var(--error); }

button, .button {
  border: 0; background: var(--brand); color: var(--on-primary); border-radius: 28px;
  padding: 18px 25px; white-space: nowrap; font-weight: 600; font-size: 14px;
  cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .2s;
}
button:hover, .button:hover { background: var(--brand-bright); }
button[disabled] { opacity: .6; cursor: default; }

.form-message { font-size: 14px; line-height: 1.6; margin: 12px 0 0; max-width: 460px; color: var(--muted); }
.form-message:empty { display: none; }
.form-message[data-state='error'] { color: var(--error); }

.hero-visual {
  background: var(--wash-blue); border-radius: 48px;
  display: grid; place-items: center; padding: 37px 30px; min-height: 554px;
}

/* ── the phone frame ───────────────────────────────────────────────────── */

.phone {
  position: relative; background: var(--page);
  border: 6px solid var(--inverse-surface); outline: 1px solid var(--outline);
  border-radius: 40px; overflow: hidden; flex-shrink: 0;
  box-shadow: 0 20px 32px -20px rgb(0 0 0 / .25);
}
.phone img { display: block; width: 100%; height: 100%; object-fit: cover; }
.camera {
  position: absolute; top: 13px; left: 50%; transform: translateX(-50%);
  width: 9px; height: 9px; border-radius: 50%; background: var(--inverse-surface);
}
.home-indicator {
  position: absolute; bottom: 11px; left: 35%; width: 30%; height: 4px;
  border-radius: 4px; background: var(--inverse-surface);
}
.hero-phone { width: 245px; height: 493px; transform: rotate(5deg); }
.small-phone { width: 196px; height: 395px; margin: 29px auto 0; border-width: 5px; border-radius: 31px; }

/* ── 2. the moment ─────────────────────────────────────────────────────── */

.moment { padding: 114px 0 134px; text-align: center; }
.moment p {
  font-family: var(--display); font-size: clamp(27px, 3.1vw, 42px); line-height: 1.5; font-weight: 500;
  letter-spacing: -0.8px; margin: 0; color: var(--outline);
}
/* Each line is its own element so the three can arrive in turn. They are block
   spans rather than three <p>s because it is one sentence, not three. */
.moment .line { display: block; }
.moment .line.last { color: var(--ink); }

/* ── shared headings ───────────────────────────────────────────────────── */

h2 { font-family: var(--display); font-size: 38px; line-height: 1.2; font-weight: 500; letter-spacing: -0.8px; margin: 0 0 56px; }
h3 { font-size: 21px; line-height: 1.4; letter-spacing: -.55px; font-weight: 600; margin: 0 0 9px; }
p { line-height: 1.7; }

/* ── 3. how it works ───────────────────────────────────────────────────── */

.how { padding-bottom: 126px; }
.how > h2 { text-align: center; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step {
  padding: 30px 20px 0; border-radius: 28px; background: var(--surface-container);
  text-align: center; overflow: hidden; height: 540px;
}
.step:nth-child(2) { background: var(--wash-blue); }
.step:nth-child(3) { background: var(--surface-container-high); }
.number {
  width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%;
  display: inline-grid; place-items: center; font-size: 12px; color: var(--brand);
  font-weight: 600; margin-bottom: 19px;
}
.step p { font-size: 14px; color: var(--muted); margin: 0 auto; max-width: 255px; min-height: 48px; }

/* ── 4. what's inside ──────────────────────────────────────────────────── */

.inside { padding-bottom: 130px; }
.inside > h2 { text-align: center; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.feature {
  border: 1px solid var(--line); border-radius: 24px;
  display: flex; gap: 24px; align-items: flex-start; padding: 35px 32px;
  min-height: 155px; background: var(--card);
}
.feature p { font-size: 16px; color: var(--muted); margin: 0; max-width: 340px; }
.icon {
  width: 48px; height: 48px; border-radius: 15px; background: var(--wash-blue);
  color: var(--brand); display: grid; place-items: center; flex-shrink: 0;
}
.icon svg {
  width: 29px; height: 29px; fill: none; stroke: currentColor;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}

/* ── 5. pricing ────────────────────────────────────────────────────────── */

.pricing { padding-bottom: 131px; }
.price-card {
  border-radius: 36px; background: var(--wash-blue); text-align: center;
  padding: 52px 24px 54px; max-width: 736px; margin: auto;
}
.eyebrow { font-size: 14px; font-weight: 600; color: var(--brand); display: block; margin-bottom: 23px; }
.price-card h2 { font-size: 42px; margin-bottom: 37px; line-height: 1.3; }

.prices { display: flex; justify-content: center; align-items: baseline; gap: 35px; }
.plan { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.plan strong { font-size: 26px; font-weight: 600; letter-spacing: -.9px; color: var(--muted); }
.plan span { font-size: 14px; color: var(--muted); }
/*
  The default plan, and the ONLY way the page says so: it is larger, darker and
  first. No badge, no percentage, no struck-through second price.
*/
.primary-plan strong { font-size: 38px; letter-spacing: -1.4px; color: var(--ink); }
.primary-plan span { color: var(--ink); }
.or { font-size: 14px; color: var(--outline); }

.trial-note { font-size: 14px; color: var(--muted); margin: 30px 0 25px; }
.price-card .button { min-width: 198px; }

/* ── 6. questions ──────────────────────────────────────────────────────── */

.questions { max-width: 800px; padding-bottom: 117px; }
.questions h2 { text-align: center; margin-bottom: 37px; }
details { border-bottom: 1px solid var(--line); }
summary {
  list-style: none; cursor: pointer; display: flex; align-items: center;
  justify-content: space-between; gap: 24px; padding: 25px 0; font-size: 16px; font-weight: 500;
}
summary::-webkit-details-marker { display: none; }
summary span { font-size: 25px; color: var(--brand); font-weight: 400; transition: transform .2s; }
details[open] summary span { transform: rotate(45deg); }
details p { color: var(--muted); margin: 0; padding: 0 40px 24px 0; font-size: 16px; }
details a { color: var(--brand); text-underline-offset: 4px; }

/* ── footer ────────────────────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--line); display: flex; align-items: center;
  justify-content: space-between; padding: 35px 0 45px;
}
footer .brand { font-size: 24px; }
footer .mark { width: 34px; height: 34px; border-radius: 10px; }
footer nav { display: flex; gap: 31px; }
footer nav a { font-size: 14px; color: var(--muted); text-decoration: none; }
footer nav a:hover { text-decoration: underline; }

/* ── launch-day store buttons ──────────────────────────────────────────── */
/*
  Hidden until config.js flips MODE. The badges are IMAGES supplied by Apple and
  Google — see web/config.js — because both require their own artwork at their own
  proportions, and a hand-drawn approximation of either breaks their terms.
  Until those files exist the buttons stay hidden, which is why MODE defaults to
  'waitlist' and the page is complete without them.
*/
.stores { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.store-badge { display: inline-block; height: 52px; background-size: contain; background-repeat: no-repeat; }
.store-badge[data-store='ios'] { width: 156px; background-image: url('assets/badge-app-store.svg'); }
.store-badge[data-store='android'] { width: 176px; background-image: url('assets/badge-google-play.png'); }

/* ── responsive ────────────────────────────────────────────────────────── */

@media (min-width: 1500px) {
  .wrap { width: min(1180px, calc(100% - 120px)); }
  .hero { gap: 70px; }
}

@media (max-width: 950px) {
  .wrap { width: calc(100% - 56px); }
  h1 { font-size: 48px; letter-spacing: -1.2px; }
  .hero { gap: 28px; }
  .hero-visual { padding: 30px 15px; min-height: 500px; }
  .hero-phone { width: 213px; height: 430px; }
  .waitlist { flex-direction: column; }
  .waitlist button { align-self: flex-start; }
  .step { padding-inline: 10px; height: 505px; }
  .small-phone { width: 170px; height: 350px; }
  .feature { padding: 25px; gap: 18px; }
}

@media (max-width: 650px) {
  .wrap { width: calc(100% - 40px); }
  header { height: 91px; }
  .brand { font-size: 26px; }
  .mark { width: 37px; height: 37px; border-radius: 11px; }
  .hero { grid-template-columns: 1fr; padding-top: 34px; padding-bottom: 0; gap: 38px; min-height: 0; }
  h1 { font-size: 44px; line-height: 1.12; letter-spacing: -1.1px; max-width: 370px; }
  .intro { font-size: 16px; line-height: 1.8; margin: 24px 0 27px; max-width: 390px; }
  .waitlist { gap: 12px; }
  .waitlist button { width: 100%; height: 54px; }
  input { font-size: 16px; } /* under 16px iOS Safari zooms the page on focus */
  .hero-visual { border-radius: 32px; min-height: 484px; padding: 32px 20px; }
  .hero-phone { height: 420px; width: 210px; }
  .moment { padding: 95px 0 98px; }
  .moment p { font-size: 26px; line-height: 1.65; letter-spacing: -.7px; }
  h2 { font-size: 31px; margin-bottom: 32px; letter-spacing: -0.6px; }
  .steps { grid-template-columns: 1fr; gap: 20px; }
  .step { height: 495px; padding-top: 28px; }
  .step p { min-height: 0; max-width: 290px; }
  .small-phone { width: 190px; height: 384px; margin-top: 28px; }
  .number { margin-bottom: 14px; }
  .how { padding-bottom: 88px; }
  .inside { padding-bottom: 87px; }
  .cards { grid-template-columns: 1fr; gap: 14px; }
  .feature { padding: 25px 22px; min-height: 145px; gap: 18px; }
  .feature h3 { font-size: 19px; }
  .feature p { font-size: 15px; }
  .icon { width: 44px; height: 44px; border-radius: 13px; }
  .pricing { padding-bottom: 91px; }
  .price-card { border-radius: 28px; padding: 39px 17px 38px; }
  .price-card h2 { font-size: 31px; margin-bottom: 29px; letter-spacing: -1px; }
  .prices { gap: 23px; }
  /*
   * ⚠️ ORDER MATTERS AND IT IS NOT COSMETIC. `.plan strong` and `.primary-plan
   * strong` have the SAME specificity (0,1,1), so whichever is written last wins.
   * These two were the other way round and both prices rendered at 23px — the
   * equal-weight treatment the founder explicitly asked not to copy from the
   * mockup, reintroduced by a CSS ordering accident that the desktop rules did not
   * have. MEASURED with getComputedStyle at a 500px viewport; reading the file
   * would not have shown it.
   */
  .plan strong { font-size: 23px; }
  .primary-plan strong { font-size: 32px; }
  .trial-note { font-size: 13px; max-width: 265px; margin: 26px auto 22px; }
  .questions { padding-bottom: 81px; }
  .questions h2 { margin-bottom: 22px; }
  summary { padding: 23px 0; font-size: 15px; line-height: 1.6; }
  details p { font-size: 15px; }
  /* Wraps rather than overflowing: at 320 px the four links ran off the right edge and
     "Contact" was cut (MEASURED 2026-10-07, headless Chrome, before and after the font
     change). */
  footer { padding: 27px 0 34px; gap: 18px 25px; flex-wrap: wrap; }
  footer nav { gap: 10px 18px; flex-wrap: wrap; }
  footer nav a { white-space: nowrap; }
  footer nav a { font-size: 12px; }
  footer .brand { font-size: 20px; gap: 8px; }
  footer .mark { width: 29px; height: 29px; border-radius: 9px; }
}

/* ── motion ────────────────────────────────────────────────────────────── */
/*
 * SLOW AND CONTINUOUS, NEVER BOUNCY, NEVER SPINNING. The founder's register, and
 * the app already wrote it down: --motion-typeShift-* is 1400ms/ease and comes from
 * design/tokens.json via tokens.css. Nothing here invents a duration, and there is
 * no overshoot easing anywhere — a cubic-bezier that goes past 1 is what "bouncy"
 * is made of.
 *
 * ⚠️ THE HIDDEN STATE IS GATED THREE WAYS, and all three matter:
 *
 *   1. `.js-motion` — added by app.js. With JavaScript off, that class never
 *      arrives and nothing is ever hidden, so the page is complete without it.
 *   2. `@media (prefers-reduced-motion: no-preference)` — the hiding lives INSIDE
 *      the positive query. Someone who has turned motion off is not served a rule
 *      that sets opacity 0 and then waits for a transition that will not run.
 *   3. app.js checks the same media query and does not add the class at all.
 *
 * (2) and (3) are deliberately redundant. The failure this guards against is
 * content that is invisible forever because the thing meant to reveal it never
 * ran, and that is not a failure worth being clever about.
 */
@media (prefers-reduced-motion: no-preference) {
  .js-motion .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition:
      opacity var(--motion-typeShift-duration) var(--motion-typeShift-easing),
      transform var(--motion-typeShift-duration) var(--motion-typeShift-easing);
  }

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

  /*
   * The three lines arrive one after another, because that is the sentence's own
   * rhythm — the third line is the turn, and it should not land at the same moment
   * as the setup. The stagger is a fraction of the shared duration rather than a
   * new number.
   */
  .js-motion .moment .line { transition-delay: 0ms; }
  .js-motion .moment .line:nth-child(2) { transition-delay: 600ms; }
  .js-motion .moment .line:nth-child(3) { transition-delay: 1200ms; }
}

/*
 * The belt-and-braces clause. If a `.reveal` rule ever escapes the query above,
 * this puts the content back rather than leaving it at opacity 0 forever.
 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
  .reveal, .js-motion .reveal { opacity: 1 !important; transform: none !important; }
}
