/* ==========================================================================
   Light Tap — design system and site styles
   --------------------------------------------------------------------------
   One idea organises this file: light is a material, not decoration. The page
   is unlit by default and brightness is spent only where it carries meaning.

   The strictest rule: RED IS ONLY EVER A TRAP. It is never a hover state,
   never an error colour, never an accent. The rule of the game is the rule of
   the design system.

   Layer order is declared once so component styles never have to out-specify
   anything above them.
   ========================================================================== */

@layer reset, tokens, base, layout, components, utilities;

/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */
@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  * {
    margin: 0;
  }

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

  body {
    min-height: 100svh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

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

  input,
  button,
  textarea,
  select {
    font: inherit;
    color: inherit;
  }

  button {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
  }

  p,
  h1,
  h2,
  h3,
  h4 {
    overflow-wrap: break-word;
  }

  ul[role="list"],
  ol[role="list"] {
    list-style: none;
    padding: 0;
  }

  html,
  body {
    overflow-x: clip;
  }
}

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */
@layer tokens {
  :root {
    /* -- Surfaces ------------------------------------------------------- */
    --ink: #08070c;
    --ink-raised: #0e0d14;
    --ink-overlay: #15141c;

    /* -- Hairlines ------------------------------------------------------ */
    --line: rgb(255 255 255 / 0.08);
    --line-strong: rgb(255 255 255 / 0.16);

    /* -- Text ----------------------------------------------------------- */
    --text: #f4f3f7;
    --text-secondary: rgb(244 243 247 / 0.64);
    /* 0.48, not 0.44. At 0.44 this token measured 4.02:1 against the page and
       4.07:1 against the raised surface — below AA for body text, and it is
       used for real prose: the hero note, the footer blurb, the AdMob
       disclosure, document meta lines and Back to top. 0.48 is the smallest
       step that clears 4.5:1 on both surfaces (4.60:1 and 4.63:1) and the
       text still reads as secondary. */
    --text-muted: rgb(244 243 247 / 0.48);

    /* -- Light -----------------------------------------------------------
       Two accents and one warning. `--live` is the light you are meant to
       reach; `--gold` marks progression and figures; `--trap` is red and is
       used for nothing except a trap light. ------------------------------ */
    /* The four cell colours of the demonstration board, taken from the app
       icon so the board and the icon above it are unmistakably the same game.
       Red is deliberately not among them: red is the trap. */
    --cell-0: #ff7a1a;
    --cell-1: #ff3ea5;
    --cell-2: #63d2ff;
    --cell-3: #ffc24b;

    --live: #63d2ff;
    --live-dim: rgb(99 210 255 / 0.16);
    --gold: #ffc24b;
    --gold-dim: rgb(255 194 75 / 0.14);
    --trap: #ff3b4e;
    --trap-dim: rgb(255 59 78 / 0.18);

    /* Editorial orientation labels — eyebrows, section indices, footer group
       headings. The same warm family as the CTA, deliberately far below it:
       a composite of --gold over the ink reads as muted bronze rather than
       yellow, so the amber repeats across the page as a quiet signature and
       the buttons stay the only strong amber. The rule under an eyebrow is
       quieter again, so the mark reads as a tick and not a divider. */
    --editorial: rgb(255 194 75 / 0.62);
    --editorial-rule: rgb(255 194 75 / 0.3);

    --on-light: #08070c;
    --focus-ring: #f4f3f7;

    /* -- Type ----------------------------------------------------------- */
    --font-sans:
      -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
      sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    --font-mono:
      ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

    /* Fluid scale, 390px → 1440px */
    --step--2: clamp(0.72rem, 0.71rem + 0.06vw, 0.76rem);
    --step--1: clamp(0.83rem, 0.81rem + 0.09vw, 0.88rem);
    --step-0: clamp(1rem, 0.97rem + 0.14vw, 1.06rem);
    --step-1: clamp(1.2rem, 1.14rem + 0.3vw, 1.38rem);
    --step-2: clamp(1.44rem, 1.32rem + 0.55vw, 1.79rem);
    --step-3: clamp(1.73rem, 1.53rem + 0.94vw, 2.33rem);
    --step-4: clamp(2.07rem, 1.75rem + 1.5vw, 3.03rem);
    --step-5: clamp(2.49rem, 1.99rem + 2.31vw, 3.94rem);
    --step-6: clamp(2.99rem, 2.24rem + 3.46vw, 5.12rem);

    /* -- Space ---------------------------------------------------------- */
    --space-3xs: 0.25rem;
    --space-2xs: 0.5rem;
    --space-xs: 0.75rem;
    --space-s: 1rem;
    --space-m: 1.5rem;
    --space-l: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4.5rem;
    --space-3xl: 7rem;
    --space-4xl: 10rem;

    /* -- Layout --------------------------------------------------------- */
    --measure: 62ch;
    --measure-tight: 46ch;
    --width-content: 72rem;
    --width-prose: 44rem;
    --gutter: clamp(1.25rem, 0.85rem + 2vw, 2.75rem);
    --section-space: clamp(3.75rem, 2.5rem + 5.5vw, 7rem);

    /* -- Radii ---------------------------------------------------------- */
    --radius-s: 6px;
    --radius-m: 14px;
    --radius-l: 24px;
    --radius-pill: 999px;

    /* -- Glow -----------------------------------------------------------
       Light bleeds; it does not sit inside a border. --------------------- */
    --glow-live: 0 0 24px rgb(99 210 255 / 0.45), 0 0 64px rgb(99 210 255 / 0.18);
    --glow-trap: 0 0 22px rgb(255 59 78 / 0.42), 0 0 58px rgb(255 59 78 / 0.16);
    --glow-gold: 0 0 22px rgb(255 194 75 / 0.34);
    --shadow-raised: 0 24px 60px -32px rgb(0 0 0 / 0.9);

    /* -- Motion --------------------------------------------------------- */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --fast: 180ms;
    --base: 280ms;
    --slow: 450ms;

    /* -- Breakpoints (documentation; media queries cannot read these) ----
       phone  < 640px      tablet 640–1023px      desktop >= 1024px       */
  }

  /* A reader who asks for less movement gets a complete static page, not a
     half-finished one: reveals resolve to their visible state. */
  /* A light runs along the ticks when a row is pointed at, at the tempo the
   pattern implies. Hover only, fine pointers only: on touch the geometry
   already carries the difference and nothing should move on its own. */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  @layer components {
    .mode__rhythm::after {
      content: "";
      position: absolute;
      inset-block: 0.25rem;
      inset-inline-start: 0;
      width: 2px;
      border-radius: 1px;
      background-color: var(--live);
      box-shadow: var(--glow-live);
      opacity: 0;
    }

    .mode:hover .mode__rhythm::after {
      animation: mode-sweep 1.6s var(--ease-in-out);
    }

    @keyframes mode-sweep {
      0% { inset-inline-start: 0; opacity: 0; }
      12% { opacity: 0.9; }
      88% { opacity: 0.9; }
      100% { inset-inline-start: 100%; opacity: 0; }
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  /* The board keeps the still frame the HTML shipped with — two lights, one
     trap, a combo. js/board.js never starts, so nothing here needs undoing. */
  .board__cell {
    transition: none;
  }

    :root {
      --fast: 1ms;
      --base: 1ms;
      --slow: 1ms;
    }

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

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
@layer base {
  html {
    color-scheme: dark;
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
  }

  html {
    background-color: var(--ink);
  }

  body {
    background-color: transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: var(--step-0);
  }

  h1,
  h2,
  h3,
  h4 {
    color: var(--text);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -0.028em;
    text-wrap: balance;
  }

  h1 {
    font-size: var(--step-6);
  }
  h2 {
    font-size: var(--step-4);
  }
  h3 {
    font-size: var(--step-1);
    line-height: 1.2;
    letter-spacing: -0.018em;
  }
  h4 {
    font-size: var(--step-0);
    line-height: 1.3;
    letter-spacing: -0.01em;
  }

  p {
    text-wrap: pretty;
  }

  a {
    color: var(--text);
    text-underline-offset: 0.22em;
    text-decoration-thickness: from-font;
    transition: color var(--fast) ease;
  }

  a:hover {
    color: var(--live);
  }

  :focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 3px;
    border-radius: var(--radius-s);
  }

  ::selection {
    background-color: var(--live);
    color: var(--on-light);
  }
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
@layer layout {
  .page {
    display: flex;
    flex-direction: column;
    min-height: 100svh;
  }

  .page > main {
    flex: 1;
  }

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

  .shell--prose {
    max-width: var(--width-prose);
  }

  .section {
    padding-block: var(--section-space);
  }

  .stack > * + * {
    margin-block-start: var(--flow, var(--space-m));
  }

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

  /* Zero-size anchor marking the true document start for #top. */
  #top {
    display: block;
    height: 0;
  }

  .skip-link {
    position: fixed;
    inset-block-start: -5rem;
    inset-inline-start: var(--space-s);
    z-index: 200;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-inline: var(--space-m);
    border-radius: var(--radius-pill);
    background-color: var(--text);
    color: var(--ink);
    font-size: var(--step--1);
    font-weight: 600;
    text-decoration: none;
    transition: inset-block-start var(--base) var(--ease-out);
  }

  .skip-link:focus {
    inset-block-start: var(--space-s);
    color: var(--ink);
  }
}

/* --------------------------------------------------------------------------
   Components
   -------------------------------------------------------------------------- */
@layer components {
  /* -- Section furniture ------------------------------------------------ */
  .eyebrow {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin-block-end: var(--space-m);
    color: var(--editorial);
    font-family: var(--font-mono);
    font-size: var(--step--2);
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
  }

  .eyebrow::before {
    content: "";
    flex: none;
    width: 1.5rem;
    height: 1px;
    background-color: var(--editorial-rule);
  }

  .lede {
    max-width: var(--measure);
    margin-block-start: var(--space-m);
    font-size: var(--step-1);
    line-height: 1.5;
    letter-spacing: -0.012em;
    color: var(--text-secondary);
  }

  .section__head {
    max-width: 46rem;
  }

  /* -- Buttons ----------------------------------------------------------- */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2xs);
    min-height: 48px;
    padding-inline: var(--space-l);
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    font-size: var(--step--1);
    font-weight: 600;
    letter-spacing: -0.005em;
    text-decoration: none;
    white-space: nowrap;
    transition:
      background-color var(--fast) ease,
      border-color var(--fast) ease,
      box-shadow var(--fast) ease,
      color var(--fast) ease,
      transform var(--fast) var(--ease-out);
  }

  .btn:active {
    transform: translateY(1px);
  }

  /* The App Store link, and nothing else on the site.

     `--live` is not a new colour: it is the light the game asks you to tap,
     already carrying that meaning on the board and in the mode list. Putting
     the one action of the page in it says the same thing in the same word.

     White was wrong for it. `--text` is the page's body colour, so a white
     pill reads as a raised surface rather than as light, and it competed with
     the app icon instead of pointing at it.

     The glow is the same treatment every light on this site gets — it bleeds
     rather than sitting inside a border — kept dimmer than `--glow-live` so
     the button does not outshine the board it sits above. */
  .btn--primary {
    background-color: var(--live);
    color: var(--on-light);
    box-shadow: 0 0 20px rgb(99 210 255 / 0.26);
  }

  .btn--primary:hover,
  .btn--primary:focus-visible {
    background-color: #8adcff;
    color: var(--on-light);
    box-shadow: 0 0 28px rgb(99 210 255 / 0.42);
  }

  .btn--ghost {
    border-color: var(--line-strong);
    color: var(--text);
  }

  .btn--ghost:hover,
  .btn--ghost:focus-visible {
    border-color: var(--text);
    background-color: rgb(255 255 255 / 0.04);
    color: var(--text);
  }

  /* The action you can actually take today.

     `--gold` is not a new brand colour: it is the icon's own warm light and
     already marks progression and the figures, so the accent is a tint of
     something the site owns. Deliberately a tinted field and a gold hairline
     rather than a solid amber button — the same pill, the same dimensions,
     one step warmer.

     Not `.btn--primary`: that belongs to the App Store link, the one action
     on the page that outranks these. */
  .btn--accent {
    border-color: rgb(255 194 75 / 0.45);
    background-color: var(--gold-dim);
    color: var(--gold);
  }

  .btn--accent:hover,
  .btn--accent:focus-visible {
    border-color: rgb(255 194 75 / 0.7);
    background-color: rgb(255 194 75 / 0.22);
  }

  .btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-s);
    margin-block-start: var(--space-xl);
  }

  /* -- Header ------------------------------------------------------------
     Sits in the page rather than floating over it: no pill, no shadow, one
     hairline. It only gains a background once the reader has left the top. */
  .site-header {
    position: sticky;
    inset-block-start: 0;
    z-index: 100;
    border-block-end: 1px solid transparent;
    transition:
      background-color var(--base) ease,
      border-color var(--base) ease,
      backdrop-filter var(--base) ease;
  }

  .site-header[data-lifted="true"] {
    background-color: rgb(8 7 12 / 0.72);
    border-block-end-color: var(--line);
    backdrop-filter: saturate(1.4) blur(16px);
    -webkit-backdrop-filter: saturate(1.4) blur(16px);
  }

  .site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-m);
    min-height: 4.5rem;
  }

  .wordmark {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2xs);
    color: var(--text);
    font-size: var(--step-0);
    font-weight: 600;
    letter-spacing: -0.02em;
    text-decoration: none;
  }


  .site-header__end {
    display: flex;
    align-items: center;
    gap: var(--space-s);
  }

  /* -- Language switcher --------------------------------------------------
     Two plain links, so it works with JavaScript off and reads correctly to a
     screen reader: the active language is a <span aria-current>, the other is
     an anchor to the equivalent page. No flags, no dropdown. */
  .lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--font-mono);
    font-size: var(--step--2);
    letter-spacing: 0.1em;
  }

  .lang-switch__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    min-height: 2.25rem;
    border-radius: var(--radius-s);
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--fast) ease, background-color var(--fast) ease;
  }

  .lang-switch__item abbr {
    text-decoration: none;
    border: 0;
  }

  .lang-switch__item[aria-current="true"] {
    color: var(--text);
  }

  a.lang-switch__item:hover,
  a.lang-switch__item:focus-visible {
    color: var(--text);
    background-color: rgb(255 255 255 / 0.06);
  }

  .lang-switch__sep {
    color: var(--line-strong);
  }

  .site-nav {
    display: none;
  }

  .site-nav__list {
    display: flex;
    align-items: center;
    gap: var(--space-l);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .site-nav__list a {
    position: relative;
    color: var(--text-secondary);
    font-size: var(--step--1);
    text-decoration: none;
  }

  .site-nav__list a::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    inset-block-end: -6px;
    height: 1px;
    background-color: currentColor;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform var(--base) var(--ease-out);
    pointer-events: none;
  }

  .site-nav__list a:hover,
  .site-nav__list a:focus-visible {
    color: var(--text);
  }

  .site-nav__list a:hover::after,
  .site-nav__list a:focus-visible::after {
    transform: scaleX(1);
  }

  /* -- Drawer ------------------------------------------------------------ */
  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    margin-inline-end: -0.5rem;
  }

  .nav-toggle__bar {
    width: 20px;
    height: 1.5px;
    border-radius: 2px;
    background-color: var(--text);
    transition: transform var(--base) var(--ease-out), opacity var(--fast) ease;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle__bar:first-child {
    transform: translateY(3.25px) rotate(45deg);
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle__bar:last-child {
    transform: translateY(-3.25px) rotate(-45deg);
  }

  .drawer {
    position: fixed;
    inset: 0;
    z-index: 150;
    display: grid;
    grid-template-rows: auto 1fr;
    background-color: rgb(8 7 12 / 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    /* `visibility` is delayed rather than eased: on close it waits for the
       fade before hiding, on open it flips at once. Transitioning it in both
       directions left the drawer computing to `visibility: hidden` at the
       moment the attribute changed, so the close button could not take focus
       and focus stayed on <body>. The fade itself is unchanged. */
    transition:
      opacity var(--base) ease,
      visibility 0s linear var(--base);
  }

  .drawer[data-open="true"] {
    opacity: 1;
    visibility: visible;
    transition:
      opacity var(--base) ease,
      visibility 0s;
  }

  .drawer__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-m);
    min-height: 4.5rem;
    padding-block-start: env(safe-area-inset-top);
  }

  /* The drawer is a fixed, viewport-height grid, so this second row only ever
     gets what the brand row leaves over. In landscape the menu is ~600px tall
     inside a ~390px viewport, and without a scroll container the overflow had
     nowhere to go: Download, Contact and the whole legal row were unreachable.

     `min-height: 0` is what actually does the work — a grid item defaults to
     `min-height: auto`, which refuses to shrink below its content and so
     defeats `overflow-y` entirely. `contain` stops the scroll from chaining
     into the page behind, which nav.js has already locked. */
  .drawer__body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-block-end: max(var(--space-l), env(safe-area-inset-bottom));
  }

  .drawer__list {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .drawer__list a {
    display: block;
    padding-block: var(--space-m);
    border-block-start: 1px solid var(--line);
    color: var(--text);
    font-size: var(--step-2);
    letter-spacing: -0.02em;
    text-decoration: none;
  }

  .drawer__list li:last-child a {
    border-block-end: 1px solid var(--line);
  }

  .drawer__foot {
    margin-block-start: var(--space-xl);
  }

  /* -- Ambient light ------------------------------------------------------
     One fixed pool of light for the whole document. It eases toward the
     scroll position and leans slightly toward the pointer, so the page feels
     lit from somewhere rather than painted flat.

     Deliberately slow and low in contrast: this is atmosphere, and rapid
     brightness change is exactly what the photosensitivity notice warns
     about. It sits behind everything and takes no pointer events. */
  .ambient {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(
      42rem 42rem at var(--amb-x, 50%) var(--amb-y, 28%),
      rgb(99 210 255 / 0.075) 0%,
      rgb(255 122 26 / 0.032) 45%,
      rgb(8 7 12 / 0) 72%
    );
  }

  /* -- Hero -------------------------------------------------------------- */
  .hero {
    position: relative;
    padding-block: clamp(3.5rem, 2rem + 8vw, 7rem) var(--section-space);
    overflow: clip;
  }

  .hero__inner {
    position: relative;
    z-index: 1;
    display: grid;
    gap: var(--space-xl);
  }

  /* Grid, purely so the two lines are flow-root siblings: the bleed below
     cancels itself with an equal negative margin, and adjacent-sibling margin
     collapsing would otherwise eat half of that and open the line gap. */
  .hero__title {
    display: grid;
    max-width: 16ch;
  }

  /* The rise needs `overflow: hidden` to mask each line, but the display
     line-height (1.05) is tighter than this font's own ascent plus descent —
     measured ~0.125em taller — so the mask cut the descenders off g, p, j, q
     and y. The bleed reopens the clip box by more than that overshoot and
     takes the same amount straight back out of the layout, so font size,
     line-height and the two-line composition are all untouched. The keyframe
     below starts past the bleed so the line still rises out of nothing. */
  .hero__line {
    --line-bleed: 0.16em;
    display: block;
    padding-block: var(--line-bleed);
    margin-block: calc(var(--line-bleed) * -1);
    overflow: hidden;
  }

  .hero__line > span {
    display: block;
    animation: line-rise 900ms var(--ease-out) both;
    animation-delay: calc(var(--line, 0) * 110ms);
  }

  .hero__line:last-child > span {
    color: var(--text-secondary);
  }

  @keyframes line-rise {
    from {
      transform: translateY(calc(100% + var(--line-bleed, 0px)));
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  .hero__note {
    margin-block-start: var(--space-l);
    color: var(--text-muted);
    font-size: var(--step--1);
  }

  /* -- Hero stage --------------------------------------------------------
     Portrait, because Light Tap is a portrait iPhone game. The object is the
     real app icon; everything around it is light, not chrome. No border, no
     card, no invented device frame. */
  .hero-stage {
    position: relative;
    display: grid;
    place-items: center;
    width: min(100%, 24rem);
    margin-inline: auto;
    aspect-ratio: 4 / 5;
    isolation: isolate;
  }

  /* The pool the icon sits in. Slow, wide and low-contrast: atmosphere, not
     a strobe. */
  .hero-stage::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: -18% -22%;
    background: radial-gradient(
      50% 44% at 50% 50%,
      rgb(99 210 255 / 0.16) 0%,
      rgb(255 122 26 / 0.07) 42%,
      rgb(8 7 12 / 0) 72%
    );
    animation: stage-breathe 14s var(--ease-in-out) infinite;
  }

  @keyframes stage-breathe {
    0%,
    100% {
      opacity: 0.75;
      transform: scale(1);
    }
    50% {
      opacity: 1;
      transform: scale(1.06);
    }
  }

  /* The icon leans a few degrees toward the pointer on fine-pointer devices;
     --tilt-x/--tilt-y are written by the motion module and default to rest. */
  .app-icon {
    width: min(72%, 17rem);
    border-radius: 22.5%;
    box-shadow:
      0 40px 90px -30px rgb(0 0 0 / 0.85),
      0 0 70px -10px rgb(99 210 255 / 0.22);
    transform: perspective(900px) rotateX(var(--tilt-x, 0deg))
      rotateY(var(--tilt-y, 0deg)) translateZ(0);
    transition: transform var(--slow) var(--ease-out);
    will-change: transform;
  }

  /* Suspended in light: a slow drift, barely a degree of rotation and a
     breath of scale. Nine seconds per cycle, so nothing reads as an
     animation — and no brightness change, which keeps it clear of the
     photosensitivity guidance. It sits on the <picture> wrapper so it never
     fights the pointer tilt on the <img>. */
  .hero-stage picture {
    animation: icon-float 9s var(--ease-in-out) infinite;
    will-change: transform;
  }

  /* The picture stretches to the stage, the image does not — so the image has
     to centre itself inside it. Without this it sits against the inline-start
     edge and drifts off the glow, which is centred on the stage. */
  .app-icon--hero {
    display: block;
    margin-inline: auto;
  }

  @keyframes icon-float {
    0%,
    100% {
      transform: translateY(-4px) rotate(-0.6deg) scale(1);
    }
    50% {
      transform: translateY(4px) rotate(0.6deg) scale(1.015);
    }
  }

  .app-icon--mark {
    width: 1.5rem;
    border-radius: 24%;
    box-shadow: none;
    transform: none;
  }

  @media (prefers-reduced-motion: reduce) {
    .hero-stage::before {
      animation: none;
      opacity: 0.9;
    }
    .hero-stage picture {
      animation: none;
      transform: none;
    }
    .app-icon {
      transform: none;
    }
  }

  /* -- The rule ---------------------------------------------------------- */
  /* -- Demonstration board ------------------------------------------------
     Sits beside the section head on wide screens and under it on narrow ones.
     Every state is a class on a cell; js/board.js only ever adds and removes
     those, so the resting look lives here and nowhere else. */
  .game-band {
    display: grid;
    gap: var(--space-xl);
    align-items: center;
  }

  /* Grid and readout share one column, so the number lines up with the
     board's left edge instead of drifting to whichever side the board sits on. */
  .board {
    display: grid;
    gap: var(--space-m);
    width: 100%;
    max-width: 22rem;
  }

  .board__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(0.5rem, 0.3rem + 0.9vw, 0.9rem);
    aspect-ratio: 3 / 4;
  }

  /* A cell at rest: dark, with a ring in its own colour. The ring is what
     makes an unlit board still read as a board — and what makes a lit cell
     read as the same cell rather than a new one. */
  .board__cell {
    border-radius: 50%;
    background-color: rgb(255 255 255 / 0.025);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hue) 30%, transparent);
    transition:
      background-color var(--slow) var(--ease-out),
      box-shadow var(--slow) var(--ease-out),
      transform var(--base) var(--ease-out);
  }

  /* Lit: the cell fills with its colour and picks up the small specular
     highlight the game's own cells have. */
  .board__cell.is-live,
  .board__cell.is-trap {
    background-image: radial-gradient(
      circle at 38% 32%,
      rgb(255 255 255 / 0.62),
      transparent 46%
    );
  }

  .board__cell.is-live {
    background-color: color-mix(in srgb, var(--hue) 78%, transparent);
    box-shadow:
      inset 0 0 0 1px color-mix(in srgb, var(--hue) 85%, transparent),
      0 0 22px color-mix(in srgb, var(--hue) 42%, transparent),
      0 0 58px color-mix(in srgb, var(--hue) 16%, transparent);
  }

  .board__cell.is-trap {
    background-color: color-mix(in srgb, var(--trap) 78%, transparent);
    box-shadow:
      inset 0 0 0 1px color-mix(in srgb, var(--trap) 85%, transparent),
      var(--glow-trap);
  }

  /* Taken: the cell answers once and settles, faster than the fade. */
  .board__cell.is-hit {
    transform: scale(0.92);
    transition-duration: var(--fast);
  }

  .rules {
    display: grid;
    gap: var(--space-xl);
    margin-block-start: var(--space-2xl);
    counter-reset: rule;
  }

  .rule {
    padding-block-start: 0;
  }

  .rule__index {
    display: block;
    margin-block-end: var(--space-s);
    color: var(--editorial);
    font-family: var(--font-mono);
    font-size: var(--step--2);
    letter-spacing: 0.14em;
  }

  .rule h3 {
    margin-block-end: var(--space-2xs);
  }

  .rule p {
    max-width: var(--measure-tight);
    color: var(--text-secondary);
    font-size: var(--step--1);
    line-height: 1.65;
  }

  /* A single dot per rule, coloured to match what the rule is about. */
  .rule__dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-inline-end: 0.55rem;
    border-radius: 50%;
    vertical-align: 0.12em;
  }

  .rule__dot--live {
    background-color: var(--live);
    box-shadow: var(--glow-live);
  }
  .rule__dot--trap {
    background-color: var(--trap);
    box-shadow: var(--glow-trap);
  }
  .rule__dot--gold {
    background-color: var(--gold);
    box-shadow: var(--glow-gold);
  }

  /* -- Modes ------------------------------------------------------------- */
  .modes {
    margin-block-start: var(--space-2xl);
  }

  .mode {
    display: grid;
    gap: var(--space-2xs) var(--space-xl);
    padding-block: var(--space-l);
  }

  /* The tick pattern. Geometry first: the spacing differs per mode and is
     visible without any motion at all. The travelling light below is only a
     reward for pointing at a row. */
  .mode__rhythm {
    position: relative;
    display: block;
    height: 1.5rem;
    margin-block-start: var(--space-2xs);
  }

  .mode__rhythm i {
    position: absolute;
    inset-block: 0.25rem;
    inset-inline-start: var(--at);
    width: 1px;
    background-color: rgb(255 255 255 / 0.22);
  }

  .mode__index {
    color: var(--editorial);
    font-family: var(--font-mono);
    font-size: var(--step--2);
    letter-spacing: 0.14em;
  }

  .mode__name {
    font-size: var(--step-2);
    letter-spacing: -0.022em;
  }

  .mode__line {
    max-width: var(--measure);
    color: var(--text-secondary);
    font-size: var(--step--1);
    line-height: 1.65;
  }

  /* -- Figures ------------------------------------------------------------
     Numbers support the story; they are not a dashboard. Tabular numerals
     keep the row optically aligned. */
  .figures {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-xl) var(--space-l);
    margin-block-start: var(--space-2xl);
  }

  .figure__value {
    display: block;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: var(--step-3);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
    line-height: 1;
  }

  .figure__label {
    display: block;
    margin-block-start: var(--space-2xs);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: var(--step--2);
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  /* -- Panels (Challenge, Connected, Fair) --------------------------------
     Columns under a hairline rather than cards. A page of bordered boxes
     reads like a dashboard; the rule plus the whitespace is enough. */
  .panel {
    padding-block-start: 0;
  }

  .panel h3 {
    margin-block-end: var(--space-xs);
  }

  .panel p {
    max-width: var(--measure);
    color: var(--text-secondary);
    font-size: var(--step--1);
    line-height: 1.65;
  }

  .panel-grid {
    display: grid;
    gap: var(--space-xl);
    margin-block-start: var(--space-2xl);
  }

  .spec-list {
    margin: 0;
    padding: 0;
  }

  .spec-list div {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs) var(--space-m);
    justify-content: space-between;
    padding-block: var(--space-xs);
  }

  .spec-list dt {
    color: var(--text-secondary);
    font-size: var(--step--1);
  }

  .spec-list dd {
    margin: 0;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: var(--step--1);
    font-variant-numeric: tabular-nums;
  }

  /* -- Safety notice ------------------------------------------------------
     Understated by design. It is information a reader deserves before they
     play, not a warning banner shouting at them. */
  .notice {
    display: grid;
    gap: var(--space-s);
    padding-inline-start: var(--space-l);
    border-inline-start: 2px solid var(--gold);
  }

  .notice h2 {
    font-size: var(--step-1);
    letter-spacing: -0.018em;
  }

  .notice p {
    max-width: var(--measure);
    font-size: var(--step--1);
    line-height: 1.7;
  }

  .notice p + p {
    margin-block-start: var(--space-s);
  }

  /* -- Contact ------------------------------------------------------------ */
  .contact-grid {
    display: grid;
    gap: var(--space-xl);
    margin-block-start: var(--space-2xl);
  }

  .contact-card {
    padding-block-start: 0;
  }

  .contact-card h3 {
    margin-block-end: var(--space-2xs);
  }

  .contact-card p {
    max-width: var(--measure-tight);
    color: var(--text-secondary);
    font-size: var(--step--1);
    line-height: 1.65;
  }

  /* -- Footer ------------------------------------------------------------- */
  .site-footer {
    padding-block: var(--space-2xl) var(--space-l);
    color: var(--text-muted);
    font-size: var(--step--1);
  }

  .site-footer__top {
    display: grid;
    gap: var(--space-xl);
  }

  .site-footer__blurb {
    max-width: 24rem;
    color: var(--text-muted);
    font-size: var(--step--1);
    line-height: 1.65;
  }

  .footer-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-l);
  }

  .footer-nav h2 {
    margin-block-end: var(--space-s);
    color: var(--editorial);
    font-family: var(--font-mono);
    font-size: var(--step--2);
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  .footer-nav ul {
    display: grid;
    gap: var(--space-2xs);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .footer-nav a {
    color: var(--text-secondary);
    text-decoration: none;
  }

  .footer-nav a:hover,
  .footer-nav a:focus-visible {
    color: var(--text);
  }

  /* The footer brand is a link home; give it a state worth the click. */
  .wordmark--footer {
    display: inline-flex;
    padding: var(--space-2xs);
    margin: calc(var(--space-2xs) * -1);
    border-radius: var(--radius-m);
    transition: background-color var(--fast) ease;
  }

  .wordmark--footer:hover,
  .wordmark--footer:focus-visible {
    background-color: rgb(255 255 255 / 0.05);
    color: var(--text);
  }

  .wordmark--footer:hover .app-icon,
  .wordmark--footer:focus-visible .app-icon {
    transform: translateY(-1px);
  }

  /* -- Back to top --------------------------------------------------------
     A same-page anchor, nothing more. Smooth scrolling comes from
     `scroll-behavior` and reduced motion turns it into an instant jump, so
     there is no script and no scroll listener behind it. */
  .to-top {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2xs);
    min-height: 44px;
    padding-inline: var(--space-s);
    margin-inline-end: calc(var(--space-s) * -1);
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    font-size: var(--step--2);
    text-decoration: none;
    transition: color var(--fast) ease, background-color var(--fast) ease;
  }

  .to-top:hover,
  .to-top:focus-visible {
    color: var(--text);
    background-color: rgb(255 255 255 / 0.05);
  }

  .to-top__arrow {
    display: inline-block;
    transition: transform var(--base) var(--ease-out);
  }

  .to-top:hover .to-top__arrow,
  .to-top:focus-visible .to-top__arrow {
    transform: translateY(-2px);
  }

  /* Two items now — copyright and back-to-top. `.to-top` carries a 44px tap
     target, so without centring the copyright stretches beside it and its text
     sits high against the link. */
  .site-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2xs) var(--space-m);
    justify-content: space-between;
    margin-block-start: var(--space-2xl);
    padding-block-start: var(--space-m);
    font-size: var(--step--2);
  }

  .site-footer__disclosure {
    max-width: 46rem;
    margin-block-start: var(--space-m);
    color: var(--text-muted);
    font-size: var(--step--2);
    line-height: 1.7;
  }

  /* -- Legal and support prose -------------------------------------------
     Calmer than the homepage: narrower measure, more air, no accents beyond
     the section rules. */
  .doc-header {
    padding-block: var(--space-2xl) var(--space-xl);
  }

  .doc-header h1 {
    font-size: var(--step-4);
  }

  .doc-meta {
    margin-block-start: var(--space-s);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: var(--step--2);
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .doc {
    padding-block-end: var(--space-4xl);
  }

  /* Any section needs air above it, including the first one after a loose
     intro paragraph — not only sections that follow another section. */
  .doc > * + section {
    margin-block-start: var(--space-2xl);
  }

  .doc h2 {
    margin-block-end: var(--space-s);
    font-size: var(--step-2);
    letter-spacing: -0.02em;
  }

  .doc h3 {
    margin-block: var(--space-l) var(--space-2xs);
    font-size: var(--step-0);
    color: var(--text);
  }

  .doc p,
  .doc li {
    max-width: var(--measure);
    line-height: 1.75;
  }

  .doc p + p,
  .doc ul + p,
  .doc p + ul {
    margin-block-start: var(--space-s);
  }

  .doc ul {
    margin-block-start: var(--space-s);
    padding-inline-start: 1.15rem;
    display: grid;
    gap: var(--space-3xs);
  }

  .doc li::marker {
    color: var(--text-muted);
  }

  /* Prose links only. Without the exclusion this rule outranks .btn on both
     specificity counts, and the support button rendered as underlined body
     text in the wrong colour instead of as a button. */
  .doc a:not(.btn) {
    color: var(--text);
    text-decoration: underline;
    text-decoration-color: var(--line-strong);
  }

  .doc a:not(.btn):hover {
    color: var(--live);
    text-decoration-color: currentColor;
  }

  .doc__toc {
    margin-block: var(--space-l) var(--space-2xl);
    padding: var(--space-m) var(--space-l);
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
    background-color: var(--ink-raised);
  }

  .doc__toc h2 {
    margin-block-end: var(--space-s);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: var(--step--2);
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  .doc__toc ol {
    display: grid;
    gap: var(--space-3xs);
    margin: 0;
    padding-inline-start: 1.35rem;
    font-size: var(--step--1);
  }

  .doc__toc a {
    text-decoration: none;
    color: var(--text-secondary);
  }

  .doc__toc a:hover,
  .doc__toc a:focus-visible {
    color: var(--text);
  }
}

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */
@layer utilities {
  .flow-s {
    --flow: var(--space-s);
  }
  .flow-l {
    --flow: var(--space-l);
  }

  .text-muted {
    color: var(--text-muted);
  }

  .no-wrap {
    white-space: nowrap;
  }

  /* Reveal on scroll.
     --------------------------------------------------------------------
     Content visibility must never depend on JavaScript, so the hidden state
     is fenced three ways:

     1. `.js-reveal` is added by an inline head script, so no JavaScript at
        all means nothing is ever hidden.
     2. That same inline script arms a timer which removes `.js-reveal`
        again — if the module fails to load, throws, or never observes
        anything, every element becomes visible on its own.
     3. `:not([data-reveal="shown"])` puts the escape inside the selector
        rather than in a second rule. An earlier version used a separate
        `[data-reveal="shown"]` rule, which lost on specificity (0,1,0
        against 0,2,0) and left the whole page at opacity 0 permanently. */
  .js-reveal [data-reveal]:not([data-reveal="shown"]) {
    opacity: 0;
    translate: 0 16px;
    filter: blur(5px);
  }

  [data-reveal] {
    transition:
      opacity var(--slow) var(--ease-out),
      translate var(--slow) var(--ease-out),
      filter var(--slow) var(--ease-out);
    transition-delay: var(--reveal-delay, 0ms);
  }

  @media (prefers-reduced-motion: reduce) {
    .js-reveal [data-reveal]:not([data-reveal="shown"]) {
      opacity: 1;
      translate: none;
      filter: none;
    }
  }

  /* No JavaScript: the drawer can never open, so the toggle is removed and the
     link row is shown inline instead. Navigation still works at every width. */
  .no-js .nav-toggle,
  .no-js .drawer {
    display: none;
  }

  .no-js .site-nav {
    display: block;
  }

  .no-js .site-nav__list {
    flex-wrap: wrap;
    gap: var(--space-2xs) var(--space-m);
  }

  .no-js .site-header__inner {
    flex-wrap: wrap;
    padding-block: var(--space-s);
  }
}

/* ==========================================================================
   Responsive — three designed layouts, not one scaled three ways
   ========================================================================== */

/* -- Phone -----------------------------------------------------------------
   Below the tablet breakpoint the shared section rhythm reads too loose: the
   same air that frames a wide three-column row is most of the screen on a
   390px phone. One token, so every chapter keeps the same rhythm — no
   per-section overrides. Landscape phones are wider than 40rem and keep the
   shared value. */
@media (max-width: 40rem) {
  @layer tokens {
    :root {
      --section-space: clamp(3.125rem, 2.25rem + 2.5vw, 4rem);
    }
  }

  @layer components {
    /* The footer opens on a fixed --space-2xl, which does not shrink with the
       token above — left alone it would make the closing boundary looser than
       any chapter boundary. One step down keeps it marginally tighter than the
       chapter rhythm, the same relationship the wider layouts already have. */
    .site-footer {
      padding-block-start: var(--space-xl);
    }
  }
}

/* -- Tablet ---------------------------------------------------------------- */
@media (min-width: 40rem) {
  @layer components {
    .rules {
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: var(--space-l);
    }

    .mode {
      grid-template-columns: 3rem minmax(0, 12rem) minmax(0, 1fr) minmax(0, 7rem);
      align-items: baseline;
    }

    .mode__rhythm {
      margin-block-start: 0;
      align-self: center;
    }

    .figures {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .panel-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contact-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: var(--space-l);
    }

    /* Words left, demonstration right. The board takes the narrower track: it
       is square, and letting it grow further would make it the section rather
       than the illustration of it. */
    .game-band {
      grid-template-columns: minmax(0, 1fr) minmax(0, 0.72fr);
      gap: var(--space-2xl);
    }

    .board {
      margin-inline-start: auto;
    }

    .notice {
      grid-template-columns: minmax(0, 16rem) minmax(0, 1fr);
      gap: var(--space-xl);
    }

    .site-footer__top {
      grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
      gap: var(--space-2xl);
    }

    /* Tablet keeps the four groups as a deliberate 2×2. Three columns is the
       one arrangement that must not appear: with four groups it leaves Legal
       stranded on a second row underneath Products. */
    .footer-nav {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }
}

/* -- Desktop --------------------------------------------------------------- */
@media (min-width: 64rem) {
  @layer components {
    /* All four navigation groups on one axis.

       `auto` columns rather than equal fractions: "Lichtempfindlichkeit" is a
       single unbreakable word and the widest label on the site, so a column
       that is a fixed fraction of the row either clips it or forces the other
       three to be needlessly wide. Sizing to content lets each group take what
       it needs, and the brand column absorbs whatever is left. */
    .site-footer__top {
      grid-template-columns: minmax(0, 1fr) auto;
    }

    .footer-nav {
      grid-template-columns: repeat(4, auto);
      gap: var(--space-xl);
    }

    .nav-toggle,
    .drawer {
      display: none;
    }

    .site-nav {
      display: block;
    }

    /* The hero becomes asymmetric: language on the left, the board on the
       right, weighted so the type still leads. */
    .hero__inner {
      grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
      align-items: center;
      /* Fixed 10rem starved the copy column at 1024 and wrapped the buttons;
         the gap now yields space back as the viewport narrows. */
      gap: clamp(3rem, 6vw, 10rem);
    }

    /* The hero icon is 20% larger on desktop only; the stage grows with it
       so the portrait proportion and the surrounding light stay balanced.
       Tablet and phone keep the smaller icon on purpose — at those widths a
       larger one pushes the copy off the first screen. */
    .hero-stage {
      width: min(100%, 29rem);
      margin-inline: auto 0;
    }

    .app-icon--hero {
      width: min(80%, 20.4rem);
    }

    .section__head {
      max-width: 52rem;
    }

    .mode {
      grid-template-columns: 4rem minmax(0, 14rem) minmax(0, 1fr) minmax(0, 9rem);
      padding-block: var(--space-xl);
    }

    .panel-grid--three {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }


    .doc-header {
      padding-block: var(--space-3xl) var(--space-xl);
    }
  }
}

/* -- Wide ------------------------------------------------------------------ */
@media (min-width: 90rem) {
  @layer tokens {
    :root {
      --width-content: 78rem;
    }
  }
}

/* -- Phone landscape --------------------------------------------------------
   A phone turned sideways is the one context where the stacked hero fails:
   the copy, a 4.5rem gap and a 4/5 icon stage add up to roughly three
   viewports of scrolling before the first section appears.

   Keyed on orientation plus a short viewport rather than on width, because
   width alone cannot tell a 932px phone from a 1024px tablet. 30rem clears
   every iPhone landscape height (320–440) and stays well under any tablet
   landscape height (768+) or desktop window, so neither is affected.
   Placed last so that on a short, wide window it also wins over the >=64rem
   desktop hero, which is the behaviour you want there too.

   Nothing here is a redesign: the same two-column idea as desktop, at phone
   scale, with the vertical budget spent on the copy instead of on padding. */
@media (orientation: landscape) and (max-height: 30rem) {
  @layer components {
    /* In landscape the notch/Dynamic Island sits on a long edge, so the
       inline padding — not the block padding — is what has to clear it. */
    .shell {
      padding-inline:
        max(var(--gutter), env(safe-area-inset-left))
        max(var(--gutter), env(safe-area-inset-right));
    }

    /* The stacked rhythm assumes a tall screen. Here it is the single largest
       source of dead space, so it is spent down rather than scaled. */
    .hero {
      padding-block: var(--space-m) var(--space-xl);
    }

    /* `auto` rather than a second fraction: the stage is sized from the
       viewport height, so a fractional column just leaves dead space beside
       it — the very thing that made landscape feel empty. The copy takes
       everything the icon does not need. */
    .hero__inner {
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: var(--space-m);
    }

    /* Sized from the viewport height, not the column width: the stage is what
       made the hero three screens tall, and height is the scarce axis here.
       aspect-ratio still derives the width, so the portrait proportion, the
       glow and the float are all preserved. */
    .hero-stage {
      width: auto;
      /* Three-way min: viewport height is the scarce axis, 17rem caps it on
         roomy screens, and 32vw hands width back to the copy on the narrowest
         phones so the CTA row stops wrapping there. The icon scales down
         progressively rather than crowding the text. */
      height: min(68vh, 17rem, 32vw);
      margin-inline: auto;
    }

    .app-icon--hero {
      width: min(88%, 13.5rem);
    }

    /* Two lines of --step-6 do not fit a 390px-tall screen beside everything
       else. One step down keeps the headline dominant without wrapping. */
    .hero__title {
      font-size: var(--step-5);
    }

    .hero__copy .lede {
      max-width: 34ch;
      font-size: var(--step-0);
    }

    .btn-row {
      margin-block-start: var(--space-s);
    }

    .hero__note {
      margin-block-start: var(--space-s);
    }
  }
}

/* ------------------------------------------------- portfolio teaser
 *
 * The other product, stated once and quietly. It sits between the contact CTA
 * and the footer, and it is deliberately smaller and calmer than the primary
 * call to action above it: one rule above, one icon, one line, one link.
 *
 * The container is pure Light Tap — same shell, same type scale, same editorial
 * amber. Only the app icon belongs to the other product.
 */
.portfolio {
  border-top: 1px solid var(--editorial-rule);
  padding-block: clamp(2.5rem, 1.8rem + 2.6vw, 4rem);
}

/* Written once, above the first row: the group is named here, not per row. */
.portfolio__eyebrow {
  margin-block-end: clamp(1.25rem, 1rem + 1vw, 1.75rem);
}

.portfolio__inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(1rem, 0.6rem + 1.6vw, 2rem);
}

/* One row per launched sibling. Today only SLYP is public, so this rule is
   dormant — it exists so that flipping a second flag in build/content.mjs
   produces a spaced stack instead of two rows welded together. */
.portfolio__inner + .portfolio__inner {
  margin-block-start: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);
  padding-block-start: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);
  border-top: 1px solid var(--editorial-rule);
}

.portfolio__icon {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 22.5%;
  display: block;
}

.portfolio__title {
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.6rem);
  margin: 0.2rem 0 0.35rem;
}

.portfolio__body {
  max-width: 46ch;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-muted, rgb(255 255 255 / 0.62));
}

.portfolio__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--editorial);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.portfolio__cta:hover,
.portfolio__cta:focus-visible {
  color: rgb(255 194 75 / 0.95);
  /* Not colour alone: the underline is what marks it as the link. */
  border-bottom-color: currentColor;
}

.portfolio__arrow {
  transition: transform 0.2s ease;
}

.portfolio__cta:hover .portfolio__arrow {
  transform: translateX(2px);
}

/* Below the two-column threshold the row becomes a stack: icon, then text,
   then the link on its own line. The icon stays small on purpose. */
@media (max-width: 48rem) {
  .portfolio__inner {
    grid-template-columns: auto minmax(0, 1fr);
    row-gap: 1.25rem;
  }

  .portfolio__cta {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portfolio__arrow,
  .portfolio__cta {
    transition: none;
  }

  .portfolio__cta:hover .portfolio__arrow {
    transform: none;
  }
}

/* ------------------------------------------------ support contact block
 *
 * Label, then the address as the button. Nothing beside it and nothing under
 * it: the address is written once, and the button is where it lives.
 * Light Tap's own amber pill — the structure is borrowed, the styling is not.
 */
/* Heading, deliberate whitespace, then the action — read as one block rather
   than as a label with something stuck to it.

   Grid with an explicit gap, not margins: `.doc h2` carries margin-block-end
   of --space-s, and next to `.doc-cta`'s own margin the two collapsed to the
   larger of the pair, so the button sat 1rem under the heading no matter what
   the paragraph asked for. Grid children do not collapse, so the gap below is
   the only thing setting this distance. */
.doc-contact {
  display: grid;
  gap: var(--space-l);
  margin-block: clamp(2rem, 1.5rem + 1.6vw, 3rem) clamp(2.5rem, 2rem + 2vw, 3.5rem);
}

.doc-contact > * {
  margin-block: 0;
}

/* The address is longer than a normal button label. Let the pill size to it
   and, on the narrowest phones, drop the horizontal padding rather than push
   the page sideways. */
.doc-cta .btn {
  max-width: 100%;
}

@media (max-width: 24rem) {
  .doc-cta .btn {
    padding-inline: var(--space-s, 1rem);
  }
}
