@font-face { font-family: "Plate Sans"; src: url("/assets/fonts/plate-regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plate Sans"; src: url("/assets/fonts/plate-bold.woff") format("woff"); font-weight: 700; font-display: swap; }

:root {
  --ink: #f6f5f8;
  --ink-dark: #1c1f2e;
  --ink-soft: rgba(246, 245, 248, 0.72);
  --ground: #161a26;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ground); color: var(--ink); scroll-behavior: smooth; }
body { margin: 0; font-family: "Plate Sans", "Century Gothic", "Avenir Next", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, p, figure { margin: 0; }
::selection { background: var(--ink); color: var(--ground); }

#stage { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; z-index: 0; }
.fallback { position: fixed; inset: 0; display: grid; place-items: center; color: var(--ink-soft); }
.fallback[hidden] { display: none; }

.mast {
  position: fixed; z-index: 2; inset: 0 0 auto 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.4rem max(1.5rem, env(safe-area-inset-right)) 1rem max(1.5rem, env(safe-area-inset-left));
  mix-blend-mode: difference; pointer-events: none;
}
.name { font-size: 0.78rem; letter-spacing: 0.22em; text-transform: lowercase; }
.scrollcue { font-size: 0.7rem; letter-spacing: 0.3em; opacity: 0.7; transition: opacity 600ms var(--ease); }
.scrolled .scrollcue { opacity: 0; }

main { position: relative; z-index: 1; }

.chapter { min-height: 112vh; display: flex; align-items: center; padding: 0 max(1.5rem, 7vw); }
.chapter:first-child { min-height: 100vh; align-items: flex-end; padding-bottom: 14vh; }
.copy { max-width: 34rem; color: var(--ink-dark); }
.chapter[data-chapter="0"] .copy { color: var(--ink); text-shadow: 0 1px 24px rgba(0, 0, 0, 0.18); }

.copy.right { margin-left: auto; text-align: right; }
.copy h1 {
  font-weight: 700; font-size: clamp(2.6rem, 1.4rem + 5vw, 6rem); line-height: 0.95; letter-spacing: -0.035em;
  margin-bottom: 1.4rem;
}
.copy p { font-size: clamp(1.15rem, 0.9rem + 1.1vw, 1.75rem); line-height: 1.35; letter-spacing: -0.01em; }
.copy .lead { font-size: clamp(2rem, 1.1rem + 3.4vw, 4.2rem); line-height: 1.02; letter-spacing: -0.03em; font-weight: 700; margin-bottom: 0.4rem; }

.copy > * { opacity: 0; transform: translateY(22px); filter: blur(6px); transition: opacity 1100ms var(--ease), transform 1100ms var(--ease), filter 1100ms var(--ease); }
.chapter.in .copy > * { opacity: 1; transform: none; filter: none; }
.chapter.in .copy > *:nth-child(2) { transition-delay: 220ms; }
html:not(.js) .copy > * { animation: settle 1100ms var(--ease) 1200ms forwards; }
@keyframes settle { to { opacity: 1; transform: none; filter: none; } }
html:not(.js) .copy, .nogl .copy { color: var(--ink); }
.nogl .copy > * { opacity: 1; transform: none; filter: none; transition: none; }

.studies {
  position: relative;
  padding: 12vh max(1.5rem, 7vw) 10vh;
  color: var(--ink);
}
.studies-head { display: grid; gap: 0.7rem; margin-bottom: clamp(2rem, 5vw, 3.5rem); max-width: 40rem; }
.studies h2 { font-size: clamp(2.4rem, 1.4rem + 4vw, 5rem); font-weight: 700; letter-spacing: -0.035em; line-height: 0.95; color: var(--ink); }
.studies-head p { font-size: clamp(1.05rem, 0.9rem + 0.6vw, 1.35rem); color: var(--ink-soft); }
.plates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 2.4vw, 2.2rem); }
.plates figure { display: grid; gap: 1.1rem; align-content: start; }
.mat {
  padding: clamp(0.5rem, 1vw, 0.8rem); background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 40px 70px -40px rgba(20, 16, 28, 0.85), 0 1px 0 rgba(255, 255, 255, 0.06) inset;
  transition: transform 700ms var(--ease), box-shadow 700ms var(--ease);
}
.plates figure:hover .mat { transform: translateY(-6px); box-shadow: 0 50px 80px -40px rgba(0, 0, 0, 0.95), 0 1px 0 rgba(255, 255, 255, 0.08) inset; }
.plate { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; }
figcaption { display: grid; gap: 0.3rem; border-left: 2px solid rgba(255, 255, 255, 0.85); padding: 0.1rem 0 0.1rem 0.8rem; }
figcaption strong { font-size: clamp(1.25rem, 1rem + 0.8vw, 1.6rem); font-weight: 700; letter-spacing: -0.015em; color: var(--ink); }
figcaption span { font-size: 0.98rem; color: var(--ink-soft); }
@media (max-width: 760px) { .plates { grid-template-columns: 1fr; } }


@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .copy > * { opacity: 1; transform: none; filter: none; transition: none; }
}
.studies, .close { --ink-soft: rgba(246, 245, 248, 0.86); }

.pane {
  position: relative;
  background: rgba(22, 20, 30, 0.42);
  -webkit-backdrop-filter: blur(22px) saturate(1.15);
  backdrop-filter: blur(22px) saturate(1.15);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.close { display: grid; justify-items: center; gap: clamp(2rem, 5vh, 3.2rem); padding: 6vh 1.5rem 12vh; text-align: center; color: var(--ink); }
.close .stay { font-weight: 700; font-size: clamp(1.6rem, 1.1rem + 2vw, 2.6rem); letter-spacing: -0.02em; }
.wordmark { position: relative; display: inline-block; font-weight: 700; font-size: clamp(2.8rem, 0.8rem + 8vw, 8rem); line-height: 0.9; letter-spacing: -0.035em; }
.wordmark .tld { position: absolute; left: 100%; bottom: 0.08em; margin-left: 0.18em; font-size: 0.32em; letter-spacing: 0; opacity: 0.8; }

body.lost { min-height: 100svh; display: grid; place-items: center; background: radial-gradient(120% 90% at 50% 20%, #2a2f48 0, #161a26 70%); }
.lost-body { display: grid; justify-items: center; gap: 1.2rem; padding: 2rem 1.5rem; text-align: center; }
.lost-code { font-size: 0.78rem; letter-spacing: 0.3em; color: var(--ink-soft); }
.lost-body h1 { font-weight: 700; font-size: clamp(2rem, 1.2rem + 3vw, 3.6rem); letter-spacing: -0.03em; line-height: 1; }
.lost-body a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 4px; }
.lost-body a:hover { text-decoration-thickness: 2px; }
