/* =================================================================
   yannickkurz.ch — stylesheet
   Sections:
     1. Reset            7. Sections & eyebrow
     2. Tokens           8. Board index (subgrid + container query)
     3. Base type        9. Specimen
     4. Utilities       10. Collapse (interpolate-size)
     5. Top bar         11. Page header (subpages)
     6. Footer          12. Tools grid
                        13. Empty state
                        14. About page
                        15. Motion
   ================================================================= */

/* ---- 1. reset (css-best-practices §1, §2) -------------------- */
*, *::before, *::after { box-sizing: border-box; }
h1, h2, h3, h4, body, p, figure, ul, li, dl, dd { margin: 0; padding: 0; }
ul { list-style: none; }

/* ---- 2. design tokens (§8 custom properties, §9 clamp) ------- */
:root {
  --paper:      #E5DBC9;  /* beige  — background            */
  --ink:        #1E1A16;  /* warm near-black — primary text */
  --brown:      #80512E;  /* raw umber — accent             */
  --brown-deep: #432B1A;  /* deep brown — secondary text    */
  --bone:       #F5F0E6;  /* warm white — surfaces          */
  --hot:        #D4535A;  /* coral red — hover / interaction */

  --mono: "Space Mono", ui-monospace, monospace;
  --disp: "Bricolage Grotesque", system-ui, sans-serif;

  /* fluid type scale — change --display to resize every big title */
  --step--1: clamp(0.78rem, 0.74rem + 0.18vw, 0.9rem);
  --step-0:  clamp(1rem,    0.94rem + 0.3vw,  1.2rem);
  --step-1:  clamp(1.4rem,  1.2rem  + 1vw,    2rem);
  --step-2:  clamp(2rem,    1.5rem  + 2.4vw,  3.4rem);
  --display: clamp(3.6rem, -0.5rem + 19vw,   17rem);

  --gutter: clamp(1.25rem, 0.8rem + 2.4vw, 3.5rem);
  --bar-gap: 1.5rem;
  --rule:   color-mix(in srgb, var(--ink) 16%, transparent);

  interpolate-size: allow-keywords;            /* §16 */
}

/* ---- 3. base type ------------------------------------------- */
body {
  cursor: crosshair;
  min-height: 100dvh;                           /* §3 */
  background: var(--paper);
  color: var(--ink);
  font-family: var(--disp);
  font-size: var(--step-0);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
p, li, figcaption {                             /* §5 readability */
  text-wrap: pretty;
  max-width: 65ch;
  line-height: 1.5;
}
h1, h2, h3 { text-wrap: balance; }              /* §4 */
a { color: inherit; }

/* ---- shared kinetic title (every big title, one treatment) -- */
.title {
  font-size: var(--display);
  line-height: 0.82;
  letter-spacing: -0.03em;
  cursor: crosshair;
}
.title .row { display: block; white-space: nowrap; }
.ltr {
  display: inline-block;
  font-variation-settings: 'wght' 300, 'opsz' 96;
  will-change: font-variation-settings, transform;
}

/* ---- 4. utilities ------------------------------------------- */
.screen-reader-only {                           /* §15 */
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; margin: -1px; clip: rect(0,0,0,0); white-space: nowrap;
}
.skip-link {
  position: absolute; inset: 0 auto auto 0;     /* §14 inset */
  z-index: 50; background: var(--ink); color: var(--paper);
  padding: 0.6em 1em; font-family: var(--mono); font-size: var(--step--1);
  transform: translateY(-120%); transition: transform .2s ease;
}
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 2px solid var(--brown); outline-offset: 3px; }

.progress {                                     /* §18 scroll-driven */
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 40;
  background: var(--brown); transform-origin: 0 50%; transform: scaleX(0);
}
@supports (animation-timeline: scroll()) {
  .progress { animation: grow linear both; animation-timeline: scroll(root block); }
  @keyframes grow { to { transform: scaleX(1); } }
}

/* ---- 5. top bar (grid: edges pinned, nav truly centered) ---- */
.bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--bar-gap);
  padding: 1.25rem var(--gutter);
  font-family: var(--mono); font-size: var(--step--1);
}
.bar .mark {
  justify-self: start; display: block;
  width: 42px; height: 28px;
  background: url("../media/logo.svg") left center / contain no-repeat;
  text-indent: -9999px; overflow: hidden;   /* "yk." bleibt im DOM für a11y */
}
.bar nav {
  justify-self: center;
  display: flex; flex-wrap: wrap; justify-content: center; gap: var(--bar-gap);
}
.bar nav a { text-decoration: none; opacity: 0.55; transition: opacity .2s, color .2s; }
.bar nav a:hover { opacity: 1; color: var(--hot); }
.bar nav a[aria-current="page"] { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.bar .status { justify-self: end; display: inline-flex; align-items: center; gap: 0.5ch; opacity: 0.7; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brown); }

@media (max-width: 640px) {
  .bar { grid-template-columns: 1fr; justify-items: center; row-gap: 0.85rem; text-align: center; }
  .bar .mark, .bar .status { justify-self: center; }
}

/* ---- 6. footer (grid: edges pinned, middle centered) -------- */
.foot {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--bar-gap);
  padding: 2.5rem var(--gutter) 3.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono); font-size: var(--step--1); color: var(--brown-deep);
}
.foot > :first-child { justify-self: start; }
.foot > :nth-child(2) { justify-self: center; text-align: center; }
.foot > :last-child { justify-self: end; }
.foot span { opacity: 0.8; }

@media (max-width: 640px) {
  .foot { grid-template-columns: 1fr; row-gap: 0.6rem; text-align: center; }
  .foot > :first-child, .foot > :nth-child(2), .foot > :last-child { justify-self: center; }
}

/* ---- 7. sections & eyebrow ---------------------------------- */
.section { padding: clamp(3rem, 9vh, 8rem) var(--gutter); border-top: 1px solid var(--rule); }
.eyebrow {
  font-family: var(--mono); font-size: var(--step--1); letter-spacing: 0.06em;
  color: var(--brown); margin-bottom: 2.5rem;
  display: flex; align-items: baseline; gap: 1ch;
}
.eyebrow::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

/* ---- hero (home) -------------------------------------------- */
.hero {
  display: grid; place-items: center start;     /* §13 */
  padding: clamp(2rem, 6vh, 7rem) var(--gutter) clamp(3rem, 8vh, 8rem);
  min-height: 78dvh;
}
.tagline {
  font-family: var(--mono); font-size: var(--step-0);
  margin-top: 1.5rem; color: var(--brown-deep); max-width: 40ch;
}
.hint {
  font-family: var(--mono); font-size: var(--step--1); margin-top: 1.5rem;
  opacity: 0.55; transition: opacity .6s ease;
  display: inline-flex; align-items: center; gap: 0.6ch;
}
.hint.gone { opacity: 0; }
.hint .arrow { font-size: 1.2em; }

/* ---- 8. board index (§11 subgrid, §7 container queries) ----- */
.index {
  display: grid;
  grid-template-columns:
    [name] minmax(0, 1.1fr) [desc] minmax(0, 1.4fr) [stat] max-content;
}
.row-item {
  display: grid; grid-template-columns: subgrid; grid-column: 1 / -1;
  align-items: baseline; gap: 1.5rem; padding: 1.4rem 0;
  border-bottom: 1px solid var(--rule); container-type: inline-size;
  text-decoration: none;
}
.row-item .label {
  font-size: var(--step-2); line-height: 1; font-variation-settings: 'wght' 600, 'opsz' 48;
  transition: color .2s ease, font-variation-settings .2s ease;
}
.row-item .desc {
  font-family: var(--mono); font-size: var(--step--1); color: var(--brown-deep); opacity: 0.8;
  transition: color .2s ease, font-weight .2s ease;
}
.row-item .stat {
  font-family: var(--mono); font-size: var(--step--1); justify-self: end; white-space: nowrap;
  padding: 0.25em 0.75em; border: 1px solid currentColor; border-radius: 99px;   /* §17 currentColor */
}
.stat.live { color: var(--brown); }
.stat.soon { color: color-mix(in srgb, var(--ink) 45%, transparent); }

/* hover: recolour + thicken text (no background change) */
.row-item:hover .label { color: var(--hot); font-variation-settings: 'wght' 760, 'opsz' 48; }
.row-item:hover .desc  { color: var(--hot); opacity: 1; font-weight: 700; }

@container (width < 520px) {                     /* §7 component-level responsive */
  .row-item {
    grid-template-columns: 1fr max-content;
    grid-template-areas: "name stat" "desc desc"; row-gap: 0.6rem;
  }
  .row-item .label { grid-area: name; }
  .row-item .stat  { grid-area: stat; }
  .row-item .desc  { grid-area: desc; }
}

/* ---- 9. specimen -------------------------------------------- */
.specimen { display: grid; gap: 2rem; }
.specimen-word {
  font-size: clamp(2.4rem, 8vw, 4rem); line-height: 0.85; letter-spacing: -0.03em;
  font-variation-settings: 'wght' 500, 'opsz' 96; color: var(--brown-deep);
}
.specimen-controls {
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
  font-family: var(--mono); font-size: var(--step--1);
}
.specimen-controls label { color: var(--brown); }
input[type="range"] {
  font: inherit;                                 /* §6 */
  flex: 1; min-width: 180px; max-width: 420px; accent-color: var(--brown);
}
.readout { min-width: 8ch; }
.readout b { font-weight: 700; }

/* ---- 10. collapse without JS (§16 interpolate-size) --------- */
.collapse-toggle { font: inherit; }              /* sr-only but focusable */
.collapse-summary {
  font-family: var(--mono); font-size: var(--step-0); cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.8ch; user-select: none;
  transition: color .2s ease;
}
.collapse-summary:hover { color: var(--hot); }
.collapse-summary .chev { transition: transform .35s ease; display: inline-block; }
.collapse-panel {
  display: grid; max-height: 0; overflow: hidden; opacity: 0; margin-top: 0;
  transition: max-height .45s ease, margin-top .45s ease, opacity .45s ease;
}
.collapse-toggle:checked ~ .collapse-panel { max-height: fit-content; opacity: 1; margin-top: 1.5rem; }
.collapse-toggle:checked ~ .collapse-summary .chev { transform: rotate(90deg); }
.collapse-panel p + p { margin-top: 1rem; }

/* ---- 11. page header (subpages) ----------------------------- */
.page-head { padding: clamp(2.5rem, 7vh, 6rem) var(--gutter) clamp(1.5rem, 4vh, 3rem); }
.page-head .kicker {
  font-family: var(--mono); font-size: var(--step--1); color: var(--brown);
  letter-spacing: 0.06em; margin-bottom: 1rem;
}
.page-intro {
  font-family: var(--mono); font-size: var(--step-0); color: var(--brown-deep);
  margin-top: 1.5rem; max-width: 52ch;
}

/* ---- 12. work list (large-type list + cursor-follow preview) */
.work {
  position: relative;
  padding: 0 var(--gutter) clamp(3rem, 8vh, 7rem);
  margin-top: 1rem;
  container-type: inline-size;
}
.work-row {
  display: grid;
  grid-template-columns: 1fr auto max-content;
  gap: 1.5rem; align-items: baseline;
  padding: clamp(1rem, 3.2vh, 2.1rem) 0;
  border-top: 1px solid var(--rule);
  text-decoration: none;
}
.work-row:last-of-type { border-bottom: 1px solid var(--rule); }
.work-name {
  font-size: clamp(2.1rem, 6vw, 5.5rem); line-height: 0.95; letter-spacing: -0.02em;
  font-variation-settings: 'wght' 560, 'opsz' 64;
  transition: color .2s ease, font-variation-settings .2s ease;
}
.work-meta {
  font-family: var(--mono); font-size: var(--step--1); color: var(--brown-deep); opacity: 0.8;
  transition: color .2s ease;
}
.work-row .stat {
  font-family: var(--mono); font-size: var(--step--1); justify-self: end; white-space: nowrap;
  padding: 0.25em 0.75em; border: 1px solid currentColor; border-radius: 99px;
}
/* hover: recolour + thicken (consistent with the rest of the site) */
.work-row:hover .work-name { color: var(--hot); font-variation-settings: 'wght' 780, 'opsz' 64; }
.work-row:hover .work-meta { color: var(--hot); opacity: 1; }
.work-row.placeholder { color: color-mix(in srgb, var(--ink) 45%, transparent); }
.work-row.placeholder .work-name { font-variation-settings: 'wght' 380, 'opsz' 64; }

/* floating preview that follows the cursor (desktop only) */
.work-preview {
  position: fixed; top: 0; left: 0; margin: 0; z-index: 30;
  width: clamp(220px, 26vw, 380px); aspect-ratio: 4 / 3;
  border-radius: 12px; overflow: hidden; pointer-events: none;
  background: var(--bone); box-shadow: 0 24px 60px -24px rgba(30, 20, 15, 0.55);
  opacity: 0; transform: translate(-50%, -50%) scale(0.92) rotate(-2deg);
  transition: opacity .28s ease, transform .28s cubic-bezier(.2,.8,.2,1);
}
.work-preview.show { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
.work-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph {
  width: 100%; height: 100%; display: grid; place-items: center; padding: 1rem; text-align: center;
  background: linear-gradient(135deg, var(--brown), var(--brown-deep));
  color: var(--paper); font-family: var(--mono); font-size: var(--step--1);
}
@media (hover: none), (pointer: coarse) { .work-preview { display: none; } }

@media (max-width: 32.5rem) {                    /* §7 responsive fallback */
  .row-item {
    grid-template-columns: 1fr max-content;
    grid-template-areas: "name stat" "desc desc"; row-gap: 0.6rem;
  }
  .row-item .label { grid-area: name; }
  .row-item .stat  { grid-area: stat; }
  .row-item .desc  { grid-area: desc; }
}

/* ---- 13. empty state ---------------------------------------- */
.empty {
  padding: clamp(2rem, 6vh, 5rem) var(--gutter) clamp(4rem, 10vh, 9rem);
  display: grid; gap: 2rem; max-width: 60ch;
}
.empty .big {
  font-family: var(--mono); font-size: var(--step-1); line-height: 1.2; color: var(--ink);
}
.empty .note { font-family: var(--mono); font-size: var(--step--1); color: var(--brown-deep); }
.upcoming { display: grid; gap: 0.6rem; }
.upcoming li {
  font-family: var(--mono); font-size: var(--step--1);
  color: color-mix(in srgb, var(--ink) 50%, transparent);
  border-top: 1px solid var(--rule); padding-top: 0.6rem;
}

/* ---- 14. about page (mono body, matches the general voice) -- */
.prose { padding: 0 var(--gutter) clamp(3rem, 8vh, 6rem); display: grid; gap: 1.25rem; }
.prose p {
  font-family: var(--mono); font-size: var(--step--1); line-height: 1.7;
  color: var(--brown-deep); max-width: 62ch;
}
.prose code { font-family: var(--mono); color: var(--brown); }
.about-stack {
  display: grid; gap: 0.25rem; margin-top: 1rem;
  font-family: var(--mono); font-size: var(--step--1);
}
.about-stack dt { color: var(--brown); }
.about-stack dd { color: var(--brown-deep); margin: 0 0 0.75rem; }
.links { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: 1rem; font-family: var(--mono); font-size: var(--step--1); }
.links a { text-underline-offset: 4px; transition: color .2s ease; }
.links a:hover { color: var(--hot); }

/* ---- 15. motion: load reveal + scroll reveal ---------------- */
@media (prefers-reduced-motion: no-preference) {
  .ltr {
    animation: rise .9s cubic-bezier(.2,.8,.2,1) backwards;
    animation-delay: calc(var(--i, 0) * 45ms + 0.1s);
  }
  @keyframes rise {
    from { transform: translateY(0.5em); opacity: 0; font-variation-settings: 'wght' 200, 'opsz' 96; }
    to   { transform: translateY(0);     opacity: 1; }
  }
  .tagline, .hint { animation: fade 1s ease backwards; animation-delay: .8s; }
  @keyframes fade { from { opacity: 0; transform: translateY(8px); } }

  @supports (animation-timeline: view()) {
    .section, .work, .empty, .prose, .foot {
      animation: enter linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 38%;
    }
    @keyframes enter { from { opacity: 0; transform: translateY(28px); } }
  }
}

/* ---- 16. tool detail page (template: substracked.html) ------ *
 * Reuses: .page-head .title .page-intro .prose .section .eyebrow
 *         .links .ph (placeholder fill). Only the blocks below are new.   */
.shot { border-radius: 12px; overflow: hidden; background: var(--bone); aspect-ratio: 16 / 10; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-lead { padding: 0 var(--gutter); margin-top: clamp(1.5rem, 4vh, 3rem); }

.caps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem; }
.caps h3 {
  font-family: var(--mono); font-size: var(--step--1); font-weight: 400;
  color: var(--brown); letter-spacing: 0.06em; margin-bottom: 1rem;
}
.caps ul { display: grid; gap: 0.5rem; }
.caps li {
  font-family: var(--mono); font-size: var(--step-0); color: var(--brown-deep);
  border-top: 1px solid var(--rule); padding-top: 0.5rem;
}

.feature { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 4rem); align-items: center; }
.feature + .feature { margin-top: clamp(2.5rem, 6vh, 5rem); }
.feature.flip .shot { order: 2; }   /* alternate the image side */
.feature-text h3 {
  font-size: var(--step-1); line-height: 1.05; margin-bottom: 0.75rem;
  font-variation-settings: 'wght' 600, 'opsz' 48;
}
.feature-text p { font-family: var(--mono); font-size: var(--step--1); color: var(--brown-deep); line-height: 1.6; }

.gallery { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }

.next-tool {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  padding: clamp(2.5rem, 7vh, 6rem) var(--gutter);
  border-top: 1px solid var(--rule); text-decoration: none;
}
.next-tool .nt-label { font-family: var(--mono); font-size: var(--step--1); color: var(--brown); }
.next-tool .nt-name {
  display: block;
  font-size: clamp(2rem, 6vw, 4.5rem); line-height: 1;
  font-variation-settings: 'wght' 560, 'opsz' 64;
  transition: color .2s ease, font-variation-settings .2s ease;
}
.next-tool:hover .nt-name { color: var(--hot); font-variation-settings: 'wght' 780, 'opsz' 64; }

@media (max-width: 700px) {
  .feature { grid-template-columns: 1fr; }
  .feature.flip .shot { order: 0; }
}

/* ---- 17. playground (home) — pure-CSS effect demos ---------- *
 * Reuses: .section .eyebrow .page-intro .screen-reader-only tokens.
 * No JavaScript and no library — all effects are CSS only.       */
.pg { display: grid; gap: clamp(1.5rem, 4vw, 2.5rem); }
.pg-item {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1rem, 3vw, 2rem);
  align-items: stretch;
}
.pg-cap {
  grid-column: 1 / -1; font-family: var(--mono); font-size: var(--step--1);
  color: var(--brown); letter-spacing: 0.06em;
}
.pg-demo {
  display: grid; place-items: center; min-height: 220px; padding: 2rem;
  background: var(--bone); border-radius: 10px; overflow: hidden;
}

/* the "editor" illustration */
.editor {
  background: #17130F; border-radius: 10px; overflow: hidden;
  box-shadow: 0 16px 42px -24px rgba(30, 20, 15, 0.55);
}
.editor-bar {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.7rem 1rem;
  border-bottom: 1px solid rgba(245,240,230,.14);
}
.editor-dots { display: flex; gap: 0.4rem; }
.editor-dots i { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: rgba(245,240,230,.28); }
.editor-name { font-family: var(--mono); font-size: 0.75rem; color: rgba(245,240,230,.6); }
.editor pre { margin: 0; padding: 1rem 1.1rem; overflow: auto; }
.editor code { font-family: var(--mono); font-size: 0.76rem; line-height: 1.6; color: #F1E7D6; white-space: pre; }

/* 1 · split reveal */
.fx-split {
  position: relative; display: inline-block; cursor: pointer; line-height: 1;
  font-size: clamp(2.4rem, 8vw, 4rem); font-variation-settings: 'wght' 720, 'opsz' 64;
}
.fx-split .fx-split-word { visibility: hidden; }
.fx-split .top, .fx-split .bot {
  position: absolute; inset: 0; color: var(--ink);
  transition: transform .45s cubic-bezier(.2,.8,.2,1);
}
.fx-split .top { clip-path: inset(0 0 50% 0); }
.fx-split .bot { clip-path: inset(50% 0 0 0); }
.fx-split .label {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--mono); font-size: 0.26em; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--paper); background: var(--hot); transform: scaleY(0); transition: transform .45s ease;
}
.fx-split:hover .top, .fx-split:focus-visible .top { transform: translateY(-32%); }
.fx-split:hover .bot, .fx-split:focus-visible .bot { transform: translateY(32%); }
.fx-split:hover .label, .fx-split:focus-visible .label { transform: scaleY(1); }

/* 2 · wave */
.fx-wave { display: inline-flex; font-size: clamp(2.4rem, 8vw, 4rem); font-variation-settings: 'wght' 640, 'opsz' 64; }
.fx-wave span { display: inline-block; animation: fx-wave 1.6s ease-in-out infinite; animation-delay: calc(var(--i) * .08s); }
@keyframes fx-wave { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-0.22em); } }

/* 3 · melt */
.fx-melt { display: inline-flex; cursor: pointer; font-size: clamp(2.4rem, 8vw, 4rem); font-variation-settings: 'wght' 720, 'opsz' 64; }
.fx-melt span {
  display: inline-block; transform-origin: top;
  transition: transform .5s ease-in, filter .5s ease-in;
  transition-delay: calc(var(--i) * .05s);
}
.fx-melt:hover span, .fx-melt:focus-visible span { transform: translateY(0.5em) scaleY(1.8); filter: blur(2px); }

/* 4 · ink fill — IntersectionObserver toggles .is-in (replays on re-entry);
 * solid, readable fallback when JS is off. */
.fx-fill { font-size: clamp(2.4rem, 9vw, 5rem); line-height: 1; font-variation-settings: 'wght' 740, 'opsz' 96; color: var(--ink); }
.js .fx-fill {
  color: color-mix(in srgb, var(--ink) 22%, transparent);
  background: linear-gradient(var(--ink), var(--ink)) no-repeat;
  background-size: 0% 100%;
  -webkit-background-clip: text; background-clip: text;
  transition: background-size 1s ease;
}
.js .fx-fill.is-in { background-size: 100% 100%; }
@media (prefers-reduced-motion: reduce) { .js .fx-fill { color: var(--ink); background: none; } }

@media (max-width: 760px) { .pg-item { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  .fx-wave span { animation: none; }
  .fx-melt:hover span, .fx-melt:focus-visible span { transform: none; filter: none; }
}

/* ---- 18. reusable scroll & motion utilities ----------------- *
 * Used on substracked.html and demoed in the home playground.
 * All native CSS — scroll-driven via animation-timeline, no JS.  */

/* reveal on scroll — driven by IntersectionObserver (works everywhere,
 * replays on re-entry). Visible by default when JS is off (no .js class). */
.js .reveal { opacity: 0; transform: translateY(40px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1); }
.js .reveal.from-left  { transform: translateX(-48px); }
.js .reveal.from-right { transform: translateX(48px); }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } }

/* marquee — seamless loop (duplicate the items in markup) */
.marquee { overflow: hidden; border-block: 1px solid var(--rule); }
.marquee-track { display: inline-flex; padding: 0.9rem 0; white-space: nowrap; animation: marquee 22s linear infinite; }
.marquee-track span { font-family: var(--mono); font-size: var(--step-0); color: var(--brown-deep); margin-left: 1.8rem; }
.marquee-track span::after { content: "·"; margin-left: 1.8rem; color: var(--brown); }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

/* button with a hover sweep */
.btn {
  display: inline-flex; align-items: center; gap: 0.5ch; position: relative; overflow: hidden;
  font-family: var(--mono); font-size: var(--step--1); text-decoration: none; color: var(--ink);
  padding: 0.7em 1.3em; border: 1px solid var(--ink); border-radius: 99px;
  transition: color .35s ease, border-color .35s ease;
}
.btn > * { position: relative; z-index: 1; }
.btn::before {
  content: ""; position: absolute; inset: 0; background: var(--hot);
  transform: translateX(-101%); transition: transform .4s cubic-bezier(.2,.8,.2,1);
}
.btn:hover, .btn:focus-visible { color: var(--paper); border-color: var(--hot); }
.btn:hover::before, .btn:focus-visible::before { transform: translateX(0); }

/* big statement that inks in on scroll (pairs with .fx-fill) */
.statement { padding: clamp(2.5rem, 7vh, 5rem) var(--gutter); max-width: 22ch; }

/* ---- 19. dark mode (prefers-color-scheme) — token overrides --- *
 * Everything is token-based, so re-theming the whole site is just a
 * palette swap. The editor panel is fixed-dark and the logo SVG adapts
 * on its own, so nothing else needs per-component dark rules.        */
@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #161310;  /* deep warm near-black — background */
    --ink:        #ECE3D2;  /* warm light — primary text         */
    --brown:      #C68A5A;  /* lifted raw umber — accent          */
    --brown-deep: #C9B79E;  /* light warm — secondary text        */
    --bone:       #211C16;  /* raised surface (cards, demos)      */
    --hot:        #E2696F;  /* lifted coral — hover / interaction */
  }
}