/* The shared landing-page system. ONE stylesheet for every brand.
 *
 * The contract this enforces (see template/CONTRACT.md): a landing page is one
 * <slug>.html plus its imagery. It links tokens.css, this file and page.js, and
 * never has a stylesheet or script of its own. What varies per brand lives
 * entirely in the [data-theme] blocks at the bottom of this file.
 *
 * That is what makes brand #5 a copy-and-fill instead of a rebuild. The moment a
 * page needs `.slowstems-something`, the system has failed and the fix belongs
 * here as a generic class, not there as a special case.
 *
 * No inline styles anywhere, in this file's usage or in any page: style-src is
 * 'self' with no 'unsafe-inline', so a style= attribute would work locally and
 * be blocked in production.
 */

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

::selection { background: var(--accent); color: var(--ground); }

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

/* Skip link: present on every page, visible only when focused. */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--ink); color: var(--ground);
  padding: 12px 18px; font: 400 13px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase;
}
.skip:focus { left: 12px; top: 12px; }

/* ============================================================== PRIMITIVES */

.wrap {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 64px);
}

/* A full-bleed section whose ground and ink can be swapped locally. Sections
 * set --band-bg / --band-ink rather than hardcoding a colour, so a theme can
 * re-ground any band without new selectors. */
.band {
  background: var(--band-bg, transparent);
  color: var(--band-ink, inherit);
  padding-block: clamp(64px, 9vw, 132px);
}
.band--tight { padding-block: clamp(40px, 6vw, 76px); }

.stack > * + * { margin-top: var(--gap, calc(var(--u) * 3)); }

.cols-2 { display: grid; gap: clamp(28px, 4vw, 64px); grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); }
.cols-3 { display: grid; gap: clamp(24px, 3vw, 44px); grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }

.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* ============================================================== TYPOGRAPHY */

h1, h2, h3 { font-weight: 400; margin: 0; text-wrap: balance; }

/* Capped at 82px, not 104px. At 104 the hero headline wrapped four times inside
 * the ~570px hero text column and read as ragged rather than as editorial. The
 * fix belongs here rather than in one page's markup: any brand dropping a
 * headline of this length into the hero would have hit it. */
h1 {
  font-family: var(--f-display);
  font-size: clamp(42px, 6.2vw, 82px);
  line-height: 0.94;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
h2 {
  font-family: var(--f-display);
  font-size: clamp(32px, 4.6vw, 58px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  text-transform: uppercase;
}
h3 { font-size: 20px; line-height: 1.25; letter-spacing: -0.01em; }

p { margin: 0; max-width: 62ch; }
.lede { font-size: clamp(18px, 2vw, 22px); line-height: 1.5; color: var(--ink-2); }
.small { font-size: 14px; color: var(--ink-2); }

.eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0;
}

/* ================================================================= CONTROLS */

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px;
  background: var(--accent);
  color: var(--ground);
  border: 1px solid var(--accent);
  border-radius: 3px;
  font-family: var(--f-mono);
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none;
  transition: opacity var(--t-fast) var(--e-out), translate var(--t-fast) var(--e-out);
}
.btn:hover { opacity: .88; translate: 0 -1px; }

.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink-2); }

/* ================================================================ SECTIONS */

.s-hero { padding-top: clamp(96px, 12vw, 168px); }
.s-hero__grid { display: grid; gap: clamp(32px, 5vw, 72px); grid-template-columns: 1fr; align-items: center; }
@media (min-width: 900px) { .s-hero__grid { grid-template-columns: 1.05fr .95fr; } }

.s-hero__media { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--band-bg, var(--ground)); }
.s-hero__media img { width: 100%; height: 100%; object-fit: cover; }

/* Same file, different crop. A second use of the hero image costs zero extra
 * bytes because the browser has already fetched and decoded it - the only thing
 * that changes is object-position. Cheaper than a second photograph, and on a
 * one-image brand it is the difference between a page and a poster. */
.s-detail__media { aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; }
.s-detail__media img { width: 100%; height: 100%; object-fit: cover; object-position: var(--crop, center); }

.s-proof__row { display: flex; flex-wrap: wrap; gap: clamp(24px, 5vw, 72px); }
.s-proof__item { min-width: 140px; }
.s-proof__n { font-family: var(--f-display); font-size: clamp(34px, 4vw, 52px); line-height: 1; display: block; }

.s-list__item { padding-block: calc(var(--u) * 3); border-top: 1px solid var(--line); }
.s-list__item:last-child { border-bottom: 1px solid var(--line); }
.s-list__head { display: flex; align-items: baseline; gap: 16px; }
.s-list__num { font-family: var(--f-mono); font-size: 11px; letter-spacing: .16em; color: var(--ink-2); }

.s-quote blockquote { margin: 0; font-family: var(--f-display); font-size: clamp(26px, 3.6vw, 44px); line-height: 1.1; text-transform: uppercase; letter-spacing: -0.01em; }
.s-quote figcaption { margin-top: calc(var(--u) * 3); }

.s-faq details { border-top: 1px solid var(--line); padding-block: calc(var(--u) * 2.5); }
.s-faq details:last-of-type { border-bottom: 1px solid var(--line); }
.s-faq summary { cursor: pointer; list-style: none; font-size: 18px; display: flex; justify-content: space-between; gap: 16px; }
.s-faq summary::-webkit-details-marker { display: none; }
.s-faq summary::after { content: '+'; font-family: var(--f-mono); color: var(--ink-2); }
.s-faq details[open] summary::after { content: '\2212'; }
.s-faq details p { margin-top: calc(var(--u) * 1.5); color: var(--ink-2); }

.s-cta { text-align: center; }
.s-cta .wrap > * + * { margin-top: calc(var(--u) * 3); }
.s-cta p { margin-inline: auto; }

/* ============================================================== NAV/FOOTER */

.nav {
  position: absolute; inset: 0 0 auto 0; z-index: 5;
  padding-block: calc(var(--u) * 3);
}
.nav__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav__brand { font-family: var(--f-mono); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; text-decoration: none; color: inherit; }

.s-footer { padding-block: calc(var(--u) * 6); border-top: 1px solid var(--line); }
.s-footer__row { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: baseline; }

/* The honesty line. Present on EVERY landing page, in the footer, in the same
 * words. These are studio builds, not client engagements, and a visitor who
 * scrolls to the bottom of one should be told so plainly rather than having to
 * infer it. It is deliberately not apologetic: in-house work is real work. */
.s-footer__origin { font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; color: var(--ink-2); max-width: 54ch; }
.s-footer__origin a { color: inherit; }

/* ================================================================== MOTION */

/* ONE motion signature for every page, so four different brands still feel like
 * one studio made them. Only opacity and translate animate - both composited,
 * neither triggering layout. */
[data-reveal] {
  opacity: 0;
  translate: 0 14px;
  transition: opacity var(--t-slow) var(--e-out), translate var(--t-slow) var(--e-out);
}
[data-reveal].is-in { opacity: 1; translate: 0 0; }

/* Two cases must never leave content invisible:
 *   - no JS at all (the observer never runs)
 *   - reduced motion (we do not want the transition, but we do want the text)
 * Both resolve to "just show it". */
.no-js [data-reveal] { opacity: 1; translate: 0 0; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; translate: 0 0; transition: none; }
  .btn { transition: none; }
}

/* ================================================================ EMBEDDED */

/* page.js sets this when the page is loaded with ?embed=1, which is how the
 * showcase renders a card. In that state the page is a still life inside a
 * 470px frame: nothing should animate, nothing should scroll, and every reveal
 * must already be in its finished position or the card would show a column of
 * invisible sections. */
.is-embed { overflow: hidden; }
.is-embed [data-reveal] { opacity: 1; translate: 0 0; transition: none; }
.is-embed .nav { position: absolute; }

/* ================================================================== THEMES */

/* Every brand is exactly this: seven values. Ratios are computed from the hex
 * pairs, not estimated, and re-asserted against rendered pixels by verify.mjs.
 * A new brand adds one block here and touches nothing else in this file. */

[data-theme="halden"] {
  --ground: #0B0C0E;
  --ink:    #F2F4F7;   /* on ground 17.76:1 */
  --ink-2:  #98A2AE;   /* on ground  7.56:1 */
  --accent: #8FB4D9;   /* on ground  9.04:1; ground on accent 9.04:1 */
  --line:   #F2F4F726;
  --f-display: 'Anton', Impact, sans-serif;
}

[data-theme="vellum"] {
  --ground: #ECECEF;
  --ink:    #141416;   /* on ground 15.60:1 */
  --ink-2:  #54545A;   /* on ground  6.38:1 */
  --accent: #6E2439;   /* on ground  9.02:1; ground on accent 9.02:1 */
  --line:   #14141620;
  --f-display: 'Anton', Impact, sans-serif;
}

[data-theme="nobodytwice"] {
  --ground: #050505;
  --ink:    #F0E9D8;   /* on ground 16.84:1 */
  --ink-2:  #A39A88;   /* on ground  7.31:1 */
  --accent: #C89B3C;   /* on ground  7.97:1; ground on accent 7.97:1 */
  --line:   #F0E9D822;
  --f-display: 'Anton', Impact, sans-serif;
}

[data-theme="slowstems"] {
  --ground: #F3ECE3;
  --ink:    #2B241F;   /* on ground 13.03:1 */
  --ink-2:  #665C52;   /* on ground  5.57:1 */
  /* #A85F54 was the colour picked off the reference photograph and it measured
   * 4.04:1, under the 4.5 AA floor for the button label sitting on it. Darkened
   * until it cleared: 4.65:1. The dusty rose survives; the failure did not. */
  --accent: #9E5549;   /* on ground  4.65:1; ground on accent 4.65:1 */
  --line:   #2B241F22;
  --f-display: 'Anton', Impact, sans-serif;
}
