/* ==========================================================================
   Base: reset, typography, layout primitives, reveal system
   ========================================================================== */

@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .38s var(--ease-in-out) both; }
::view-transition-new(root) { animation: vt-in .6s var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-12px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(18px); } }

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 88px;
  background: var(--c-ink-900);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-sans);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl, dd { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
[hidden] { display: none !important; }
::selection { background: var(--c-brand-500); color: var(--c-white); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--r-1);
}

.skip-link {
  position: fixed; left: 16px; top: -100px; z-index: 100;
  background: var(--c-paper-100); color: var(--c-ink-900);
  padding: 12px 18px; border-radius: var(--r-pill); font-weight: 600;
  transition: top var(--d-2) var(--ease-out);
}
.skip-link:focus { top: 16px; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- Sections & layout ------------------------------------------------- */
section, footer, .sec { position: relative; background: var(--bg); color: var(--fg); }
.sec { padding-block: var(--sec-y); }
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); }
.stack > * + * { margin-top: var(--stack, var(--s-5)); }
.rule { height: var(--line-w); background: var(--line); border: 0; margin: 0; }

/* ---- Typography -------------------------------------------------------- */
.t-mega, .t-xxl, .t-xl, .t-l {
  font-weight: 600;
  letter-spacing: var(--tr-tight);
  line-height: var(--lh-tight);
  text-wrap: balance;
}
.t-mega { font-size: var(--t-mega); letter-spacing: -.055em; line-height: .86; }
.t-xxl  { font-size: var(--t-xxl); }
.t-xl   { font-size: var(--t-xl); line-height: var(--lh-head); }
.t-l    { font-size: var(--t-l); line-height: 1.08; letter-spacing: var(--tr-head); }
.t-m    { font-size: var(--t-m); line-height: var(--lh-snug); letter-spacing: -.015em; font-weight: 500; }
.t-lead { font-size: var(--t-body-l); line-height: 1.55; color: var(--muted); max-width: 38em; text-wrap: pretty; }
.t-body { font-size: var(--t-body); color: var(--muted); text-wrap: pretty; }
.t-s    { font-size: var(--t-s); }
.serif  { font-family: var(--f-serif); font-weight: 400; font-style: italic; letter-spacing: -.02em; }
.mono   { font-family: var(--f-mono); font-feature-settings: "zero" 1; }
.muted  { color: var(--muted); }
.accent { color: var(--accent-text); }

.label {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  line-height: 1.4;
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex; align-items: center; gap: 10px;
}
.label--dot::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
}
.label--line::before { content: ""; width: 28px; height: 1px; background: currentColor; opacity: .6; }

.prose { max-width: 40em; }
.prose p + p { margin-top: 1em; }
.prose p, .prose li { color: var(--muted); text-wrap: pretty; }
.prose strong { color: var(--fg); font-weight: 600; }

/* ---- Icons ------------------------------------------------------------- */
.i { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.i--fill { fill: currentColor; stroke: none; }

/* ---- Reveal system ------------------------------------------------------
   Content is visible by default (no-JS, crawlers). JS adds .js to <html>,
   then [data-reveal] elements animate in when they enter the viewport.   */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition: opacity var(--d-3) var(--ease-out), transform var(--d-4) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.js [data-reveal="fade"] { transform: none; }
.js [data-reveal="scale"] { transform: scale(.94); }
/* clip: the observed wrapper stays unclipped (IntersectionObserver honours
   clip-path), its child wipes in. */
.js [data-reveal="clip"] { opacity: 1; transform: none; }
.js [data-reveal="clip"] > * {
  clip-path: inset(100% 0 0 0);
  transition: clip-path 1.2s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }
.js [data-reveal="clip"].is-in > * { clip-path: inset(0 0 0 0); }

/* Split headings: lines rise from a mask */
.split-line { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
.split-line > span { display: block; }
.js [data-split] .split-line > span {
  transform: translate3d(0, 105%, 0);
  transition: transform 1.1s var(--ease-out);
  transition-delay: calc(var(--l, 0) * 90ms + var(--delay, 0ms));
}
.js [data-split].is-in .split-line > span { transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0ms !important; }
  .js [data-reveal], .js [data-reveal="clip"] > *, .js [data-split] .split-line > span { opacity: 1 !important; transform: none !important; clip-path: none !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
