/* Afterimage — brand tokens from Colour & Material System (Phase 5A),
   Grid & Graphic Language (5C) and Imagery & Motion Direction (5D). */

@font-face {
  /* Metric-matched fallback so the Work Sans swap causes no layout shift */
  font-family: "Work Sans Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Liberation Sans");
  size-adjust: 110%;
  ascent-override: 84.5%;
  descent-override: 22.1%;
  line-gap-override: 0%;
}

:root {
  --bone: #F2EEE7;
  --mocha: #5A3F30;
  --ink: #191715;
  --mineral: #A8A5A1;
  --pearl: #E6DCCE;

  --ink-soft: #4A4440;
  --hair: rgba(25, 23, 21, .14);
  --hair-light: rgba(242, 238, 231, .16);

  --font: "Work Sans", "Work Sans Fallback", system-ui, sans-serif;

  /* 8-point rhythm */
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 48px; --s6: 64px; --s7: 96px; --s8: 128px;

  /* 6% outer margins, growing so content never exceeds --max on wide screens */
  --max: 1680px;
  --margin: max(6vw, calc((100vw - var(--max)) / 2));
  --gutter: 16px;

  /* Cubic ease-out — confident arrival, no elastic movement */
  --ease-out: cubic-bezier(.215, .61, .355, 1);
  --ease-out-strong: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scrollbar-gutter: stable;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Fine cotton-paper texture: felt before it is noticed */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: .5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .25 0 0 0 0 .19 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, svg { display: block; max-width: 100%; }

/* Wordmark strokes keep a fixed optical weight at any size */
#wordmark path { vector-effect: non-scaling-stroke; }
a { color: inherit; }
p, h1, h2, h3, blockquote, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

::selection { background: var(--mocha); color: var(--bone); }

:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 4px;
}

/* ---------- Grid: 12 columns · 16px gutters · 6% margins ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  padding-inline: var(--margin);
}

@media (max-width: 760px) {
  :root { --margin: 24px; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- Type ---------- */

.heading {
  font-weight: 300;
  font-size: clamp(32px, 4vw, 60px);
  line-height: 1.08;
  letter-spacing: -.02em;
  max-width: 17ch;
  text-wrap: balance;
}

/* Ghost: a heading's residual traces (wrapped by main.js) */
.ghost { position: relative; }
.ghost__t {
  position: absolute;
  inset: 0;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  opacity: 0;
  color: var(--mineral);
}
.ghost__t + .ghost__t { color: var(--pearl); }
.section--ink .ghost__t,
.section--mocha .ghost__t { color: var(--mineral); }

/* ---------- Buttons & links ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 var(--s4);
  background: var(--mocha);
  color: var(--bone);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 2px;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color 160ms var(--ease-out), transform 120ms var(--ease-out);
}
.button:hover { background: #4A3327; }
.button:active { transform: scale(.98); }

.link {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  user-select: none;
  -webkit-user-select: none;
  background: linear-gradient(currentColor, currentColor) left bottom / 100% 1px no-repeat;
  padding-bottom: 4px;
  transition: opacity 160ms var(--ease-out);
}
.link:hover { opacity: .6; }

/* ---------- Navigation ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding-inline: var(--margin);
  color: var(--ink);
  transition: background-color 240ms var(--ease-out), box-shadow 240ms var(--ease-out), color 240ms var(--ease-out);
}
.nav::before {
  /* Blur lives on its own layer */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  opacity: 0;
  transition: opacity 240ms var(--ease-out);
}
/* Once the page moves the bar becomes a thin veil over what passes beneath,
   tinted toward the section it sits on rather than a band of its own */
.nav.is-scrolled { background: rgba(242, 238, 231, .86); }
.nav.is-scrolled::before { opacity: 1; }

/* Over Mocha and Ink sections the bar takes the night treatment */
.nav.is-dark { color: var(--bone); }
.nav.is-dark.is-scrolled { background: rgba(25, 23, 21, .14); }

.nav__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  transition: opacity 240ms var(--ease-out);
}
/* The hero carries the signature; the bar's logo waits until it has gone */
.nav.is-top .nav__brand { opacity: 0; pointer-events: none; }
.nav__mark { width: 33px; height: 22px; }
.nav__mark circle { transition: fill 240ms var(--ease-out), stroke 240ms var(--ease-out), opacity 240ms var(--ease-out); }
/* On dark surfaces the mark turns monochrome, like the favicon */
.nav.is-dark .nav__disc { fill: var(--bone); }
.nav.is-dark .nav__trace { stroke: var(--bone); }
.nav.is-dark .nav__trace--1 { opacity: .75; }
.nav.is-dark .nav__trace--2 { opacity: .45; }
.nav__wordmark {
  width: 132px;
  height: 14px;
  stroke-width: 1.4px;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--s4);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.nav__links a {
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
  transition: opacity 160ms var(--ease-out), background-color 240ms var(--ease-out), color 240ms var(--ease-out);
}
.nav__links a:not(.nav__cta) { opacity: .72; }
@media (hover: hover) and (pointer: fine) {
  .nav__links a:not(.nav__cta):hover { opacity: 1; }
  .nav__cta:hover { opacity: .82; }
}
/* The one solid object in the bar; it inverts with the surface */
.nav__cta {
  margin-left: var(--s1);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bone);
}
.nav.is-dark .nav__cta { background: var(--bone); color: var(--ink); }

@media (max-width: 760px) {
  .nav { height: 64px; }
  .nav__links a:not(.nav__cta) { display: none; }
  .nav__wordmark { width: 112px; }
}
@media (max-width: 359px) {
  .nav__mark { display: none; }
  .nav__wordmark { width: 104px; }
  .nav__cta { padding: 8px 14px; }
}

/* ---------- Hero ---------- */

/* Exactly one screen. The lockup scales to whichever axis runs out first:
   --w is the wordmark width; the symbol is 0.75w, its paper margin overlaps. */
.hero {
  --w: max(120px, min(50vw, calc((100svh - 300px) * 1.7), 1080px));
  height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 72px var(--margin) 0;
}

.hero__stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.hero__lockup {
  display: flex;
  align-items: center;
}

.hero__type {
  position: relative;
  width: var(--w);
}
.hero__wordmark {
  width: 100%;
  height: auto;
  aspect-ratio: 656 / 68;
}
.hero__claim {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: calc(var(--w) * .055);
  text-align: right;
}
.hero__tagline {
  font-size: clamp(15px, calc(var(--w) * .03), 28px);
  font-weight: 300;
  line-height: 1.3;
  letter-spacing: .01em;
  white-space: nowrap;
  color: var(--ink);
}
.hero__support {
  margin: var(--s1) 0 0 auto;
  max-width: 44ch;
  font-size: clamp(13px, calc(var(--w) * .015), 16px);
  font-weight: 300;
  line-height: 1.5;
  color: var(--ink-soft);
  text-wrap: balance;
}
.hero__cta { margin-top: var(--s3); }

.hero__symbol {
  width: calc(var(--w) * .65);
  flex-shrink: 0;
}
.mark { width: 100%; height: auto; overflow: visible; }


@media (max-width: 760px) {
  /* Phones: the lockup stacks, symbol above the wordmark, and the claim joins
     the flow so the whole group centres on the screen */
  .hero { --w: min(calc(100vw - 48px), calc((100svh - 260px) * 4)); padding-top: 64px; }
  .hero__lockup {
    flex-direction: column;
    align-items: flex-start;
    width: var(--w);
  }
  .hero__symbol {
    --s: min(58vw, calc(24svh * 280 / 220));
    order: -1;
    width: var(--s);
    /* The disc sits 28/280 into the mark; align its edge with the wordmark */
    margin: 0 0 calc(var(--s) * .14) calc(var(--s) * -28 / 280);
  }
  .hero__claim {
    position: static;
    margin-top: var(--s4);
    text-align: left;
  }
  .hero__tagline { font-size: 19px; white-space: normal; text-wrap: balance; }
  .hero__support { margin-left: 0; font-size: 14px; text-wrap: pretty; }
}

/* Partner strip: low and quiet, it adds credibility without competing.
   Two identical sets move by one set's width, so the loop is seamless. */
.logos {
  margin-inline: calc(var(--margin) * -1);
  padding-block: var(--s3) var(--s5);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent);
}
.logos__track {
  display: flex;
  width: max-content;
  animation: logos 64s linear infinite;
}
.logos__set {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.logos__set li {
  display: flex;
  align-items: center;
  height: 36px;
  padding-inline: clamp(36px, 4.5vw, 72px);
}
/* Monochrome and translucent, so the crests sit in the paper like a watermark */
.logos__set img {
  height: 100%;
  width: auto;
  filter: grayscale(1) contrast(.85);
  opacity: .38;
  mix-blend-mode: multiply;
}
/* A wide wordmark reads larger than a crest at the same height */
.logos__set .logos__wordmark { height: 72%; }
/* A tall shield reads smaller: let it stand a little prouder */
.logos__set .logos__crest { height: 118%; }
@keyframes logos { to { transform: translateX(-50%); } }

@media (max-width: 760px) {
  .logos { padding-block: var(--s2) var(--s4); }
  .logos__set li { height: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .logos__track { animation: none; }
}

/* ---------- Sections ---------- */

/* Every section holds at least one screen, its content centred in it, so each
   reads as its own scene and the nav never straddles two of them */
.section {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* The top clears the fixed nav; the content centres in what remains */
  padding-block: calc(72px + var(--s3)) var(--s4);
}
.section > .grid { width: 100%; }
.section--mocha { background: var(--mocha); color: var(--bone); }
.section--ink { background: var(--ink); color: var(--bone); }

@media (max-width: 760px) {
  .section { padding-block: calc(64px + var(--s4)) var(--s6); }
}
/* Desktop: scrolling settles on a section's edge when it comes to rest near
   one, so the nav always sits over a single section. Proximity, not mandatory:
   the pinned and taller sections still scroll freely */
@media (min-width: 761px) {
  html { scroll-snap-type: y proximity; }
  .hero, .section, .closing { scroll-snap-align: start; }
}

/* Short laptop screens: tighter rhythm so dense sections still fit one screen */
@media (min-width: 761px) and (max-height: 780px) {
  .section { padding-block: calc(72px + var(--s2)) var(--s2); }
  .section .chart, .section .value, .section .strata { margin-top: var(--s4); }
  .section .stratum { padding-block: var(--s2); }
}

/* 01 — Definition */

.dict { grid-column: 1 / span 7; }

.dict__word {
  font-weight: 300;
  font-size: clamp(54px, 8.4vw, 150px);
  line-height: .95;
  letter-spacing: -.04em;
}

.dict__meta {
  margin-top: var(--s3);
  font-size: 18px;
  color: var(--ink-soft);
}
.dict__meta em { margin-left: var(--s1); }

.dict__defs {
  margin-top: var(--s6);
  display: grid;
  gap: var(--s4);
  max-width: 600px;
}
.dict__defs li {
  display: grid;
  grid-template-columns: 24px 1fr;
  font-size: clamp(19px, 1.6vw, 23px);
  font-weight: 300;
  line-height: 1.45;
}
.dict__defs em { font-style: normal; color: var(--mocha); }
.dict__n {
  padding-top: 7px;
  font-size: 12px;
  color: var(--mineral);
}

/* Ends on the same line as the definitions */
.dict__aside {
  grid-column: 9 / -1;
  align-self: end;
  color: var(--ink-soft);
}

.trace-list {
  margin-top: var(--s5);
  border-top: 1px solid var(--hair);
}
.trace-list li {
  padding: var(--s2) 0;
  border-bottom: 1px solid var(--hair);
  font-size: 16px;
}
/* One voice down the chain; only where it leads is marked */
.trace-list li:last-child { color: var(--mocha); }

@media (max-width: 1080px) {
  .dict { grid-column: 1 / -1; }
  .dict__aside { grid-column: 1 / -1; margin-top: var(--s6); max-width: 560px; }
}

/* 02 — Tension (pinned; main.js drives the states) */

.tension__pin { padding-block: var(--s7); }

/* The lead sits level with the first line, read before it */
.tension__lead {
  grid-column: 1 / span 3;
  align-self: start;
  padding-top: calc(var(--lines) * .22);
  max-width: 24ch;
  font-size: 17px;
  font-weight: 300;
  color: rgba(242, 238, 231, .72);
}

.tension { --lines: clamp(32px, 3.7vw, 64px); }
.tension__lines {
  grid-column: 5 / -1;
  font-size: var(--lines);
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: -.025em;
}
.tension__lines li { transition: opacity 480ms var(--ease-out), transform 480ms var(--ease-out); }

/* The answer the lines lead to: the turn is quiet, the claim carries */
.tension__final {
  grid-column: 5 / -1;
  margin-top: var(--s6);
  max-width: 30ch;
  font-size: clamp(24px, 2.3vw, 38px);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -.015em;
  color: var(--pearl);
  transition: opacity 480ms var(--ease-out), transform 480ms var(--ease-out);
}
.tension__final span {
  display: block;
  margin-bottom: var(--s2);
  font-size: 17px;
  letter-spacing: 0;
  color: rgba(242, 238, 231, .62);
}

.motion .tension { height: calc(100svh + 6 * 42svh); }
.motion .tension__pin {
  position: sticky;
  top: 0;
  min-height: 100svh;
  display: flex;
  align-items: center;
}
.motion .tension__pin > .grid { width: 100%; }
.motion .tension__lines li { opacity: 0; transform: translateY(16px); }
.motion .tension__lines li.is-now { opacity: 1; transform: none; }
/* What disappears still leaves an impression */
.motion .tension__lines li.is-past { opacity: .2; transform: none; }
.motion .tension.is-resolved .tension__lines li.is-past { opacity: .1; }
.motion .tension__final { opacity: 0; transform: translateY(12px); }
.motion .tension__final.is-now { opacity: 1; transform: none; }

@media (max-width: 1080px) {
  .tension__lead { grid-column: 1 / -1; margin-bottom: var(--s5); padding-top: 0; }
  .tension__lines, .tension__final { grid-column: 1 / -1; }
}

/* 03 — System */

/* One screen: heading and triad side by side, the sequence runs beneath */
.system__heading { grid-column: 1 / span 6; }

.triad {
  grid-column: 8 / -1;
  grid-row: 1;
  align-self: end;
  display: grid;
  gap: var(--s3);
}
/* One sentence each: the term in ink, the rest recedes */
.triad__item {
  font-size: clamp(20px, 1.7vw, 24px);
  font-weight: 300;
  line-height: 1.3;
  color: var(--ink-soft);
}
.triad__k { font-weight: 400; color: var(--ink); }

/* Sequence: one axis that deepens left to right, and markers that grow at
   each step — what each interaction adds to the last */
.sequence {
  grid-column: 1 / -1;
  position: relative;
  margin-top: var(--s7);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--gutter);
}
.sequence__axis {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, var(--hair), var(--mocha));
}
.sequence__step {
  --dot: 6px;
  --tone: 40%;
  position: relative;
  padding-top: var(--s4);
}
.sequence__step:nth-child(3) { --dot: 8px;  --tone: 55%; }
.sequence__step:nth-child(4) { --dot: 10px; --tone: 70%; }
.sequence__step:nth-child(5) { --dot: 12px; --tone: 85%; }
.sequence__step:nth-child(6) { --dot: 14px; --tone: 100%; }
.sequence__step::before {
  content: "";
  position: absolute;
  top: calc(var(--dot) / -2);
  left: 0;
  width: var(--dot);
  height: var(--dot);
  border-radius: 50%;
  background: color-mix(in srgb, var(--mocha) var(--tone), var(--bone));
}
.sequence__n { font-size: 13px; font-variant-numeric: tabular-nums; color: #85807B; }
.sequence h3 { margin-top: var(--s1); font-size: 19px; font-weight: 500; }
.sequence p { margin-top: var(--s1); font-size: 15px; line-height: 1.55; color: var(--ink-soft); }

@media (max-width: 1080px) {
  .system__heading { grid-column: 1 / -1; }
  .triad { grid-column: 1 / -1; grid-row: auto; margin-top: var(--s6); }
  .sequence { grid-template-columns: repeat(2, 1fr); row-gap: var(--s5); }
  .sequence__axis { display: none; }
  .sequence__step { border-top: 1px solid var(--hair); }
}
@media (max-width: 760px) {
  .sequence { grid-template-columns: 1fr; margin-top: var(--s7); }
}

/* 04 — Afterimage OS (intelligence mode: ink-led, grid visible) */

.grid--visible { position: relative; }
.grid--visible::before {
  content: "";
  position: absolute;
  inset: calc(var(--s7) * -1) var(--margin) calc(var(--s8) * -1);
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to right,
    rgba(242, 238, 231, .045) 0 1px,
    transparent 1px calc((100% + var(--gutter)) / 12)
  );
}

.os__heading { grid-column: 1 / span 6; }
.os__text {
  grid-column: 7 / -1;
  max-width: 60ch;
  align-self: end;
  position: relative;
}
.os__lede { color: rgba(242, 238, 231, .7); }
.os__foot { margin-top: var(--s2); font-style: italic; font-weight: 300; color: var(--pearl); }

/* Four strata: one aligned column to scan, tone deepening from the
   experience people touch to the intelligence that remains */
.strata {
  grid-column: 1 / -1;
  position: relative;
  margin-top: var(--s6);
  border-radius: 2px;
  overflow: hidden;
}
.stratum {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gutter);
  align-items: center;
  padding: var(--s3) 0;
  background: var(--tone);
}
.stratum:nth-child(1) { --tone: #5A3F30; }
.stratum:nth-child(2) { --tone: #45332A; }
.stratum:nth-child(3) { --tone: #342A24; }
.stratum:nth-child(4) { --tone: #26221F; box-shadow: inset 0 1px 0 rgba(230, 220, 206, .1); }
.stratum dt {
  grid-column: 1 / span 5;
  padding-left: var(--s4);
  display: flex;
  align-items: baseline;
  gap: var(--s3);
  font-size: clamp(20px, 1.7vw, 26px);
  font-weight: 300;
  letter-spacing: -.01em;
}
.stratum dt span {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--pearl);
  opacity: .7;
}
.stratum dd {
  grid-column: 7 / -1;
  max-width: 60ch;
  padding-right: var(--s4);
  font-size: 15px;
  line-height: 1.5;
  color: rgba(242, 238, 231, .72);
}

@media (max-width: 1080px) {
  .os__heading, .os__text { grid-column: 1 / -1; }
  .os__text { margin-top: var(--s4); max-width: 56ch; }
}
@media (max-width: 760px) {
  .grid--visible::before { display: none; }
  .strata { margin-top: var(--s6); }
  .stratum { grid-template-columns: 1fr; gap: var(--s1); padding: var(--s4) var(--s3); }
  .stratum dt, .stratum dd { grid-column: auto; }
  .stratum dt { padding-left: 0; }
  .stratum dd { padding-right: 0; }
  .stratum dt { font-size: 21px; }
  .stratum dd { font-size: 15px; }
}

/* 03 — Compound */

.compound__heading { grid-column: 1 / span 8; }
.compound__aside {
  grid-column: 9 / -1;
  align-self: end;
  color: var(--ink-soft);
}

.chart {
  grid-column: 1 / -1;
  position: relative;
  margin-top: var(--s5);
}
/* Each line is named where it ends, in a margin to the right of the plot:
   one finishes back at nothing, the other where it has climbed to */
.chart { --label-w: 180px; }
.chart__plot { margin-right: calc(var(--label-w) + var(--s3)); }
.chart__plot { position: relative; }
.chart__label {
  position: absolute;
  left: calc(100% + var(--s3));
  width: var(--label-w);
  font-size: 14px;
  line-height: 1.35;
  transform: translateY(-50%);
}
.chart__label--iso { top: calc(350 / 380 * 100%); color: #85807B; }
.chart__label--ai { top: calc(60 / 380 * 100%); color: var(--mocha); }
.chart__end {
  position: absolute;
  right: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  transform: translate(50%, -50%);
}
.chart__end--iso { top: calc(350 / 380 * 100%); background: var(--bone); box-shadow: inset 0 0 0 1.5px var(--mineral); }
.chart__end--ai { top: calc(60 / 380 * 100%); background: var(--mocha); }

/* The figure gives up height on short screens so the section stays one screen;
   strokes keep their weight while it stretches */
.chart__svg { display: block; width: 100%; height: clamp(180px, calc(100svh - 500px), 400px); overflow: visible; }
.chart__svg path, .chart__svg line { vector-effect: non-scaling-stroke; }
.chart__base { stroke: var(--hair); stroke-width: 1; }
.chart__line { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.chart__line--iso { stroke: var(--mineral); stroke-width: 1.5; opacity: .7; }
.chart__line--ai { stroke: var(--mocha); stroke-width: 2.5; }
.chart__area { fill: rgba(90, 63, 48, .05); }

.chart__caption {
  margin-top: var(--s2);
  font-size: 12px;
  color: #85807B;
}

/* The plot is uncovered once, left to right, so both lines and the fill
   arrive together; names and end points follow once it has finished */
.motion .chart__svg { clip-path: inset(-12px 100% -12px -12px); }
.motion .chart.is-in .chart__svg { animation: uncover 2000ms var(--ease-out) forwards; }
.motion .chart__label,
.motion .chart__end { opacity: 0; transition: opacity 600ms var(--ease-out) 1700ms; }
.motion .chart.is-in .chart__label,
.motion .chart.is-in .chart__end { opacity: 1; }
@keyframes uncover { to { clip-path: inset(-12px -12px -12px -12px); } }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* Intended areas of value: four short items, not a text block */
.value {
  grid-column: 1 / -1;
  margin-top: var(--s5);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gutter);
}
.value li {
  padding: var(--s2) var(--s3) 0 0;
  border-top: 1px solid var(--hair);
  font-size: 17px;
  font-weight: 300;
  line-height: 1.4;
  text-wrap: balance;
}

/* 07 — Difference */

.difference__heading { grid-column: 1 / span 9; max-width: 22ch; }

/* Three columns, ruled like the value list: what others do fades,
   what Afterimage does stays in full ink */
.contrast {
  grid-column: 1 / -1;
  margin-top: var(--s7);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gutter);
}
.contrast__row {
  padding-top: var(--s3);
  border-top: 1px solid var(--hair);
}
.contrast__a {
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -.01em;
}
.contrast__b {
  margin-top: var(--s3);
  max-width: 34ch;
  font-size: 17px;
  font-weight: 300;
  line-height: 1.5;
  color: var(--ink);
}
.contrast__them { color: #85807B; }

@media (max-width: 1080px) {
  .compound__heading, .compound__aside, .difference__heading { grid-column: 1 / -1; }
  .compound__aside { margin-top: var(--s4); max-width: 52ch; }
  .value { grid-template-columns: repeat(2, 1fr); row-gap: var(--s4); }
}
@media (max-width: 760px) {
  .value { grid-template-columns: 1fr; row-gap: var(--s2); }
  .contrast { grid-template-columns: 1fr; row-gap: var(--s5); }
  .chart { --label-w: 76px; }
  .chart__plot { margin-right: calc(var(--label-w) + var(--s2)); }
  .chart__label { left: calc(100% + var(--s2)); font-size: 12px; }
}

/* 06 — Heritage */

/* One screen: the copy sets the height, the figure fills it beside the copy */
.heritage__copy { grid-column: 1 / span 6; }
.heritage__text {
  margin-top: var(--s4);
  max-width: 52ch;
  color: var(--ink-soft);
}
.heritage__figure {
  grid-column: 7 / -1;
  position: relative;
}
/* Absolutely placed so it takes the copy's height without adding to it;
   the viewBox keeps it square and centred */
.heritage__figure svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.heritage__orbit { fill: none; stroke: var(--mineral); stroke-width: .8; opacity: .8; }
.heritage__orbit--near { stroke: #C9B8A8; opacity: .6; }
.heritage__nodes { fill: var(--mocha); }
.heritage__ring-label {
  font-family: var(--font);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .36em;
  text-transform: uppercase;
  fill: #85807B;
}
.heritage__core {
  font-family: var(--font);
  font-size: 15px;
  font-weight: 300;
  letter-spacing: .04em;
  fill: var(--bone);
}
/* Technology turns around what stays at the centre */
.heritage__layer { transform-origin: 160px 160px; }
.motion .heritage__layer { animation: orbit 90s linear infinite; }
@keyframes orbit { to { transform: rotate(1turn); } }

.principles {
  margin-top: var(--s5);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gutter);
}
.principles li {
  padding-top: var(--s2);
  border-top: 1px solid var(--hair);
  font-size: clamp(18px, 1.5vw, 22px);
  font-weight: 300;
  font-style: italic;
  line-height: 1.35;
  max-width: 30ch;
}

@media (max-width: 1080px) {
  .heritage__copy { grid-column: 1 / -1; }
  .heritage__figure {
    grid-column: 1 / -1;
    justify-self: center;
    width: min(100%, 320px);
    aspect-ratio: 1;
    margin-top: var(--s6);
  }
}
@media (max-width: 760px) {
  .principles { grid-template-columns: 1fr; gap: var(--s3); }
}

/* ---------- Closing: an afterimage the visitor makes ---------- */

.closing {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  min-height: 100svh;
  padding-block: var(--s8) var(--s6);
  background: var(--ink);
  color: var(--bone);
}

/* Ink / night: deep ink with a mocha undertone */
.closing::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 60% 70% at 72% 42%, rgba(90, 63, 48, .22), transparent 70%);
}

.closing__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.closing__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  align-items: end;
}

.closing__copy { grid-column: 1 / span 7; }

.closing__title {
  margin-top: var(--s3);
  font-weight: 300;
  font-size: clamp(44px, 6.2vw, 104px);
  line-height: 1;
  letter-spacing: -.03em;
  max-width: 11ch;
}

.closing__lede {
  margin-top: var(--s4);
  max-width: 44ch;
  color: rgba(242, 238, 231, .66);
}

.closing__contact {
  margin-top: var(--s5);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3);
}
.closing__contact .button {
  background: var(--bone);
  color: var(--ink);
  text-transform: none;
  letter-spacing: .02em;
  font-size: 15px;
}
.closing__contact .button:hover { background: var(--pearl); }
.closing__who {
  font-size: 13px;
  line-height: 1.7;
  color: rgba(242, 238, 231, .5);
}
.closing__who a {
  color: var(--bone);
  text-decoration: none;
  transition: color 160ms var(--ease-out);
}
.closing__who a:hover { color: var(--pearl); }

@media (max-width: 1080px) {
  .closing__copy { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  /* Reserve the upper field for the symbol (radius ≤150px, see main.js) */
  .closing { padding-top: calc(min(60vw, 300px) + 120px); }
}

/* ---------- Footer ---------- */

/* The closing scene continues: same night, no seam */
.footer {
  position: relative;
  overflow: hidden;
  padding: var(--s6) var(--margin) 0;
  background: var(--ink);
  color: var(--bone);
}
/* A mocha dawn behind the signature */
.footer::before {
  content: "";
  position: absolute;
  inset: auto -10% 0;
  height: 70%;
  pointer-events: none;
  background: radial-gradient(ellipse 50% 70% at 50% 100%, rgba(90, 63, 48, .7), transparent 72%);
}
.footer > * { position: relative; }

.footer__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s2) var(--s5);
  padding-top: var(--s3);
  border-top: 1px solid var(--hair-light);
  font-size: 15px;
  font-weight: 300;
}
.footer__line { color: rgba(242, 238, 231, .55); }
.footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1) var(--s4);
}
.footer__nav a {
  color: rgba(242, 238, 231, .55);
  text-decoration: none;
  white-space: nowrap;
  transition: color 160ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .footer__nav a:hover { color: var(--bone); }
}
/* The wordmark spans the page in a heavier stroke; two traces trail it like
   the symbol's, the base fades into the night and the page edge cuts it */
.footer__sign {
  --gap: 1.1%;
  /* Nearly edge to edge, leaving room on the right for the traces */
  margin: var(--s7) calc(var(--margin) * -1 + 2.5%) -2vw;
  margin-right: calc(var(--margin) * -1 + 2.5% + 2 * var(--gap));
  aspect-ratio: 656 / 68;
  -webkit-mask-image: linear-gradient(#000 35%, transparent 96%);
  mask-image: linear-gradient(#000 35%, transparent 96%);
}
.footer__sign svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  stroke-width: 2.6;
}
.footer__wordmark { color: var(--bone); }
.footer__trace { color: var(--mocha); transform: translateX(var(--gap)); }
.footer__trace--far { color: var(--mineral); opacity: .22; transform: translateX(calc(var(--gap) * 2)); }

/* Once, as the footer arrives: the traces slide out of the word. The sign is
   mostly below the fold, so the bar above it triggers the moment */
.motion .footer__trace { transition: transform 1400ms var(--ease-out) 200ms, opacity 1400ms var(--ease-out) 200ms; }
.motion .footer__trace--far { transition-delay: 320ms; }
.motion .footer__bar:not(.is-in) ~ .footer__sign .footer__trace { transform: none; opacity: 0; }

@media (max-width: 760px) {
  .footer__bar { flex-direction: column; }
  .footer__sign {
    margin-top: var(--s6);
    margin-bottom: 0;
    -webkit-mask-image: linear-gradient(#000 55%, transparent 100%);
    mask-image: linear-gradient(#000 55%, transparent 100%);
  }
  .footer__sign svg { stroke-width: 3.4; }
}

/* ---------- Motion: movement leaves evidence ---------- */

/* Text / UI: 240–480ms · fade + 8–16px directional shift · cubic ease-out */
.js .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 480ms var(--ease-out),
    transform 480ms var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* Headings: the source appears, its traces extend, then resolve into clarity */
.motion .ghost.is-in:not(.ghost--hover) .ghost__t {
  animation: ghost-trace 1100ms var(--ease-out) both;
  animation-delay: calc(var(--d, 0ms) + 140ms);
}
.motion .ghost.is-in:not(.ghost--hover) .ghost__t + .ghost__t {
  animation-name: ghost-trace-far;
  animation-delay: calc(var(--d, 0ms) + 220ms);
}
@keyframes ghost-trace {
  0%   { opacity: 0; transform: translateX(0); }
  20%  { opacity: .32; }
  100% { opacity: 0; transform: translateX(.16em); }
}
@keyframes ghost-trace-far {
  0%   { opacity: 0; transform: translateX(0); }
  25%  { opacity: .2; }
  100% { opacity: 0; transform: translateX(.34em); }
}

/* Symbol reveal: 900–1200ms · sequential displacement · the source appears
   before its traces, which slide out from behind it as opacity decays in */
.js .mark__trace { animation: trace-out 900ms var(--ease-out-strong) both; }
.js .mark__trace--1 { --from: -43px; animation-delay: 360ms; }
.js .mark__trace--2 { --from: -78px; animation-delay: 520ms; animation-duration: 1100ms; }
@keyframes trace-out {
  from { opacity: 0; transform: translateX(var(--from)); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Landing sequence ---------- */

/* 1 · A stimulus on Ink. 2 · The light goes; Bone floods in and the Mocha disc
   remains — the afterimage. 3 · It travels into the lockup, leaving traces.
   4 · The wordmark draws itself; the page settles. Any input skips to the end. */

.landing { display: none; }
.landing.is-live {
  --d: min(40vmin, 420px);
  display: block;
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
}
.landing__field {
  position: absolute;
  inset: 0;
  background: var(--ink);
}
.landing__light,
.landing__flood,
.landing__disc {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--d);
  height: var(--d);
  margin: calc(var(--d) / -2) 0 0 calc(var(--d) / -2);
  border-radius: 50%;
}
.landing__light {
  background: radial-gradient(circle at 38% 32%, #FFFFFF 0%, var(--bone) 52%, var(--pearl) 100%);
  /* Restrained bloom: an edge of light, never a neon glow */
  box-shadow: 0 0 48px 6px rgba(230, 220, 206, .22), 0 0 140px 30px rgba(230, 220, 206, .07);
  opacity: 0;
}
.landing__disc { opacity: 0; overflow: visible; will-change: transform, opacity; }
/* The light floods the field: Bone expands from the stimulus, never through grey */
.landing__flood { background: var(--bone); opacity: 0; will-change: transform; }
.landing__trace {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(168, 165, 161, .9);
  pointer-events: none;
}

/* Hero states while the sequence runs */
.nav { transition-property: background-color, box-shadow, color, opacity; }
html.intro:not(.intro-done) .nav { opacity: 0; }
html.intro:not(.intro-done) .hero__claim,
html.intro:not(.intro-done) .logos { opacity: 0; transform: translateY(8px); }
.hero__claim, .logos { transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out); }
html.intro:not(.intro-land) .mark__disc,
html.intro:not(.intro-land) .mark__trace { animation: none; opacity: 0; }
html.intro.intro-land .mark__trace--1 { animation-delay: 120ms; }
html.intro.intro-land .mark__trace--2 { animation-delay: 280ms; }
html.intro .hero__wordmark path { stroke-dasharray: 1; stroke-dashoffset: 1; }
html.intro.intro-type .hero__wordmark path {
  animation: draw 900ms var(--ease-out) forwards;
  animation-delay: calc(var(--i, 0) * 70ms);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .js .mark__trace { animation: none; opacity: 1; }
}
