/* ==========================================================================
   Japandi Dev — styles.css
   Layer order: fonts → tokens → base → layout → components → sections →
                utilities → responsive → reduced motion → dark theme

   The dark palette is a token block inside section 2; section 10 holds only the
   handful of dark rules that override a component rather than a colour.
   ========================================================================== */

/* ---------------------------------------------------------------- 1. FONTS */
/* Self-hosted so the site makes zero third-party requests. Latin subset only. */

@font-face {
  font-family: 'Fraunces';
  src: url('../fonts/fraunces-latin-var.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  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: 'Karla';
  src: url('../fonts/karla-latin-var.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  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;
}

/* --------------------------------------------------------------- 2. TOKENS */

:root {
  /* Declares that the page has real styles for both schemes. This is the line that
     stops Chrome on Android from force-inverting the site with Auto Dark Theme:
     that engine only darkens pages it believes are light-only. It names both
     schemes unconditionally because it states a capability, not a current state —
     putting it inside the dark media query below would come too late to be read. */
  color-scheme: light dark;

  /* Palette sampled from the logo artwork so the brand tile sits naturally on the page. */
  --bg: #F7F2E8;
  --surface: #FCFAF4;
  --surface-alt: #F2ECDE;
  --logo-field: #F3E8D1;   /* the logo PNG's own background — brand tile only */

  --ink: #2C2925;
  --ink-soft: #6E6A60;

  --pine: #4C6956;         /* the logo green */
  --pine-deep: #38503F;
  --pine-contrast: #F5EBD6;

  /* --terracotta is 3.63:1 on --bg: decorative use, large text and borders only.
     --terracotta-ink is 4.82:1 and is the one safe for body-sized text. */
  --terracotta: #B66A42;
  --terracotta-ink: #A0552F;

  --sand: #E6DAC4;
  --line: #E0D5C0;        /* decorative rules and card edges */
  --line-strong: #94886F;  /* boundaries of interactive controls — 3.13:1 on --bg */

  --footer-bg: #38503F;
  --footer-ink: #F5EBD6;
  --footer-ink-soft: #C9D2C4;
  --footer-line: #4F6857;

  /* Type */
  --font-display: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, 'Times New Roman', serif;
  --font-body: 'Karla', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --step-eyebrow: 0.78rem;
  --step-small: 0.9rem;
  --step-body: clamp(1rem, 0.97rem + 0.15vw, 1.075rem);
  --step-lead: clamp(1.075rem, 1rem + 0.35vw, 1.25rem);
  --step-h3: clamp(1.2rem, 1.1rem + 0.45vw, 1.4rem);
  --step-h2: clamp(1.85rem, 1.45rem + 1.7vw, 2.85rem);
  --step-h1: clamp(2.3rem, 1.6rem + 3.1vw, 4.05rem);

  /* Space */
  --space-2xs: 0.375rem;
  --space-xs: 0.625rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.25rem;
  --space-xl: 3.5rem;
  --space-section: clamp(4.5rem, 9vw, 8rem);

  /* Shape */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --border: 1px solid var(--line);

  --container: 1140px;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --header-h: 4.5rem;

  --transition: 220ms ease;
}

/* The dark palette. Same Japandi warmth — a dim room, not a cold blue-grey UI —
   so every plane keeps a warm brown-green cast rather than going neutral.

   Every ratio quoted below is sRGB relative luminance, (L1+0.05)/(L2+0.05),
   computed against the dark values in this block. The light-theme figures above
   do not carry over, because three tokens invert their role here:

     - --pine and --pine-deep become LIGHTER than their light-theme values. The
       accent has to rise off a dark ground, and "deep" now means a lighter
       hover, not a darker one.
     - --pine-contrast flips from cream to a near-black ink, because it labels a
       button whose fill is now light.
     - --footer-bg becomes a RAISED plane. Elevation runs lighter in dark UI, and
       there is no room left below --bg to recede into without the footer reading
       as the page having ended.

   Only the component overrides that cannot be expressed as tokens live apart
   from this block; they are in section 10 at the end of the file, where they
   come after the rules they override. */

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1B1917;
    --surface: #2E2820;      /* cards and the scrolled header, raised 1.20:1 above --bg */
    --surface-alt: #231F18;  /* alternating bands, a gentler 1.07:1 step */

    /* Unchanged, deliberately. This is the logo PNG's own background colour, and
       the footer mark carries it baked in as opaque pixels — a darker tile would
       draw a visible seam around the image. It is also what the header mark gets
       back in dark mode; see section 10. */
    --logo-field: #F3E8D1;

    --ink: #EDE6D8;       /* 14.12:1 on --bg, 11.74:1 on --surface, 13.21:1 on --surface-alt */
    --ink-soft: #B0A794;  /*  7.35:1 on --bg,  6.11:1 on --surface,  6.87:1 on --surface-alt */

    /* --pine carries small text (.eyebrow at 0.78rem, the aria-current nav link)
       and the :focus-visible ring, so it clears 4.5:1 on every ground it can
       land on, not just the 3:1 a ring would need. */
    --pine: #8FB39A;          /* 7.58:1 on --bg, 6.30:1 on --surface, 7.09:1 on --surface-alt */
    --pine-deep: #A8C6B1;     /* the lighter hover fill; 7.90:1 as text on --surface */
    --pine-contrast: #16211A; /* 7.17:1 on --pine, 8.98:1 on --pine-deep, so the label survives the hover */

    /* The two-tier accent keeps its light-theme contract, which means
       --terracotta-ink is now the lighter of the pair rather than the darker. */
    --terracotta: #D08A5E;      /* 6.24:1 on --bg — decorative use, large text and borders */
    --terracotta-ink: #E0A177;  /* 7.96:1 on --bg, 6.62:1 on --surface — the one safe for body-sized text */

    --sand: #3E362A;        /* .pill fill and the hero's heavy SVG fills; --ink on it is 9.58:1 */
    --line: #35302A;        /* decorative rules and card edges */
    --line-strong: #8C8371; /* boundaries of interactive controls — 4.67:1 on --bg, 3.89:1 on --surface */

    --footer-bg: #1F2B24;       /* the one full pine field, raised 1.19:1 above --bg */
    --footer-ink: #EDE6D8;      /* 11.83:1 on --footer-bg; also the footer focus ring */
    --footer-ink-soft: #C2CFC4; /*  9.11:1 on --footer-bg */
    --footer-line: #35473A;     /*  1.48:1 on --footer-bg, matching the light theme's 1.45:1 */
  }
}

/* ----------------------------------------------------------------- 3. BASE */

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

html {
  /* SC 2.4.11 Focus Not Obscured: keeps anchor targets clear of the sticky header. */
  scroll-padding-top: calc(var(--header-h) + var(--space-md));
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

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

a { color: inherit; }

/* A single visible focus style for everything. 2px ring + offset clears SC 1.4.11 comfortably. */
:focus-visible {
  outline: 2px solid var(--pine);
  outline-offset: 3px;
  border-radius: 2px;
}
:focus:not(:focus-visible) { outline: none; }

.skip-link {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--pine);
  color: var(--pine-contrast);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transform: translateY(-160%);
  transition: transform var(--transition);
}
.skip-link:focus { transform: translateY(0); }

/* --------------------------------------------------------------- 4. LAYOUT */

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

.section { padding-block: var(--space-section); }
.section--sand { background: var(--surface-alt); }

.section__head { max-width: 46rem; margin-bottom: var(--space-xl); }
.section__title { font-size: var(--step-h2); }
.section__lead {
  margin-top: var(--space-md);
  font-size: var(--step-lead);
  color: var(--ink-soft);
  max-width: 42rem;
}

/* The eyebrow's leading dot restates the logo's circuit nodes. */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: var(--space-md);
  font-size: var(--step-eyebrow);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pine);
}
.eyebrow__node {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--terracotta);
}

/* ----------------------------------------------------------- 5. COMPONENTS */

/* -- Brand ---------------------------------------------------------------- */
/* The logo PNG is opaque, so it always sits on a tile filled with its own
   background colour. The radius is on the tile; the image itself is never
   cropped, masked, recoloured or distorted. */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
/* The image keeps its own square corners — no radius, no mask, nothing clipped.
   The tile's padding is large enough that those corners stay inside the rounded
   silhouette, so only the tile appears rounded. */
.brand-mark {
  display: block;
  padding: 5px;
  background: var(--logo-field);
  border-radius: var(--radius-md);
}
.brand-mark--sm { border-radius: var(--radius-sm); }

.site-header .brand-mark {
  background: transparent;
  border-radius: 0;
}

/* -- Buttons -------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;             /* comfortably clears SC 2.5.8 (24×24 minimum) */
  padding: 0.7rem 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--step-small);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition);
}

.button--primary { background: var(--pine); color: var(--pine-contrast); }
.button--primary:hover { background: var(--pine-deep); }

.button--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.button--ghost:hover { border-color: var(--pine); color: var(--pine); }

.button:disabled {
  color: var(--ink-soft);
  border-style: dashed;
  border-color: var(--line);
  background: transparent;
  cursor: not-allowed;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}
.button-row--center { justify-content: center; }

/* -- Status pill ---------------------------------------------------------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.8rem;
  background: var(--sand);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}
.pill__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  /* The darker accent keeps the dot at 3:1 against the pill fill. The words
     "Coming Soon" carry the status regardless, so colour is never the only cue. */
  background: var(--terracotta-ink);
}

/* ------------------------------------------------------------- 6. SECTIONS */

/* -- Header --------------------------------------------------------------- */

.scroll-sentinel {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: var(--header-h);
  pointer-events: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), background-color var(--transition);
}
.site-header.is-scrolled {
  background: var(--surface);
  border-bottom-color: var(--line);
}

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

/* -- Primary navigation --------------------------------------------------- */

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}
.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
}
.site-nav__list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--step-small);
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
  transition: color var(--transition);
}
.site-nav__list a:hover { color: var(--pine); }

.site-nav__list a[aria-current] {
  color: var(--pine);
  font-weight: 600;
}
.site-nav__list a[aria-current]::before {
  content: "";
  width: 5px;
  height: 5px;
  margin-inline-end: 0.45rem;
  border-radius: 50%;
  background: var(--terracotta-ink);
}

/* The toggle only exists in the small-screen layout. */
.nav-toggle { display: none; }

/* -- Hero ----------------------------------------------------------------- */

.hero { padding-block: clamp(3rem, 7vw, 6rem) var(--space-section); }

.hero__inner {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4.5rem);
  align-items: center;
}

.hero__title { font-size: var(--step-h1); }
.hero__lead {
  margin-top: var(--space-md);
  max-width: 34rem;
  font-size: var(--step-lead);
  color: var(--ink-soft);
}

/* A fixed viewBox aspect keeps the illustration from shifting layout as it loads. */
.hero__art { width: 100%; height: auto; }

/* -- Product card --------------------------------------------------------- */

.product {
  --product-accent: var(--pine);
  --product-accent-deep: var(--pine-deep);
  --product-accent-dark: var(--pine-deep);
  /* The label on the accent fill. Aliased like the rest so the card re-themes
     from the root tokens alone; it was a hardcoded #FFFFFF, which would have
     dropped to 1.8:1 once --pine inverts to a light green in dark mode. */
  --product-accent-contrast: var(--pine-contrast);
  --product-surface: var(--surface);
  --product-surface-strong: var(--sand);
  --product-line: var(--line);
  display: grid;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: center;
  padding: clamp(1.75rem, 4vw, 3rem);
  background: var(--product-surface);
  border: 1px solid var(--product-line);
  border-radius: var(--radius-lg);
}

.product__heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.product__icon {
  flex: none;
  border: 1px solid var(--product-line);
  border-radius: var(--radius-md);
}
/* Deliberately below --step-h2 so the product name never competes with the
   section heading above it. */
.product__name { font-size: clamp(1.6rem, 1.3rem + 1.1vw, 2.15rem); }
.product__category {
  font-size: var(--step-eyebrow);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
/* Pushes the status pill to the far end on roomy rows, wraps underneath on narrow ones. */
.product__heading .pill {
  margin-inline-start: auto;
  background: var(--product-surface-strong);
  color: var(--ink);
}
.product__heading .pill__dot { background: var(--terracotta-ink); }

.product__tagline {
  font-family: var(--font-display);
  font-size: var(--step-h3);
  line-height: 1.3;
  color: var(--ink);
}
.product__description {
  margin-top: var(--space-sm);
  color: var(--ink-soft);
  max-width: 34rem;
}
.product__note {
  margin-top: var(--space-sm);
  font-size: var(--step-small);
  color: var(--ink-soft);
}

.product__preview img {
  width: 100%;
  height: auto;
  border: 1px solid var(--product-line);
  border-radius: var(--radius-md);
}

.product .button--primary {
  background: var(--product-accent);
  color: var(--product-accent-contrast);
}
.product .button--primary:hover { background: var(--product-accent-deep); }
/* .button:disabled is defined earlier in the file, so this scoped rule would
   otherwise win on later-wins and keep a disabled button looking clickable. */
.product .button--primary:disabled {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-soft);
}

.product .button--ghost {
  border-color: var(--product-line);
  color: var(--product-accent-dark);
}
.product .button--ghost:hover {
  border-color: var(--product-accent);
  color: var(--product-accent-dark);
}
.product .button--ghost:disabled {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink-soft);
}

/* -- Future products note ------------------------------------------------- */

.future-note {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-xl);
  font-size: var(--step-small);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.future-note__rule {
  flex: 1 1 auto;
  height: 1px;
  background: var(--line);
}

/* -- Philosophy ----------------------------------------------------------- */

.principles {
  display: grid;
  gap: var(--space-lg);
}
.principle {
  position: relative;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--line);
}
.principle__index {
  position: absolute;
  top: var(--space-lg);
  right: 0;
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  color: var(--terracotta);
}
.principle__mark { display: block; width: 48px; height: 48px; margin-bottom: var(--space-md); }
.principle__title { font-size: var(--step-h3); margin-bottom: var(--space-xs); }
.principle p { color: var(--ink-soft); max-width: 30rem; }

.philosophy__note {
  max-width: 46rem;
  margin-top: var(--space-xl);
  padding-left: var(--space-md);
  border-left: 2px solid var(--sand);
  color: var(--ink-soft);
}

/* -- About ---------------------------------------------------------------- */

.about { max-width: 48rem; }
.about__lead {
  font-family: var(--font-display);
  font-size: var(--step-lead);
  line-height: 1.5;
  margin-bottom: var(--space-md);
}
.about p + p { margin-top: var(--space-md); color: var(--ink-soft); }

.about__tech-title {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
  font-family: var(--font-body);
  font-size: var(--step-eyebrow);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}
.tech-list li {
  padding: 0.4rem 0.85rem;
  background: var(--surface);
  border: var(--border);
  border-radius: 999px;
  font-size: var(--step-small);
  color: var(--ink);
}

/* -- Contact -------------------------------------------------------------- */

.contact { max-width: 46rem; margin-inline: auto; text-align: center; }
.contact .eyebrow { justify-content: center; }
.contact .section__lead { margin-inline: auto; }

.contact__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md) var(--space-xl);
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--line);
}
.contact__label {
  display: block;
  font-size: var(--step-eyebrow);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: var(--space-2xs);
}
.contact__links a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  font-size: var(--step-small);
  color: var(--ink);
  text-decoration-color: var(--line);
  text-underline-offset: 4px;
}
.contact__links a:hover { color: var(--pine); text-decoration-color: currentColor; }

/* -- Footer --------------------------------------------------------------- */

.site-footer {
  padding-block: var(--space-xl);
  background: var(--footer-bg);
  color: var(--footer-ink);
}
.site-footer .brand { color: var(--footer-ink); }

.site-footer__top {
  display: grid;
  gap: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--footer-line);
}
.site-footer__description {
  margin-top: var(--space-md);
  max-width: 26rem;
  font-size: var(--step-small);
  color: var(--footer-ink-soft);
}

.site-footer__nav { display: flex; flex-wrap: wrap; gap: var(--space-xl); }
.site-footer__heading {
  font-family: var(--font-body);
  font-size: var(--step-eyebrow);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--footer-ink-soft);
  margin-bottom: var(--space-sm);
}
.site-footer__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  font-size: var(--step-small);
  text-decoration: none;
  color: var(--footer-ink);
}
.site-footer__nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.site-footer :focus-visible { outline-color: var(--footer-ink); }

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-sm);
  padding-top: var(--space-lg);
  font-size: var(--step-small);
  color: var(--footer-ink-soft);
}

/* -- Simple page (privacy / 404) ------------------------------------------ */

.page { padding-block: var(--space-section); }
.page__inner { max-width: 44rem; }
.page__title { font-size: var(--step-h2); }
.page__inner h2 {
  font-size: var(--step-h3);
  margin-top: var(--space-lg);
  margin-bottom: var(--space-xs);
}
.page__inner p { margin-top: var(--space-sm); color: var(--ink-soft); }
.page__back { margin-top: var(--space-xl); }
/* :not(.button) matters — without it this descendant selector outranks .button--primary
   and repaints the button label in ink, dropping it to 2.38:1 on the green fill. */
.page__inner a:not(.button) { color: var(--ink); text-underline-offset: 4px; }
.page__inner a:not(.button):hover { color: var(--pine); }

/* A visibly-marked placeholder so draft policy text can never be mistaken for final copy. */
.notice {
  margin-bottom: var(--space-lg);
  padding: var(--space-md);
  background: var(--surface);
  border: 1px dashed var(--terracotta);
  border-radius: var(--radius-md);
}
.notice p { color: var(--ink); margin-top: 0; }
.notice__label {
  display: block;
  margin-bottom: var(--space-2xs);
  font-size: var(--step-eyebrow);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--terracotta-ink);
}

.page--center { text-align: center; }
.page--center .page__inner { margin-inline: auto; }
.page--center .eyebrow { justify-content: center; }

/* ------------------------------------------------------------ 7. RESPONSIVE */

@media (min-width: 48em) {
  .principles { grid-template-columns: repeat(2, 1fr); gap: var(--space-lg) var(--space-xl); }
  .site-footer__top { grid-template-columns: 1.3fr 1fr; align-items: start; }
}

@media (min-width: 56em) {
  .product { grid-template-columns: 1.05fr 0.95fr; }
}

@media (min-width: 62em) {
  .hero__inner { grid-template-columns: 1.05fr 0.95fr; }
}

/* Small-screen navigation. Everything here is scoped to .js: without scripting the
   nav simply stays open and stacked, so all links remain reachable. */
@media (max-width: 61.99em) {
  .js .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 44px;
    padding: 0.5rem 0.9rem;
    background: transparent;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: var(--step-small);
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
  }
  .nav-toggle__bars {
    display: grid;
    gap: 4px;
    width: 18px;
  }
  .nav-toggle__bars span {
    display: block;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    transition: transform var(--transition), opacity var(--transition);
  }
  .js .site-header__inner { flex-wrap: wrap; }

  /* The nav wraps onto a second flex line when it opens. Without a height of its
     own the first line has none either: closed, it is the only line, so it
     stretches to fill the inner's 4.5rem min-height and the brand sits centred
     ~9px down; open, the min-height is already exceeded and the line collapses to
     its ~54px content height, snapping the brand up. Pinning the brand to the
     full header height makes line 1 the same box either way. */
  .js .site-header .brand { min-height: var(--header-h); }

  .js .site-nav {
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-sm);
    padding-bottom: var(--space-md);
  }
  /* display:none also removes the links from the accessibility tree while closed. */
  .js .site-nav { display: none; }
  .js .site-header.is-nav-open .site-nav { display: flex; }
  .js .site-header.is-nav-open { background: var(--surface); border-bottom-color: var(--line); }

  .site-nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav__list a {
    min-height: 48px;
    border-bottom: 1px solid var(--line);
  }
  .site-nav__cta { width: 100%; }

  /* Bars fold into a cross while the menu is open. */
  .is-nav-open .nav-toggle__bars span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .is-nav-open .nav-toggle__bars span:nth-child(2) { opacity: 0; }
  .is-nav-open .nav-toggle__bars span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
}

/* --------------------------------------------------- 8. REVEAL ON SCROLL */
/* Scoped to .js. script.js removes .js from <html> if it fails to load, and
   reveals everything immediately when IntersectionObserver is unavailable. */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 600ms ease, transform 600ms ease;
}
.js [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* Printing never scrolls, so the observer would never fire and whole sections
   would come out blank. Reveal everything on paper. */
@media print {
  .js [data-reveal] { opacity: 1 !important; transform: none !important; }
  .site-header { position: static; }
}

/* --------------------------------------------------- 9. REDUCED MOTION */

@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;
    scroll-behavior: auto !important;
  }

  .js [data-reveal] { opacity: 1; transform: none; }
}

/* --------------------------------------------------- 10. DARK THEME OVERRIDES */
/* The palette itself is a token block up in section 2. These are the two places
   where dark mode needs more than a different colour, so they have to sit after
   the rules they override — same specificity, later wins. */

@media (prefers-color-scheme: dark) {
  /* The header uses the transparent logo PNG, so section 5 strips the tile and
     lets the page show through. On a dark ground that fails: about 70% of the
     mark's opaque pixels are the logo's own dark pine (#436552), which measures
     2.72:1 there — the artwork reads as half erased. Give the header back the
     cream field the logo was drawn on, where the same pine is 5.36:1. The logo
     is still never cropped, recoloured, masked or filtered; only what sits
     behind it changes. */
  .site-header .brand-mark {
    background: var(--logo-field);
    border-radius: var(--radius-md);
  }

  /* The Squirio screenshot and icon keep their own pixels — dimming a product
     shot shows people an app that does not exist. What changes is the frame:
     --line is only 1.12:1 on the card here, so the bright raster would meet the
     dark page as a raw cut. --line-strong is visible against both sides, and the
     image reads as a framed object rather than a hole punched in the page. */
  .product__preview img,
  .product__icon { border-color: var(--line-strong); }
}
