/* Smile4U v8 · base: reset, layout helpers, type roles, the primary button, the three motion primitives' start states,
   the night layer. Tokens only (tokens.css). Block CSS lives in css/blocks/NN-name.css and never edits this file. */

/* ---- reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  overflow-x: clip;                       /* not hidden: a second scroller eats the first swipe (studio lesson) */
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-weight: var(--fw-display);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-synthesis: none;                   /* no faux bold or italic */
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, p, ol, ul, dl, dd, figure, blockquote { margin: 0; padding: 0; }
ol, ul { list-style: none; }
h1, h2, h3, h4, h5 { font-weight: inherit; font-size: inherit; }
em, i { font-style: normal; }           /* no italic emphasis anywhere (kill list) */
img, picture, video, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue-deep); outline-offset: 2px; }
p, li, dd, dt, h1, h2, h3, h4, h5, a, span { overflow-wrap: break-word; min-width: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }

/* ---- skip link ---- */
.skip { position: fixed; left: 16px; top: -100px; z-index: 100; padding: 12px 16px; background: var(--paper); border-radius: var(--r-md); font-size: var(--fs-ui); }
.skip:focus { top: 16px; }

/* ---- layout: the 1200 container with 40 px sides (P 24), and its 12 columns, gutter 24 ---- */
.wrap { width: 100%; max-width: calc(var(--container) + 2 * var(--side)); margin-inline: auto; padding-inline: var(--side); }
.g12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-grid); }
.blk { padding-block: var(--sec-pad); scroll-margin-top: calc(var(--nav-bottom) + 16px); }
:root { --logo-w: 176px; --nav-h: 80px; --nav-top: 8px; --nav-bottom: calc(var(--nav-top) + var(--nav-h)); --bar-h: 0px; }   /* header: LOCKED V19 */
@media (max-width: 809.98px) { :root { --logo-w: 144px; --nav-h: 68px; --bar-h: 64px; } }

/* ---- type roles (sizes from tokens; blocks pick a role, never a raw size) ---- */
.t-wordmark { font-size: var(--fs-wordmark); line-height: var(--lh-wordmark); letter-spacing: var(--ls-wordmark); font-weight: var(--fw-closing); }
.t-h1 { font-size: var(--fs-h1); line-height: var(--lh-h1); letter-spacing: var(--ls-h1); }
.t-band { font-size: var(--fs-band); line-height: var(--lh-band); letter-spacing: var(--ls-band); }
.t-h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); letter-spacing: var(--ls-h2); }
.t-statement { font-size: var(--fs-statement); line-height: var(--lh-statement); letter-spacing: var(--ls-statement); font-weight: var(--fw-statement); }
.t-h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); letter-spacing: var(--ls-h3); }
.t-h4 { font-size: var(--fs-h4); line-height: var(--lh-h4); letter-spacing: var(--ls-h4); }
.t-figure { font-size: var(--fs-figure); line-height: var(--lh-figure); letter-spacing: var(--ls-figure); font-variant-numeric: tabular-nums; }
.t-h5 { font-size: var(--fs-h5); line-height: var(--lh-h5); letter-spacing: var(--ls-h5); }
.t-quote { font-size: var(--fs-quote); line-height: var(--lh-quote); letter-spacing: var(--ls-quote); }
.t-body { font-size: var(--fs-body); line-height: var(--lh-body); color: var(--ink-75); }
.t-ui { font-size: var(--fs-ui); line-height: var(--lh-ui); }
.t-meta { font-size: var(--fs-ui); line-height: var(--lh-ui); color: var(--ink-64); }

/* ---- primary button (V8-SYSTEM §5): ink pill r16, label 18/27 paper, a 56 px lime block holds the arrow.
   Hover: the lime block fills across the button and the label swaps sides (makro effect 15). ---- */
.btn {
  --bh: 56px;
  position: relative; isolation: isolate; display: inline-flex; align-items: center; min-height: var(--bh);
  padding: 0 calc(var(--bh) + 24px) 0 24px; border-radius: var(--r-md); color: var(--paper);
  /* the ink stops 3 px inside the lime block (which starts 1 px late, see ::before): no ink under its rounded edge, so no dark fringe on the right */
  background: linear-gradient(to right, var(--ink) calc(100% - var(--bh) + 3px), transparent 0);
  font-size: var(--fs-body); line-height: 1.5; text-decoration: none; white-space: nowrap; overflow: hidden;
}
.btn::before {             /* the lime fill: clipped to the arrow block at rest, the whole button on hover */
  content: ""; position: absolute; inset: -1px; z-index: -1; background: var(--lime);   /* 1 px past the edge, trimmed by the pill: no hairline of ink at the rounded corners */
  clip-path: inset(0 0 0 calc(100% - var(--bh)) round 0 var(--r-md) var(--r-md) 0);   /* square where it meets the ink */
  transition: clip-path .45s var(--spring-enter);
}
.btn-label { transition: transform .45s var(--spring-enter), color .2s var(--ease-ui); }
.btn-arrow {
  position: absolute; top: 0; right: 0; width: var(--bh); height: 100%; display: grid; place-items: center; color: var(--ink);
  transition: right .45s var(--spring-enter);
}
.btn-arrow svg { width: 20px; height: 20px; }
@media (hover: hover) {
  .btn:hover::before { clip-path: inset(0 0 0 0 round var(--r-md)); }
  .btn:hover .btn-label { transform: translateX(var(--bh)); color: var(--ink); }
  .btn:hover .btn-arrow { right: calc(100% - var(--bh)); }
}
.btn:focus-visible { outline-offset: 3px; }
.btn--sm { --bh: 40px; font-size: var(--fs-ui); padding: 0 calc(var(--bh) + 16px) 0 16px; border-radius: 12px; }
.btn--sm::before { clip-path: inset(0 0 0 calc(100% - var(--bh)) round 0 12px 12px 0); }
.btn--sm .btn-arrow svg { width: 16px; height: 16px; }
@media (hover: hover) { .btn--sm:hover::before { clip-path: inset(0 0 0 0 round 12px); } }

/* the text link of a pair (call link next to the button) */
.link { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--fs-body); color: var(--ink); text-decoration: underline; text-decoration-color: var(--ink-64); }
.link:hover { text-decoration-color: var(--ink); }

/* ---- motion primitive start states (js/core/rise.js, words.js). Only under html.motion (set by main.js), so a page
   whose JS never booted shows everything. Reduced motion: html.rm, no start states at all. ---- */
html.motion:not(.rm) [data-rise] { opacity: 0; transform: translate3d(0, var(--ry, var(--enter-y1)), 0) skewY(var(--rskew, 0deg)); }
html.motion:not(.rm) [data-rise].is-in {
  opacity: 1; transform: none;
  transition: transform var(--rdur, var(--dur-enter)) var(--spring-enter) var(--rdelay, 0s), opacity var(--rdur, var(--dur-enter)) var(--ease-ui) var(--rdelay, 0s);
}
html.motion:not(.rm) .words.is-split .w { display: inline-block; opacity: .001; transform: translate3d(0, var(--words-y), 0); }
html.motion:not(.rm) .words.is-split.is-in .w {
  opacity: 1; transform: none;
  transition: transform var(--words-dur) var(--spring-words) calc(var(--wi) * var(--words-stagger)), opacity var(--words-dur) var(--ease-ui) calc(var(--wi) * var(--words-stagger));
}
/* a word span is an inline-block: it must not inherit the paragraph's text-indent (a hanging quote mark would shrink
   every word by the indent and change the wrap), nor its own wrapping */
.words .w { text-indent: 0; white-space: nowrap; }
html.motion:not(.rm) .words.is-measuring .w { transform: none !important; transition: none !important; }   /* words.js measures here */
html.motion:not(.rm) .words.is-whole { opacity: 0; transform: translate3d(0, var(--words-y), 0); }
html.motion:not(.rm) .words.is-whole.is-in { opacity: 1; transform: none; transition: transform var(--words-dur) var(--spring-words), opacity var(--words-dur) var(--ease-ui); }
/* fill (words.fill, M2): colour only, the words stay inline. Word i: ink 28 % → ink over a window of 3 words at the
   window position --fp (JS, scroll-linked); fully filled, JS removes .is-filling and the words inherit the ink */
html.motion:not(.rm) .fill.is-fsplit.is-filling .w { color: color-mix(in srgb, currentColor calc(28% + 72% * clamp(0, (var(--fp, 0) - var(--wi, 0)) / 3, 1)), transparent); }
/* wipe (rise.js, M3 „Schnitt"): the picture is cut in by a hard vertical edge that travels toward its outer edge
   (data-wipe="r": left → right; "l": right → left) while the image settles from 1.06; resets when it leaves below.
   Open = clip-path none (.is-open after the transition) */
html.motion:not(.rm) [data-wipe] { clip-path: inset(0 100% 0 0); }
html.motion:not(.rm) [data-wipe="l"] { clip-path: inset(0 0 0 100%); }
html.motion:not(.rm) [data-wipe] > * { scale: 1.06; }
html.motion:not(.rm) [data-wipe].is-wiped { clip-path: inset(0); transition: clip-path .7s cubic-bezier(.2, .7, .1, 1); }
html.motion:not(.rm) [data-wipe].is-wiped > * { scale: 1; transition: scale .7s cubic-bezier(.2, .7, .1, 1); }
html.motion:not(.rm) [data-wipe].is-wiped.is-open { clip-path: none; }

/* ---- the theme flip (R5): one fixed night layer under all content; blocks in the stretch have transparent grounds ---- */
.night-layer { position: fixed; inset: 0; z-index: -1; background: var(--band); opacity: 0; pointer-events: none; }

/* ---- Lenis ---- */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---- 3D posters: where the live canvas will run (head.js: html[data-t3d-pre="live"]) no poster is laid out, so no
   lazy poster downloads; they return on a fallback (three.js: data-t3d="poster") or a slow host (data-slow) ---- */
html[data-t3d-pre="live"]:not([data-t3d="poster"]) :not([data-slow]) > .t3d-post picture { display: none; }
