/*
 * relevant.mk — the landing page.
 *
 * Every value here comes from relevant_flutter/docs/plans/DESIGN_SYSTEM.md;
 * §11 there covers what is specific to the web. The tokens below mirror §2.2
 * one for one, so a colour change is made in that document first, then here
 * and in AppTokens.
 */

/* ------------------------------------------------------------------ fonts */
/* Manrope, subset to Latin, Latin Extended-A and Cyrillic (SIL OFL 1.1 —
   assets/fonts/OFL.txt). Static instances, as in the app (§3.1). */
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/manrope-400.9efd62c045.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/manrope-500.08746ba345.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/manrope-600.c27ee046a5.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/manrope-700.817763267e.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 800; font-display: swap; src: url("/assets/fonts/manrope-800.2c7f900855.woff2") format("woff2"); }

/* ----------------------------------------------------------------- tokens */
:root {
  color-scheme: light dark;

  /* §2.2, light */
  --paper: #F7F7F7;
  --raised: #FFFFFF;
  --sunken: #F2F4F7;
  --rule: #E4E7EC;
  --outline: #858FA1;
  --ink: #0B1020;
  --body: #344054;
  --muted: #667085;
  --accent: #2563EB;
  --on-accent: #FFFFFF;
  --accent-text: #2563EB;
  --accent-container: #EEF3FF;
  --on-accent-container: #12358E;
  --highlight: #06B6D4;
  --danger: #D92D20;
  --logo-chip: #F2F4F7;

  /* §4 and §6 */
  --space-xxs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 20px;
  --space-xl: 24px;
  --space-xxl: 32px;
  --space-xxxl: 48px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;
  --duration-fast: 120ms;
  --duration-medium: 220ms;
  --duration-slow: 360ms;
  --ease-enter: cubic-bezier(0.215, 0.61, 0.355, 1); /* easeOutCubic */

  /* §7: gutter 16 on compact windows, 24 from 600 up; grid measure 1080. */
  --gutter: var(--space-md);
  --grid-max: 1080px;
  --reading-max: 680px;
  --form-max: 560px;

  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* §2.2, dark */
    --paper: #0B1020;
    --raised: #161E33;
    --sunken: #1B2338;
    --rule: #283149;
    --outline: #667085;
    --ink: #F7F7F7;
    --body: #D0D5DD;
    --muted: #98A2B3;
    --accent: #2563EB;
    --on-accent: #FFFFFF;
    --accent-text: #6EA8FE;
    --accent-container: #15285E;
    --on-accent-container: #DBEAFE;
    --highlight: #22D3EE;
    --danger: #F97066;
    --logo-chip: #E4E7EC;
  }
}

@media (min-width: 600px) {
  :root { --gutter: var(--space-xl); }
}

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

[hidden] { display: none !important; }

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

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }

h1, h2, h3, p, ul, figure, blockquote { margin: 0; }

h1, h2, h3 { color: var(--ink); text-wrap: balance; }

p, li { text-wrap: pretty; }

a { color: var(--accent-text); text-underline-offset: 0.18em; }

::selection { background: var(--accent-container); color: var(--on-accent-container); }

/* §9: a 2px accentText ring, radius matched to the control. */
:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: var(--space-xs);
  left: var(--space-xs);
  z-index: 10;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  transform: translateY(-200%);
}

.skip-link:focus { transform: none; }

.wrap {
  width: 100%;
  max-width: calc(var(--grid-max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}

/* ------------------------------------------------------------- type scale */
/* §3.3, with display and headline growing past the phone sizes on wide
   windows (§11): 30 → 56 and 24 → 34. Everything scales with the browser's
   text size, because it is all rem/clamp on rem. */
.display {
  font-size: clamp(1.875rem, 1.2rem + 3.2vw, 3.5rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.headline {
  font-size: clamp(1.5rem, 1.2rem + 1.3vw, 2.125rem);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.lead {
  max-width: 34rem;
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  line-height: 1.55;
}

.lead--strong {
  color: var(--ink);
  font-weight: 600;
}

/* ----------------------------------------------------------------- header */
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  min-height: 72px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border-radius: var(--radius-sm);
}

/* §8.13 / plan 24: mark height = 1.6 × wordmark height. */
.logo__mark { width: auto; height: 32px; }
.logo__word { width: auto; height: 20px; }

/* §8.4, the segmented control. */
.lang-switch {
  display: inline-flex;
  padding: var(--space-xxs);
  border-radius: var(--radius-pill);
  background: var(--sunken);
}

.lang-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 40px;
  padding-inline: var(--space-sm);
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-enter), background-color var(--duration-fast) var(--ease-enter);
}

.lang-switch a:hover { color: var(--ink); }

.lang-switch a[aria-current="page"] {
  background: var(--raised);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--rule);
}

/* ------------------------------------------------------------------- hero */
.hero { padding-block: var(--space-xl) var(--space-xxxl); }

.hero__grid {
  display: grid;
  /* minmax(0, …) on every grid on the page: an `auto` track grows to its
     widest item's min-content, and the email field's default width alone
     pushes a phone at 200% text past the screen edge (§9). */
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-xxl);
}

@media (min-width: 960px) {
  .hero { padding-block: var(--space-xxxl) 80px; }

  .hero__grid {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    align-items: center;
    gap: 64px;
  }
}

.hero__copy { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-md); justify-items: start; }

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 6px var(--space-sm);
  border-radius: var(--radius-pill);
  background: var(--accent-container);
  color: var(--on-accent-container);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
}

.status-chip__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--highlight);
}

.hero__art {
  width: 100%;
  max-width: 520px;
  justify-self: center;
}

.art { width: 100%; height: auto; }

/* ---------------------------------------------------------------- waitlist */
.waitlist {
  width: 100%;
  max-width: var(--form-max);
  margin-top: var(--space-xs);
}

.waitlist__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-xs);
  padding: var(--space-xl);
  border: 1px solid var(--rule);
  border-radius: var(--radius-xl);
  background: var(--raised);
}

.waitlist__title {
  font-size: 1.0625rem;
  line-height: 1.3;
  font-weight: 700;
}

.waitlist__label {
  margin-top: var(--space-xxs);
  color: var(--body);
  font-size: 0.8125rem;
  font-weight: 600;
}

.waitlist__row {
  display: flex;
  gap: var(--space-xs);
}

.input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 52px;
  padding: 0 var(--space-md);
  border: 1px solid var(--outline);
  border-radius: var(--radius-md);
  background: var(--sunken);
  color: var(--ink);
  /* 16px or more, or iOS Safari zooms the page on focus. */
  font: 500 1rem/1.2 var(--font);
}

.input::placeholder { color: var(--muted); opacity: 1; font-weight: 400; }

.input:focus { outline: 2px solid var(--accent-text); outline-offset: 1px; border-color: transparent; }

.input[aria-invalid="true"] { border-color: var(--danger); }

/* §8.1 */
.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 var(--space-xl);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  max-width: 100%;
  font: 600 0.9375rem/1.2 var(--font);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-enter), border-color var(--duration-fast) var(--ease-enter);
}

.button--primary { background: var(--accent); color: var(--on-accent); }
.button--primary:hover { background: color-mix(in srgb, var(--accent) 88%, #0B1020); }
.button--primary:active { background: color-mix(in srgb, var(--accent) 78%, #0B1020); }

.button--secondary { border-color: var(--outline); color: var(--ink); background: transparent; }
.button--secondary:hover { background: var(--sunken); }

/* A busy button keeps its width and shows a 20px spinner in its own text
   colour (§8.1). */
.button__spinner {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 20px;
  height: 20px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  opacity: 0;
}

.waitlist__form.is-busy .button__label { visibility: hidden; }
.waitlist__form.is-busy .button__spinner { opacity: 1; animation: spin 0.8s linear infinite; }
.waitlist__form.is-busy .button { cursor: progress; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 519px) {
  .waitlist__form { padding: var(--space-lg); }
  .waitlist__row { flex-direction: column; }
  .waitlist__row .button { width: 100%; }
}

.waitlist__status { color: var(--muted); font-size: 0.875rem; font-weight: 500; }
.waitlist__status:empty { display: none; }
.waitlist__status.is-error { color: var(--danger); }

.waitlist__note { color: var(--muted); font-size: 0.8125rem; line-height: 1.45; }

/* Off-screen rather than display:none: some bots skip fields that are not
   rendered at all. */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.waitlist__done {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-xl);
  border-radius: var(--radius-xl);
  background: var(--accent-container);
  color: var(--on-accent-container);
}

.waitlist__done:focus { outline: none; }
.waitlist__done:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; }

.waitlist__done-icon { flex: none; }

.waitlist__done-title { font-size: 1.0625rem; font-weight: 700; line-height: 1.3; }
.waitlist__done-body { margin-top: var(--space-xxs); font-size: 0.9375rem; }

/* ---------------------------------------------------------------- the art */
.art__halo { fill: none; stroke: #FFFFFF; stroke-opacity: 0.14; stroke-width: 1.5; }
.art__noise circle { fill: #FFFFFF; }
.art__flow path { fill: none; stroke: #FFFFFF; stroke-opacity: 0.6; stroke-width: 2; stroke-linecap: round; }
.art__picked circle { fill: #FFFFFF; }
.art__card { fill: var(--raised); }
.art__card--far { fill-opacity: 0.35; }
.art__card--near { fill-opacity: 0.6; }
.art__card--chip { fill-opacity: 0.94; }
.art__sunken { fill: var(--sunken); }
.art__ink { fill: var(--ink); }
.art__line { fill: var(--outline); fill-opacity: 0.4; }
.art__muted { fill: var(--muted); fill-opacity: 0.7; }
.art__source { fill: var(--logo-chip); stroke: var(--raised); stroke-width: 3; }
.art__dot { fill: var(--highlight); }
.art__accent { fill: var(--accent); }

/* The page's one unprompted motion: a single reveal of the art on load
   (§6). Nothing loops, and nothing moves at all under reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .art__noise { animation: art-fade var(--duration-slow) var(--ease-enter) both; }
  .art__picked { animation: art-fade var(--duration-slow) var(--ease-enter) 120ms both; }
  .art__flow path {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: art-draw 900ms var(--ease-enter) 160ms forwards;
  }
  .art__cards { animation: art-rise var(--duration-slow) var(--ease-enter) 280ms both; }
}

@keyframes art-fade { from { opacity: 0; } }
@keyframes art-draw { to { stroke-dashoffset: 0; } }
@keyframes art-rise { from { opacity: 0; transform: translateY(12px); } }

/* ------------------------------------------------------------- glyph fills */
.g-muted { fill: var(--outline); }
.g-accent { fill: var(--accent); }
.g-hl-stroke { stroke: var(--highlight); }
.g-line-stroke { stroke: var(--outline); }
.g-muted-stroke { stroke: var(--muted); stroke-opacity: 0.6; }
.g-on-accent-stroke { stroke: var(--on-accent); }

/* --------------------------------------------------------------- sections */
.section { padding-block: var(--space-xxxl); }

@media (min-width: 960px) {
  .section { padding-block: 80px; }
}

.section__lead {
  max-width: 40rem;
  margin-top: var(--space-sm);
  font-size: 1.0625rem;
  line-height: 1.55;
}

.pillars {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-xxl);
  padding: 0;
  list-style: none;
}

@media (min-width: 600px) {
  .pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .pillars { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* §4.3: no shadow; a hairline separates the card from the page. */
.pillar {
  padding: var(--space-xl);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--raised);
}

.pillar__glyph { margin-bottom: var(--space-md); }

.pillar__title {
  font-size: 1.0625rem;
  line-height: 1.3;
  font-weight: 700;
}

.pillar__body {
  margin-top: var(--space-xs);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.section--trust {
  border-block: 1px solid var(--rule);
  background: var(--raised);
}

.trust {
  max-width: 46rem;
  margin-inline: auto;
  text-align: center;
}

.trust__quote p {
  color: var(--ink);
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.125rem);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.trust__caption {
  margin-top: var(--space-md);
  color: var(--muted);
  font-size: 1rem;
  font-weight: 500;
}

/* Running text keeps the reading measure (§3.3) but stays on the page's
   left edge, under the header's logo. */
.privacy > * { max-width: var(--reading-max); }

.privacy__list {
  display: grid;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
  padding: 0;
  list-style: none;
  font-size: 1.0625rem;
  line-height: 1.55;
}

.privacy__list li {
  position: relative;
  padding-left: var(--space-xl);
}

.privacy__list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.6em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--highlight);
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  margin-top: var(--space-md);
  font-weight: 600;
}

.section--closing { padding-top: 0; }

.closing {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: var(--space-xl);
  text-align: center;
}

.closing__line {
  color: var(--ink);
  font-size: clamp(1.375rem, 1.1rem + 1.2vw, 1.875rem);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

/* ----------------------------------------------------------------- footer */
.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: var(--space-xl) max(var(--space-xxl), env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 0.875rem;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm) var(--space-xl);
}

.site-footer__brand { display: inline-flex; align-items: center; gap: var(--space-xs); }
.site-footer__brand img { width: auto; height: 20px; }

.site-footer__links { display: flex; flex-wrap: wrap; gap: 0 var(--space-xl); }

.site-footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  color: var(--body);
  text-decoration: none;
}

.site-footer__links a:hover { color: var(--ink); text-decoration: underline; }

/* -------------------------------------------------------------------- 404 */
.not-found {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
  gap: var(--space-md);
  padding-block: var(--space-xxxl) 96px;
}

.not-found > * { max-width: var(--reading-max); }

.not-found .button { margin-top: var(--space-xs); }
