/* ==========================================================================
   page-home.css: Home only (H). Linked after site.css and assets/story/story.css (chrome.json).
   Tokens only (site.css section 1); no new colours, sizes, durations or breakpoints. Nothing here is unlayered.
   Layers as site.css orders them (reset, base, layout, components, story, line, page, utilities): sections 1 to 6 in
   components (they follow site.css, so they win at equal specificity); section 7, the rules for the elements the story
   package builds, in page (after the package's own layer, A3-X16).

   1. Hero: the index at the foot of the side column (the Projects button is gone, vision 4.1 item 1)
   2. How we work (N21, vision 5.10): theme, frame, the held height, the list without JavaScript
      [How we work story 2026\src\demo\page-home.css sections 1 to 3]
   3. Tech stack: the link line under the grid
   4. Services: the link line inside an open answer
   5. Designing Success: the lead under the display text
   6. FAQ intro (N15) and the questions under it
   7. The story's own elements [the demo's section 4]

   Sticky safety (vision 3.3 rule 14): nothing around #story may have overflow, transform, filter, contain: paint or
   content-visibility; no rule here sets any of them on .home-story or its ancestors.
   ========================================================================== */

@layer components {

  /* --- 1. Hero. Desktop: the side column holds only the "On this page" index now, at its foot, level with the foot of
     the reel. Below 68.75em the index is hidden (site.css), so the empty column goes too and adds no gap. --- */
  @media (min-width: 68.75em) { .hero__side { justify-content: flex-end; } }
  @media (max-width: 68.74em) { .hero__side { display: none; } }

  /* --- 2. How we work. Theme: the story's custom properties, from the site's tokens (vision 3.1 and 5.7). Black,
     white and the site's greys; Manrope and Geist Mono. The 3D scene reads these once, when it starts. (Custom
     properties inherit, so their layer does not matter: the package's defaults sit on :where(:root).) --- */
  .home-story {
    --story-paper: var(--surface);          /* the desk (Concept, Design) */
    --story-sheet: var(--paper);            /* the napkin and the drawing sheet */
    --story-bench: var(--surface);          /* the bench (Industrialize, Production) */
    --story-dark: var(--ink);               /* the studio (Prototype) */
    --story-ink: var(--ink);
    --story-muted: var(--ink-3);            /* phase names not current, the kicker, the note */
    --story-muted-2: var(--ink-2);          /* the map's node labels */
    --story-on-dark: var(--inv-ink);
    --story-muted-dark: var(--inv-ink-2);
    --story-line: var(--line);
    --story-rule: var(--line);
    --story-rule-dark: var(--inv-line);
    --story-accent: var(--ink);             /* the one highlighter in the picture: black on light, white on dark */
    --story-accent-dark: var(--inv-ink);
    --story-on-accent: var(--paper);
    --story-marker: var(--line);            /* the napkin's highlighter: the site's hairline grey */
    --story-font-sans: var(--font-sans);
    --story-font-mono: var(--font-mono);
    --story-phase-size: clamp(1rem, 0.76rem + 0.72vw, 1.375rem);
    --story-text-size: clamp(1rem, 0.92rem + 0.3vw, 1.1875rem);
    --story-title-size: var(--fs-h2);
    --story-small-size: var(--fs-small);
    --story-mono-size: var(--fs-mono);
    --story-mono-tracking: var(--ls-mono);
    /* the kicker (vision 5.7 and 5.10: mono 12 px, 500, --ink-3; --inv-ink-2 on the studio) */
    --story-kicker-font: var(--font-mono);
    --story-kicker-size: var(--fs-mono);
    --story-kicker-weight: 500;
    --story-kicker-color: var(--ink-3);
    --story-kicker-color-dark: var(--inv-ink-2);
    --story-gutter: var(--margin);          /* edge to edge (phones, tablets): the page's own side margin */
    --story-top: calc(var(--header-h) + var(--hair));   /* the top band starts under the sticky header */
    --story-radius: var(--radius);
    --story-ease: var(--ease-out);
  }
  /* desktop: the stage is a panel in the page column, like every picture on the site, so its own inner margin */
  @media (min-width: 68.75em) { .home-story { --story-gutter: var(--s-6); } }

  /* Frame. Desktop: the stage fills the page column. Tablet and phone: it runs edge to edge. */
  @media (max-width: 68.74em) {
    .home-story__story.story--live { margin-inline: calc(-1 * var(--margin)); }
  }

  /* Before story.js has built the story, and without JavaScript. Without JavaScript the five stops are Version 1's
     ruled list (.rows) with the map's line and link under it. With JavaScript the list is hidden from the first paint
     and its height held in exactly the package's unit (5.5 x 100svh, after a 100vh line for older browsers; 100svh
     after a reload with the story done), so nothing moves when the story is built (C11). If the story cannot load,
     page-home.js adds .is-fallback and the list returns. Under reduced motion the list stays until the package puts
     its still version in its place. */
  .home-story__steps .row__head { gap: 0.3rem; }
  .home-story__map-line { margin-top: var(--s-6); max-width: var(--measure); font-size: var(--fs-body); color: var(--ink-2); }
  .home-story__map-link { margin-top: var(--s-3); }
  .home-story__map-link a { display: inline-flex; align-items: center; gap: 0.5em; min-height: 2.75rem; font-weight: var(--w-strong); font-size: var(--fs-small); }
  @media (prefers-reduced-motion: no-preference) {
    .js .home-story__story:not(.story):not(.is-fallback) > * { display: none; }
    .js .home-story__story:not(.story):not(.is-fallback) { height: calc(var(--story-len, 5.5) * 100vh); height: calc(var(--story-len, 5.5) * 100svh); background: var(--surface); }
    .js.story-done .home-story__story:not(.story):not(.is-fallback) { height: 100vh; height: 100svh; }
  }
  @media (max-width: 68.74em) {
    .js .home-story__story:not(.story):not(.is-fallback) { margin-inline: calc(-1 * var(--margin)); }
  }

  /* --- 3. Tech stack: "Automation & Machine Building" under the grid, on the column 5 axis (.axis-5) --- */
  .expertise__more { margin-top: var(--s-7); }
  @media (max-width: 47.99em) { .expertise__more { margin-top: var(--s-5); } }

  /* --- 4. Services and FAQ answers. A link line ("Meet the team", "See Fabrication") sits close under its text, and
     a link inside a sentence carries its arrow a little apart from the words, on their baseline. --- */
  .acc__content > .acc__more { margin-top: var(--s-2); }
  .acc__content p a:not(.link) .icon { margin-left: 0.2em; vertical-align: -0.1em; }
  /* (Services 4.2, the N24 link row: its line no longer sits under the focus ring; site.css 5.17 since H-02 landed) */

  /* --- 5. Designing Success: the lead under the display text (vision 4.1 item 8: --fs-lead, --ink-2) --- */
  .pitch__lead { font-size: var(--fs-lead); line-height: 1.5; color: var(--ink-2); max-width: var(--measure); }
  .pitch > .pitch__lead { margin-top: calc(-1 * var(--s-3)); }   /* the pitch's 32 px gap less 12: lead and text read as one */

  /* --- 6. FAQ intro (N15): the slogan (the display-line size, N5) and the napkin crop, then the nine questions.
     Desktop: the slogan on cols 1-7, set on the foot of the figure, the figure on cols 9-12. Tablet: side by side, the
     figure at half width on the right. Phones: the slogan only. The figure is decorative (aria-hidden). --- */
  .faq-intro { display: grid; gap: var(--s-6) var(--gutter); align-items: end; }
  .faq-intro__slogan { margin: 0; }
  .faq-intro__fig { margin: 0; }
  @media (min-width: 68.75em) {
    .faq-intro { grid-template-columns: repeat(12, minmax(0, 1fr)); }
    .faq-intro__slogan { grid-column: 1 / span 7; }
    .faq-intro__fig { grid-column: 9 / span 4; }
  }
  @media (min-width: 48em) and (max-width: 68.74em) {
    .faq-intro { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .faq-intro__fig { grid-column: 2; }
  }
  @media (max-width: 47.99em) { .faq-intro__fig { display: none; } }
  /* the questions start on their own hairline, a block below the intro (the section's black rule is above the intro) */
  .faq-intro + .acc { margin-top: var(--block-gap); border-top: var(--hair) solid var(--line); }
}

/* --- 7. The elements the story package builds (in the page layer, after the package's own): the buttons in the
   site's type, and the still version set like a project entry: the words on columns 1 to 4, the picture (on its grey,
   as every picture here) on columns 5 to 12; on tablets and phones the words first --- */
@layer page {
  .home-story .story__btn { font: var(--w-strong) 1rem / 1.2 var(--font-sans); letter-spacing: -0.005em; }
  .home-story .story__pic img { border-radius: 0; }
  .home-story .story--static .story__map { padding-block: var(--s-7) var(--s-6); border-top-color: var(--line); }
  .home-story .story--static .story__beat { gap: var(--s-5) var(--gutter); padding-block: var(--s-7); border-top-color: var(--line); }
  /* the first stop sits on the section head's black rule, as Version 1's rows do: no second rule above it */
  .home-story .story--static .story__beat:first-child { border-top: 0; padding-top: 0; }
  .home-story .story--static .story__pic img { background: var(--surface); }
  .home-story .story--static .story__num { color: var(--ink-3); }
  .home-story .story--static .story__title { font: var(--w-strong) var(--fs-h3) / 1.25 var(--font-sans); letter-spacing: var(--ls-h3); }
  .home-story .story--static .story__text { font-size: var(--fs-body); color: var(--ink-2); }
  .home-story .story--static .story__rail { padding: var(--s-5) 0 0; border-top: var(--hair) solid var(--line); }
  .home-story .story--static .story__note { color: var(--ink-3); max-width: none; }
  @media (min-width: 68.75em) {
    .home-story .story--static .story__beat { grid-template-columns: repeat(12, minmax(0, 1fr)); }
    .home-story .story--static .story__caption { grid-column: 1 / span 4; grid-row: 1; }
    .home-story .story--static .story__pic { grid-column: 5 / span 8; grid-row: 1; }
  }
  @media (max-width: 68.74em) {
    .home-story .story--static .story__beat { grid-template-columns: minmax(0, 1fr); }
    .home-story .story--static .story__pic { grid-column: 1; grid-row: 2; }
  }
}
