/* ==========================================================================
   Fine Kilter — page composition layer (B158 F4, 18 July 2026)
   Charter: "The constant frame, set in register" (../../art-direction/direction-charter.md)

   Grounds, grain, band rhythm, hero display type and the offset content
   grid: the page-level composition that sits ABOVE the three asset kits
   (constant-frame.css, exhibit-family.css, registration-kit.css) and BELOW
   the base geometry in site.css/components.css. Reference values carried
   verbatim from the accepted D4 proof (art-direction/d4-home-proof.html,
   Stuart: "I want it all and I want to proceed") and the F2 family
   prototype's scaffolding — no new judgement made here, only migration.

   Load order: fonts.css, tokens.css, components.css, site.css, the three
   kits, then this file last (page composition sits over asset grammar).
   ========================================================================== */

/* --- Full-bleed bands: grounds are gradated, never flat (I6) --------------
   .grain = the deep, textured band; .band-mount = the mount gradient with
   no noise overlay. Bands alternate through a page's section rhythm.
   hc themes collapse both to flat token-governed ground (I6). */
.band { position: relative; overflow: hidden; }
:root[data-theme="dark"] .band.grain { background: linear-gradient(180deg, var(--n-95) 0%, var(--n-90) 130%); }
:root[data-theme="dark"] .band.band-mount { background: linear-gradient(180deg, var(--n-90) 0%, var(--n-95) 160%); }
:root:not([data-theme]) .band.grain,
:root[data-theme="light"] .band.grain { background: linear-gradient(180deg, var(--n-10) 0%, var(--n-05) 130%); }
:root:not([data-theme]) .band.band-mount,
:root[data-theme="light"] .band.band-mount { background: linear-gradient(180deg, var(--n-05) 0%, var(--n-10) 160%); }
:root[data-theme="hc-light"] .band, :root[data-theme="hc-dark"] .band { background: var(--surface-ground); }

.grain::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .09;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="180" height="180"><filter id="g"><feTurbulence type="fractalNoise" baseFrequency="0.85" numOctaves="2" stitchTiles="stitch"/><feColorMatrix type="saturate" values="0"/></filter><rect width="180" height="180" filter="url(%23g)" opacity="0.5"/></svg>');
}
:root:not([data-theme]) .grain::after,
:root[data-theme="light"] .grain::after { opacity: .06; }
:root[data-theme="hc-light"] .grain::after,
:root[data-theme="hc-dark"] .grain::after { display: none; }

/* --- Full-bleed grounds beat boxed columns (iMPACT learning #7): bands run
   edge to edge; .wrap-inner narrows only the content riding on them. Wider
   than the shell .wrap (880px) to carry the two-column offset/rail layouts. */
.wrap-inner { max-width: 1120px; margin: 0 auto; padding: 0 var(--s-6); }

/* --- Depth: honest elevation — the exhibit/panel is the page's object,
   not a decorative card (I1). hc: borders carry everything, no shadow. */
:root[data-theme="dark"] .panel { box-shadow: inset 0 1px 0 rgba(243,245,246,.07), 0 10px 28px rgba(0,0,0,.45); }
:root:not([data-theme]) .panel,
:root[data-theme="light"] .panel { box-shadow: 0 6px 20px rgba(17,20,24,.08); }
:root[data-theme="hc-light"] .panel, :root[data-theme="hc-dark"] .panel { box-shadow: none; }

/* --- Hero: display type ~5x, tight leading, negative tracking (typographic
   role). The ghost layer itself lives in registration-kit.css (I11). */
.hero-band {
  position: relative; min-height: min(86vh, 760px);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: var(--s-7) 0 var(--s-8);
}
.hero-grid {
  position: relative; display: grid;
  grid-template-columns: minmax(0,5fr) minmax(0,6fr); gap: var(--s-7); align-items: center;
}
.disp {
  font-size: clamp(44px, 6.4vw, 82px); font-weight: 500;
  letter-spacing: -.02em; line-height: 1.02; max-width: 14ch; margin: var(--s-3) 0 0;
}
.hero-band .lede { margin: 0; }
.hero-band .actions { margin-top: var(--s-5); }

/* --- Section rhythm: density and release alternate (composition grammar) -
   padding-block only (never the shorthand): .section-band is combined with
   .wrap-inner in the markup, and the earlier shorthand's 0 horizontal value
   was overriding .wrap-inner's own side padding at the cascade's later
   position — invisible on wide viewports (the wrap-inner box is narrower
   than the viewport and centred, so the missing padding read as outer
   whitespace) but total edge-to-edge content below ~1120px, i.e. on every
   mobile viewport and mobile "request desktop site" (fixed 19 July 2026). */
.section-band { padding-block: var(--s-8); }

/* --- Offset content grid: counterweighted, corner-pinned — never a centred
   stack (composition grammar). Heading pins while its content runs long. */
.offset-grid { display: grid; grid-template-columns: minmax(0,5fr) minmax(0,6fr); gap: var(--s-7); align-items: start; }
.offset-grid > h2 { position: sticky; top: var(--s-6); }

/* --- Secondary CTA: designed outline, same geometry as primary ------------ */
.btn-outline { border: 1px solid var(--border-mount); color: var(--text-primary); background: transparent; border-radius: var(--radius-1); }
.btn-outline:hover { border-color: var(--text-primary); }
.btn-outline:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* --- Diagram containers: inline SVGs, container width >= viewBox units
   (iMPACT lesson #2); a mobile restack swaps in below the breakpoint rather
   than scaling the desktop layout illegibly small. */
.diagram-frame { max-width: 960px; margin: var(--s-5) 0 0; }
.diagram-frame svg { width: 100%; height: auto; display: block; }
.diagram-mobile { display: none; }
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  .offset-grid { grid-template-columns: 1fr; }
  .offset-grid > h2 { position: static; }
  .disp { font-size: clamp(36px, 9.5vw, 44px); }
  .diagram-desktop { display: none; }
  .diagram-mobile { display: block; max-width: 420px; }
}
