/*
 * WKD Toys design tokens: the single source of truth for both apps (ADR-0001).
 * apps/web imports this file; the React Native theme is generated from it at build time
 * (scripts/build-native-theme.mjs), so no token value is written anywhere else.
 *
 * Values follow the Claude Design prototype, "Tokens & Components" (docs/40-design/02-claude-design-prototype.md):
 * dark-first and nearly monochrome so the vehicles carry the colour, warm off-white as the only primary,
 * gold reserved for the Club star, status colours only inside chips.
 *
 * Naming: --color-*, --space-*, --radius-*, --touch-target-*, --font-family-* and
 * --text-<style>-<family|weight|size|line-height|letter-spacing|transform|stretch>.
 * The generator refuses any other prefix.
 */

:root {
  /* Surfaces, darkest first */
  --color-ground: #0a0a0b;
  --color-inset: #141416;
  --color-surface: #1c1c1f;
  --color-raised: #2a2a2e;
  --color-line: #2e2e33;
  --color-line-subtle: #26262a;
  /* Tab bar and sticky headers over scrolling content */
  --color-bar: rgba(10, 10, 11, 0.96);

  /* Content */
  --color-primary: #f5f3ef;
  --color-on-primary: #0a0a0b;
  --color-text: #f5f3ef;
  --color-text-secondary: #b4b1ab;
  --color-text-meta: #a8a5a0;
  /* Icons, hints, disabled labels */
  --color-text-muted: #8e8b85;
  /* Secondary button border */
  --color-outline: rgba(255, 255, 255, 0.4);
  /* Unselected radio ring */
  --color-control-border: #6b6862;
  /* Switch track when off */
  --color-control-off: #3a3a40;
  /* Hairlines drawn over media */
  --color-divider-on-media: rgba(255, 255, 255, 0.12);
  /* Gradients behind text on media (WCAG AA on overlays) */
  --color-scrim: rgba(0, 0, 0, 0.55);
  --color-scrim-strong: rgba(0, 0, 0, 0.88);

  /* ★ WKD Toys Club: the single accent of status (F13, REC-72) */
  --color-club-star: #f2b53a;
  --color-club-surface: #2b2415;

  /* Status chips */
  --color-status-neutral-text: #e6e3dd;
  --color-status-neutral-surface: #2a2a2e;
  --color-status-ok-text: #9be8c0;
  --color-status-ok-surface: #0e3021;
  --color-status-attention-text: #f6dfa8;
  --color-status-attention-surface: #2b2415;
  --color-status-attention-border: #6a5424;
  --color-status-danger-text: #ffc2c4;
  --color-status-danger-surface: #4a1f22;

  /* Destructive actions and the Sold badge */
  --color-danger: #ff7a7f;
  --color-sold: #f2555a;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  /* Screen margins: grids use 16, text uses 20 */
  --space-screen-grid: 16px;
  --space-screen-text: 20px;

  /* Radii: actions are pills, containers are soft rectangles */
  --radius-input: 12px;
  --radius-tile: 14px;
  --radius-card: 20px;
  --radius-sheet: 28px;
  --radius-pill: 999px;

  /* Minimum tap target (F02: 44 pt; the prototype uses 48 on Android) */
  --touch-target-min: 44px;
  --touch-target-min-android: 48px;

  /* Type families: Archivo (widened) for titles and numbers, Instrument Sans for reading,
     JetBrains Mono only for small section labels */
  --font-family-display: 'Archivo', system-ui, sans-serif;
  --font-family-body: 'Instrument Sans', system-ui, sans-serif;
  --font-family-label: 'JetBrains Mono', ui-monospace, monospace;

  /* Text styles. Body never goes below 13 px; tap labels are 15–17 px.
     -stretch is web only: React Native needs a width-specific font file instead. */
  --text-display-family: var(--font-family-display);
  --text-display-weight: 800;
  --text-display-size: 28px;
  --text-display-line-height: 1.08;
  --text-display-letter-spacing: -0.01em;
  --text-display-stretch: 108%;

  --text-amount-family: var(--font-family-display);
  --text-amount-weight: 800;
  --text-amount-size: 44px;
  --text-amount-line-height: 1;
  --text-amount-stretch: 108%;

  --text-screen-title-family: var(--font-family-display);
  --text-screen-title-weight: 800;
  --text-screen-title-size: 20px;
  --text-screen-title-stretch: 112%;

  --text-button-family: var(--font-family-body);
  --text-button-weight: 700;
  --text-button-size: 17px;

  --text-body-family: var(--font-family-body);
  --text-body-weight: 400;
  --text-body-size: 16px;
  --text-body-line-height: 1.45;

  --text-meta-family: var(--font-family-body);
  --text-meta-weight: 400;
  --text-meta-size: 13px;

  --text-label-family: var(--font-family-label);
  --text-label-weight: 600;
  --text-label-size: 12px;
  --text-label-letter-spacing: 0.1em;
  --text-label-transform: uppercase;
}

/*
 * Self-hosted variable fonts (SIL Open Font License 1.1) from @fontsource-variable, latin subset.
 * The build copies the files and their licences into dist/fonts/; the family names are the ones the
 * design tokens use (--font-family-display, --font-family-body, --font-family-label).
 */

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url('fonts/archivo-latin-wdth-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/instrument-sans-latin-wght-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2');
}

/*
 * Landing page styles. Every colour, type style and radius comes from the design tokens
 * (@wkd-toys/design-tokens, placed before this file by the build); the custom properties below are
 * layout values that only shape this page.
 */

:root {
  --page-width: 1120px;
  --page-gutter: var(--space-screen-text);
  --section-padding: clamp(64px, 10vw, 120px);
  --header-height: 64px;
}

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

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: var(--header-height);
}

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

body {
  margin: 0;
  background: var(--color-ground);
  color: var(--color-text);
  font-family: var(--text-body-family);
  font-size: var(--text-body-size);
  font-weight: var(--text-body-weight);
  line-height: var(--text-body-line-height);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
p,
ol,
ul {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

.container {
  width: min(100% - 2 * var(--page-gutter), var(--page-width));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-4);
  z-index: 10;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-200%);
}

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

/* Type */

.label {
  margin-bottom: var(--space-4);
  color: var(--color-text-muted);
  font-family: var(--text-label-family);
  font-size: var(--text-label-size);
  font-weight: var(--text-label-weight);
  letter-spacing: var(--text-label-letter-spacing);
  text-transform: var(--text-label-transform);
}

h1,
h2,
h3,
h4 {
  font-family: var(--text-display-family);
  font-weight: var(--text-display-weight);
  font-stretch: var(--text-display-stretch);
  letter-spacing: var(--text-display-letter-spacing);
  text-wrap: balance;
}

h2 {
  max-width: 20ch;
  font-size: clamp(32px, 4.6vw, 52px);
  line-height: 1.04;
}

h3 {
  font-size: var(--text-screen-title-size);
  font-stretch: var(--text-screen-title-stretch);
  line-height: 1.2;
}

h4 {
  font-size: 18px;
  line-height: 1.25;
}

p {
  text-wrap: pretty;
}

.lead {
  max-width: 62ch;
  color: var(--color-text-secondary);
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.5;
}

/* Actions */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: 32px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-target-min-android);
  padding: 0 var(--space-6);
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-family: var(--text-button-family);
  font-size: var(--text-button-size);
  font-weight: var(--text-button-weight);
  text-decoration: none;
  white-space: nowrap;
}

.button:hover {
  background: color-mix(in srgb, var(--color-primary) 86%, var(--color-ground));
}

.button--secondary {
  background: transparent;
  color: var(--color-text);
  box-shadow: inset 0 0 0 1.5px var(--color-outline);
}

.button--secondary:hover {
  background: var(--color-surface);
}

.button--small {
  min-height: var(--touch-target-min);
  padding: 0 var(--space-4);
  font-size: 15px;
}

.button--large {
  min-height: 56px;
  padding: 0 32px;
  font-size: 18px;
}

/* Header and footer */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid var(--color-line-subtle);
  background: var(--color-bar);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  min-height: var(--header-height);
}

.site-header .button {
  margin-left: auto;
}

.wordmark {
  font-family: var(--font-family-display);
  font-size: 24px;
  font-stretch: 120%;
  font-weight: 900;
  letter-spacing: -0.01em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.wordmark span {
  font-weight: 500;
}

.wordmark--small {
  color: var(--color-text);
  font-size: 18px;
}

.site-nav {
  display: none;
  gap: var(--space-6);
  margin-left: auto;
}

.site-nav a {
  color: var(--color-text-secondary);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--color-text);
}

@media (min-width: 860px) {
  .site-nav {
    display: flex;
  }

  .site-header .button {
    margin-left: 0;
  }
}

.site-footer {
  padding-block: var(--space-6);
  border-top: 1px solid var(--color-line-subtle);
  color: var(--color-text-muted);
  font-size: var(--text-meta-size);
}

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

/* Hero */

.hero {
  overflow: hidden;
  padding-block: clamp(48px, 8vw, 104px) var(--section-padding);
  background: radial-gradient(60% 70% at 78% 40%, var(--color-inset), transparent 70%);
}

.hero__inner {
  display: grid;
  align-items: center;
  gap: clamp(48px, 6vw, 80px);
}

.hero__title {
  margin-bottom: var(--space-6);
  font-size: clamp(44px, 12vw, 92px);
  font-stretch: 112%;
  letter-spacing: -0.025em;
  line-height: 0.92;
}

.hero__note {
  margin-top: var(--space-4);
  color: var(--color-text);
  font-weight: 600;
}

@media (min-width: 960px) {
  .hero__inner {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  }

  .hero__title {
    font-size: clamp(64px, 7.2vw, 92px);
  }

  .phone {
    width: min(100%, 320px);
  }
}

/* App preview: the qualification card (F06) */

.phone {
  justify-self: center;
  width: min(100%, 280px);
  aspect-ratio: 390 / 800;
  padding: 10px;
  border-radius: 46px;
  background: var(--color-inset);
  box-shadow:
    0 0 0 1px var(--color-line),
    0 40px 80px -24px var(--color-scrim);
}

.phone__screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 36px;
  background: var(--color-surface);
}

.phone__media {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(70% 40% at 50% 42%, var(--color-raised), transparent 70%),
    linear-gradient(180deg, var(--color-surface) 0%, var(--color-inset) 55%, var(--color-ground) 100%);
}

.phone__chip {
  position: absolute;
  top: 20px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: var(--color-bar);
  color: var(--color-text);
  font-family: var(--text-label-family);
  font-size: 11px;
  font-weight: var(--text-label-weight);
  letter-spacing: var(--text-label-letter-spacing);
  text-transform: var(--text-label-transform);
}

.phone__vehicle {
  position: absolute;
  top: 27%;
  left: 7%;
  width: 86%;
  color: var(--color-text-secondary);
}

.phone__sheet {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 72px 18px 22px;
  background: linear-gradient(180deg, transparent, var(--color-scrim-strong) 45%);
}

.phone__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.phone__meta span {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: var(--color-status-neutral-surface);
  color: var(--color-status-neutral-text);
  font-size: 12px;
  font-weight: 600;
}

.phone__question {
  font-family: var(--font-family-display);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.22;
}

.phone__answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.phone__answer {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: var(--radius-pill);
  box-shadow: inset 0 0 0 1.5px var(--color-outline);
  font-size: 15px;
  font-weight: 700;
}

.phone__answer--toy {
  background: var(--color-primary);
  box-shadow: none;
  color: var(--color-on-primary);
}

/* Sections */

.section {
  padding-block: var(--section-padding);
  border-top: 1px solid var(--color-line-subtle);
}

.section__lead {
  margin-top: var(--space-5);
}

.split {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
    gap: 64px;
  }
}

.subheading {
  margin-top: 72px;
}

.grid {
  display: grid;
  gap: var(--space-4);
  margin-top: 40px;
}

.subheading + .grid {
  margin-top: var(--space-5);
}

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

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

.card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-6);
  border: 1px solid var(--color-line-subtle);
  border-radius: var(--radius-card);
  background: var(--color-inset);
}

.card p {
  color: var(--color-text-secondary);
}

.card--quiet {
  background: transparent;
}

.card__index {
  color: var(--color-text-muted);
  font-family: var(--text-label-family);
  font-size: var(--text-label-size);
  font-weight: var(--text-label-weight);
  letter-spacing: var(--text-label-letter-spacing);
}

.tag {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: var(--color-status-neutral-surface);
  color: var(--color-status-neutral-text);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.tag--ok {
  background: var(--color-status-ok-surface);
  color: var(--color-status-ok-text);
}

.tag--attention {
  background: var(--color-status-attention-surface);
  box-shadow: inset 0 0 0 1px var(--color-status-attention-border);
  color: var(--color-status-attention-text);
}

/* Business model */

.business {
  display: grid;
  gap: var(--space-4);
  margin-top: 40px;
}

.business__notes {
  display: grid;
  gap: var(--space-4);
}

@media (min-width: 900px) {
  .business {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  }
}

.club {
  border-color: color-mix(in srgb, var(--color-club-star) 35%, transparent);
  background: var(--color-club-surface);
}

.club h3 {
  font-size: 28px;
}

.club__star {
  color: var(--color-club-star);
}

.club .club__price {
  color: var(--color-text);
  font-weight: 600;
}

.club__benefits {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

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

.club__benefits li {
  display: flex;
  gap: var(--space-2);
  color: var(--color-text-secondary);
}

.club__benefits li::before {
  content: '✓';
  color: var(--color-text-muted);
}

/* Go to market and status */

.facts {
  display: grid;
  gap: var(--space-4);
  margin-top: 40px;
}

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

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

.fact {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-6);
  border: 1px solid var(--color-line-subtle);
  border-radius: var(--radius-card);
}

.fact__value {
  font-family: var(--text-amount-family);
  font-size: var(--text-amount-size);
  font-stretch: var(--text-amount-stretch);
  font-weight: var(--text-amount-weight);
  line-height: var(--text-amount-line-height);
}

.fact__text {
  color: var(--color-text-secondary);
}

.plan__note {
  margin-top: var(--space-6);
}

.timeline {
  display: grid;
  margin-top: var(--space-5);
  border-left: 1px solid var(--color-line);
}

.timeline li {
  position: relative;
  display: grid;
  gap: var(--space-2);
  padding: 0 0 var(--space-6) var(--space-6);
}

.timeline li:last-child {
  padding-bottom: 0;
}

.timeline li::before {
  position: absolute;
  top: 9px;
  left: -5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-text-muted);
  content: '';
}

.timeline p {
  max-width: 70ch;
  color: var(--color-text-secondary);
}

@media (min-width: 720px) {
  .timeline li {
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: baseline;
  }
}

/* Contact */

.contact {
  background: radial-gradient(50% 80% at 50% 100%, var(--color-inset), transparent 70%);
  text-align: center;
}

.contact__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
}

.contact h2 {
  max-width: none;
  font-size: clamp(44px, 8vw, 96px);
}

.contact .lead {
  max-width: 52ch;
}
