:root {
  --bg: #000;
  --fg: #fff;
  --dim: #5c5c5c;
  --mid: #9b9b9b;
  --soft: #cfcfcf;
  --line: rgba(255, 255, 255, 0.14);
  --gutter: clamp(16px, 2.6vw, 36px);
  --font: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--fg); font-family: var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
::selection { background: #fff; color: #000; }

/* ---------- full-screen stage (background animation / video) ---------- */
.stage { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #000; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity 0.6s ease; }
.stage .layer { position: absolute; inset: 0; opacity: 0; transition: opacity 1.1s ease; }
.stage .layer.on { opacity: 1; }
.stage .layer video, .stage .layer img { width: 100%; height: 100%; object-fit: cover; display: block; }
.stage .layer img { animation: drift 22s ease-in-out infinite alternate; }
@keyframes drift { from { transform: scale(1.03); } to { transform: scale(1.14) translate(-1.5%, -1%); } }
.stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0,0,0,.7) 0%, rgba(0,0,0,.2) 55%, rgba(0,0,0,.05) 100%),
    linear-gradient(0deg, rgba(0,0,0,.65) 0%, transparent 50%);
}

/* ---------- top bar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 22px var(--gutter);
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
}
.topbar .left { justify-self: start; }
.topbar .right { justify-self: end; }
.topbar a { text-decoration: none; color: var(--mid); transition: color 0.25s; }
.topbar a:hover, .topbar a:focus-visible { color: var(--fg); }
.topbar .brand { color: var(--fg); font-weight: 600; letter-spacing: 0.22em; }

/* ---------- reel (the big list) ---------- */
body.stage-page { height: 100vh; height: 100dvh; overflow: hidden; }
.reel { position: fixed; left: var(--gutter); right: var(--gutter); bottom: clamp(28px, 6vh, 64px); z-index: 5; }
.reel-eyebrow {
  display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap;
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--mid);
  margin-bottom: clamp(14px, 2.4vh, 24px);
}
.reel-eyebrow a { color: var(--mid); text-decoration: none; transition: color .25s; }
.reel-eyebrow a:hover { color: var(--fg); }
.reel ol {
  list-style: none; max-height: 64vh; overflow-y: auto; scrollbar-width: none;
  padding-right: 8px;
}
.reel ol::-webkit-scrollbar { display: none; }
.reel li { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.reel-item {
  background: none; border: 0; cursor: pointer; text-align: left; color: var(--dim);
  font: inherit; font-weight: 500; font-size: clamp(30px, 5.4vw, 72px);
  letter-spacing: -0.025em; line-height: 1.08;
  display: inline-flex; align-items: flex-start; gap: 0.32em;
  transition: color 0.35s ease;
}
.reel-item:hover, .reel-item:focus-visible, li.active .reel-item { color: var(--fg); }
.reel-item:focus-visible { outline: 1px solid rgba(255,255,255,.5); outline-offset: 4px; }
.reel-num { font-size: 0.24em; letter-spacing: 0.08em; margin-top: 0.62em; min-width: 2.2em; }
.reel-item sup { font-size: 0.19em; letter-spacing: 0.08em; margin-top: 0.4em; vertical-align: top; }
.reel-enter {
  font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; text-decoration: none; color: var(--fg);
  border-bottom: 1px solid rgba(255,255,255,.45); padding-bottom: 3px;
  opacity: 0; transform: translateX(-10px); pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease, border-color .25s;
}
.reel-enter:hover { border-color: #fff; }
li.active .reel-enter { opacity: 1; transform: none; pointer-events: auto; }
.reel-empty { color: var(--mid); font-size: 18px; }

.caption {
  position: fixed; right: var(--gutter); bottom: clamp(28px, 6vh, 64px); z-index: 5;
  width: min(340px, 30vw); font-size: 14px; line-height: 1.6; color: var(--soft);
  opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s ease;
}
.caption.on { opacity: 1; transform: none; }
.caption-k { display: block; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--mid); margin-bottom: 10px; }
.bottombar {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 6;
  display: flex; align-items: center; gap: 22px; white-space: nowrap;
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
}
.hint { color: var(--dim); }
.export {
  color: var(--mid); text-decoration: none; border: 1px solid rgba(255,255,255,.22); border-radius: 999px;
  padding: 5px 12px; transition: color .25s, border-color .25s;
}
.export:hover, .export:focus-visible { color: var(--fg); border-color: rgba(255,255,255,.7); }
.footer-links { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.footer .export { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }

/* ---------- phones & touch (classes set by site.js; media queries cover narrow desktop windows) ---------- */
.topbar { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; }
.topbar .left { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (hover: none) {
  .reel-item:hover { color: var(--dim); }
  li.active .reel-item:hover { color: var(--fg); }
}
.is-touch .reel-enter { padding: 10px 0 6px; }

@media (max-width: 900px) {
  .reel li { gap: 4px 12px; }
  .reel { bottom: 64px; }
  .reel ol { max-height: 52vh; max-height: 52dvh; }
  .caption { left: var(--gutter); right: var(--gutter); top: 68px; bottom: auto; width: auto; font-size: 13px; }
  .bottombar { width: calc(100% - 2 * var(--gutter)); justify-content: center; }
}
.is-phone .topbar { padding: 16px var(--gutter); font-size: 11px; }
.is-phone .topbar .brand { letter-spacing: .14em; }
.is-phone .reel-item { font-size: clamp(28px, 8.4vw, 40px); line-height: 1.12; }
.is-phone .reel-num { min-width: 1.9em; }
.is-phone .stage::after {
  background: linear-gradient(0deg, rgba(0,0,0,.85) 0%, rgba(0,0,0,.35) 55%, rgba(0,0,0,.55) 100%);
}
.is-phone .hero h1 { font-size: clamp(36px, 11vw, 56px); }
.is-phone .body p { font-size: 16px; }
.is-phone .meta { grid-template-columns: 1fr 1fr; gap: 20px; }
.is-phone .gallery { grid-template-columns: 1fr; }
.is-phone .footer { flex-direction: column; }

/* ---------- project page ---------- */
body.project-page .stage { position: absolute; height: 82vh; height: 82svh; }
.hero { position: relative; height: 82vh; height: 82svh; z-index: 1; display: flex; align-items: flex-end; padding: 0 var(--gutter) clamp(28px, 6vh, 56px); }
.hero-eyebrow { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--mid); margin-bottom: 16px; }
.hero-eyebrow a { color: var(--mid); text-decoration: none; }
.hero-eyebrow a:hover { color: var(--fg); }
.hero h1 { font-weight: 500; font-size: clamp(40px, 7.5vw, 112px); letter-spacing: -0.035em; line-height: 0.98; max-width: 16ch; }
.hero h1 sup { font-size: 0.17em; letter-spacing: .08em; vertical-align: top; margin-left: .3em; }
.hero .tagline { margin-top: 18px; font-size: clamp(16px, 1.6vw, 20px); color: var(--soft); max-width: 48ch; }

.content { position: relative; z-index: 1; background: var(--bg); padding: clamp(40px, 7vw, 96px) var(--gutter) 0; }
.wrap { max-width: 1200px; margin: 0 auto; }
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 28px; border-top: 1px solid var(--line); padding-top: 22px; }
.meta dt { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--mid); margin-bottom: 8px; }
.meta dd { font-size: 15px; line-height: 1.5; }
.story { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: clamp(28px, 6vw, 96px); margin-top: clamp(48px, 8vw, 110px); }
.lead { font-size: clamp(22px, 2.4vw, 32px); line-height: 1.3; letter-spacing: -0.015em; font-weight: 400; }
.body p { font-size: 17px; line-height: 1.7; color: var(--soft); max-width: 62ch; }
.body p + p { margin-top: 1.1em; }
.gallery { margin-top: clamp(56px, 9vw, 120px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(10px, 1.4vw, 20px); }
.gallery figure { margin: 0; }
.gallery figure.wide { grid-column: 1 / -1; }
.gallery img, .gallery video { width: 100%; display: block; background: #111; }
.gallery figcaption { margin-top: 10px; font-size: 13px; color: var(--mid); }
.links { margin-top: clamp(48px, 7vw, 90px); display: flex; flex-wrap: wrap; gap: 14px 28px; }
.links a { font-size: 13px; letter-spacing: .16em; text-transform: uppercase; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.4); padding-bottom: 3px; }
.links a:hover { border-color: #fff; }
.next { display: block; margin-top: clamp(80px, 12vw, 160px); padding: 40px 0 56px; border-top: 1px solid var(--line); text-decoration: none; }
.next span { display: block; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--mid); margin-bottom: 12px; }
.next strong { font-weight: 500; font-size: clamp(32px, 5vw, 72px); letter-spacing: -0.03em; color: var(--dim); transition: color .35s; }
.next:hover strong, .next:focus-visible strong { color: var(--fg); }
.footer { padding: 28px 0 36px; font-size: 12px; color: var(--dim); letter-spacing: .08em; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer a { color: var(--mid); text-decoration: none; }
.footer a:hover { color: var(--fg); }

@media (max-width: 800px) {
  .story { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
}

/* ---------- text fades ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.fade-in { opacity: 0; animation: fadeUp 1s cubic-bezier(.2, .7, .2, 1) forwards; animation-delay: calc(var(--i, 0) * 90ms + 150ms); }
.topbar, .reel, .caption, .bottombar, .hero, .content { transition: opacity .45s ease; }
body.leaving .topbar, body.leaving .reel, body.leaving .caption, body.leaving .bottombar,
body.leaving .hero, body.leaving .content { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .fade-in { animation: none; opacity: 1; }
}

.notfound { position: fixed; inset: 0; display: grid; place-items: center; text-align: center; color: var(--mid); z-index: 5; }
.notfound a { color: var(--fg); }
