/* Base: tokens, page, stage, room animations */

:root {
  --void: #0D0916;
  --panel: #150E20;
  --panel2: #1B1228;
  --accent: #A78BFA;
  --accent-strong: #C4B0FF;
  --accent-deep: #6D4FD1;
  --beige: #F3EBFF;
  --muted: rgba(243, 235, 255, 0.62);
  --line: rgba(167, 139, 250, 0.22);
  --green: #6EE7B7;
  --display: "Chillax", "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { background: #0b1030; }

body {
  margin: 0;
  background: #0b1030;
  color: var(--beige);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

img { display: block; }

a { color: inherit; text-decoration: none; }

em { font-style: normal; }

/* --------------------------------------------------------------- stage */
.track { position: relative; height: 1600vh; }

.stage {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  overflow: hidden;
  background: #0e1338;
}

.world { position: absolute; inset: 0; will-change: transform; }

/* pointer-events: none by default -- these are purely decorative scene
   SVGs stacked on top of one another (room, furn, ...), and an SVG root
   captures clicks over its whole box even where nothing is painted, so
   without this the top-most layer blocks clicks on anything underneath
   it, including interactive elements like .balloon (which re-enables
   pointer-events on itself explicitly, see scene.js/base.css). */
.layer { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }

.tint {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 46%, transparent 40%, #05081c99 100%),
    linear-gradient(#1a2a8c22, #1a2a8c22);
  mix-blend-mode: multiply;
}

/* ------------------------------------------------- svg scene animation */
#stars circle { animation: twinkle 3.2s ease-in-out infinite; }

@keyframes twinkle { 0%, 100% { opacity: .95; } 50% { opacity: .25; } }

#cityNear .lit, #cityFar .lit { animation: flick 6s steps(1) infinite; }

@keyframes flick { 0%, 92% { opacity: 1; } 94%, 97% { opacity: .15; } }

.leaf { transform-box: fill-box; transform-origin: 50% 100%; animation: sway 6s ease-in-out infinite; }

.leaf:nth-of-type(2) { animation-delay: -1.4s; }

.leaf:nth-of-type(3) { animation-delay: -2.8s; }

.leaf:nth-of-type(4) { animation-delay: -4s; }

@keyframes sway { 0%, 100% { transform: rotate(var(--r, 0deg)); } 50% { transform: rotate(calc(var(--r, 0deg) + 2.5deg)); } }

.steam { animation: steam 3.4s ease-in-out infinite; opacity: 0; }

.steam.s2 { animation-delay: -1.7s; }

@keyframes steam { 0% { opacity: 0; transform: translateY(8px); } 40% { opacity: .5; } 100% { opacity: 0; transform: translateY(-14px); } }

.screen-glow {
  position: absolute; left: 50%; bottom: 0; width: 120vmax; height: 70%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 70%, #8b7bff55, #6d8bff18 38%, transparent 68%);
  opacity: 0; pointer-events: none; mix-blend-mode: screen;
}

/* Each animated star/lit-window/steam puff is its own always-running CSS
   animation (opacity/transform), and browsers commonly promote those to
   their own GPU compositor layer -- dozens of them, running forever, not
   just during scroll. Fine on a desktop GPU; on weaker/mid mobile GPUs
   this is a plausible cause of the stutter and outright rendering
   corruption (garbled text, a scene that goes blank for a frame) seen on
   a real phone but never on desktop. Cut here, not case by case: stars
   and lit windows stay visible as a fixed frame instead of animated; the
   coffee steam's own base style is opacity:0 (its animation is what ever
   makes it visible), so on mobile it simply doesn't puff, a small enough
   detail to trade for not corrupting the screen behind it. */
@media (max-width: 700px), (pointer: coarse) {
  #stars circle, #cityNear .lit, #cityFar .lit, .steam { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  #stars circle, .leaf, .steam, .boot img, .hint i { animation: none; }
}

/* The scene's ambient animations (twinkling stars, flickering windows, swaying plant leaves)
   used to be PAUSED while the stage had the "busy" class, which flips twice during the scroll
   (when the chat starts and when the closing starts). Pausing/resuming ~100 animations in one
   frame made the browser re-promote their layers, and on a fast scroll that showed as a dark box
   flashing at the sides of the scene for a moment. They now simply keep running: on phones and
   touch screens they are switched off anyway (see the max-width / coarse-pointer rule above). */

/* Netlify's own free-plan badge, an iframe it injects at runtime (id
   nl-badge-frame) -- not part of this page's markup, so it can't be
   removed, only hidden. Ported from the old site (see commit "site: hide
   the Netlify free-plan badge"), lost when this page replaced it. */
#nl-badge-frame { display: none !important; }

/* Discord/X balloons in the window (markup in index.html, positioned and
   faded in per-frame from scene.js using timeline.js's balloonRise/
   balloonOpacity). Cursor/hover here; the pop burst is its own keyframe so
   a click can layer it on top of whatever position transform JS is setting. */
.balloon { cursor: pointer; opacity: 0; pointer-events: none; }

.balloon:hover .balloon-shape, .balloon:focus-visible .balloon-shape { filter: brightness(1.12); }

/* Animated on .balloon-body, an inner group, never on .balloon itself:
   .balloon's own transform is set every frame from JS (scene.js) to
   position it in the window, and a CSS animation's transform would
   otherwise fight that positional one for the same attribute. */
.balloon-body { transform-box: fill-box; transform-origin: 50% 50%; }

.balloon.popped .balloon-body { animation: balloonPop .38s ease forwards; }

.balloon.popped { pointer-events: none; }

@keyframes balloonPop {
  0% { transform: scale(1); opacity: 1; }
  35% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .balloon.popped { animation: none; opacity: 0; }
}


[hidden] { display: none !important; }


/* page scrollbar hidden (scrolling still works): the scene fills the whole window */
html { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; width: 0; height: 0; }
