/* ==========================================================================
   Categorush — categorush.app
   Marketing site stylesheet.

   Contents
   1.  Fonts (self-hosted, no network requests)
   2.  Design tokens (OKLCH + sRGB fallback + dark mode)
   3.  Reset & base
   4.  Layout primitives
   5.  Header / nav
   6.  Animated wordmark + speed lines
   7.  Hero
   8.  Device mockup (pure CSS iPhone frame + home screen)
   9.  Features
   10. Footer
   11. Document pages (privacy / support / 404)
   12. Keyframes
   13. Responsive  — breakpoints 900px, 640px
   14. Reduced motion
   ========================================================================== */


/* 1. Fonts =============================================================== */
/* Baloo 2 and Nunito, SIL Open Font License 1.1.
   License text: assets/fonts/OFL.txt
   Both files are variable fonts; one file covers the whole weight axis. */

@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('assets/fonts/baloo2-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('assets/fonts/baloo2-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url('assets/fonts/nunito-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url('assets/fonts/nunito-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}


/* 2. Design tokens ======================================================= */

:root {
  /* Palette — OKLCH is authoritative. */
  --bg:              oklch(0.975 0.012 85);
  --surface:         oklch(0.99 0.005 85);
  --ink:             oklch(0.27 0.03 280);
  --brand:           oklch(0.72 0.17 35);
  --brand-hover:     oklch(0.6 0.17 35);
  --brand-warm:      oklch(0.8 0.12 60);
  --text-secondary:  oklch(0.45 0.02 280);
  --text-muted:      oklch(0.5 0.02 280);
  --text-faint:      oklch(0.6 0.02 280);
  --tile-1:          oklch(0.96 0.03 40);
  --tile-2:          oklch(0.95 0.04 150);
  --tile-3:          oklch(0.95 0.03 265);
  --tile-4:          oklch(0.96 0.03 340);

  --border:          oklch(0.9 0.012 85);
  --on-brand:        #fff;
  --store-bg:        #000;
  --store-fg:        #fff;

  /* Type */
  --font-display: 'Baloo 2', ui-rounded, 'Trebuchet MS', system-ui, sans-serif;
  --font-body:    'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-emoji:   'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;

  /* Radii */
  --r-pill:  999px;
  --r-badge: 14px;
  --r-tile:  16px;
  --r-card:  20px;

  /* Rhythm — the page gutter is the single lever the breakpoints pull. */
  --gutter:   48px;
  --measure:  1200px;
  --hero-gap: clamp(2rem, 5.5vw, 70px);
}

/* sRGB fallback for engines without OKLCH (pre-2023 Safari/Chrome/Firefox).
   Values are the exact sRGB conversions of the OKLCH tokens above. */
@supports not (color: oklch(0 0 0)) {
  :root {
    --bg:             #FAF6EE;
    --surface:        #FDFCF8;
    --ink:            #232535;
    --brand:          #FC7756;
    --brand-hover:    #D25030;
    --brand-warm:     #F6AB6B;
    --text-secondary: #535461;
    --text-muted:     #61626F;
    --text-faint:     #7D7F8C;
    --tile-1:         #FFECE3;
    --tile-2:         #DCF7E1;
    --tile-3:         #E5EFFF;
    --tile-4:         #FFEAF8;
    --border:         #EBE4D8;
  }
  .device { --dev-brand: #FC7756; --dev-ink: #232535; --dev-faint: #7D7F8C; }
}

/* Dark mode. The device mockup deliberately keeps its light appearance —
   it depicts the app's light theme, like a screenshot would. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:             oklch(0.19 0.016 285);
    --surface:        oklch(0.235 0.018 285);
    --ink:            oklch(0.955 0.008 85);
    --brand:          oklch(0.77 0.15 35);
    --brand-hover:    oklch(0.85 0.11 40);
    --brand-warm:     oklch(0.83 0.11 60);
    --text-secondary: oklch(0.8 0.02 280);
    --text-muted:     oklch(0.75 0.02 280);
    --text-faint:     oklch(0.65 0.02 280);
    --tile-1:         oklch(0.33 0.045 40);
    --tile-2:         oklch(0.32 0.05 150);
    --tile-3:         oklch(0.32 0.045 265);
    --tile-4:         oklch(0.33 0.045 340);
    --border:         oklch(0.32 0.015 285);
    --on-brand:       oklch(0.2 0.03 35);
    --store-bg:       oklch(0.99 0.005 85);
    --store-fg:       oklch(0.2 0.02 280);
  }
  @supports not (color: oklch(0 0 0)) {
    :root {
      --bg:             #13131B;
      --surface:        #1D1D26;
      --ink:            #F3F0EA;
      --brand:          #FF8E70;
      --brand-hover:    #FFB597;
      --brand-warm:     #FCB67C;
      --text-secondary: #BBBDCB;
      --text-muted:     #ABADBB;
      --text-faint:     #8C8E9C;
      --tile-1:         #492D24;
      --tile-2:         #1F3A25;
      --tile-3:         #28324A;
      --tile-4:         #452C3D;
      --border:         #32323A;
      --on-brand:       #2B1109;
      --store-bg:       #FDFCF8;
      --store-fg:       #2B2C38;
    }
  }
}


/* 3. Reset & base ======================================================== */

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

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

body {
  margin: 0;
  min-height: 100vh;      /* fallback for browsers without dvh */
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Safety net: nothing in this layout should overflow, but a stray long
     word or an emoji metric surprise must never produce a scrollbar. */
  overflow-x: clip;
}

main { flex: 1 0 auto; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.2;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }

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

a {
  color: var(--brand);
  text-decoration: none;
}
a:hover { color: var(--brand-hover); }

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
  border-radius: 6px;
}

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

.skip-link {
  position: absolute;
  left: 12px; top: -100px;
  z-index: 100;
  padding: 10px 20px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-display);
  font-weight: 700;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 12px;
  color: var(--bg);
}


/* 4. Layout primitives =================================================== */

.container {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}


/* 5. Header ============================================================== */

/* The prototype's inline `color:white` made this rule unreachable; with the
   colours in the stylesheet the hover state actually applies. */
/* 6. Animated wordmark + speed lines ===================================== */

.wordmark {
  display: flex;
  align-items: center;
  gap: 14px;
}

.speedlines {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  flex: none;
}
.speedlines i {
  display: block;
  height: 6px;
  border-radius: var(--r-pill);
  animation: speedLine 1.1s ease-out infinite;
}
.speedlines i:nth-child(1) { width: 28px; background: var(--brand);      animation-delay: 0s;   }
.speedlines i:nth-child(2) { width: 18px; background: var(--brand-warm); animation-delay: 0.2s; }
.speedlines i:nth-child(3) { width: 24px; background: var(--brand);      animation-delay: 0.4s; }

.wordmark-letters {
  display: flex;
  align-items: baseline;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 10.5vw, 4rem);   /* 38.4px → 64px */
  line-height: 1;
  letter-spacing: -0.016em;
  min-width: 0;
}
.wordmark-letters span {
  display: inline-block;
  animation:
    logoDash 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) calc(var(--i) * 0.05s) both,
    logoWave 2.6s ease-in-out calc(1s + var(--i) * 0.08s) infinite;
}
.wordmark-letters .is-rush { color: var(--brand); }


/* 7. Hero ================================================================ */

.hero .container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 410px);
  align-items: center;
  justify-content: center;
  gap: var(--hero-gap);
  padding-block: 50px 90px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 26px;
  max-width: 520px;
  min-width: 0;
}

.hero-title {
  font-weight: 700;
  font-size: clamp(1.5rem, 4.4vw, 1.75rem);  /* 24px → 28px */
  line-height: 1.25;
}

.hero-sub {
  font-size: clamp(1rem, 2.2vw, 1.0625rem);
  line-height: 1.6;
  color: var(--text-secondary);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.hero-meta {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
}

/* App Store badge */
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--store-bg);
  color: var(--store-fg);
  border-radius: var(--r-badge);
  padding: 12px 22px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.store-badge:hover,
.store-badge:focus-visible {
  color: var(--store-fg);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}
.store-badge svg { flex: none; fill: currentColor; }
.store-badge-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.store-badge-kicker {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.85;
}
.store-badge-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
}


/* 8. Device mockup ======================================================= */
/*
   Recreates claude_design/ios-frame.jsx in pure CSS: a rounded, clipped rect,
   a soft drop shadow plus a 1px hairline ring (the second `0 0 0 1px` shadow),
   a dynamic island and a home indicator. No bezel element.

   Scaling: the stage is a container, so everything inside can be expressed in
   the frame's own design units. `--du` is one design pixel of the 402px-wide
   reference frame, so `calc(var(--du) * 48)` reads as "48px in the design".
*/

.device-stage {
  position: relative;
  width: 100%;
  max-width: 410px;             /* 342px frame + 34px emoji gutter each side */
  margin-inline: auto;
  padding: 20px 34px 0;         /* the float emoji live in this padding, so
                                   their overhang can never leave the stage */
  container-type: inline-size;
}

.device {
  --du: 0.2488cqw;              /* 100cqw = frame width = 402 design px */
  --dev-brand: oklch(0.72 0.17 35);
  --dev-ink:   oklch(0.27 0.03 280);
  --dev-faint: oklch(0.6 0.02 280);

  position: relative;
  width: 100%;
  aspect-ratio: 402 / 874;
  border-radius: calc(var(--du) * 48);
  overflow: hidden;
  background: #F2F2F7;
  box-shadow:
    0 40px 80px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(0, 0, 0, 0.12);
  font-family: var(--font-body);
  color: var(--dev-ink);
}

/* Without container query units the frame renders at its fixed 342px size. */
@supports not (container-type: inline-size) {
  .device-stage { max-width: 410px; }
  .device { --du: 0.851px; }
}

.device-island {
  position: absolute;
  top: calc(var(--du) * 11);
  left: 50%;
  transform: translateX(-50%);
  width: calc(var(--du) * 126);
  height: calc(var(--du) * 37);
  border-radius: calc(var(--du) * 24);
  background: #000;
  z-index: 5;
}

.device-home-indicator {
  position: absolute;
  bottom: calc(var(--du) * 8);
  left: 50%;
  transform: translateX(-50%);
  width: calc(var(--du) * 139);
  height: calc(var(--du) * 5);
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, 0.25);
  z-index: 6;
}

/* --- the home screen inside the frame --- */

.device-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: calc(var(--du) * 118) calc(var(--du) * 22) calc(var(--du) * 44);
  text-align: center;
}

.m-wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: calc(var(--du) * 56);
  line-height: 1;
  letter-spacing: -0.02em;
}
.m-wordmark span { color: var(--dev-brand); }

.m-tagline {
  margin-top: calc(var(--du) * 9);
  font-size: calc(var(--du) * 15);
  font-weight: 600;
  line-height: 1.35;
  color: var(--dev-faint);
}

.m-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: calc(var(--du) * 8);
  margin-top: calc(var(--du) * 26);
}
.m-pill {
  display: inline-flex;
  align-items: center;
  gap: calc(var(--du) * 5);
  padding: calc(var(--du) * 7) calc(var(--du) * 13);
  border-radius: var(--r-pill);
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  font-size: calc(var(--du) * 12.5);
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.m-card {
  display: flex;
  align-items: center;
  gap: calc(var(--du) * 14);
  margin-top: calc(var(--du) * 24);
  padding: calc(var(--du) * 16);
  border-radius: calc(var(--du) * 22);
  background: #fff;
  box-shadow: 0 calc(var(--du) * 6) calc(var(--du) * 18) rgba(0, 0, 0, 0.06);
  text-align: left;
}
.m-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: calc(var(--du) * 52);
  height: calc(var(--du) * 52);
  border-radius: 50%;
  background: #FFECE3;
  font-size: calc(var(--du) * 28);
}
.m-card-label {
  font-size: calc(var(--du) * 12);
  font-weight: 700;
  color: var(--dev-faint);
  line-height: 1.2;
}
.m-picker {
  display: flex;
  gap: calc(var(--du) * 6);
  margin-top: calc(var(--du) * 8);
}
.m-swatch {
  display: grid;
  place-items: center;
  width: calc(var(--du) * 30);
  height: calc(var(--du) * 30);
  border-radius: 50%;
  background: #F2F2F7;
  font-size: calc(var(--du) * 16);
}
.m-swatch.is-selected {
  box-shadow: 0 0 0 calc(var(--du) * 2.5) var(--dev-brand);
}

.m-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: calc(var(--du) * 11);
}
.m-btn {
  display: grid;
  place-items: center;
  height: calc(var(--du) * 54);
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: calc(var(--du) * 19);
  line-height: 1;
}
.m-btn--primary {
  background: var(--dev-brand);
  color: #fff;
  box-shadow: 0 calc(var(--du) * 8) calc(var(--du) * 20) rgba(252, 119, 86, 0.35);
}
.m-btn--outline {
  background: transparent;
  color: var(--dev-brand);
  border: calc(var(--du) * 3) solid var(--dev-brand);
}
.m-btn--ghost {
  background: #E4E4EA;
  color: #3A3A46;
}

/* --- floating decorative emoji --- */

.float-emoji {
  position: absolute;
  font-family: var(--font-emoji);
  line-height: 1;
  animation: floatSlow 4s ease-in-out infinite;
  pointer-events: none;
}
.float-fox {
  top: calc(20px - 14px * 0.85);
  right: calc(34px - 20px * 0.85);
  font-size: clamp(26px, 11cqw, 44px);
}
.float-unicorn {
  bottom: 18%;
  left: 0;
  font-size: clamp(24px, 10cqw, 40px);
  animation-duration: 5s;
  animation-delay: 1s;
}


/* 9. Features ============================================================ */

.features {
  background: var(--surface);
  padding-block: clamp(46px, 7vw, 70px);
  border-block: 1px solid var(--border);
}

.feature-grid {
  max-width: 1000px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 28px;
}

.feature {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.feature-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: var(--r-tile);
  font-family: var(--font-emoji);
  font-size: 26px;
  line-height: 1;
}
.feature:nth-child(1) .feature-icon { background: var(--tile-1); }
.feature:nth-child(2) .feature-icon { background: var(--tile-2); }
.feature:nth-child(3) .feature-icon { background: var(--tile-3); }
.feature:nth-child(4) .feature-icon { background: var(--tile-4); }

.feature h3 {
  font-size: 19px;
  font-weight: 800;
}
.feature p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
}


/* 10. Footer ============================================================= */

.site-footer {
  padding-block: 28px;
}
.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.site-footer small {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  font-size: 13px;
  font-weight: 700;
}


/* 11. Document pages ===================================================== */

.doc {
  padding-block: clamp(32px, 6vw, 56px) clamp(48px, 8vw, 80px);
}
.doc .container { max-width: 760px; }

.doc-header { margin-bottom: 32px; }
.doc h1 {
  font-size: clamp(2rem, 6.5vw, 2.75rem);
  letter-spacing: -0.02em;
}
.doc-updated {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
}
.doc-lede {
  margin-top: 18px;
  font-size: clamp(1rem, 2.4vw, 1.125rem);
  color: var(--text-secondary);
}

.doc section { margin-top: 40px; }
.doc h2 {
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  margin-bottom: 12px;
}
.doc h3 {
  font-size: clamp(1.0625rem, 3.2vw, 1.1875rem);
  font-weight: 700;
  margin-top: 26px;
  margin-bottom: 8px;
}
.doc p, .doc li {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-secondary);
}
.doc p + p { margin-top: 14px; }
.doc ul, .doc ol {
  margin: 14px 0 0;
  padding-left: 22px;
}
.doc li + li { margin-top: 8px; }
.doc li::marker { color: var(--brand); }
.doc strong { color: var(--ink); font-weight: 700; }

.callout {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: var(--r-card);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
}
.callout p { margin: 0; }

.doc-table-wrap { overflow-x: auto; margin-top: 16px; }
.doc table {
  width: 100%;
  min-width: 460px;
  border-collapse: collapse;
  font-size: 15px;
}
.doc th, .doc td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-secondary);
}
.doc th {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

/* 404 */
.notfound {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 22px;
  padding-block: clamp(60px, 12vw, 120px);
}
.notfound-code {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(4rem, 18vw, 7rem);
  line-height: 1;
  color: var(--brand);
  letter-spacing: -0.03em;
}
.notfound p {
  max-width: 46ch;
  color: var(--text-secondary);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  padding: 14px 28px;
  border-radius: var(--r-pill);
  background: var(--brand);
  color: var(--on-brand);
  transition: background-color 0.18s ease, transform 0.18s ease;
}
.button:hover,
.button:focus-visible {
  background: var(--brand-hover);
  color: var(--on-brand);
  transform: translateY(-1px);
}


/* 12. Keyframes ========================================================== */

@keyframes logoDash {
  0%   { transform: translateX(-70px) skewX(-14deg); opacity: 0; }
  70%  { transform: translateX(6px) skewX(3deg);     opacity: 1; }
  100% { transform: translateX(0) skewX(0);          opacity: 1; }
}

@keyframes logoWave {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}

@keyframes speedLine {
  0%   { transform: translateX(-26px); opacity: 0; }
  35%  { opacity: 0.9; }
  100% { transform: translateX(34px);  opacity: 0; }
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50%      { transform: translateY(-14px) rotate(4deg); }
}


/* 13. Responsive ========================================================= */

/* Tablet and below — the hero stacks. */
@media (max-width: 900px) {
  :root { --gutter: 32px; }

  .hero .container {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    padding-block: 36px 64px;
  }
  .hero-copy {
    order: 1;
    align-items: flex-start;
    text-align: left;
  }
  .device-stage { order: 2; }

  .feature-grid { gap: 24px; }
}

/* Phones — 48px of gutter was eating a seventh of a 375px viewport. */
@media (max-width: 640px) {
  :root {
    --gutter: 20px;
    --hero-gap: 32px;
  }

  body { font-size: 16px; }

  .wordmark { gap: 10px; }
  .speedlines i:nth-child(1) { width: 22px; }
  .speedlines i:nth-child(2) { width: 14px; }
  .speedlines i:nth-child(3) { width: 19px; }

  .hero-copy { gap: 20px; }
  .hero .container { padding-block: 28px 52px; }

  /* Tighter emoji gutter so the frame keeps a usable width at 320px. */
  .device-stage { padding: 16px 22px 0; }
  .float-fox { top: 4px; right: 6px; }
  .float-unicorn { left: 0; bottom: 16%; }

  .features { padding-block: 44px; }
  .feature-grid { gap: 22px; }

  .site-footer .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .footer-nav { gap: 18px; }
}


/* 14. Reduced motion ===================================================== */
/*
   The prototype ran five infinite animations unconditionally: ten logoWave
   loops, three speedLine loops and two floatSlow loops. All are decorative,
   so honour the user's preference and settle each element on its resting
   frame rather than mid-cycle.
*/
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .wordmark-letters span {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
  .speedlines i {
    animation: none !important;
    opacity: 0.9;
    transform: none;
  }
  .float-emoji {
    animation: none !important;
    transform: rotate(-6deg);
  }
  }
