/*
 * Digital Humanist — Story homepage.
 * Loaded only on the front page when "Story homepage" is enabled
 * (Customizer → Digital Humanist Story homepage). Uses the theme tokens
 * (--bg, --text, --accent, --font-display …) defined in main.css/dh-system.css.
 */
body.dh-story {
  --stage: #EFEEF4;
  --paper: #FFFFFF;
  --glow: rgba(var(--accent-rgb), .22);
  --on-image: #F3F3F3;
  --gutter: var(--page-gutter, clamp(20px, 5vw, 80px));
  background: var(--stage);
  overflow-x: clip;
}
html[data-theme="dark"] body.dh-story {
  --stage: #0A0911;
  --paper: #13121C;
  --glow: rgba(var(--accent-rgb), .28);
}
html:has(body.dh-story) { background: var(--stage, #EFEEF4); }
.dh-story .sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* The theme footer repeats the closing line; the Close chapter already says it. */
body.dh-story .site-footer { position: relative; z-index: 2; }

/* ---- Atmosphere: glow, WebGL particle field, film grain ---------------- */
.atmos {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60vmax 60vmax at 78% 18%, var(--glow), transparent 62%),
    radial-gradient(50vmax 50vmax at 10% 90%, rgba(var(--accent-rgb), .10), transparent 60%),
    var(--stage);
  transition: background .5s var(--ease);
}
.field { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; transition: opacity .6s var(--ease); }
.grain {
  position: fixed; inset: -50%; z-index: 80; pointer-events: none; opacity: .055;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
html[data-theme="dark"] body.dh-story .grain { opacity: .08; }

/* ---- Type --------------------------------------------------------------- */
.display { font-family: var(--font-display); font-weight: 700; letter-spacing: -.055em; line-height: .92; margin: 0; }
.kicker {
  margin: 0; color: var(--accent);
  font-family: var(--font-body); font-size: 12px; font-weight: 800;
  letter-spacing: .16em; text-transform: uppercase; font-variant-numeric: tabular-nums;
}
.accent { color: var(--accent); }
.line { display: block; overflow: hidden; padding: .02em 0 .08em; margin-bottom: -.08em; }
.w { display: inline-block; white-space: nowrap; }
.c { display: inline-block; will-change: transform, opacity; }

/* ---- Chapter rail -------------------------------------------------- */
.rail {
  position: fixed; right: calc(var(--gutter) * .45); top: 50%; z-index: 55; translate: 0 -50%;
  display: grid; gap: 14px; margin: 0; padding: 0; list-style: none;
}
.rail a {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  color: var(--muted); font-family: var(--font-display); font-weight: 700; font-size: 11px; letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}
.rail a::after { content: ""; width: 14px; height: 1px; background: currentColor; transition: width .4s var(--ease); }
.rail a span { opacity: 0; translate: 6px 0; transition: opacity .3s, translate .4s var(--ease); text-transform: lowercase; }
.rail a[aria-current="step"] { color: var(--accent); }
.rail a[aria-current="step"]::after { width: 36px; }
.rail a[aria-current="step"] span, .rail a:hover span { opacity: 1; translate: 0 0; }

/* ---- Chapters ----------------------------------------------------------- */
.dh-story-main { position: relative; z-index: 1; }
.ch { position: relative; }
.stage { position: relative; min-height: 100vh; min-height: 100svh; overflow: hidden; }
.st-motion .ch { height: calc(var(--len, 100) * 1vh); }
.st-motion .stage { position: sticky; top: 0; height: 100vh; height: 100svh; }
.ch--paper { background: var(--paper); z-index: 2; transition: background-color .5s var(--ease); }

/* Image slots: real image if present, otherwise a labelled placeholder. */
.slot { position: absolute; margin: 0; overflow: hidden; background: var(--surface); }
.slot img { width: 100%; height: 100%; object-fit: cover; }
.slot.is-placeholder {
  background:
    radial-gradient(circle at 34% 30%, rgba(var(--accent-rgb), .55), transparent 52%),
    radial-gradient(circle at 72% 72%, rgba(var(--accent-rgb), .32), transparent 58%),
    linear-gradient(160deg, var(--surface), rgba(var(--accent-rgb), .12));
}
.dh-story-editor .slot.is-placeholder::after {
  content: attr(data-label);
  position: absolute; left: 18px; bottom: 16px;
  color: var(--muted-strong); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
}
.caption {
  position: absolute; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
}

/* 01 HERO --------------------------------------------------------------- */
.st-hero .slot--hero {
  right: 3vw; top: 10vh; width: min(48vw, 820px); height: 80vh;
  background: transparent;
  -webkit-mask-image: radial-gradient(ellipse 60% 62% at 58% 46%, #000 38%, transparent 74%);
  mask-image: radial-gradient(ellipse 60% 62% at 58% 46%, #000 38%, transparent 74%);
}
.st-hero .slot--hero.is-placeholder { background: radial-gradient(circle at 55% 40%, rgba(var(--accent-rgb), .5), transparent 55%); }
.hero-copy { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 13vh; z-index: 3; }
.hero-copy .kicker { margin-bottom: 18px; }
.hero-title { font-size: clamp(34px, min(11vw, 15.5vh), 200px); text-transform: uppercase; letter-spacing: -.072em; line-height: .84; }
.lede { max-width: 34ch; margin: 26px 0 0; color: var(--muted-strong); font-size: clamp(16px, 1.25vw, 20px); line-height: 1.5; }
.hero-question {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%; z-index: 3;
  width: min(92vw, 1180px); text-align: center; font-size: clamp(36px, 6.4vw, 116px);
}
.st-motion .hero-question .c { opacity: 0; transform: translateY(100%); }
.cue {
  position: absolute; left: 50%; bottom: 4vh; translate: -50% 0; z-index: 3;
  display: grid; justify-items: center; gap: 10px;
  color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase;
}
.cue i { width: 1px; height: 46px; background: linear-gradient(var(--text), transparent); animation: cue 2.2s var(--ease) infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }
.fig-hero { right: var(--gutter); bottom: 4.5vh; z-index: 3; }

/* Opening: the title rises out of its masks once. */
.st-motion:not(.st-ready) .hero-title .w { transform: translateY(105%); }
.st-ready .hero-title .w { animation: rise 1.4s var(--ease) both; animation-delay: calc(var(--wi, 0) * 90ms + 150ms); }
@keyframes rise { from { transform: translateY(105%); } to { transform: none; } }

/* 02 THESIS ------------------------------------------------------------- */
.thesis-index { position: absolute; left: var(--gutter); top: calc(var(--header-h) + 5vh); z-index: 2; display: flex; align-items: center; gap: 16px; }
.thesis-index .num { font-family: var(--font-display); font-weight: 800; font-size: 14px; color: var(--accent); }
.thesis-index .rule { width: 140px; height: 1px; background: var(--text); transform-origin: left; transform: scaleX(var(--p, 1)); }
.thesis-index .lbl { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.thesis-text {
  position: absolute; z-index: 2; left: var(--gutter); top: calc(var(--header-h) + 13vh);
  width: min(100% - 2 * var(--gutter), 1320px);
  font-size: clamp(38px, min(6.8vw, 11vh), 128px); font-weight: 700; letter-spacing: -.06em; line-height: .95;
}
.thesis-text .t2 { display: block; margin-top: .22em; }
.wd { display: inline-block; will-change: transform, opacity; }
.st-motion .thesis-text .wd { opacity: .1; }
.thesis-foot { position: absolute; z-index: 2; left: var(--gutter); right: var(--gutter); bottom: 9vh; display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; }
.thesis-body {
  max-width: 380px; margin: 0;
  color: var(--muted-strong); font-size: 16px; line-height: 1.6;
}
.thesis-body strong { color: var(--accent); }
.thesis .slot--land {
  left: 0; right: 0; bottom: 0; height: 44vh; z-index: 1; background: transparent;
  -webkit-mask-image: linear-gradient(to top, #000 25%, transparent 95%); mask-image: linear-gradient(to top, #000 25%, transparent 95%);
}
.thesis .slot--land img { height: 120%; }

/* 03 TENSION — the bust (particles) between two solid words -------------- */
.tw { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.tw-word {
  --melt: 0;
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(30px, 4.6vw, 84px); letter-spacing: -.055em; line-height: .9; white-space: nowrap;
  color: color-mix(in srgb, var(--accent) calc(var(--melt) * 100%), var(--text));
  text-shadow: 0 0 calc(var(--melt) * 60px) rgba(var(--accent-rgb), calc(var(--melt) * .9));
  will-change: transform, opacity, filter;
}
.tw-machine { transform: translate(-50%, -50%) translateX(-31vw); }
.tw-human { transform: translate(-50%, -50%) translateX(31vw); }
.st-motion .tw-word { opacity: 0; }
/* The light the two words turn into. */
.tw-light {
  position: absolute; left: 50%; top: 50%; z-index: 2; width: 70vmin; height: 70vmin;
  border-radius: 50%; pointer-events: none; opacity: 0; transform: translate(-50%, -50%) scale(.3);
  background: radial-gradient(circle, rgba(255, 255, 255, .95) 0%, rgba(var(--accent-rgb), .85) 22%, rgba(var(--accent-rgb), .35) 48%, rgba(var(--accent-rgb), 0) 72%);
  filter: blur(8px);
  will-change: transform, opacity;
}
html[data-theme="dark"] .tw-light { background: radial-gradient(circle, rgba(255, 255, 255, .9) 0%, rgba(190, 180, 255, .8) 20%, rgba(var(--accent-rgb), .4) 46%, rgba(var(--accent-rgb), 0) 72%); }
.tension-final {
  position: absolute; z-index: 4; left: 50%; top: 50%; translate: -50% -50%;
  width: min(90vw, 1060px); text-align: center; font-size: clamp(30px, 4.4vw, 76px);
}
.st-motion .tension-final .c { opacity: 0; transform: translateY(100%); }

/* 05 FUTURE — a human-driven future in AI ---------------------------------- */
.pr-head {
  position: absolute; z-index: 3; left: var(--gutter); right: var(--gutter); top: calc(var(--header-h) + 4vh + 34px);
  display: flex; justify-content: flex-start; align-items: flex-start;
}
.pr-title { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(18px, 1.6vw, 26px); line-height: 1.1; letter-spacing: -.035em; color: var(--accent); }
.pr-list { margin: 0; padding: 0; list-style: none; }
.pr {
  position: relative; z-index: 2; display: grid; grid-template-columns: 1fr; align-content: center; gap: 0; max-width: 1180px;
  padding: 14vh var(--gutter);
}
.pr-num { display: flex; align-items: center; gap: 14px; margin-bottom: 3vh; font-family: var(--font-display); font-weight: 700; font-size: clamp(15px, 1.2vw, 19px); letter-spacing: .02em; color: var(--accent); font-variant-numeric: tabular-nums; }
.pr-num::after { content: ""; width: 56px; height: 1px; background: currentColor; }
.pr-name { font-size: clamp(40px, min(7vw, 12vh), 128px); margin-bottom: .3em; }
.pr p { max-width: 38ch; margin: 0; color: var(--muted-strong); font-size: clamp(17px, 1.4vw, 22px); line-height: 1.5; }
.st-motion .pr { position: absolute; inset: calc(var(--header-h) + 10vh) var(--gutter) 13vh; padding: 0; }
.st-motion .pr > * { opacity: 0; transform: translateY(9vh); transition: opacity .7s var(--ease), transform 1s var(--ease); }
.st-motion .pr.is-past > * { transform: translateY(-9vh); }
.st-motion .pr.is-active > * { opacity: 1; transform: none; }
.st-motion .pr.is-active > :nth-child(2) { transition-delay: .08s; }
.pr-body { display: grid; }
.pr-rail { position: absolute; z-index: 3; left: var(--gutter); bottom: 6vh; display: flex; gap: 8px; }
.pr-rail i { width: 52px; height: 2px; background: var(--line); transition: background-color .4s; }
.pr-rail i.is-on { background: var(--accent); }
html:not(.st-motion) .pr-rail { display: none; }
/* Optional background images: one per statement, cross-fading, with a scrim for legibility. */
.pr-bgs { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.pr-bg {
  position: absolute; inset: -4%; background-size: cover; background-position: center;
  opacity: 0; transform: scale(1.06); transition: opacity 1.2s var(--ease), transform 6s linear;
}
.pr-bg.is-active { opacity: 1; transform: scale(1); }
.pr-bgs::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8, 7, 14, .78) 0%, rgba(8, 7, 14, .45) 55%, rgba(8, 7, 14, .2) 100%); }
.future.has-bgs { color: #F3F3F3; }
.future.has-bgs .pr p { color: rgba(243, 243, 243, .82); }
.future.has-bgs .pr-title, .future.has-bgs .pr-num { color: #CFC8FF; }
.future.has-bgs .pr-rail i { background: rgba(243, 243, 243, .25); }
.future.has-bgs .pr-rail i.is-on { background: #CFC8FF; }
.future.has-bgs .stage { background: #0C0B14; }

/* 04 WRITING — the latest articles, horizontal ----------------------------- */
.wr-track { display: flex; align-items: center; gap: clamp(28px, 3vw, 56px); padding: calc(var(--header-h) + 8vh) var(--gutter) 8vh; overflow-x: auto; }
.st-motion .wr-track { position: absolute; left: 0; top: 0; bottom: 0; padding-block: calc(var(--header-h) + 4vh) 6vh; overflow: visible; will-change: transform; }
.wr-card { flex: 0 0 clamp(220px, 19vw, 320px); align-self: center; }
.wr-card__link { display: block; color: inherit; }
.wr-card__media {
  position: relative; width: 100%; aspect-ratio: 4 / 5; margin: 0;
  border-radius: clamp(14px, 1.4vw, 22px); overflow: hidden; background: var(--surface);
  box-shadow: 0 18px 50px rgba(8, 7, 14, .10);
}
/* two semi-vertical cards, offset like a contact sheet */
.wr-card--down { margin-top: 22vh; }
.wr-card--up { margin-bottom: 18vh; }
/* the big one: image card with the copy laid over it */
.wr-card--cover { flex-basis: min(60vw, 980px); }
.wr-card--cover .wr-card__link { position: relative; height: min(64vh, 640px); border-radius: clamp(18px, 1.8vw, 28px); overflow: hidden; color: #F3F3F3; box-shadow: 0 24px 70px rgba(8, 7, 14, .16); }
.wr-card--cover .wr-card__media { position: absolute; inset: 0; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
.wr-card--cover .wr-card__link::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(to top, rgba(8, 7, 14, .86), rgba(8, 7, 14, .18) 58%, rgba(8, 7, 14, 0)); pointer-events: none; }
.wr-card--cover .wr-card__body { position: absolute; z-index: 2; left: 5%; right: 26%; bottom: 7%; padding: 0; }
.wr-card--cover .wr-card__meta { color: #CFC9F3; }
.wr-card--cover .wr-card__title { font-size: clamp(28px, 3.4vw, 58px); line-height: 1; letter-spacing: -.045em; -webkit-line-clamp: 3; }
.wr-card--cover .wr-card__excerpt { color: rgba(243, 243, 243, .8); font-size: 16px; }
.wr-card--cover .wr-card__read { color: #fff; }
.wr-card--cover .wr-card__link:hover .wr-card__title { color: #CFC8FF; }
.wr-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
.wr-card__link:hover .wr-card__media img, .wr-card__link:focus-visible .wr-card__media img { transform: scale(1.04); }
.wr-card__body { padding: 18px 2px 0; }
.wr-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 10px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.wr-card__flag { padding: 3px 9px; border-radius: 999px; background: var(--accent); color: #fff; letter-spacing: .08em; }
.wr-card__title {
  margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(19px, 1.5vw, 25px);
  line-height: 1.12; letter-spacing: -.035em;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.wr-card__excerpt { margin: 12px 0 0; max-width: 46ch; color: var(--muted-strong); font-size: 15px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wr-card__read { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; color: var(--accent); font-family: var(--font-display); font-weight: 700; font-size: 14px; }
.wr-card__link:hover .wr-card__title { color: var(--accent); }
.wr-card__link:hover .wr-card__read span { transform: translateX(4px); }
.wr-card__read span { transition: transform .35s var(--ease); }
.wr-end { flex: 0 0 auto; align-self: center; margin-right: var(--gutter); padding: 16px 26px; border: 1px solid var(--line); border-radius: 999px; font-size: clamp(18px, 1.6vw, 24px); letter-spacing: -.03em; white-space: nowrap; }
.wr-end:hover, .wr-end:focus-visible { color: #fff !important; background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 6px rgba(var(--accent-rgb), .16), 0 12px 40px rgba(var(--accent-rgb), .45); }

/* 02 THESIS — small line bottom-left (replaces the landscape image) */
.thesis-note {
  max-width: 30ch; margin: 0;
  font-family: var(--font-display); font-weight: 600; font-size: clamp(16px, 1.3vw, 20px); line-height: 1.25; letter-spacing: -.02em; color: var(--accent);
}

/* 06 CLOSE -------------------------------------------------------------- */
.close-title { position: absolute; z-index: 3; left: var(--gutter); bottom: 26vh; font-size: clamp(34px, min(10.6vw, 18vh), 196px); text-transform: uppercase; letter-spacing: -.072em; line-height: .84; }
.st-motion .close-title .c { transform: translateY(105%); }
.close-side { position: absolute; z-index: 3; right: var(--gutter); bottom: 7vh; max-width: 380px; }
.close-side p { margin: 0 0 22px; color: var(--muted-strong); font-size: 17px; line-height: 1.5; }
.close-side .row { display: flex; flex-wrap: wrap; gap: 8px; }
.st-motion .close-side { opacity: 0; }
.ftr {
  position: relative; z-index: 2; display: grid; grid-template-columns: 1fr auto auto; gap: 28px; align-items: center;
  padding: 28px var(--gutter); border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px; font-weight: 600;
}
.ftr nav { display: flex; gap: 20px; }
.ftr a:hover { color: var(--accent); }

/* ---- Small screens ---------------------------------------------------- */
@media (max-width: 760px) {
  .rail { display: none; }
  .st-hero .slot--hero { right: -20vw; top: 8vh; width: 110vw; height: 62vh; }
  /* the lede sits well clear of the scroll cue */
  .st-hero .hero-copy { bottom: calc(4vh + 96px); }
  .cue { bottom: 3vh; gap: 8px; }
  .cue i { height: 34px; }
  .thesis-foot { flex-direction: column; align-items: stretch; gap: 14px; bottom: 7vh; }
  .thesis-body { max-width: none; }
  .tw-word { font-size: clamp(24px, 8vw, 40px); }
  .thesis-note { max-width: none; }
  .st-motion .pr { grid-template-columns: 1fr; align-content: center; gap: 2vh; }
  .pr { grid-template-columns: 1fr; }
  .pr-title { display: none; }
  .wr-card { flex-basis: 64vw; }
  .wr-card--down, .wr-card--up { margin: 0; }
  .wr-card__media { max-height: 46vh; }
  .wr-card--cover { flex-basis: 86vw; }
  .wr-card--cover .wr-card__link { height: 62vh; }
  .wr-card--cover .wr-card__media { max-height: none; }
  .wr-card--cover .wr-card__body { right: 6%; }
  .pr-title { display: block; }
  .close-title { bottom: 34vh; }
  .close-side { left: var(--gutter); right: var(--gutter); bottom: 8vh; max-width: none; }
  .ftr { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .cue i { animation: none; }
}


/* =========================================================================
 * Refinement pass — editorial details, cinematic overlaps, intro, cursor.
 * ====================================================================== */

/* ---- Masthead strip (hero) --------------------------------------------- */
.masthead {
  position: absolute; z-index: 3; left: var(--gutter); right: var(--gutter); top: calc(var(--header-h) + 1.5vh);
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 24px; padding: 11px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
}
.masthead span:nth-child(2) { text-align: center; color: var(--text); }
.masthead span:last-child { text-align: right; }
.st-hero .hero-copy .kicker { display: inline-flex; align-items: center; gap: 12px; }
.st-hero .hero-copy .kicker::before { content: ""; width: 34px; height: 1px; background: currentColor; }

/* ---- Paper chapters: magazine page details ----------------------------- */
.folio {
  position: absolute; z-index: 3; left: var(--gutter); right: var(--gutter); bottom: 2.4vh;
  display: flex; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; font-variant-numeric: tabular-nums;
}
.principles .pr-rail { bottom: calc(2.4vh + 34px); }

/* ---- Cinematic overlaps: paper pages slide over the pinned dark scenes -- */
.st-motion .ch--paper {
  margin-top: -100vh;
  border-radius: clamp(24px, 3vw, 44px) clamp(24px, 3vw, 44px) 0 0;
  overflow: clip;
  box-shadow: 0 -40px 120px rgba(8, 7, 14, .22);
}
.st-motion .has-cover > .stage {
  transform-origin: 50% 0;
  transform: scale(calc(1 - var(--cover, 0) * .08)) translateY(calc(var(--cover, 0) * -3vh));
  opacity: calc(1 - var(--cover, 0) * .6);
  filter: blur(calc(var(--cover, 0) * 4px));
}

/* ---- Living placeholders until the real images arrive ------------------- */
.slot.is-placeholder { background-size: 170% 170%; animation: st-drift 16s ease-in-out infinite alternate; }
@keyframes st-drift { from { background-position: 0% 0%; } to { background-position: 100% 100%; } }

/* ---- Opening intro (once per session) ---------------------------------- */
.st-loader { display: none; }
.st-motion:not(.st-seen) .st-loader {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background: var(--stage); color: var(--text);
  clip-path: inset(0 0 0 0); transition: clip-path 1.1s var(--ease);
}
.st-loader.is-done { clip-path: inset(0 0 100% 0) !important; }
.st-loader__mark { font-family: var(--font-display); font-weight: 800; font-size: clamp(90px, 16vw, 260px); letter-spacing: -.09em; line-height: .8; }
.st-loader__count { position: absolute; right: var(--gutter); bottom: 5vh; font-family: var(--font-display); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--muted); }
.st-loader__line { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--line); }
.st-loader__line i { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }

/* ---- Cursor + magnetic buttons (mouse only) ---------------------------- */
/* cursor styles now live in dh-system.css (shared by every page) */
.dh-story-main .pill, .dh-story-main .round { transition: transform .45s var(--ease), background-color .25s, color .25s, border-color .25s; }

@media (max-width: 760px) {
  .masthead { grid-template-columns: 1fr 1fr; }
  .masthead span:nth-child(2) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .slot.is-placeholder { animation: none; }
}

/* Light mode: a soft paper-white halo behind the hero description, so it reads over the particle wave. */
.st-hero .lede { position: relative; isolation: isolate; }
.st-hero .lede::before {
  content: ""; position: absolute; z-index: -1; inset: -48px -90px -52px -70px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(var(--bg-rgb, 243, 243, 243), 1) 0%, rgba(var(--bg-rgb, 243, 243, 243), .97) 62%, rgba(var(--bg-rgb, 243, 243, 243), 0) 100%);
  filter: blur(10px);
}
html[data-theme="dark"] .st-hero .lede::before { display: none; }
