:root {
  --vh: 1vh;
  --ink: #412511;
  --fur: #c9985a;
  --fur-deep: #b77c3a;
  --cream: #f1e8d9;
  --snow: #eaf4fa;
  --snow-shade: #d3e4ef;
  --sky-top: #2c464f;
  --sky-mid: #3f6a72;
  --sky-low: #a4e3e2;
  --night: #0f2229;
  --star: #38e07f;
  --ice: #63d6ff;
  --ice-deep: #0b63e5;
  --pink: #f8bcdc;
  --display: "Modak", "Arial Black", system-ui, sans-serif;
  --hand: "Patrick Hand", "Comic Sans MS", "Segoe Print", cursive;
  --gutter: clamp(16px, 4vw, 56px);
  --ink-line: clamp(3px, .42vw, 6px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: auto; background: var(--snow); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--snow);
  font: 400 clamp(1.2rem, .55vw + 1.05rem, 1.5rem)/1.35 var(--hand);
  overflow-x: clip;
}
img, video, svg, canvas { display: block; max-width: 100%; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; }
:focus-visible { outline: 4px solid var(--ice-deep); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: fixed; left: 12px; top: -80px; z-index: 100;
  background: var(--cream); padding: 8px 16px; border: 3px solid var(--ink); border-radius: 12px;
}
.skip:focus { top: 12px; }

/* Type: the logo's fat cream letters with a thick ink line */
.display {
  font-family: var(--display);
  font-weight: 400;
  line-height: .98;
  font-size: clamp(2.7rem, 6.6vw, 6.2rem);
  letter-spacing: .012em;
  color: var(--cream);
  -webkit-text-stroke: .1em var(--ink);
  paint-order: stroke fill;
  text-wrap: balance;
}
.display.small { font-size: clamp(1.9rem, min(3.6vw, calc(var(--vh) * 6.4)), 3.5rem); }
.display.on-snow { color: var(--fur); }

/* Buttons: squishy, like everything else in the drawings */
.btn {
  display: inline-block;
  padding: .5em 1.05em .55em;
  background: var(--fur);
  color: var(--ink);
  border: var(--ink-line) solid var(--ink);
  border-radius: 40% 46% 42% 48% / 70% 62% 74% 66%;
  font: inherit;
  font-size: 1.1em;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 .24em 0 var(--ink);
  transition: transform .14s, box-shadow .14s, background-color .14s;
}
.btn:hover { background: #ddb06f; transform: translateY(-2px) rotate(-1deg); box-shadow: 0 .32em 0 var(--ink); }
.btn:active { transform: translateY(.18em); box-shadow: 0 .06em 0 var(--ink); }
.btn-ghost { background: var(--cream); }
.btn-ghost:hover { background: #fff; }
.btn-small { font-size: .85em; }

/* Top bar */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px var(--gutter);
  pointer-events: none;
}
.bar > * { pointer-events: auto; }
.bar-brand {
  flex: none;
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
  font-family: var(--display); font-size: 1.7rem; line-height: 1;
  color: var(--cream); -webkit-text-stroke: .1em var(--ink); paint-order: stroke fill;
}
.bar-brand img { border-radius: 50%; border: 3px solid var(--ink); width: 44px; height: 44px; }
.bar nav {
  display: flex; align-items: center; gap: 4px;
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 4px;
}
.bar nav a { padding: 3px 12px; border-radius: 999px; text-decoration: none; font-size: 1.05rem; white-space: nowrap; }
.bar nav a:hover { background: var(--snow-shade); }
.bar nav .bar-x { display: grid; place-items: center; width: 36px; height: 29px; padding: 0; }
.bar nav .bar-buy { background: var(--fur); }
.bar nav .bar-buy:hover { background: #ddb06f; }

/* The pinned scene */
#scroller { position: relative; background: var(--snow); }
#stage {
  position: sticky;
  top: 0;
  height: calc(var(--vh) * 100);
  overflow: hidden;
  background: var(--sky-top);
  isolation: isolate;
}
.sky, .sky-night, #stars, #rain { position: absolute; inset: 0; width: 100%; height: 100%; }
.sky-night, #stars { will-change: opacity; }
#stars canvas { position: absolute; inset: 0; width: 100%; height: 100%; will-change: opacity; animation: twinkle 3.4s ease-in-out infinite alternate; }
#stars canvas:nth-child(2) { animation-duration: 2.3s; animation-delay: -1.1s; }
#stars canvas:nth-child(3) { animation-duration: 4.6s; animation-delay: -2.2s; }
@keyframes twinkle { from { opacity: 1; } to { opacity: .28; } }
.sky { background: linear-gradient(180deg, var(--sky-top) 0%, #30505a 38%, var(--sky-mid) 58%, #6fb3b6 72%, var(--sky-low) 86%); }
.sky-night { background: linear-gradient(180deg, #081419 0%, var(--night) 55%, #173641 86%); opacity: 0; }
#rain { z-index: 14; pointer-events: none; }

.moon-wrap {
  position: absolute; z-index: 1;
  left: 50%; top: 0;
  width: var(--moon, 26vmin); height: var(--moon, 26vmin);
  will-change: transform;
}
.moon-wrap canvas { position: absolute; left: -15%; top: -15%; width: 130%; height: 130%; max-width: none; }

.candles { position: absolute; z-index: 2; left: 0; right: 0; bottom: calc(var(--vh) * 16); width: 100%; height: calc(var(--vh) * 62); }
.candle { position: absolute; bottom: 0; will-change: transform; transform: scaleY(0); transform-origin: 50% 100%; }

.range { position: absolute; left: 0; width: 100%; will-change: transform; }
.range-far { z-index: 3; bottom: calc(var(--vh) * 14); height: calc(var(--vh) * 44); }
.range-near { z-index: 4; bottom: 0; height: calc(var(--vh) * 50); }

.logo {
  position: absolute; z-index: 6;
  left: 45%; bottom: calc(var(--vh) * 16.5);
  width: min(74vw, calc(var(--vh) * 118));
  aspect-ratio: 2127 / 638;
  transform: translateX(-50%);
  will-change: transform;
}
/* A soft shadow so the letters sit on the snow */
.logo::after {
  content: "";
  position: absolute; z-index: -2;
  left: 1%; right: 1%; bottom: -5%; height: 13%;
  background: radial-gradient(closest-side, rgba(112,152,178,.55), rgba(112,152,178,0));
}
.letter {
  position: absolute;
  height: auto;
  max-width: none;
  transform-origin: 50% 100%;
  will-change: transform;
  -webkit-user-drag: none;
  user-select: none;
}
.peek {
  position: absolute;
  z-index: -1;
  width: 31%;
  height: auto;
  right: -19.5%;
  bottom: -11%;
  transform-origin: 50% 100%;
  will-change: transform;
}

.biter {
  position: absolute; z-index: 7;
  left: 50%; bottom: 0;
  width: min(calc(var(--vh) * 66), 86vw);
  aspect-ratio: 1400 / 1525;
  margin-left: calc(min(calc(var(--vh) * 66), 86vw) / -2);
  transform-origin: 50% 40%;
  visibility: hidden;
  will-change: transform;
}
.biter img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; will-change: opacity; }
#biterOpen { opacity: 0; }

.crumbs { position: absolute; z-index: 8; inset: 0; pointer-events: none; }
.crumb {
  position: absolute; left: 0; top: 0;
  background: #fff; border: 2px solid var(--ink);
  border-radius: 46% 54% 58% 42% / 52% 44% 56% 48%;
  visibility: hidden;
  will-change: transform;
}

.ground { position: absolute; z-index: 10; left: 0; right: 0; top: 0; height: calc(var(--vh) * 130); transform: translateY(calc(var(--vh) * 82)); will-change: transform; }
.drift { width: 100%; height: calc(var(--vh) * 11); position: relative; margin-bottom: -2px; }
.snowfield { position: relative; height: calc(calc(var(--vh) * 130) - calc(var(--vh) * 11) + 4px); background: var(--snow); overflow: hidden; }
.snow-marks { position: absolute; left: 0; top: 0; width: 100%; height: calc(var(--vh) * 44); }
.prints { position: absolute; left: 0; right: 0; top: 0; height: calc(var(--vh) * 36); }
.print { position: absolute; transform: translate(-50%, -50%) rotate(var(--r)); }
.print svg { position: absolute; inset: 0; }
.print ellipse.base { fill: #d9e8f2; }
.print circle { fill: #b9d2e2; }
.print canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; will-change: opacity; }

/* Copy over the scene */
.beat { position: absolute; z-index: 20; }
.beats { position: absolute; inset: 0; z-index: 20; pointer-events: none; }
.beats .beat { visibility: hidden; max-width: 44vw; will-change: opacity; }
.beats .big-num { will-change: transform; transform-origin: 50% 50%; }
/* Copy over the scene sits on little cream notes, so it reads over sky, moon and snow alike */
.beats .beat p:not(.big-num) {
  display: inline-block;
  margin-top: .6em;
  max-width: 38ch;
  padding: .35em .7em .4em;
  color: var(--ink);
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 16px 22px 14px 24px / 22px 14px 24px 16px;
  transform: rotate(-.9deg);
  text-align: left;
}

.hero-copy {
  left: 0; right: 0; bottom: calc(var(--vh) * 3.2);
  padding-inline: var(--gutter);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5em 1.4em;
  text-align: center;
  color: var(--ink);
}
.hero-line { font-size: 1.14em; max-width: 34ch; text-align: left; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .55em .9em; }

.beat-a { left: var(--gutter); top: calc(var(--vh) * 15); max-width: 42vw !important; }
.beat-b { left: var(--gutter); top: calc(var(--vh) * 11); max-width: 31vw !important; }
.beat-b .display { margin-top: .08em; }
.beat-c { left: var(--gutter); top: calc(var(--vh) * 15); max-width: 36vw !important; }
.beat-d { left: 50%; top: calc(var(--vh) * 8); transform: translateX(-50%); text-align: center; max-width: min(46ch, 90vw) !important; width: 90vw; }

.lock-tag {
  display: flex; align-items: center; gap: .45em;
  width: fit-content;
  margin-top: .55em;
  padding: .28em .75em .32em .5em;
  background: var(--pink);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 999px;
  font-size: 1.04em;
  line-height: 1.1;
  will-change: transform;
}
.lock-tag svg { flex: none; }

.big-num {
  font-family: var(--display);
  line-height: .86;
  font-size: clamp(6rem, min(14vw, calc(var(--vh) * 25)), 15rem);
  color: var(--cream);
  -webkit-text-stroke: .055em var(--ink);
  paint-order: stroke fill;
  font-variant-numeric: lining-nums;
}
/* Modak's own % sign reads like "96", so percent marks borrow Chango */
.pct { font-family: "Chango", var(--display); font-size: .56em; margin-left: .06em; -webkit-text-stroke-width: .07em; vertical-align: .22em; }
.night-num { font-size: clamp(4.6rem, min(10vw, calc(var(--vh) * 19)), 10rem); color: var(--ice); }

.scroll-cue {
  position: absolute; z-index: 21; right: var(--gutter); top: calc(var(--vh) * 18);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: #fff; font-size: 1.05rem; text-align: center; max-width: 7em;
  animation: cue 1.8s ease-in-out infinite;
}
@keyframes cue { 50% { transform: translateY(9px); } }

/* Below the scene: daylight on snow */
.after { position: relative; z-index: 2; background: var(--snow); overflow: hidden; }
.after section { padding-inline: var(--gutter); max-width: 1320px; margin-inline: auto; }

.ledger-sec {
  padding-block: clamp(48px, 7vw, 96px) clamp(56px, 8vw, 120px);
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .85fr); gap: clamp(18px, 3vw, 40px);
  align-items: center;
}
.ledger-sec h2 { grid-column: 1 / -1; }
.ice {
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, #dff7ff 0%, #9fe6fb 46%, #6ed5f7 100%);
  border: var(--ink-line) solid var(--ink);
  border-radius: 18px 26px 14px 30px / 26px 16px 28px 18px;
  box-shadow: inset 0 0 0 7px rgba(255,255,255,.55), 0 14px 0 -4px var(--snow-shade);
  transform: rotate(-1.1deg);
}
.ice-facets { position: absolute; inset: 0; width: 100%; height: 100%; }
.ice dl { position: relative; display: grid; grid-template-columns: 1fr 1fr; }
.ice dl > div { padding: clamp(14px, 2.2vw, 30px); }
.ice dl > div:nth-child(odd):not(.wide) { border-right: 3px dashed rgba(65,37,17,.5); }
.ice dl > div:not(.wide) { border-bottom: 3px dashed rgba(65,37,17,.5); }
.ice dl > .wide { grid-column: 1 / -1; }
.ice dt { font-size: 1.05em; }
.ice dd {
  font-family: var(--display); line-height: 1;
  font-size: clamp(2.5rem, 6.4vw, 6rem);
  color: #fff; -webkit-text-stroke: .08em var(--ink); paint-order: stroke fill;
}
.ice .dd-small { font-size: clamp(1.75rem, 3.7vw, 3.5rem); padding-top: .25em; }
.ice dd a { text-decoration: none; }
.ice dd a:hover { color: var(--pink); }
.ice-cat {
  border: var(--ink-line) solid var(--ink);
  border-radius: 28px 18px 30px 16px / 18px 30px 16px 28px;
  transform: rotate(2deg);
  width: 100%; height: auto;
}

.get { padding-block: 0 clamp(56px, 8vw, 120px); }
.tracks {
  counter-reset: t;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 44px);
  margin-top: clamp(22px, 3vw, 40px);
}
.tracks li { counter-increment: t; position: relative; }
.tracks li::before {
  content: counter(t);
  display: grid; place-items: center;
  width: 1.6em; height: 1.6em;
  margin-bottom: .1em;
  font-family: var(--display);
  font-size: clamp(3rem, 5vw, 4.4rem);
  line-height: 1;
  color: var(--ink);
  background: var(--snow-shade);
  border-radius: 48% 52% 44% 56% / 56% 46% 54% 44%;
  box-shadow: inset 0 5px 0 #b9d2e2;
}
.tracks h3 { font-weight: 400; font-size: 1.32em; line-height: 1.15; }
.tracks p { margin-top: .3em; max-width: 32ch; }

.ca {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  margin-top: clamp(26px, 4vw, 48px);
  padding: 12px 18px;
  background: #fff;
  border: 3px dashed var(--ink);
  border-radius: 18px;
}
.ca code { font: inherit; overflow-wrap: anywhere; min-width: 0; flex: 1 1 14em; color: #6b4a2e; }
.ca-label { flex: none; }

.art { padding-block: 0 clamp(60px, 9vw, 130px); }
.art-head { display: grid; grid-template-columns: 1.2fr .8fr; gap: 12px 40px; align-items: end; margin-bottom: clamp(20px, 3vw, 36px); }
.art-head p { max-width: 36ch; }
.film {
  border: var(--ink-line) solid var(--ink);
  border-radius: 22px;
  overflow: hidden;
  background: var(--ink);
}
.film video { width: 100%; height: auto; }

.wall {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(12px, 2vw, 26px);
  margin-top: clamp(30px, 5vw, 60px);
}
.pin { position: relative; transition: transform .25s cubic-bezier(.3,1.7,.5,1); }
.pin img {
  width: 100%; height: auto;
  border: var(--ink-line) solid var(--ink);
  border-radius: 24px 16px 26px 14px / 16px 26px 14px 24px;
}
.pin figcaption { margin-top: 6px; text-align: center; }
.pin:hover { transform: rotate(0) scale(1.03); z-index: 3; }
.p1 { grid-column: 1 / 6; transform: rotate(-1.6deg); }
.p2 { grid-column: 6 / 10; margin-top: 12%; transform: rotate(1.2deg); }
.p3 { grid-column: 10 / 13; margin-top: 2%; transform: rotate(-1deg); }
.p4 { grid-column: 1 / 4; transform: rotate(1.6deg); }
.p5 { grid-column: 4 / 8; margin-top: -8%; transform: rotate(-1.2deg); }
.p6 { grid-column: 8 / 13; margin-top: -14%; transform: rotate(1deg); }

/* The closing scene: back out under the same night sky, with the leopard still watching */
.foot {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--sky-top) 0%, #30505a 45%, var(--sky-mid) 72%, #6fb3b6 88%, var(--sky-low) 100%);
  color: #fff;
}
.foot-edge { position: absolute; z-index: 2; left: 0; top: -1px; width: 100%; height: clamp(44px, 6vw, 90px); }
#footStars { position: absolute; inset: 0; width: 100%; height: 100%; }
#footMoon { position: absolute; right: clamp(10px, 7vw, 120px); top: clamp(44px, 6vw, 84px); max-width: none; }
.foot-main {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: clamp(14px, 1.8vw, 24px);
  padding: clamp(120px, 13vw, 190px) var(--gutter) clamp(48px, 6vw, 84px);
  text-align: center;
}
.foot-word { width: min(86vw, 780px); height: auto; }
.foot-line { font-size: 1.2em; }
.socials .btn { display: inline-flex; align-items: center; gap: .45em; }
.socials svg { width: .85em; height: .85em; fill: currentColor; flex: none; }
.foot-ground { position: relative; z-index: 3; }
.foot-peek {
  position: absolute; z-index: 1;
  right: clamp(12px, 11vw, 190px);
  bottom: calc(100% - clamp(26px, 3.2vw, 48px));
  width: clamp(150px, 22vw, 330px);
  height: auto;
}
.foot-drift { position: relative; z-index: 2; width: 100%; height: clamp(48px, 6vw, 90px); margin-bottom: -2px; }
.fine {
  position: relative; z-index: 2;
  margin: 0;
  padding: 6px var(--gutter) 36px;
  background: var(--snow);
  color: #6b4a2e;
  font-size: .86em;
  text-align: center;
}
.socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 24px; }
.socials:empty { display: none; }

@media (max-width: 359px) {
  .bar nav a { padding: 3px 7px; font-size: 1rem; }
  .bar nav .bar-x { width: 28px; }
}

@media (max-width: 760px) {
  .only-wide { display: none; }
  .bar-brand span { display: none; }
  .logo { left: 50%; width: 92vw; bottom: calc(var(--vh) * 27); }
  .peek { right: -2%; width: 46%; bottom: 60%; }
  .hero-copy { bottom: calc(var(--vh) * 2); gap: .45em; }
  .hero-line { text-align: center; }
  .hero-actions .btn { font-size: 1em; }
  .scroll-cue { display: none; }
  .beats .beat { max-width: none !important; }
  .big-num { font-size: 24vw; }
  .night-num { font-size: 22vw; }
  .candles { height: calc(var(--vh) * 34); }
  .prints { height: calc(var(--vh) * 40); }
  .beat-a, .beat-b, .beat-c { left: var(--gutter); right: var(--gutter); top: calc(var(--vh) * 9); text-align: left; }
  .beat-d { top: calc(var(--vh) * 8.5); }
  .biter { width: min(calc(var(--vh) * 60), 92vw); margin-left: calc(min(calc(var(--vh) * 60), 92vw) / -2); }
  .lock-tag { font-size: .95em; }
  .range-far { height: calc(var(--vh) * 36); }
  .ledger-sec { grid-template-columns: minmax(0, 1fr); }
  .ice-cat { width: 72%; justify-self: center; }
  .tracks { grid-template-columns: minmax(0, 1fr); }
  .tracks li { padding-left: 5.2rem; min-height: 4.8rem; }
  .tracks li::before { position: absolute; left: 0; top: 0; font-size: 2.6rem; }
  .art-head { grid-template-columns: minmax(0, 1fr); }
  .wall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wall .pin { grid-column: auto; margin-top: 0; }
  .wall .p1 { grid-column: 1 / -1; }
  .ca-label { flex-basis: 100%; }
}

/* No scrubbed motion: the same story, laid out as ordinary sections */
.reduced #stage { height: auto; min-height: calc(var(--vh) * 100); padding: 100px var(--gutter) 40px; overflow: visible; background: linear-gradient(180deg, var(--sky-top), var(--night)); }
.reduced .sky, .reduced .sky-night, .reduced #stars, .reduced #rain, .reduced .candles, .reduced .range, .reduced .biter, .reduced .crumbs, .reduced .ground, .reduced .scroll-cue, .reduced .peek { display: none; }
.reduced .logo { position: relative; left: auto; bottom: auto; transform: none; margin: 0 auto 32px; width: min(100%, 900px); }
.reduced .logo::after { display: none; }
.reduced .hero-copy, .reduced .beats, .reduced .beats .beat { position: relative; inset: auto; left: auto; right: auto; top: auto; bottom: auto; transform: none; visibility: visible; max-width: 60ch !important; width: auto; margin: 0 auto 44px; text-align: left; color: #fff; }
.reduced .hero-copy { display: block; }
.reduced .hero-line { color: #fff; max-width: none; margin-bottom: .6em; }
.reduced .hero-actions { justify-content: flex-start; }
.reduced .moon-wrap { position: relative; left: auto; margin: 6vmin auto; width: 40vmin; height: 40vmin; }
.reduced #moonBitten { visibility: visible; }
.reduced .beats { max-width: none !important; }
@media (prefers-reduced-motion: reduce) {
  .scroll-cue, #stars canvas { animation: none; }
  .btn, .pin { transition: none; }
}
