/* ============================================================
   SECOND NATURE / motion-first editorial (GSAP dark × Osmo volt)
   All motion = transform/opacity only. GPU stays cold.
   ============================================================ */

:root {
  /* Surfaces */
  --canvas: #0e100f;
  --panel: #191919;
  --cream: #fffce1;
  --muted: #a3a395;
  --hairline: #42433d;

  /* Accents: discipline color taxonomy */
  --volt: #a1ff62;
  --green-a: #0ae448;
  --green-b: #abff84;
  --blue: #00bae2;
  --orange: #ff8709;
  --pink: #fec5fb;
  --red: #ff4d6d;
  --lilac: #9d95ff;

  /* Type */
  --font-display: 'Anton', 'Arial Narrow', sans-serif;
  --font-body: 'Instrument Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --font-hand: 'Caveat', cursive;

  /* Shape */
  --r-tile: 8px;
  --r-pill: 100px;
  --max-w: 1200px;
  --gap: clamp(24px, 5vw, 64px);
  --nav-h: 64px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: auto; scroll-padding-top: calc(var(--nav-h) + 32px); }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  background: var(--canvas);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
::selection { background: var(--volt); color: #0e100f; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--volt); outline-offset: 4px; }
ul, ol { list-style: none; }
.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* ---------- Grain (static SVG texture, zero repaint cost) ---------- */
.grain {
  position: fixed;
  inset: 0; /* static tile: viewport-sized is enough, a 200% layer is 4x the GPU memory */
  pointer-events: none;
  z-index: 999;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Nav (Osmo floating pill) ---------- */
.nav {
  position: fixed;
  top: 16px;
  left: 50%;
  translate: -50% 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 28px;
  height: var(--nav-h);
  padding: 0 12px 0 24px;
  background: color-mix(in srgb, var(--canvas) 82%, transparent);
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  max-width: calc(100vw - 32px);
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.nav__mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--volt);
  color: #0e100f;
  font-size: 15px;
  font-weight: 700;
}
.nav__tld { color: var(--muted); font-weight: 500; }
.nav__toggle { display: none; }
.nav__links { display: flex; gap: 4px; }
.nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  border-radius: var(--r-pill);
  transition: color .25s, background .25s;
}
.nav__link:hover { color: var(--cream); background: var(--panel); }
.nav__cta { margin-left: 4px; }
.nav__link.is-active { color: var(--cream); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 22px;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.1;
  white-space: nowrap;
  border: 1px solid transparent;
  cursor: pointer;
  transition: border-color .25s, color .25s, background .25s, opacity .25s;
}
.btn--lg { padding: 15px 28px; font-size: 17px; }
.btn--volt {
  background: var(--volt);
  color: #0e100f;
}
.btn--volt:hover { background: var(--green-b); }
.btn--ghost {
  background: transparent;
  border-color: var(--hairline);
  color: var(--cream);
}
.btn--ghost:hover { border-color: var(--cream); }

/* ---------- Layout ---------- */
.section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(72px, 12vh, 128px) 24px;
}
.section__head { margin-bottom: clamp(40px, 7vh, 72px); }
.section__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(44px, 7.5vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.015em;
  margin-top: 18px;
  text-transform: uppercase;
}
.section__sub {
  color: var(--muted);
  font-size: 19px;
  max-width: 46ch;
  margin-top: 16px;
}
.eyebrow { color: var(--muted); }
.curly { color: var(--volt); }
.hairline {
  border: 0;
  border-top: 1px solid var(--hairline);
  max-width: var(--max-w);
  margin: 0 auto;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: calc(var(--nav-h) + 90px) 24px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}
.hero__eyebrow { color: var(--muted); margin-bottom: 20px; }
.hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(64px, 13.5vw, 190px);
  line-height: 0.92;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin-left: -0.05em; /* optical bleed */
}
.hero__line { display: block; }
.hero__line--accent {
  background: linear-gradient(114deg, var(--green-a) 20%, var(--volt) 65%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__dot { color: var(--cream); -webkit-text-fill-color: var(--cream); }
.hero__sub {
  color: var(--muted);
  font-size: clamp(18px, 2.2vw, 23px);
  line-height: 1.4;
  max-width: 52ch;
  margin-top: 28px;
}
.hero__sub em {
  color: var(--cream);
  font-style: normal;
  border-bottom: 2px solid var(--volt);
}
.hero__annotation {
  position: absolute;
  pointer-events: none;
  right: clamp(24px, 6vw, 90px);
  top: 38%;
  font-family: var(--font-hand);
  font-size: clamp(20px, 2.4vw, 27px);
  color: var(--pink);
  transform: rotate(6deg);
}
.hero__ctas { display: flex; gap: 14px; margin-top: 36px; flex-wrap: wrap; }
.hero__meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: clamp(48px, 9vh, 96px);
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
  color: var(--muted);
}
.hero__meta span:first-child { color: var(--volt); }

/* ---------- Marquee ---------- */
.marquee {
  overflow: clip;
  border-block: 1px solid var(--hairline);
  padding: 18px 0;
}
.marquee__track {
  display: flex;
  gap: 28px;
  width: max-content;
  animation: marquee 30s linear infinite;
  will-change: transform; /* moved every frame: keep it on its own layer */
}
.marquee:hover .marquee__track { animation-play-state: paused; }
/* JS takes over the loop (script.js): CSS animation disabled */
.marquee--js .marquee__track { animation: none; }
.marquee__item {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.marquee__sep { color: var(--volt); font-size: 18px; align-self: center; }
@keyframes marquee { to { transform: translate3d(-50%, 0, 0); } }

/* ---------- Work cards ---------- */
.work__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 28px;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 32px;
  min-height: 460px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-tile);
  background: var(--panel);
  transition: transform .5s cubic-bezier(.22, 1, .36, 1), border-color .5s;
}
.card--blue { transform: rotate(-1.2deg); }
.card--orange { transform: rotate(1.2deg); }
.card--lilac { transform: rotate(-0.8deg); }
.card--volt { transform: rotate(0.9deg); }
.card--pink { transform: rotate(-1deg); }
.card--red { transform: rotate(1.1deg); }
.card:hover {
  transform: rotate(0deg) translateY(-8px);
  border-color: var(--c, var(--cream));
}
.card__top {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}
.card__status { color: var(--c, var(--volt)); }
.card--blue { --c: var(--blue); }
.card--orange { --c: var(--orange); }
.card--lilac { --c: var(--lilac); }
.card--volt { --c: var(--volt); }
.card--pink { --c: var(--pink); }
.card--red { --c: var(--red); }
.card__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, 4.5vw, 64px);
  line-height: 0.95;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin-top: auto;
}
.card__desc { color: var(--muted); font-size: 17px; max-width: 38ch; }
.card__note {
  color: var(--c, var(--muted));
  font-size: 11px;
  letter-spacing: 0.06em;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
}
.card__tags { display: flex; gap: 8px; flex-wrap: wrap; }
.card__tags li {
  padding: 4px 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  color: var(--muted);
}
.hint { color: var(--muted); font-size: 11px; letter-spacing: 0.06em; text-transform: none; }

/* ---------- Demo credentials ---------- */
.creds {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.creds__val {
  padding: 5px 12px;
  border: 1px solid color-mix(in srgb, var(--volt) 40%, transparent);
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--volt) 10%, transparent);
  color: var(--volt);
  font-weight: 400;
  user-select: all;
}
.card__cta { align-self: flex-start; margin-top: 4px; }
.card__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  transition: opacity .5s;
  background: radial-gradient(420px circle at 85% 15%, color-mix(in srgb, var(--c) 14%, transparent), transparent 70%);
}
.card:hover .card__glow { opacity: 1; }

/* ---------- Work tabs: live products / n8n workflows ---------- */
.work__tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  margin-top: 28px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
}
.work__tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--muted);
  font: inherit;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .25s, background .25s;
}
#work [hidden] { display: none; } /* .work__grid's display:grid would otherwise beat the hidden attribute */
.work__tab span { opacity: .55; }
.work__tab:hover { color: var(--cream); }
.work__tab[aria-selected="true"] { background: var(--volt); color: #0e100f; }
.work__tab[aria-selected="true"] span { opacity: .7; }
.work__more { margin-top: 40px; }
#panel-n8n .card__title { font-size: clamp(40px, 3.9vw, 56px); } /* "Qualification" is wider than the 64px cap allows */
.card__ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin-top: 4px; }
.card__json { color: var(--muted); transition: color .25s; }
.card__json:hover { color: var(--cream); }
.is-entering .card { animation: tab-in .6s cubic-bezier(.22, 1, .36, 1) both; }
.is-entering .card:nth-child(2) { animation-delay: .07s; }
.is-entering .card:nth-child(3) { animation-delay: .14s; }
@keyframes tab-in { from { opacity: 0; translate: 0 24px; } }

/* n8n canvas minimap: node positions come straight from each workflow's JSON */
.canvas {
  position: relative;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: radial-gradient(circle at 1px 1px, #2a2b26 1px, transparent 1.4px) 0 0 / 18px 18px, var(--canvas);
  overflow: hidden;
}
.canvas .mm { position: absolute; left: 10px; top: 10px; width: calc(100% - 20px); height: calc(100% - 38px); }
.canvas__cap, .canvas__key { position: absolute; bottom: 8px; font-size: 10px; }
.canvas__cap { left: 10px; color: var(--muted); }
.canvas__key { right: 10px; color: var(--orange); }
.mm { --u: 15; overflow: visible; }
.mm .st { fill: var(--cream); opacity: .035; }
.mm .e, .mm .a { fill: none; stroke: #4a4b44; stroke-width: var(--u); }
.mm .a { stroke-dasharray: 30 45; }
.mm .n { --f: var(--canvas); --s: #8d8c7d; fill: var(--f); stroke: var(--s); stroke-width: 20; }
.mm .n.t { --s: var(--volt); }
.mm .n.ai { --f: var(--orange); --s: var(--orange); }
@keyframes mm-run { 0%, 35%, 100% { fill: var(--f); stroke: var(--s); } 8% { fill: var(--c); stroke: var(--c); } }
@keyframes mm-flow { to { stroke-dashoffset: -120; } }
@media (prefers-reduced-motion: no-preference) {
  .card:hover .mm .n { animation: mm-run 3s var(--d) infinite; }
  .card:hover .mm .e { stroke: color-mix(in srgb, var(--c) 70%, transparent); stroke-dasharray: 60 60; animation: mm-flow 1s linear infinite; }
}

/* ---------- Stack ---------- */
.stack__row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(0, 1.9fr);
  gap: clamp(16px, 4vw, 56px);
  align-items: start;
  padding: clamp(26px, 4vh, 40px) 0;
  border-top: 1px solid var(--hairline);
}
.stack__row:last-child { border-bottom: 1px solid var(--hairline); }
.stack__num {
  display: block;
  color: var(--c);
  margin-bottom: 8px;
}
.stack__name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 0.95;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--cream);
  transition: color .35s;
}
.stack__row:hover .stack__name { color: var(--c); }
.stack__desc {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
  max-width: 52ch;
}
.stack__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cream);
}
.stack__sep { color: var(--c); font-size: 11px; }

/* ---------- Process ---------- */
.process { position: relative; }
.process__steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
  counter-reset: step;
}
.step {
  position: relative;
  padding: 28px 24px 24px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-tile);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform .5s cubic-bezier(.22, 1, .36, 1), border-color .5s;
}
.step:hover { transform: translateY(-6px); border-color: var(--cream); }
.step__num { color: var(--muted); }
.step:hover .step__num { color: var(--volt); }
.step__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 34px;
  text-transform: uppercase;
  letter-spacing: 0;
}
.step__desc { color: var(--muted); font-size: 16px; }
.step__you { font-size: 11px; letter-spacing: 0.06em; color: var(--cream); }
.step__you-key { color: var(--muted); }
.step__proof {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.step__proof span { color: var(--c); }
.step__label {
  color: var(--c, var(--muted));
  font-size: 11px;
  padding: 4px 10px;
  width: fit-content;
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
}
.process__annotation {
  position: absolute;
  pointer-events: none;
  right: 24px;
  bottom: clamp(24px, 4vh, 48px);
  font-family: var(--font-hand);
  font-size: 24px;
  color: var(--pink);
  transform: rotate(-4deg);
}

/* ---------- About ---------- */
.about__row {
  display: grid;
  grid-template-columns: minmax(260px, 380px) 1fr;
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
}
.about__manifesto {
  position: sticky;
  top: calc(var(--nav-h) + 56px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}
.about__rule {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 0.98;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--cream);
  padding-left: clamp(16px, 2vw, 24px);
  border-left: 2px solid var(--volt);
}
.about__rule em { font-style: normal; color: var(--volt); }
.about__badge {
  padding: 8px 16px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  color: var(--muted);
}

/* base body type, then the two overrides below it */
.about__body p { color: var(--muted); font-size: 19px; line-height: 1.55; max-width: 58ch; }
.about__body strong { color: var(--cream); font-weight: 600; }

.about__body .about__lede { color: var(--cream); }
.about__body p + p { margin-top: 22px; }
.about__body .about__sig {
  font-family: var(--font-hand);
  font-size: 28px;
  color: var(--pink);
  margin-top: 36px;
}

/* ---------- Footer ---------- */
.footer { text-align: left; padding-bottom: 48px; }
.footer__cta {
  position: relative;
  display: block;
  margin-top: 20px;
  font-family: var(--font-display);
  font-size: clamp(64px, 14vw, 200px);
  line-height: 0.9;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.footer__cta-rows { display: block; }
.footer__cta-line { display: block; }
.footer__arrow { color: var(--volt); }
/* Green gradient layer, revealed by cursor X via clip-path (script.js) */
.footer__cta-fill {
  position: absolute;
  inset: 0;
  pointer-events: none;
  clip-path: inset(0 100% 0 0);
}
.footer__cta-fill .footer__cta-line {
  background: linear-gradient(114deg, var(--green-a) 20%, var(--volt) 65%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* No-JS hover fallback: full green on hover */
.footer__cta:hover .footer__cta-fill { clip-path: inset(0 0 0 0); }
.footer__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: clamp(40px, 7vh, 72px);
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
  color: var(--muted);
}
.footer__link { color: var(--muted); transition: color .25s; }
.footer__link:hover { color: var(--cream); }

/* ============================================================
   PROJECT PAGES (/work/<slug>/)
   Leans on .section, .stack__row, .card__tags and .footer.
   ============================================================ */

/* ---------- Project hero ---------- */
.project-hero {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: calc(var(--nav-h) + 80px) 24px clamp(40px, 6vh, 64px);
}
.project-hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(48px, 9vw, 124px);
  line-height: 0.92;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin: 18px 0 0;
  margin-left: -0.05em; /* optical bleed, matches .hero__title */
}
.project-hero__sub {
  color: var(--muted);
  font-size: clamp(18px, 2.2vw, 23px);
  line-height: 1.45;
  max-width: 54ch;
  margin-top: 24px;
}
.project-hero__sub em {
  color: var(--cream);
  font-style: normal;
  border-bottom: 2px solid var(--c, var(--volt));
}
.project-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px clamp(28px, 6vw, 72px);
  margin-top: clamp(36px, 6vh, 64px);
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
}
.project-hero__meta dt { color: var(--muted); margin-bottom: 6px; }
.project-hero__meta dd { color: var(--cream); }
.project-hero__meta .is-live { color: var(--c, var(--volt)); }

/* ---------- Demo video ---------- */
.demo { margin: 0 auto; max-width: var(--max-w); padding: 0 24px; }
.demo__video {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--r-tile);
  object-fit: contain;
}
.demo__cap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 14px;
  color: var(--muted);
}
.demo__cap b { color: var(--c, var(--volt)); font-weight: 400; }

/* ---------- Prose (sits inside .stack__body) ---------- */
.prose p { color: var(--muted); font-size: 18px; line-height: 1.6; max-width: 58ch; }
.prose p + p { margin-top: 16px; }
.prose strong { color: var(--cream); font-weight: 600; }
.prose em {
  color: var(--cream);
  font-style: normal;
  border-bottom: 2px solid var(--c, var(--volt));
}

/* ---------- Results strip (1px gap = hairline dividers) ---------- */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: var(--r-tile);
  overflow: clip;
}
.metric { background: var(--panel); padding: clamp(22px, 3vw, 30px) 24px; }
.metric__num {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(34px, 4.4vw, 54px);
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--c, var(--cream));
}
.metric__label { display: block; margin-top: 10px; color: var(--muted); }

/* ---------- Prev / next pager ---------- */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: var(--r-tile);
  overflow: clip;
}
.pager__link {
  display: block;
  background: var(--panel);
  padding: clamp(24px, 4vh, 40px) 24px;
  transition: background .35s;
}
.pager__link:hover { background: var(--canvas); }
.pager__link--next { text-align: right; }
.pager__dir { display: block; color: var(--muted); margin-bottom: 10px; }
.pager__name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(22px, 3.2vw, 38px);
  line-height: 0.98;
  text-transform: uppercase;
  transition: color .35s;
}
.pager__link:hover .pager__name { color: var(--volt); }

/* ---------- GSAP-owned transforms ----------
   Once script.js runs GSAP it writes these transforms every frame; a CSS transform
   transition would re-ease each write (laggy reveals/tilt, extra style work). */
html.gsap .card, html.gsap .step { transition: border-color .5s; }
/* Pre-promoted so reveals don't rasterise a new layer mid-scroll (measured: fewer dropped frames) */
[data-reveal], .reveal-line { will-change: transform, opacity; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none; }
  .card, .step, .card__glow, .nav__toggle-icon::before, .nav__toggle-icon::after { transition: none; }
  .card, .card:hover { transform: none; }
  .grain { display: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .step__proof { font-size: 12px; }
  .hero__annotation { display: none; }
  .nav { width: calc(100% - 24px); max-width: 540px; gap: 8px; padding: 0 10px 0 16px; }
  .nav__brand { order: 1; }
  .nav__cta { order: 2; margin-left: auto; }
  .nav__toggle {
    order: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--hairline);
    border-radius: var(--r-pill);
    background: var(--panel);
    color: var(--cream);
    font: 600 13px/1 var(--font-body);
    cursor: pointer;
  }
  .nav__toggle-icon { position: relative; display: block; width: 18px; height: 14px; background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat; }
  .nav__toggle-icon::before,
  .nav__toggle-icon::after { content: ''; position: absolute; left: 0; width: 18px; height: 2px; background: currentColor; transition: transform .2s ease, top .2s ease; }
  .nav__toggle-icon::before { top: 0; }
  .nav__toggle-icon::after { top: 12px; }
  .nav.is-open .nav__toggle { border-color: var(--volt); color: var(--volt); }
  .nav.is-open .nav__toggle-icon { background: none; }
  .nav.is-open .nav__toggle-icon::before { top: 6px; transform: rotate(45deg); }
  .nav.is-open .nav__toggle-icon::after { top: 6px; transform: rotate(-45deg); }
  .nav__links {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    border: 1px solid var(--hairline);
    border-radius: 18px;
    background: var(--panel);
    box-shadow: 0 18px 48px #0009;
  }
  .nav.is-open .nav__links { display: flex; }
  .nav__link { width: 100%; min-height: 48px; padding: 10px 14px; color: var(--cream); }
  .nav__link:is(:hover, :focus-visible, .is-active) { background: var(--canvas); }
  .about__row { grid-template-columns: 1fr; }
  .about__manifesto { position: static; }
  .about__rule { font-size: 26px; }
  .hero__meta { flex-direction: column; gap: 6px; }
  .stack__row { grid-template-columns: 1fr; gap: 14px; }
  .stack__name { font-size: 26px; }
  .stack__tools { font-size: 12px; }
  .project-hero__meta { gap: 16px 32px; }
  .prose p { font-size: 17px; }
}

@media (max-width: 520px) {
  .nav__cta, .nav__tld { display: none; }
}

@media (max-width: 640px) {
  .pager { grid-template-columns: 1fr; }
  .pager__link--next { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .stack__name { transition: none; }
}
