:root {
  --ink: #ffffff;
  --muted: rgba(255, 228, 220, 0.86);
  --glass: rgba(26, 5, 11, 0.74);
  --glass-hi: rgba(60, 10, 20, 0.84);
  --glass-b: rgba(255, 150, 120, 0.34);
  --accent: #ff5a4f;
  --gold: #ffc46b;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); background: #12030a;
  font-family: 'Poppins', system-ui, sans-serif; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: #e11d48; color: #fff; }

/* ================= scene ================= */
.scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: #0a0204; }
.world { position: absolute; inset: 0; z-index: 0; }
/* the journey pictures; journey.js positions and scales them */
.shot { position: absolute; left: 0; top: 0; width: 1672px; height: 941px; max-width: none; transform-origin: 0 0; display: none; user-select: none; }
.shot.on { display: block; will-change: transform, opacity; }
#stars, #embers { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
#stars { opacity: 0; }

.vignette, .grain, .whiteout { z-index: 2; }
.vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(10, 0, 4, .12) 40%, rgba(10, 0, 4, .6)); }
.grain {
  position: absolute; inset: -50%; opacity: 0; mix-blend-mode: overlay; animation: grain .5s steps(4) infinite paused; visibility: hidden;
  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='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes grain { 25% { transform: translate(-3%, 2%); } 50% { transform: translate(2%, -3%); } 75% { transform: translate(-1%, -2%); } }
.whiteout { position: absolute; inset: 0; background: radial-gradient(circle at 50% 45%, #ff6b4a, #b3001b 70%); opacity: 0; mix-blend-mode: screen; }
.phase {
  position: fixed; left: 16px; bottom: 16px; z-index: 20; padding: 7px 14px; border-radius: 99px; font-size: .82rem; font-weight: 500;
  background: rgba(28, 5, 11, .8); border: 1px solid rgba(255, 160, 130, .25); color: #fff; pointer-events: none;
}
.phase.pop { animation: phasepop .6s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes phasepop { 0% { transform: translateY(20px) scale(.6); opacity: 0; } 100% { transform: none; opacity: 1; } }

#fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 40; pointer-events: none; }
.flash { position: fixed; inset: 0; z-index: 39; background: #eef2ff; opacity: 0; pointer-events: none; }
.flash.go { animation: flash .9s ease-out; }
@keyframes flash { 0%, 18%, 40% { opacity: 0; } 8% { opacity: .55; } 28% { opacity: .35; } 100% { opacity: 0; } }

/* ================= nav ================= */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: 14px clamp(12px, 3vw, 28px);
}
.brand, .links, .theme {
  background: rgba(24, 5, 10, .78); border: 1px solid rgba(255, 160, 130, .22);
}
.brand {
  display: flex; align-items: center; gap: 10px; padding: 10px 18px 10px 14px; border-radius: 16px; text-decoration: none;
  font-family: 'Playfair Display', serif; font-style: italic; font-weight: 700; font-size: 1.35rem;
}
.crown { width: 34px; color: var(--gold); filter: drop-shadow(0 0 8px rgba(255, 196, 107, .75)); transition: transform .5s cubic-bezier(.3, 2, .5, 1); }
.brand:hover .crown { transform: translateY(-5px) rotate(-12deg) scale(1.15); }
.links { position: relative; display: flex; gap: 4px; padding: 6px; border-radius: 18px; margin-left: auto; }
.links a {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 13px;
  text-decoration: none; font-size: .98rem; color: var(--muted); transition: color .3s;
}
.links a svg { width: 18px; height: 18px; transition: transform .45s cubic-bezier(.3, 2, .5, 1); }
.links a:hover svg { transform: rotate(-15deg) scale(1.25); }
.links a.on, .links a:hover { color: #fff; }
.pill {
  position: absolute; top: 6px; height: calc(100% - 12px); border-radius: 13px; z-index: 0;
  background: linear-gradient(135deg, rgba(225, 29, 72, .6), rgba(255, 150, 60, .35));
  box-shadow: 0 0 20px rgba(255, 70, 60, .45), inset 0 0 0 1px rgba(255, 255, 255, .2);
  transition: left .55s cubic-bezier(.3, 1.6, .5, 1), width .55s cubic-bezier(.3, 1.6, .5, 1);
}
.theme {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  transition: transform .6s cubic-bezier(.3, 1.8, .5, 1);
}
.theme:hover { transform: rotate(25deg) scale(1.1); }
.theme svg { width: 22px; height: 22px; grid-area: 1 / 1; }
.skip:active { transform: scale(.85) translateX(6px); }

.music { position: relative; }
.music .eq { position: absolute; right: 7px; bottom: 9px; display: flex; gap: 1.5px; align-items: flex-end; height: 10px; opacity: 0; transition: opacity .3s; }
.music .eq i { width: 2.5px; height: 100%; background: var(--gold); border-radius: 2px; transform-origin: bottom; animation: eq .8s ease-in-out infinite alternate; }
.music .eq i:nth-child(2) { animation-delay: -.3s; }
.music .eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { from { transform: scaleY(.25); } to { transform: scaleY(1); } }
.music.on { box-shadow: 0 0 22px rgba(255, 120, 80, .55); border-color: rgba(255, 150, 110, .6); }
.music.on .eq { opacity: 1; }
.music.on svg { animation: hover 1.2s ease-in-out infinite; }

/* ================= hero ================= */
main { position: relative; z-index: 10; }
.hero {
  min-height: 100svh; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 104px 16px 40px;
}
.peaks { width: 120px; color: #fff; filter: drop-shadow(0 0 10px rgba(255, 255, 255, .5)); animation: hover 4s ease-in-out infinite; }
@keyframes hover { 50% { transform: translateY(-6px); } }

.title { position: relative; margin: 6px 0 0; line-height: 1; text-shadow: 0 4px 30px rgba(60, 0, 10, .85), 0 0 2px rgba(0, 0, 0, .6); }
.title .ch { display: inline-block; animation: bob var(--d, 3s) ease-in-out var(--dl, 0s) infinite; cursor: default; }
.title .ch.jump { animation: jump .7s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes bob { 50% { transform: translateY(var(--a, -5px)) rotate(var(--r, 2deg)); } }
@keyframes jump { 0% { transform: none; } 35% { transform: translateY(-.35em) rotate(var(--r, 8deg)) scale(1.15); } 100% { transform: none; } }
.t1 { display: block; font-family: 'Playfair Display', serif; font-style: italic; font-size: clamp(2.6rem, 6.5vw, 4.4rem); }
.t2 { display: block; font-family: 'Kaushan Script', cursive; font-size: clamp(3.4rem, 10vw, 7.4rem); margin-top: -.05em; white-space: nowrap; }
.w-space .ch { color: var(--c, #ff7a5c); text-shadow: 0 0 24px rgba(255, 60, 50, .7), 0 2px 10px rgba(0, 0, 0, .6); }
.zap { position: absolute; right: -2%; bottom: -14px; width: min(52%, 300px); color: #ff6b4a; filter: drop-shadow(0 0 8px #ff2e2e); stroke-dasharray: 700; stroke-dashoffset: 700; animation: draw 1.4s .6s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.sub1 { margin: 34px 0 6px; font-size: clamp(1.05rem, 2.2vw, 1.4rem); font-weight: 500; }
.spark { display: inline-block; animation: spin-spark 3s ease-in-out infinite; }
@keyframes spin-spark { 50% { transform: rotate(25deg) scale(1.3); } }
.sub2 { margin: 0; color: var(--muted); font-size: clamp(.92rem, 1.6vw, 1.08rem); max-width: 640px; }

/* ================= cards ================= */
.cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; margin-top: 44px; max-width: 980px; }
.card { width: 158px; height: 158px; position: relative; }
.card-inner { position: absolute; inset: 0; will-change: transform; }
.card-link {
  color: #fff; position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 14px 10px; border-radius: 22px; text-decoration: none;
  background: var(--glass); border: 1.5px solid var(--glass-b);
  box-shadow: 0 10px 30px rgba(20, 0, 6, .45), inset 0 1px 0 rgba(255, 255, 255, .12);
  transition: background .3s, border-color .3s, box-shadow .3s;
}
.card:hover .card-link, .card-link:focus-visible {
  background: var(--glass-hi); border-color: var(--g);
  box-shadow: 0 0 0 1px var(--g), 0 0 34px color-mix(in srgb, var(--g) 70%, transparent), 0 16px 40px rgba(20, 0, 6, .45);
  outline: none;
}
.card-link.flip { animation: flip .9s cubic-bezier(.4, 1.4, .5, 1); }
@keyframes flip { to { transform: rotateY(360deg); } }
.icon { width: 56px; height: 56px; display: grid; place-items: center; margin-bottom: 6px; }
.icon i { width: 52px; height: 52px; background: var(--ibg, var(--c)); -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.icon svg { width: 58px; height: 58px; }
.icon.spin { animation: ispin .8s cubic-bezier(.4, 1.6, .5, 1); }
@keyframes ispin { to { transform: rotate(360deg); } }
.icon.pop { animation: ipop .6s cubic-bezier(.3, 2, .5, 1); }
@keyframes ipop { 40% { transform: translateY(-16px) scale(1.25); } }
.cname { font-weight: 600; font-size: 1.12rem; }
.handle { font-size: .85rem; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ext { position: absolute; top: 12px; right: 12px; width: 16px; height: 16px; opacity: .75; transition: transform .4s cubic-bezier(.3, 2, .5, 1); }
.card:hover .ext { transform: translate(3px, -3px) scale(1.2); opacity: 1; }
.copy {
  position: absolute; top: 9px; left: 9px; z-index: 2; width: 28px; height: 28px; border-radius: 9px; cursor: pointer;
  display: grid; place-items: center; background: rgba(255, 255, 255, .1); border: 1px solid var(--glass-b);
  transition: transform .4s cubic-bezier(.3, 2, .5, 1), background .2s;
}
.copy:hover { transform: scale(1.15) rotate(-8deg); background: rgba(255, 255, 255, .22); }
.copy svg { width: 14px; height: 14px; }
.bubble {
  position: absolute; left: 50%; top: -12px; z-index: 3; pointer-events: none; white-space: nowrap;
  padding: 4px 11px; border-radius: 12px; font-size: .8rem; font-weight: 600; color: #3a0610; background: #fff4ec;
  box-shadow: 0 6px 18px rgba(30, 10, 60, .35); animation: bubble 1.5s cubic-bezier(.3, 1.8, .5, 1) forwards;
}
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; background: #fff4ec; transform: translateX(-50%) rotate(45deg); }
@keyframes bubble {
  0% { transform: translate(-50%, 10px) scale(.2); opacity: 0; }
  18% { transform: translate(-50%, -14px) scale(1); opacity: 1; }
  80% { transform: translate(-50%, -18px) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -30px) scale(.8); opacity: 0; }
}

/* ================= chips ================= */
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 38px; max-width: 900px; }
.chip {
  --r: 0deg; --y: 0px; --s: 1;
  display: inline-flex; align-items: center; gap: 9px; padding: 11px 22px; border-radius: 99px; cursor: pointer;
  background: var(--glass); border: 1.5px solid var(--glass-b); font-weight: 500; font-size: 1rem;
  box-shadow: 0 6px 20px rgba(20, 0, 6, .3);
  transform: translate(var(--dx, 0px), calc(var(--dy, 0px) + var(--y))) rotate(var(--r)) scale(var(--s));
  transition: transform .5s cubic-bezier(.3, 1.9, .5, 1), background .25s, border-color .25s, box-shadow .25s;
}
.chip svg { width: 20px; height: 20px; transition: transform .5s cubic-bezier(.3, 2, .5, 1); }
.chip:hover { background: var(--glass-hi); border-color: var(--accent); box-shadow: 0 0 26px rgba(255, 90, 70, .55); }
.chip:hover svg { transform: rotate(-20deg) scale(1.3); }
.chip:active { --s: .9; }
.chip.boing { animation: boing .7s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes boing { 30% { transform: translate(var(--dx, 0px), calc(var(--dy, 0px) - 14px)) scale(1.15, .9); } 60% { transform: translate(var(--dx, 0px), var(--dy, 0px)) scale(.92, 1.08); } }

.cat {
  margin-top: 46px; display: flex; align-items: center; gap: 18px; background: none; border: 0; cursor: pointer; color: #fff; padding: 6px;
}
.cat::before, .cat::after { content: ''; width: min(22vw, 160px); height: 1px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7)); }
.cat::after { transform: scaleX(-1); }
.cat svg { width: 48px; filter: drop-shadow(0 0 8px rgba(255, 255, 255, .5)); transition: transform .5s cubic-bezier(.3, 2, .5, 1); }
.cat:hover svg { transform: rotate(-10deg) scale(1.15); }
.cat.happy svg { animation: catjump .8s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes catjump { 40% { transform: translateY(-26px) rotate(15deg) scale(1.2); } }
.cat .eye { transform-box: fill-box; transform-origin: center; animation: blinkeye 5s infinite; }
@keyframes blinkeye { 0%, 92%, 100% { transform: none; } 95% { transform: scaleY(.1); } }

/* ================= about ================= */
.about { display: flex; justify-content: center; padding: 60px 16px 40px; }
.panel {
  width: min(820px, 100%); padding: clamp(24px, 5vw, 44px); border-radius: 28px;
  background: var(--glass); border: 1.5px solid var(--glass-b);
  box-shadow: 0 20px 60px rgba(20, 0, 6, .4);
}
.panel h2 { margin: 0 0 18px; font-family: 'Kaushan Script', cursive; font-weight: 400; font-size: clamp(2rem, 5vw, 2.8rem); color: var(--gold); }
.facts { list-style: none; margin: 0; padding: 0; }
.facts li {
  display: grid; grid-template-columns: 42px 1fr; gap: 12px; padding: 16px 0; border-top: 1px solid rgba(255, 160, 130, .2);
  transition: transform .5s cubic-bezier(.3, 1.8, .5, 1);
}
.facts li:hover { transform: translateX(10px) rotate(-.6deg); }
.facts span { font-weight: 600; color: #ff8a6b; padding-top: 2px; }
.facts p { margin: 0; font-size: clamp(1rem, 2vw, 1.12rem); line-height: 1.6; }
.facts em { font-style: normal; font-weight: 600; color: var(--gold); }

footer {
  position: relative; z-index: 10; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  max-width: 980px; margin: 0 auto; padding: 20px 16px 72px; font-size: .88rem; color: var(--muted);
}
footer p { margin: 0; }

.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 50; padding: 11px 20px; border-radius: 99px;
  background: #fff4ec; color: #3a0610; font-weight: 600; box-shadow: 0 10px 30px rgba(40, 0, 8, .5);
  transform: translate(-50%, 140px) rotate(-6deg); transition: transform .55s cubic-bezier(.3, 1.6, .5, 1);
}
.toast.show { transform: translate(-50%, 0) rotate(0); }

/* ================= small screens ================= */
@media (max-width: 760px) {
  .links a span { display: none; }
  .links a { padding: 9px 12px; }
  .brand { padding: 8px 12px; font-size: 1.1rem; }
  .crown { width: 26px; }
}
@media (max-width: 520px) {
  .brand span { display: none; }
  .hero { padding-top: 92px; }
  .cards { gap: 14px; }
  .card { width: calc(50vw - 30px); max-width: 158px; height: 140px; }
  .chip { padding: 9px 16px; font-size: .92rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .zap { stroke-dashoffset: 0; }
}

/* ================= glitch bursts (toggled by journey.js) ================= */
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.world { transform-origin: 50% 50%; }
.title.glitch { animation: tglitch .14s steps(2) infinite; }
@keyframes tglitch {
  0% { transform: translate(3px, -1px) skewX(-8deg); filter: drop-shadow(-4px 0 0 #ff2a4f) drop-shadow(4px 0 0 #2af0ff); clip-path: inset(0 0 0 0); }
  33% { transform: translate(-4px, 2px); filter: drop-shadow(4px 0 0 #ff2a4f) drop-shadow(-4px 0 0 #2af0ff); clip-path: inset(18% 0 38% 0); }
  66% { transform: translate(2px, 0) skewX(6deg); filter: drop-shadow(-2px 0 0 #2af0ff); clip-path: inset(52% 0 6% 0); }
  100% { transform: none; filter: none; clip-path: inset(0 0 0 0); }
}
.phase { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .title.glitch { animation: none; } }
.grain.on { visibility: visible; animation-play-state: running; }
