/* manifesto — typographic interlude: the studio's one sentence is
   crushed word by word as you scroll (serif -> Anton, scroll-driven).
   Pure typography: no images, no decoration beyond the hairline frame. */

.manifesto {
  position: relative;
}

/* the long scroll track only exists when the scroll-driven crush can run;
   without JS the section is a single static poster (no dead scrolling) */
.manifesto--js {
  height: 260vh;
  height: 260svh;
}

.manifesto-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 clamp(24px, 5vw, 72px);
}

/* ---------- the sentence ---------- */

.manifesto-sentence {
  max-width: 14ch;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(40px, 5.5vw, 96px);
  line-height: 1.15;
  letter-spacing: normal;
  color: var(--ink);
  text-wrap: balance;
}

.manifesto-word {
  display: inline-block;
  color: var(--ink);
}

/* soft "unpressed" state only while JS will resolve it — the no-JS
   fallback keeps the sentence at full ink */
.manifesto--js .manifesto-word {
  color: var(--ink-soft);
}

/* crushed: same font-size box, Anton is narrower so the word physically
   compacts — like a press stamping it flat. Condensed system fallback
   keeps the compaction if Anton fails to load. */
.manifesto-word--crushed,
.manifesto--js .manifesto-word--crushed {
  font-family: "Anton", "Arial Narrow", "Helvetica Neue Condensed", var(--font-sans);
  font-weight: 400;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--ink);
}

@media (prefers-reduced-motion: no-preference) {
  .manifesto-word--crushed {
    animation: manifesto-snap 180ms ease-out both;
  }
}

@keyframes manifesto-snap {
  0%   { transform: translateY(-0.08em); }
  65%  { transform: translateY(0.015em); }
  100% { transform: translateY(0); }
}

/* ---------- kicker / caption ---------- */

.manifesto-kicker {
  position: absolute;
  top: clamp(104px, 13vh, 124px);
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: var(--ls-kicker);
  text-transform: uppercase;
  color: var(--ink);
}

.manifesto-caption {
  position: absolute;
  bottom: clamp(44px, 8vh, 72px);
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: var(--ls-kicker);
  text-transform: uppercase;
  color: var(--ink);
  transition: opacity 0.4s ease-out;
}

/* ---------- done state: sentence mounted as a poster ---------- */

/* hairline frame, inset around the viewport content */
.manifesto-sticky::after {
  content: "";
  position: absolute;
  inset: clamp(88px, 11vh, 100px) clamp(16px, 2.5vw, 32px) clamp(16px, 2.5vw, 32px);
  border: 1px solid var(--hairline);
  pointer-events: none;
  transition: opacity 0.5s ease-out;
}

/* frame + caption are hidden only while JS drives the reveal; without JS
   the finished poster (frame, caption, full-ink sentence) shows by default */
.manifesto--js .manifesto-sticky::after { opacity: 0; }
.manifesto--js .manifesto-caption { opacity: 0; }

.manifesto--done .manifesto-sticky::after { opacity: 1; }
.manifesto--done .manifesto-caption { opacity: 1; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .manifesto-sticky { padding: 0 24px; }
  /* clearance derives from the measured sticky-header height
     (set by js/manifesto.js as --manifesto-header-h), not magic numbers */
  .manifesto-sticky::after {
    inset: calc(var(--manifesto-header-h, 80px) + 16px) 12px 12px;
  }
  .manifesto-kicker { top: calc(var(--manifesto-header-h, 80px) + 20px); }
  .manifesto-caption {
    bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 640px) {
  /* shorter track: ~1 viewport of thumb travel is enough for 8 words */
  .manifesto--js {
    height: 180vh;
    height: 180svh;
  }
  /* fluid floor: ~41px at 390 (matches current look), ~34px at 320,
     keeping both serif and crushed states on two lines */
  .manifesto-sentence {
    font-size: clamp(30px, 10.5vw, 44px);
  }
}
