:root {
  --paper: #f2efe9;
  --ink: #111111;
  --ink-2: #57544f;
  --line: rgba(17, 17, 17, 0.12);
  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background: var(--paper);
}
a { color: inherit; }
.mono { font-family: var(--mono); }

/* Scene */
#scene { background: var(--paper); position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; pointer-events: none; }
.still { position: fixed; inset: 0; pointer-events: none; background: var(--paper) url("/img/prism-still.jpg") center / cover no-repeat; display: none; }
.nogl #scene { display: none; }
.nogl .still { display: block; }

/* Nav: fixed, above every chapter */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 20px 40px;
}
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: 17px; letter-spacing: -0.02em; text-decoration: none; }
.nav-mid { display: flex; gap: 30px; font-size: 14px; }
.nav-mid a { text-decoration: none; color: var(--ink-2); }
.nav-mid a:hover { color: var(--ink); }
.nav-end { display: flex; justify-content: flex-end; align-items: center; gap: 18px; font-size: 14px; }
.nav-ghost { text-decoration: none; color: var(--ink-2); }
.nav-ghost:hover { color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: 500 15px var(--sans); letter-spacing: -0.01em;
  border: 0; border-radius: 10px; padding: 14px 22px;
  text-decoration: none; cursor: pointer;
  transition: transform .2s ease, background .2s ease;
}
.btn:active { transform: scale(.98); }
.btn-dark { background: var(--ink); color: #f7f5f1; }
.btn-dark:hover { background: #2a2926; }
.btn-glass { background: rgba(255,255,255,.55); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(17,17,17,.1); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.btn-glass:hover { background: rgba(255,255,255,.8); }
.btn-sm { padding: 10px 16px; font-size: 14px; border-radius: 8px; }

/* Chapters: tall sections, each with a pinned full-screen layer */
main { position: relative; }
.chapter { height: 190vh; }
.chapter.hero { height: 160vh; }
.chapter.tall { height: 280vh; }
.chapter.demo { height: 220vh; }
.chapter.end { height: 150vh; }
.pin {
  position: sticky; top: 0; height: 100vh;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0 24px 7vh;
  pointer-events: none;
}
.copy { pointer-events: auto; text-align: center; display: flex; flex-direction: column; align-items: center; max-width: 1100px; }

.head {
  margin: 0;
  font-weight: 700;
  font-size: clamp(54px, 8.6vw, 148px);
  line-height: .9;
  letter-spacing: -0.065em;
  background: linear-gradient(180deg, #0d0d0d 0%, #1c1b1a 45%, #7b7873 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  padding-bottom: .08em;
}
.head .serif { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.035em; font-size: 1.08em; padding-right: .06em; }
.head-sm { font-size: clamp(48px, 6.6vw, 112px); }
.kicker { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 22px; }
.sub { font-size: clamp(16px, 1.35vw, 19px); color: var(--ink-2); max-width: 34ch; margin: 22px 0 0; line-height: 1.45; letter-spacing: -0.01em; }
.cta { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; justify-content: center; }
.hint-touch { display: none; }
/* Wall chapters: copy sits bottom left so the light has the right side */
.chapter.side .pin { justify-content: flex-start; padding-left: 6vw; }
.chapter.side .copy { text-align: left; align-items: flex-start; width: 100%; }
.chapter.side .try { justify-content: flex-start; }
.chapter.side .head { font-size: clamp(50px, 7.2vw, 124px); }
@media (hover: none) { .hint-mouse { display: none; } .hint-touch { display: inline; } }

/* Demo */
.try { margin-top: 30px; width: 100%; max-width: 520px; display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; justify-content: center; }
.field {
  display: flex; align-items: center; gap: 2px;
  background: rgba(255,255,255,.6); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 0 0 1px rgba(17,17,17,.1);
  border-radius: 10px; padding: 0 16px; width: 100%; max-width: 380px;
}
.field span { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 500 15px var(--mono); color: var(--ink); padding: 14px 0; }
.field input::placeholder { color: rgba(17,17,17,.3); }
.addrs { list-style: none; margin: 18px 0 0; padding: 0; font-size: 12px; width: min(560px, 88vw); }
.addrs li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 2px; border-top: 1px solid var(--line); animation: land .6s ease-out both; }
.addrs li a { text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.addrs li a:hover { text-decoration: underline; }
.addrs li span { color: var(--ink-2); flex: none; }
@keyframes land { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* End */
.stats { display: flex; gap: 56px; margin-top: 40px; text-align: left; }
.stats .label { display: block; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); }
.stats b { display: block; font-weight: 600; font-size: 32px; letter-spacing: -0.04em; }
.stats .usd { color: var(--ink-2); font-size: 14px; }
.token { margin-top: 28px; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.ca {
  display: flex; align-items: center; gap: 12px; max-width: min(520px, 88vw);
  background: rgba(255,255,255,.6); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 0 0 1px rgba(17,17,17,.1); border: 0; border-radius: 10px;
  padding: 0 16px; cursor: pointer; color: var(--ink);
}
.ca .label { font-size: 12px; color: var(--ink-2); }
.ca code { font: 13px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-hint { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-2); flex: none; }

.foot {
  position: relative; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 26px 40px; font-size: 13px; color: var(--ink-2);
  background: var(--paper); border-top: 1px solid var(--line);
}
.foot-links { display: flex; gap: 18px; }

/* Text is visible by default; it only animates once JS has marked the page */
.js .reveal { opacity: 0; transform: translateY(22px); filter: blur(6px); transition: opacity 1s ease, transform 1.1s cubic-bezier(.2,.7,.2,1), filter 1s ease; }
.js .in .reveal { opacity: 1; transform: none; filter: none; }
.js .in .reveal:nth-child(2) { transition-delay: .08s; }
.js .in .reveal:nth-child(3) { transition-delay: .16s; }
.js .in .reveal:nth-child(4) { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; filter: none; transition: none; }
  .addrs li { animation: none; }
}

@media (max-width: 720px) {
  .chapter.side .pin { padding-left: 16px; }
  .nav { grid-template-columns: 1fr auto; padding: 16px; }
  .nav-mid { display: none; }
  .nav-end .nav-ghost { display: none; }
  .pin { padding: 0 16px 6vh; }
  .head { font-size: clamp(46px, 14vw, 72px); }
  .head-sm { font-size: clamp(40px, 12vw, 60px); }
  .chapter.tall { height: 230vh; }
  .stats { gap: 28px; }
  .foot { padding: 22px 16px; }
}
