@font-face {
  font-family: "Groatesk";
  src: url("fonts/Groatesk-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #fff;
  --ink: #0d0f12;
  --mute: #43474c;
  --soft: #8c9096;
  --faint: #cfd1d4;
  --accent: #55708a;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

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

html { background: var(--bg); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 "Groatesk", system-ui, sans-serif;
  letter-spacing: -0.0075em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, p, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; text-decoration: none; }

.stamp, .badge, .route-label, .links {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-variant-numeric: tabular-nums;
}

.folio {
  min-height: calc(100dvh + 200px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 120px 16px 200px;
}

/* intro */
.intro { width: 460px; max-width: 100%; text-align: center; }
.intro h1 { font-size: 20px; line-height: 32px; font-weight: 400; letter-spacing: -0.02em; text-wrap: balance; }

/* timeline */
.route {
  --stamp: 80px;
  --line: 120px;
  --content: 156px;
  position: relative;
  width: 100%;
  max-width: calc(var(--content) + 520px);
  margin-top: 56px;
}
.route-head { position: relative; height: 56px; }
.route-label {
  position: absolute;
  left: calc(var(--line) - 40px);
  top: 20px;
  width: 80px;
  text-align: center;
  font-size: 8px;
  line-height: 10px;
  color: var(--accent);
}

.stops { position: relative; }
.stops::before {
  content: "";
  position: absolute;
  top: -22px; bottom: -20px;
  left: calc(var(--line) - 6px);
  width: 12px;
  background: radial-gradient(circle at 50% 1px, var(--faint) 1px, transparent 1.5px) 0 0 / 12px 7px repeat-y;
}

.drift {
  position: absolute;
  top: 56px;
  left: calc(var(--line) - 6px);
  z-index: 3;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--accent);
  will-change: transform;
}

.stop { position: relative; padding-left: var(--content); padding-bottom: 72px; }
.stop:last-child { padding-bottom: 0; }
.stop::before {
  content: "";
  position: absolute;
  top: 10px;
  left: calc(var(--line) - 4px);
  z-index: 1;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 1.5px var(--faint);
  transition: box-shadow 200ms var(--ease-out), background-color 200ms var(--ease-out);
}
.stop.passed::before { background: var(--accent); box-shadow: 0 0 0 1.5px var(--accent); }

.stop a::after { content: ""; position: absolute; inset: -8px -8px -16px 0; }
.stop a .arrow {
  display: inline-block;
  margin-left: 6px;
  color: var(--soft);
  transition: transform 200ms var(--ease-out), color 200ms var(--ease-out);
}
.stop a:active .arrow { transform: translateX(2px) scale(0.97); }
.stop a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.stop a:focus-visible .arrow { color: var(--accent); }
@media (hover: hover) and (pointer: fine) {
  .stop a:hover .arrow { transform: translateX(4px); color: var(--accent); }
}

.stamp { position: absolute; left: 0; top: 2px; width: var(--stamp); text-align: right; }
.stamp .code { display: block; font-size: 7px; line-height: 8px; letter-spacing: 0.1em; color: var(--faint); }
.stamp .date { display: block; font-size: 12px; line-height: 15px; letter-spacing: 0.08em; color: var(--soft); }

.stop h2 { font-size: 16px; font-weight: 400; line-height: 28.8px; }
.badge { margin-left: 6px; font-size: 12px; letter-spacing: 0.08em; color: var(--accent); }
.role, .desc { color: var(--mute); line-height: 25.6px; }
.desc { margin-top: 10px; text-wrap: pretty; }

.route-end {
  display: block;
  width: 7px; height: 7px;
  margin: 44px 0 0 calc(var(--line) - 3.5px);
  border-right: 1.5px solid var(--accent);
  border-bottom: 1.5px solid var(--accent);
  transform: rotate(45deg);
}

/* footer links */
.links {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 28px;
  padding: 72px 16px calc(24px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, transparent, var(--bg) 70%);
  font-size: 12px;
  color: var(--soft);
  pointer-events: none;
}
.links a {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: -12px 0;
  touch-action: manipulation;
  transition: color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.links a:active { transform: scale(0.97); }
.links a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

@media (hover: hover) and (pointer: fine) {
  .links a:hover { color: var(--ink); }
}

/* simple text pages */
.doc { max-width: 460px; margin: 0 auto; padding: 120px 16px 200px; text-align: center; }
.doc h1 { font-size: 20px; line-height: 32px; font-weight: 400; letter-spacing: -0.02em; }
.doc .lead { margin-top: 8px; color: var(--mute); text-wrap: balance; }
.doc h2 { margin-top: 48px; font-size: 12px; font-weight: 400; line-height: 16px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--accent); }
.doc ul { margin-top: 12px; display: grid; gap: 8px; color: var(--mute); }
.doc p { color: var(--soft); }
.doc .lead + .lead { margin-top: 16px; }

/* entrance: once, only with JS */
.js .reveal { opacity: 0; transform: translateY(12px); }
.js .reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out);
}

@media (max-width: 560px) {
  .folio { padding-top: 80px; }
  .route { --stamp: 52px; --line: 84px; --content: 116px; }
  .badge { letter-spacing: 0.04em; }
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal { transform: none; }
  .js .reveal.in { transition: opacity 300ms var(--ease-out); }
  .links a { transition: color 160ms var(--ease-out); }
}

/* logo mark */
.mark { position: absolute; top: 28px; left: 50%; z-index: 4; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; transform: translateX(-50%); color: var(--ink); transition: transform 160ms var(--ease-out); }
.mark { font-size: 24px; line-height: 1; letter-spacing: -0.03em; }
.mark:active { transform: translateX(-50%) scale(0.97); }
.mark:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.folio { padding-top: 160px; }
.doc { padding-top: 160px; }
@media (max-width: 560px) { .folio { padding-top: 130px; } }

.route-end { transition: opacity 200ms var(--ease-out); }
.route.at-end .route-end { opacity: 0; }

/* banner: arrives when the marker reaches the arrow */
.banner {
  position: fixed;
  left: 50%; bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 5;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  border-radius: 999px;
  background: var(--ink); color: #fff;
  font-size: 14px;
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out);
}
.banner.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.banner.show:active { transform: translate(-50%, 0) scale(0.97); }
.banner .arrow { display: inline-block; transition: transform 200ms var(--ease-out); }
.banner:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { .banner:hover .arrow { transform: translateX(3px); } }

/* huxley page: one screen, no scroll */
html:has(body.fit) { overflow: hidden; }
body.fit { height: 100dvh; overflow: hidden; }
.stage {
  height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  gap: clamp(24px, 5vw, 72px);
  padding: 88px 24px 80px;
}
.stage .doc { flex: 0 1 460px; max-width: 460px; margin: 0; padding: 0; }
.stage .doc h2 { margin-top: 24px; }
.stage .doc ul { margin-top: 8px; gap: 2px; }
.stage .doc .lead + .lead { margin-top: 8px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.shot {
  flex: none;
  height: min(100%, 440px, calc((100vw - 460px - 160px) * 2 / 3));
  aspect-ratio: 3 / 4;
  border-radius: 20px;
  background: linear-gradient(160deg, #eef2f5, #dbe3ea);
}
@media (max-width: 860px) { .shot { display: none; } .pair { grid-template-columns: 1fr; gap: 0; } }

/* posters */
.shot { container-type: inline-size; position: relative; overflow: hidden; border-radius: 6px; }
.poster-a { background: var(--accent); color: #fff; background-image: none; }
.poster-a .tile {
  position: absolute; inset: 0; margin: 0;
  font-size: 6.4cqw; line-height: 0.95; letter-spacing: 0.02em; text-transform: uppercase;
  word-break: break-all; overflow: hidden; text-align: justify;
  color: rgba(255,255,255,0.22);
  -webkit-mask: radial-gradient(ellipse 62% 48% at 50% 62%, transparent 0 55%, #000 100%);
          mask: radial-gradient(ellipse 62% 48% at 50% 62%, transparent 0 55%, #000 100%);
}
.poster-a .tag { position: absolute; left: 8cqw; top: 8cqw; font-size: 4.4cqw; letter-spacing: 0.15em; text-transform: uppercase; }
.poster-a .big { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; font-size: 26cqw; letter-spacing: -0.05em; line-height: 1; }
.poster-b { background: #f3f5f6; color: var(--ink); }
.poster-b .tag { position: absolute; left: 8cqw; top: 7cqw; font-size: 9cqw; letter-spacing: -0.03em; }
.poster-b .foot { position: absolute; left: 8cqw; bottom: 7cqw; font-size: 4cqw; line-height: 1.35; color: var(--mute); }
.rings { position: absolute; left: 8cqw; right: 8cqw; top: 22cqw; bottom: 24cqw; }
.rings i { position: absolute; display: block; border-radius: 1cqw; }
.rings i:nth-child(1) { inset: 0; background: #55708a; }
.rings i:nth-child(2) { inset: 9% 11%; background: #7d95aa; }
.rings i:nth-child(3) { inset: 18% 22%; background: #a9bccb; }
.rings i:nth-child(4) { inset: 27% 33%; background: linear-gradient(#e9f0f5, #c7d6e2); }

.poster-a img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block}

.poster-b img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block}
.shot{border-radius:4px}

/* legal pages */
.legal { max-width: 560px; margin: 0 auto; padding: 160px 16px 200px; }
.legal h1 { font-size: 20px; line-height: 32px; font-weight: 400; letter-spacing: -0.02em; text-align: center; }
.legal h2 { margin-top: 40px; font-size: 12px; font-weight: 400; line-height: 16px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--accent); }
.legal p { margin-top: 8px; color: var(--mute); text-wrap: pretty; }
@media (max-width: 560px) { .legal { padding-top: 130px; } }

/* timeline label, trail and marker */
.route-label { left: var(--line); width: auto; transform: translateX(-50%); top: 16px; padding: 0; background: none; color: var(--accent); font-size: 14px; line-height: 16px; letter-spacing: -0.01em; text-transform: none; }
.trail { position: absolute; top: 62px; left: calc(var(--line) - 1px); z-index: 1; width: 2px; background: var(--accent); transform-origin: top; transform: scaleY(0); will-change: transform; }
.drift { opacity: 0; transition: opacity 300ms var(--ease-out); }
.route.moving .drift { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .drift { transition: none; } }

/* marker: small, no ring; trail starts under the label */
.drift { top: 30px; left: calc(var(--line) - 3px); width: 6px; height: 6px; box-shadow: none; }
.trail { top: 33px; }
