:root {
  --cream: #F3EDE2;
  --cream-2: #E9E0CF;
  --ink: #17130F;
  --pink: #FF4FA3;
  --orange: #FF7A1A;
  --honey: #FFC531;
  --lime: #A8E82A;
  --mint: #2ED3A2;
  --blue: #3D5AFE;
  --violet: #9B6BFF;
  --display: "Unbounded", system-ui, sans-serif;
  --body: "Manrope", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --spring: linear(0, 0.0479, 0.1716, 0.3416, 0.5314, 0.7187, 0.8871, 1.0256, 1.1286, 1.1953, 1.2281, 1.2322, 1.214, 1.1806, 1.1386, 1.0939, 1.0513, 1.0142, 0.9847, 0.9636, 0.9509, 0.9457, 0.9467, 0.9524, 0.9611, 0.9712, 0.9816, 0.9912, 0.9993, 1.0055, 1.0098, 1.0121, 1.0128, 1.0121, 1.0105, 1.0083, 1.0059, 1.0035, 1.0014, 0.9996, 1);
  --spring-soft: cubic-bezier(.34, 1.3, .64, 1);
  --spring-soft: linear(0, 0.0577, 0.1963, 0.3719, 0.5526, 0.7171, 0.8535, 0.9571, 1.0284, 1.0713, 1.0912, 1.0943, 1.0861, 1.0716, 1.0545, 1.0377, 1.0228, 1.0107, 1.0018, 0.9959, 0.9925, 0.9911, 0.9912, 0.9922, 0.9937, 0.9953, 0.9969, 0.9982, 0.9993, 1, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--cream);
  color: var(--ink);
  font: 500 17px/1.55 var(--body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body::after { /* paper grain */
  content: ""; position: fixed; inset: 0; z-index: 900; pointer-events: none;
  opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .09 0 0 0 0 .07 0 0 0 0 .06 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }
::selection { background: var(--pink); color: var(--cream); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- custom cursor ---------- */
.cursor { position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; mix-blend-mode: difference; display: none; }
.has-cursor .cursor { display: block; }
.has-cursor, .has-cursor * { cursor: none !important; }
.cursor-ball { position: absolute; left: -50px; top: -50px; width: 100px; height: 100px; border-radius: 50%; background: #fff; transform: scale(0); will-change: transform; }
.cursor-label {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%);
  font: 600 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
  color: #000; opacity: 0; transition: opacity .15s;
}

/* ---------- splat overlay ---------- */
.splat-layer { position: fixed; inset: 0; z-index: 800; pointer-events: none; width: 100vw; height: 100vh; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 700;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 18px clamp(18px, 3vw, 40px);
  color: #fff; mix-blend-mode: difference;
}
.logo { display: inline-flex; align-items: baseline; position: relative; font: 900 20px/1 var(--display); text-decoration: none; letter-spacing: -.02em; }
.logo span { display: inline-block; transition: transform .6s var(--spring); }
.logo:hover span { transform: translateY(-5px) scaleY(1.15); }
.logo:hover span:nth-child(2) { transition-delay: .03s } .logo:hover span:nth-child(3) { transition-delay: .06s }
.logo:hover span:nth-child(4) { transition-delay: .09s } .logo:hover span:nth-child(5) { transition-delay: .12s }
.logo:hover span:nth-child(6) { transition-delay: .15s } .logo:hover span:nth-child(7) { transition-delay: .18s }
.logo-drop { position: absolute; right: -9px; bottom: 2px; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: drip 2.8s cubic-bezier(.5,0,.75,0) infinite; }
@keyframes drip {
  0%, 30% { transform: translateY(0) scale(.2, .2); }
  55% { transform: translateY(0) scale(1, 1.2); }
  70% { transform: translateY(2px) scale(.8, 1.5); }
  100% { transform: translateY(26px) scale(.7, 1); opacity: 0; }
}
.nav-links { display: flex; gap: clamp(14px, 2.4vw, 34px); font: 600 13px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.nav-links a { text-decoration: none; position: relative; padding: 6px 0; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform .5s var(--spring-soft);
}
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }
.sound { display: inline-flex; align-items: center; gap: 10px; font: 600 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.sound-track { width: 34px; height: 20px; border: 2px solid currentColor; border-radius: 20px; position: relative; }
.sound-knob { position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: currentColor; transition: transform .55s var(--spring), width .2s; }
.sound:active .sound-knob { width: 16px; }
.sound[aria-pressed="true"] .sound-knob { transform: translateX(14px); }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: grid; place-items: center; overflow: hidden; padding: 90px 0 140px; }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.word {
  position: relative; z-index: 2; white-space: nowrap; opacity: 0;
  font: 900 clamp(64px, 15.5vw, 290px)/1 var(--display); letter-spacing: -.035em;
  user-select: none; -webkit-user-select: none;
}
.word.ready { opacity: 1; }
.ch {
  display: inline-block; color: var(--c); position: relative;
  text-shadow: 0 .045em 0 var(--d);
  transform-origin: 50% 70%; will-change: transform; touch-action: none;
}
.entry {
  position: absolute; z-index: 3; left: clamp(18px, 3vw, 40px); bottom: clamp(22px, 4vh, 44px);
  font: 400 13px/1.6 var(--mono); max-width: 330px;
  opacity: 0; animation: rise .9s var(--spring-soft) 1.3s forwards;
}
.entry b { font-weight: 600; font-size: 15px; }
.entry i { opacity: .6; }
.entry em { font-style: italic; opacity: .6; }
.entry ol { margin-top: 6px; padding-left: 22px; }
.entry li::marker { font-weight: 600; }
.hint {
  position: absolute; z-index: 3; right: clamp(18px, 3vw, 40px); bottom: clamp(22px, 4vh, 44px);
  font: 600 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
  opacity: 0; animation: rise .9s var(--spring-soft) 1.5s forwards;
  transition: opacity .4s, transform .6s var(--spring);
}
.hint.gone { opacity: 0 !important; transform: translateY(12px); animation: none; }
.hint-arrow { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--cream); animation: nudge 1.6s var(--spring) infinite; }
@keyframes nudge { 0%, 60%, 100% { transform: translateY(0) } 30% { transform: translateY(-7px) scaleY(1.1) } }
@keyframes rise { from { opacity: 0; transform: translateY(24px) } to { opacity: 1; transform: none } }

/* ---------- tapes ---------- */
.tapes { position: relative; height: clamp(250px, 32vw, 420px); margin: -40px 0 -20px; z-index: 4; touch-action: pan-y; }
.tape-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; display: block; }
.tape-text { font-family: var(--display); font-weight: 700; letter-spacing: .04em; user-select: none; }

/* ---------- sections ---------- */
.block { padding: clamp(60px, 9vw, 130px) clamp(14px, 3vw, 40px) 0; }
.sec-head {
  display: grid; grid-template-columns: 1fr minmax(260px, 420px); align-items: end; gap: 12px 40px;
  margin: 0 auto clamp(24px, 3vw, 40px); max-width: 1500px; padding: 0 clamp(4px, 1vw, 12px);
}
.sec-num { grid-column: 1 / -1; font: 600 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; opacity: .6; }
.title { font: 800 clamp(42px, 7.4vw, 124px)/.95 var(--display); letter-spacing: -.045em; transform-origin: 0 100%; will-change: transform; }
.sec-copy { font-size: clamp(15px, 1.25vw, 18px); max-width: 420px; padding-bottom: .4em; }

.split .w { display: inline-block; white-space: nowrap; }
.split .l { display: inline-block; opacity: 0; transform: translateY(70%) scale(.6, 1.5) rotate(10deg); transform-origin: 50% 100%;
  transition: transform 1.1s var(--spring), opacity .25s; transition-delay: calc(var(--i) * 32ms); }
.split.in .l { opacity: 1; transform: none; }
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .6s, transform 1s var(--spring-soft); transition-delay: .25s; }
.reveal.in { opacity: 1; transform: none; }

.tank {
  user-select: none; -webkit-user-select: none;
  position: relative; max-width: 1500px; margin: 0 auto;
  height: min(78vh, 760px); min-height: 460px; border-radius: clamp(20px, 2.4vw, 36px); overflow: hidden;
  background: var(--cream-2);
  box-shadow: inset 0 3px 0 rgba(23,19,15,.06), inset 0 0 0 2px rgba(23,19,15,.07);
}
.tank canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; }
.fly { background: radial-gradient(120% 70% at 50% -10%, #FFF8E8 0%, #F4EAD6 45%, #E6DAC4 100%); }
.tank-ui { position: absolute; top: 16px; right: 16px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; pointer-events: none; }
.tank-ui > * { pointer-events: auto; }
.tank-ui button, .fly-count {
  font: 600 12px/1 var(--mono); letter-spacing: .05em; text-transform: uppercase;
  padding: 11px 16px; border-radius: 40px; border: 2px solid var(--ink); background: var(--cream);
  box-shadow: 0 3px 0 var(--ink);
  transition: transform .5s var(--spring), box-shadow .5s var(--spring), background .2s;
}
.tank-ui button:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 5px 0 var(--ink); background: #fff; }
.tank-ui button:active { transform: translateY(3px) scale(.96, .92); box-shadow: 0 0 0 var(--ink); transition-duration: .08s; }
.fly-count { background: var(--honey); display: inline-flex; gap: 8px; align-items: center; }
.fly-count b { display: inline-block; min-width: 1.4em; text-align: center; font-weight: 600; }
.fly-count.bump b { animation: bump .6s var(--spring); }
@keyframes bump { 0% { transform: scale(1.8, .6) } 100% { transform: none } }

/* ---------- end ---------- */
.end {
  margin-top: clamp(70px, 10vw, 140px); background: var(--ink); color: var(--cream);
  min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column;
  border-radius: clamp(24px, 3vw, 48px) clamp(24px, 3vw, 48px) 0 0;
  position: relative; overflow: hidden;
}
.end-inner { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 22px; padding: 120px 20px 40px; }
.end .sec-num { opacity: .5; }
.end-title { font-size: clamp(52px, 11vw, 190px); transform-origin: 50% 100%; }
.end .sec-copy { opacity: .75; max-width: 520px; margin: 0 auto; }
.goo { position: relative; width: min(640px, 100%); height: 360px; margin-top: -10px; }
.goo-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.goo-btn {
  position: absolute; left: 50%; top: 50%; width: 270px; height: 84px; margin: -42px 0 0 -135px;
  font: 800 17px/1 var(--display); letter-spacing: -.01em; color: var(--ink); border-radius: 60px; white-space: nowrap;
  will-change: transform;
}
.goo-btn:focus-visible { outline: 3px solid var(--cream); outline-offset: 6px; }
.credits {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 22px clamp(18px, 3vw, 40px); font: 400 12px/1.4 var(--mono); letter-spacing: .04em; opacity: .5;
  border-top: 1px solid rgba(243,237,226,.15);
}

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .nav-links { display: none; }
  .sec-head { grid-template-columns: 1fr; }
  .word { font-size: 15vw; }
  .hero { padding-bottom: 220px; }
  .entry { bottom: 64px; }
  .hint { left: clamp(18px, 3vw, 40px); right: auto; bottom: 24px; }
  .tank { height: 72vh; min-height: 420px; }
  .tank-ui { top: 12px; right: 12px; left: 12px; }
  .tank-ui button, .fly-count { padding: 9px 12px; font-size: 11px; }
  .goo { height: 300px; }
  .goo-btn { width: 230px; height: 74px; margin: -37px 0 0 -115px; font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .logo-drop, .hint-arrow { animation: none; }
  .split .l, .reveal { transition-duration: .01s; transition-delay: 0s; }
}
