/* Ghostaholics — design + motion system
   Motion identity (one personality, applied everywhere: "Playful-spooky"):
     signature easing  --ease-out   (fast start, soft landing — things *materialize*)
     durations         --d-quick 160ms · --d-std 360ms · --d-slow 800ms
     entrance pattern  "materialize": rise 24px + un-blur + fade, staggered <= 480ms
     layers            primary (content) · secondary (glow/shadow) · ambient (fog, motes, lantern) */

:root {
  --void: #07060d;
  --ink: #0e0b1c;
  --ink-2: #16122b;
  --line: rgba(167, 139, 250, .18);
  --text: #ece8ff;
  --muted: #a9a3c9;
  --violet: #8b5cf6;
  --violet-2: #a78bfa;
  --purple-hot: #b026ff;
  --blue: #3b82f6;
  --blue-2: #60a5fa;
  --ecto: #c4b5fd;
  --accent: var(--violet-2);
  --accent-2: var(--blue-2);
  --glow: 0 0 24px rgba(139, 92, 246, .45), 0 0 60px rgba(59, 130, 246, .25);

  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in: cubic-bezier(.55, 0, 1, .45);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease-float: cubic-bezier(.45, 0, .55, 1);
  --d-quick: 160ms;
  --d-std: 360ms;
  --d-slow: 800ms;

  --radius: 22px;
  --wrap: 1180px;
  --font-body: "DM Sans", system-ui, sans-serif;
  --font-head: "Unbounded", "DM Sans", system-ui, sans-serif;
  --font-logo: "Creepster", "Unbounded", cursive;
  color-scheme: dark;
}

.theme-hot {
  --accent: #e879f9;
  --accent-2: #a78bfa;
  --line: rgba(232, 121, 249, .2);
  --glow: 0 0 24px rgba(217, 70, 239, .45), 0 0 60px rgba(139, 92, 246, .3);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; interpolate-size: allow-keywords; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--void);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--font-body);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #fff; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--violet); color: #fff; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--violet); color: #fff; padding: .6rem 1rem; border-radius: 10px; }
.skip:focus { left: 12px; }

/* ---------- ambient layers ---------- */
.fog { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -3; pointer-events: none; }
.lantern {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(420px circle at var(--lx, 50%) var(--ly, 30%), rgba(139, 92, 246, .16), rgba(59, 130, 246, .06) 40%, transparent 70%);
  transition: opacity var(--d-slow) var(--ease-out);
}
.theme-hot .lantern { background: radial-gradient(420px circle at var(--lx, 50%) var(--ly, 30%), rgba(217, 70, 239, .16), rgba(139, 92, 246, .07) 40%, transparent 70%); }
.grain {
  position: fixed; inset: -50%; z-index: -2; pointer-events: none; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain { 0%,100% { transform: translate(0,0) } 20% { transform: translate(-3%,2%) } 40% { transform: translate(2%,-3%) } 60% { transform: translate(-2%,-1%) } 80% { transform: translate(3%,3%) } }

/* ---------- navigation ---------- */
.nav {
  position: fixed; top: 14px; left: 50%; z-index: 50;
  width: min(calc(100% - 24px), var(--wrap));
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .55rem .6rem .55rem 1rem;
  background: rgba(14, 11, 28, .62);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  transform: translateX(-50%);
  transition: transform var(--d-std) var(--ease-out), opacity var(--d-std) var(--ease-out), box-shadow var(--d-std) var(--ease-out);
  animation: nav-in 900ms var(--ease-out) both;
}
@keyframes nav-in { from { opacity: 0; transform: translate(-50%, -140%) scale(.96); filter: blur(6px); } }
.nav.is-scrolled { box-shadow: 0 10px 40px rgba(0,0,0,.45), var(--glow); }
.nav.is-hidden { transform: translate(-50%, -150%); transition-timing-function: var(--ease-in); transition-duration: 260ms; }

.nav__brand { display: flex; align-items: center; gap: .55rem; color: var(--text); text-decoration: none; }
.nav__word { font: 400 1.45rem/1 var(--font-logo); letter-spacing: .04em; background: linear-gradient(90deg, var(--violet-2), var(--blue-2), var(--violet-2)); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 6s linear infinite; }
.mini-ghost { width: 30px; height: 34px; display: inline-block; animation: bob 2.6s var(--ease-float) infinite; }
.mini-ghost svg { width: 100%; height: 100%; overflow: visible; }
.mini-ghost__body { fill: #e9e2ff; filter: drop-shadow(0 0 6px rgba(167, 139, 250, .8)); }
.mini-ghost__eye { fill: var(--void); transform-box: fill-box; transform-origin: center; animation: blink 5s infinite; }
.nav__brand:hover .mini-ghost { animation: boo-spin 700ms var(--ease-spring); }

.nav__links { position: relative; display: flex; align-items: center; gap: .15rem; }
.nav__links a {
  position: relative; z-index: 1;
  padding: .55rem 1rem; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem;
  transition: color var(--d-quick) var(--ease-out);
}
.nav__links a:hover, .nav__links a[aria-current="page"] { color: #fff; }
.nav__links a .ch { display: inline-block; transition: transform var(--d-std) var(--ease-spring); transition-delay: calc(var(--c) * 18ms); }
.nav__links a:hover .ch { transform: translateY(-3px); }
/* the wisp: a glowing spirit that glides between links (spring-driven in site.js) */
.nav__wisp {
  position: absolute; left: 0; top: 50%; z-index: 0;
  width: var(--ww, 0px); height: 38px;
  transform: translate(var(--wx, 0px), -50%) scaleX(var(--wsx, 1)) scaleY(var(--wsy, 1));
  opacity: var(--wo, 0);
  pointer-events: none;
  transition: opacity var(--d-std) var(--ease-out);
}
.nav__wisp span {
  position: absolute; inset: 0; border-radius: 999px;
  background: linear-gradient(90deg, rgba(139, 92, 246, .55), rgba(59, 130, 246, .5));
  box-shadow: 0 0 18px rgba(139, 92, 246, .7), 0 0 40px rgba(59, 130, 246, .35);
}
.theme-hot .nav__wisp span { background: linear-gradient(90deg, rgba(217, 70, 239, .55), rgba(139, 92, 246, .5)); box-shadow: 0 0 18px rgba(217, 70, 239, .7), 0 0 40px rgba(139, 92, 246, .35); }
.nav__wisp span::after { /* ectoplasm tail, stretches with velocity */
  content: ""; position: absolute; top: 50%; right: 88%; width: var(--tail, 0px); height: 60%;
  transform: translateY(-50%); border-radius: 999px 0 0 999px;
  background: linear-gradient(90deg, transparent, rgba(167, 139, 250, .45));
  filter: blur(4px);
}
.nav__wisp.is-left span::after { right: auto; left: 88%; border-radius: 0 999px 999px 0; background: linear-gradient(-90deg, transparent, rgba(167, 139, 250, .45)); }

.nav__toggle { display: none; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--ink-2); color: var(--text); cursor: pointer; }
.nav__toggle-lines { display: grid; gap: 5px; justify-items: center; }
.nav__toggle-lines i { display: block; width: 20px; height: 2px; border-radius: 2px; background: currentColor; transition: transform var(--d-std) var(--ease-spring), opacity var(--d-quick) var(--ease-out), width var(--d-std) var(--ease-out); }
.nav__toggle-lines i:nth-child(2) { width: 14px; }
.nav__toggle[aria-expanded="true"] i:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] i:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav__toggle[aria-expanded="true"] i:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* mobile menu: a portal that tears open from the button */
.portal {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-content: center; gap: 2rem; text-align: center;
  background: radial-gradient(circle at 50% 40%, #1b1440, var(--void) 70%);
  clip-path: circle(0 at var(--px, 90%) var(--py, 40px));
  transition: clip-path 620ms var(--ease-out);
}
.portal[hidden] { display: grid; visibility: hidden; }
.portal.is-open { clip-path: circle(150% at var(--px, 90%) var(--py, 40px)); visibility: visible; }
.portal.is-closing { transition: clip-path 380ms var(--ease-in); }
.portal nav { display: grid; gap: .6rem; }
.portal a {
  font: 700 clamp(1.8rem, 8vw, 2.6rem)/1.2 var(--font-head); color: var(--text); text-decoration: none;
  opacity: 0; transform: translateY(26px); filter: blur(8px);
  transition: opacity var(--d-std) var(--ease-out), transform var(--d-std) var(--ease-spring), filter var(--d-std) var(--ease-out), color var(--d-quick);
}
.portal.is-open a { opacity: 1; transform: none; filter: none; transition-delay: calc(180ms + var(--i) * 70ms); }
.portal a:hover { color: var(--accent); }
.portal__whisper { color: var(--muted); font-style: italic; opacity: 0; transition: opacity var(--d-slow) var(--ease-out) 600ms; }
.portal.is-open .portal__whisper { opacity: .8; }

/* ---------- buttons ---------- */
.btn {
  --bg: linear-gradient(120deg, var(--violet), var(--blue));
  position: relative; display: inline-flex; align-items: center; gap: .5rem;
  padding: .9rem 1.5rem; border-radius: 999px; border: 0;
  background: var(--bg); color: #fff; font: 700 .98rem/1 var(--font-body); text-decoration: none; letter-spacing: .01em;
  box-shadow: 0 8px 30px rgba(99, 70, 246, .35);
  transform: translate(var(--mx, 0), var(--my, 0));
  transition: transform var(--d-std) var(--ease-spring), box-shadow var(--d-std) var(--ease-out), filter var(--d-quick);
  isolation: isolate; overflow: hidden;
}
.btn::after { /* sheen sweep */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform 700ms var(--ease-out);
}
.btn:hover { color: #fff; box-shadow: 0 10px 40px rgba(99, 70, 246, .55), var(--glow); }
.btn:hover::after { transform: translateX(120%); }
.btn:active { transform: translate(var(--mx, 0), var(--my, 0)) scale(.96); transition-duration: 120ms; }
.btn--hot { --bg: linear-gradient(120deg, #c026d3, var(--violet)); box-shadow: 0 8px 30px rgba(192, 38, 211, .35); }
.btn--ghost { --bg: transparent; border: 1px solid var(--line); box-shadow: none; color: var(--text); }
.btn--ghost:hover { background: rgba(139, 92, 246, .12); }

/* ---------- hero + motion logo ---------- */
.hero { position: relative; min-height: 100svh; display: grid; place-items: center; padding: 7rem 16px 5rem; text-align: center; }
.hero__stage { max-width: 880px; }
.logo { display: grid; justify-items: center; gap: .2rem; cursor: pointer; }
.logo__ghost { width: clamp(130px, 22vw, 200px); overflow: visible; animation: ghost-in 1.1s var(--ease-spring) both; }
@keyframes ghost-in { from { opacity: 0; transform: translateY(60px) scale(.6); filter: blur(12px); } }
.logo__float { animation: float 3.2s var(--ease-float) infinite; transform-origin: 100px 120px; }
.logo__squash { transform-origin: 100px 190px; transform-box: view-box; }
.logo__shadow { fill: rgba(139, 92, 246, .35); filter: blur(4px); transform-origin: 100px 212px; animation: shadow 3.2s var(--ease-float) infinite; }
.logo__eyes ellipse { fill: #120d26; }
.logo__eyes { transform-origin: 100px 92px; transform-box: view-box; animation: blink 4.6s infinite; }
.logo__shine { fill: #fff; }
.logo__mouth { fill: #120d26; transform-origin: 100px 124px; transform-box: view-box; animation: ooh 3.2s var(--ease-float) infinite; }
.logo__blush { fill: #f0abfc; opacity: .55; }
.logo__arm { fill: #b9a6ff; transform-box: fill-box; }
.logo__arm--l { transform-origin: 100% 0; animation: wave-l 3.2s var(--ease-float) infinite; }
.logo__arm--r { transform-origin: 0 0; animation: wave-r 3.2s var(--ease-float) infinite; }
.logo:hover .logo__squash, .logo.is-boo .logo__squash { animation: squash 800ms var(--ease-out); }
.logo.is-boo .logo__mouth { animation: boo-mouth 800ms var(--ease-spring); }

.logo__word {
  margin: 0; font: 400 clamp(3.2rem, 12vw, 8.5rem)/.95 var(--font-logo); letter-spacing: .03em;
  display: flex; flex-wrap: wrap; justify-content: center;
  filter: drop-shadow(0 0 22px rgba(139, 92, 246, .55)) drop-shadow(0 0 60px rgba(59, 130, 246, .35));
}
.logo__word span {
  display: inline-block;
  background: linear-gradient(100deg, #ede9fe 0%, var(--violet-2) 30%, var(--blue-2) 60%, #ede9fe 100%);
  background-size: 300% 100%; background-position: calc(var(--i) * 9%) 0;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: letter-in 900ms var(--ease-spring) both, wave 3.2s var(--ease-float) infinite, shimmer-letter 7s linear infinite;
  animation-delay: calc(300ms + var(--i) * 40ms), calc(1300ms + var(--i) * 110ms), calc(var(--i) * -300ms);
}
.logo:hover .logo__word span { animation: letter-in 900ms var(--ease-spring) both, jitter 420ms var(--ease-out) calc(var(--i) * 25ms), shimmer-letter 7s linear infinite; }
.logo__word.is-flicker { animation: flicker 600ms steps(1) 1; }

.hero__tag { margin: 1.4rem 0 .3rem; font: 700 clamp(1.3rem, 3.4vw, 2rem)/1.2 var(--font-head); }
.hero__wind { display: inline-block; animation: gust 2.4s var(--ease-float) infinite; }
.hero__sub { margin: 0 auto; max-width: 560px; color: var(--muted); font-size: 1.1rem; }
.hero__now { display: inline-flex; align-items: center; gap: .55rem; margin: 1.4rem 0 0; padding: .45rem 1rem; border: 1px solid var(--line); border-radius: 999px; background: rgba(22, 18, 43, .6); color: var(--muted); font-size: .95rem; }
.hero__now strong { color: var(--text); }
.pulse-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--blue-2); box-shadow: 0 0 0 0 rgba(96, 165, 250, .7); animation: pulse 2s var(--ease-out) infinite; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; margin-top: 2rem; }
.hero__scroll { position: absolute; bottom: 26px; left: 50%; width: 28px; height: 46px; margin-left: -14px; border: 2px solid var(--line); border-radius: 20px; }
.hero__scroll span { position: absolute; left: 50%; top: 9px; width: 4px; height: 9px; margin-left: -2px; border-radius: 4px; background: var(--accent); animation: scroll-cue 1.8s var(--ease-out) infinite; }

/* ---------- sections ---------- */
.section { width: min(calc(100% - 32px), var(--wrap)); margin: 0 auto; padding: 5.5rem 0 2rem; }
.section--flush { padding-top: 1rem; }
.section__head { max-width: 680px; margin-bottom: 2.4rem; }
.eyebrow { margin: 0 0 .6rem; color: var(--accent-2); font: 600 .8rem/1.2 var(--font-body); letter-spacing: .18em; text-transform: uppercase; }
.section__title { margin: 0 0 .6rem; font: 900 clamp(2rem, 5.5vw, 3.4rem)/1.05 var(--font-head); letter-spacing: -.02em; }
.section__lede { margin: 0; color: var(--muted); font-size: 1.1rem; }
.section__more { margin-top: 2rem; text-align: center; }
.section--hot { --accent: #e879f9; --accent-2: #f0abfc; --line: rgba(232, 121, 249, .22); }
.section--hot .section__title { background: linear-gradient(90deg, #f5d0fe, #e879f9, #a78bfa); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cta-band { text-align: center; padding-bottom: 5rem; }
.cta-band .section__lede { margin-bottom: 1.4rem; }

.page-hero { width: min(calc(100% - 32px), var(--wrap)); margin: 0 auto; padding: 9rem 0 2rem; }
.page-hero__title { margin: 0 0 1rem; font: 400 clamp(3.2rem, 11vw, 7.5rem)/.95 var(--font-logo); letter-spacing: .02em; color: var(--ecto); filter: drop-shadow(0 0 24px rgba(139, 92, 246, .55)); }
.theme-hot .page-hero__title { color: #f5d0fe; filter: drop-shadow(0 0 24px rgba(217, 70, 239, .6)); }
.page-hero__title .ch { display: inline-block; animation: letter-in 900ms var(--ease-spring) both, wave 3.4s var(--ease-float) infinite; animation-delay: calc(var(--c) * 40ms), calc(1200ms + var(--c) * 110ms); }
.page-hero__lede { max-width: 700px; color: var(--muted); font-size: 1.15rem; margin: 0; }
.page-hero--404 { min-height: 80vh; display: grid; align-content: center; justify-items: center; text-align: center; }
.page-hero--404 .page-hero__lede { margin-bottom: 1.6rem; }

/* ---------- gallery (polaroids adrift) ---------- */
.gallery { display: flex; flex-wrap: wrap; justify-content: center; gap: 2rem 1.6rem; align-items: flex-start; }
.gallery .polaroid { flex: 0 1 calc((100% - 4 * 1.6rem) / 5); min-width: 200px; }
@media (max-width: 1100px) { .gallery .polaroid { flex-basis: calc((100% - 2 * 1.6rem) / 3); } }
@media (max-width: 640px) { .gallery .polaroid { flex-basis: min(100%, 320px); } }
.polaroid { position: relative; margin: 0; --r: 0deg; transform: rotate(var(--r)); translate: 0 var(--fy, 0px); transition: transform var(--d-std) var(--ease-spring); }
.polaroid:nth-child(even) { margin-top: 2.5rem; }
.polaroid a { display: block; text-decoration: none; }
.polaroid__frame { display: block; padding: 10px 10px 0; background: #f3efff; border-radius: 6px 6px 0 0; box-shadow: 0 20px 50px rgba(0,0,0,.55); overflow: hidden; }
.polaroid__frame img { width: 100%; height: auto; filter: saturate(.9) contrast(1.05); transition: transform var(--d-slow) var(--ease-out), filter var(--d-std) var(--ease-out); }
.polaroid__placeholder { display: grid; place-items: center; aspect-ratio: 1; background: linear-gradient(135deg, #1b1440, #0e0b1c); }
.polaroid__placeholder svg { width: 40%; fill: rgba(196, 181, 253, .5); animation: bob 2.6s var(--ease-float) infinite; }
.polaroid figcaption { display: grid; padding: .7rem 1rem 1rem; background: #f3efff; border-radius: 0 0 6px 6px; color: #1a1433; box-shadow: 0 20px 50px rgba(0,0,0,.55); }
.polaroid__cap { font: 400 1.35rem/1.1 var(--font-logo); color: #4c1d95; letter-spacing: .03em; }
.polaroid__place { font-size: .8rem; color: #5b5680; }
.polaroid:hover { transform: rotate(0deg) translateY(-10px) scale(1.03); z-index: 2; }
.polaroid:hover img { transform: scale(1.07); filter: saturate(1.1) contrast(1.05); }
.polaroid::before { /* tape */
  content: ""; position: absolute; top: -12px; left: 50%; z-index: 1; width: 90px; height: 26px; margin-left: -45px;
  background: rgba(167, 139, 250, .55); transform: rotate(calc(var(--r) * -1.5)); backdrop-filter: blur(2px);
}

/* ---------- story cards ---------- */
.stories { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 1.4rem; align-items: start; }
.story {
  position: relative; overflow: hidden;
  padding: 1.6rem 1.5rem 1.3rem;
  background: linear-gradient(160deg, rgba(27, 20, 64, .78), rgba(14, 11, 28, .88));
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
  transform: perspective(900px) rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg));
  transition: transform var(--d-std) var(--ease-out), border-color var(--d-std) var(--ease-out), box-shadow var(--d-std) var(--ease-out);
}
.story:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: 0 24px 60px rgba(0,0,0,.45), var(--glow); }
.story__glare { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(360px circle at var(--gx, 50%) var(--gy, 0%), rgba(196, 181, 253, .16), transparent 60%); transition: opacity var(--d-std) var(--ease-out); }
.story:hover .story__glare { opacity: 1; }
.story__num { position: absolute; top: .6rem; right: 1rem; font: 900 3.4rem/1 var(--font-head); color: transparent; -webkit-text-stroke: 1px var(--line); }
.story__place { margin: 0 0 .35rem; color: var(--accent-2); font-size: .8rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; padding-right: 3.5rem; }
.story__title { margin: 0 0 .35rem; font: 700 1.3rem/1.25 var(--font-head); letter-spacing: -.01em; }
.story__era { margin: 0 0 .9rem; color: var(--muted); font-size: .88rem; }
.story__teaser { margin: .9rem 0 .6rem; }

.meter { display: flex; align-items: center; gap: .3rem; }
.meter__label { margin-right: .35rem; color: var(--muted); font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.pip { width: 22px; height: 22px; opacity: .22; transform: scale(.7); transition: opacity var(--d-std) var(--ease-out), transform var(--d-std) var(--ease-spring); }
.pip svg { width: 100%; height: 100%; fill: var(--ecto); }
.pip .eye { fill: var(--ink); }
.meter--heat .pip svg { fill: #f0abfc; }
.story.is-in .pip.on { opacity: 1; transform: scale(1); transition-delay: calc(250ms + var(--i) * 80ms); }
.story.is-in .pip.on svg { filter: drop-shadow(0 0 5px color-mix(in srgb, var(--accent) 80%, transparent)); }
.meter--heat .pip.on { animation: heartbeat 1.6s var(--ease-out) infinite; animation-delay: calc(var(--i) * 120ms); }

.story__more summary {
  display: inline-flex; align-items: center; gap: .45rem; list-style: none; cursor: pointer;
  padding: .5rem .95rem; border-radius: 999px; border: 1px solid var(--line);
  color: var(--text); font-weight: 600; font-size: .92rem;
  transition: background var(--d-quick) var(--ease-out), border-color var(--d-quick) var(--ease-out);
}
.story__more summary::-webkit-details-marker { display: none; }
.story__more summary:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: var(--accent); }
.summary__icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.5; transition: transform var(--d-std) var(--ease-spring); }
.summary__close { display: none; }
.story__more[open] .summary__open { display: none; }
.story__more[open] .summary__close { display: inline; }
.story__more[open] .summary__icon { transform: rotate(180deg); }
.story__more::details-content { block-size: 0; overflow: hidden; transition: block-size 520ms var(--ease-out), content-visibility 520ms allow-discrete; }
.story__more[open]::details-content { block-size: auto; }
.story__body { padding-top: .6rem; }
.story__body p { margin: .8rem 0; }
.story__more[open] .story__body > * { animation: materialize 600ms var(--ease-out) both; }
.story__more[open] .story__body > :nth-child(2) { animation-delay: 60ms; }
.story__more[open] .story__body > :nth-child(3) { animation-delay: 120ms; }
.story__more[open] .story__body > :nth-child(n+4) { animation-delay: 180ms; }
.story__visit { padding: .8rem 1rem; border-radius: 14px; background: rgba(59, 130, 246, .1); border: 1px solid rgba(96, 165, 250, .2); font-size: .95rem; }
.story__sources { display: flex; flex-wrap: wrap; gap: .4rem; margin: .8rem 0 0; padding: 0; list-style: none; font-size: .8rem; }
.story__sources::before { content: "Sources:"; color: var(--muted); margin-right: .2rem; }
.story__sources a { color: var(--muted); }
.story__sources a:hover { color: var(--text); }

.theme-hot .story { background: linear-gradient(160deg, rgba(58, 16, 70, .7), rgba(14, 11, 28, .9)); }
.section--hot .story { background: linear-gradient(160deg, rgba(58, 16, 70, .7), rgba(14, 11, 28, .9)); }

/* ---------- reveal on scroll ("materialize") ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); filter: blur(8px); }
.js .reveal.is-in { opacity: 1; transform: none; filter: none; transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out), filter 700ms var(--ease-out); transition-delay: calc(var(--n, 0) * 90ms); }
.js .polaroid.reveal { transform: rotate(var(--r)) translateY(40px); }
.js .polaroid.reveal.is-in { transform: rotate(var(--r)); transition: opacity 800ms var(--ease-out), transform 900ms var(--ease-spring), filter 800ms var(--ease-out); transition-delay: calc(var(--n, 0) * 80ms); }
.js .polaroid.reveal.is-in:hover { transform: rotate(0deg) translateY(-10px) scale(1.03); transition-delay: 0ms; }
/* after the entrance, tilt/hover need their own quick timing */
.js .story.reveal.is-in.is-settled { transition: transform var(--d-std) var(--ease-out), border-color var(--d-std) var(--ease-out), box-shadow var(--d-std) var(--ease-out); transform: perspective(900px) rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg)); }

/* ---------- footer ---------- */
.footer { position: relative; margin-top: 5rem; background: var(--ink); text-align: center; }
.footer__drip { position: absolute; top: -1px; left: 0; right: 0; height: 60px; transform: translateY(-1px); }
.footer__drip svg { width: 100%; height: 100%; fill: var(--void); animation: drip 6s var(--ease-float) infinite; transform-origin: top; }
.footer__inner { padding: 6rem 16px 3rem; }
.footer__brand { margin: 0; font: 400 2.6rem/1 var(--font-logo); color: var(--ecto); text-shadow: 0 0 24px rgba(139, 92, 246, .6); }
.footer__small { color: var(--muted); font-size: .85rem; }
.footer__boos { min-height: 1.4em; color: var(--accent); font-size: .9rem; }

/* ---------- the drive-by ghost ---------- */
.flyby { position: fixed; z-index: 30; width: 64px; height: 72px; left: 0; top: 0; cursor: pointer; pointer-events: auto; offset-rotate: 0deg; filter: drop-shadow(0 0 12px rgba(167, 139, 250, .9)); border: 0; padding: 0; background: none; }
.flyby svg { width: 100%; height: 100%; overflow: visible; }
.flyby .b { fill: rgba(237, 233, 254, .92); }
.flyby .e { fill: var(--void); }
.flyby.is-caught { animation: caught 600ms var(--ease-spring) forwards; }
.boo-pop { position: fixed; z-index: 31; pointer-events: none; font: 400 2rem/1 var(--font-logo); color: var(--ecto); text-shadow: 0 0 18px var(--violet); animation: boo-pop 900ms var(--ease-out) forwards; }

/* ---------- keyframes ---------- */
@keyframes float { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-14px) rotate(2deg); } }
@keyframes shadow { 0%,100% { transform: scale(1); opacity: .9; } 50% { transform: scale(.72); opacity: .45; } }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.08); } }
@keyframes ooh { 0%,100% { transform: scale(1); } 50% { transform: scale(.8, 1.15); } }
@keyframes wave-l { 0%,100% { transform: rotate(0deg); } 50% { transform: rotate(-14deg); } }
@keyframes wave-r { 0%,100% { transform: rotate(0deg); } 50% { transform: rotate(14deg); } }
@keyframes squash { 0% { transform: scale(1); } 18% { transform: scale(1.12, .86); } 40% { transform: scale(.9, 1.14) translateY(-10px); } 62% { transform: scale(1.04, .97); } 100% { transform: scale(1); } }
@keyframes boo-mouth { 0% { transform: scale(1); } 40% { transform: scale(1.6, 1.9); } 100% { transform: scale(1); } }
@keyframes boo-spin { 0% { transform: rotate(0) scale(1); } 40% { transform: rotate(-20deg) scale(1.2); } 100% { transform: rotate(0) scale(1); } }
@keyframes letter-in { from { opacity: 0; transform: translateY(40px) scale(.6) rotate(-12deg); filter: blur(10px); } }
@keyframes wave { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-.08em); } }
@keyframes jitter { 0% { transform: translate(0,0) rotate(0); } 30% { transform: translate(0,-.12em) rotate(-6deg); } 60% { transform: translate(0,.04em) rotate(4deg); } 100% { transform: translate(0,0) rotate(0); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes shimmer-letter { from { background-position: 0% 0; } to { background-position: 300% 0; } }
@keyframes flicker { 0%, 100% { opacity: 1; } 10% { opacity: .35; } 20% { opacity: 1; } 32% { opacity: .15; } 38% { opacity: .9; } 55% { opacity: .5; } 60% { opacity: 1; } }
@keyframes gust { 0%,100% { transform: translateX(0) rotate(0); } 50% { transform: translateX(6px) rotate(8deg); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(96, 165, 250, .7); } 80%,100% { box-shadow: 0 0 0 12px rgba(96, 165, 250, 0); } }
@keyframes scroll-cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(16px); } }
@keyframes materialize { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } }
@keyframes heartbeat { 0%, 60%, 100% { transform: scale(1); } 10% { transform: scale(1.2); } 22% { transform: scale(.96); } 34% { transform: scale(1.12); } }
@keyframes drip { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(1.25); } }
@keyframes caught { 0% { transform: scale(1); } 40% { transform: scale(1.5) rotate(20deg); } 100% { transform: scale(0) rotate(-40deg); opacity: 0; } }
@keyframes boo-pop { from { opacity: 0; transform: translate(-50%, 0) scale(.6); } 30% { opacity: 1; transform: translate(-50%, -20px) scale(1.2); } to { opacity: 0; transform: translate(-50%, -70px) scale(1); } }

/* ---------- page transitions (cross-document View Transitions) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out 320ms var(--ease-in) both; }
::view-transition-new(root) { animation: vt-in 520ms var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-16px); filter: blur(10px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(20px); filter: blur(10px); } }
.nav { view-transition-name: nav; }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .nav { padding: .45rem .5rem .45rem .9rem; }
  .nav__links { display: none; }
  .nav__toggle { display: grid; place-items: center; }
  .polaroid:nth-child(even) { margin-top: 0; }
  .page-hero { padding-top: 7.5rem; }
}
@media (hover: none) { .lantern { display: none; } }

/* ---------- reduced motion: keep the look, drop the movement ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; transition-delay: 0ms !important; scroll-behavior: auto !important; }
  .grain { animation: none; }
  .js .reveal { opacity: 1; transform: none; filter: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
