/* ==========================================================================
   GLOOPY — shared design system
   --------------------------------------------------------------------------
   One stylesheet for every page. Retheme the whole site from the :root block
   below; nothing further down uses a raw colour literal.

   All custom properties are prefixed --g- on purpose. game/css/style.css
   declares its own :root vars (--bg, --text, --accent, --panel, --line, --dim)
   and game.html loads both — the prefix keeps them from colliding.
   ========================================================================== */

/* ------------------------------------------------------------------ tokens */

:root {
  /* --- sky & world ------------------------------------------------------ */
  --g-sky-top:      #2b7fe8;
  --g-sky-mid:      #4aa3f5;
  --g-sky-low:      #5db8ff;
  --g-sky-haze:     #a5d8ff;
  --g-cloud:        #ffffff;
  --g-cloud-shade:  #cfe3fa;
  --g-sun:          #ffd84d;
  --g-sun-core:     #fff3b0;

  /* --- lime ------------------------------------------------------------- */
  /* #b3e609 is the logo's own background. It is the second brand colour and
     carries roughly as much of the page as the gold does. */
  --g-lime:         #b3e609;
  --g-lime-lt:      #d6ff4a;
  --g-lime-dk:      #7ea300;
  --g-lime-deep:    #56720a;

  /* --- terrain ---------------------------------------------------------- */
  --g-grass:        #8fd420;
  --g-grass-deep:   #63a516;
  --g-moss:         #4a7d12;
  --g-rock:         #7b6a5a;
  --g-rock-dark:    #574a3e;
  --g-dirt:         #8b5a2b;
  --g-dirt-dark:    #6a4220;
  --g-volcano:      #8c3b2e;
  --g-lava:         #ff7a2f;
  --g-water:        #7fd8ff;

  /* --- brand ------------------------------------------------------------ */
  --g-gold:         #ffc93c;
  --g-gold-lt:      #ffe27a;
  --g-gold-dk:      #d99a10;
  --g-choc:         #b5701e;
  --g-choc-lt:      #d99245;
  --g-choc-dk:      #7d4a11;
  --g-jelly:        #e5233c;
  --g-jelly-lt:     #ff6d7e;
  --g-jelly-dk:     #a5122c;
  --g-jelly-glow:   #ff8fa0;
  --g-purple:       #7b3fa0;
  --g-purple-dk:    #4a1f66;

  /* --- ink & paper ------------------------------------------------------ */
  --g-ink:          #1a1220;   /* the one true outline colour */
  --g-ink-soft:     #3a2b47;
  --g-cream:        #fff6e0;
  --g-paper:        #fffaf0;
  --g-body:         #2b2038;   /* body copy on light panels — AA on cream */
  --g-body-dim:     #5c4d6b;
  --g-on-dark:      #f4ecff;
  --g-on-dark-dim:  #c3b6d4;

  /* --- console ---------------------------------------------------------- */
  --g-term-bg:      #16102a;
  --g-term-bg-2:    #221741;
  --g-term-bar:     #0f0a1e;
  --g-term-text:    #cdbdf0;
  --g-term-bright:  #ffffff;
  --g-term-accent:  var(--g-gold);
  --g-term-hot:     #ff6d7e;
  --g-term-lime:    var(--g-lime);
  --g-term-line:    #3b2c5c;

  /* --- type ------------------------------------------------------------- */
  --g-font-display: 'Baloo 2', 'Fredoka', 'Trebuchet MS', ui-rounded, system-ui, sans-serif;
  --g-font-body:    'Nunito', 'Segoe UI', ui-rounded, system-ui, -apple-system, sans-serif;
  --g-font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --g-font-pixel:   'Press Start 2P', 'Courier New', ui-monospace, monospace;

  /* --- geometry --------------------------------------------------------- */
  --g-stroke:       3px;       /* standard cartoon outline weight */
  --g-stroke-fat:   4px;
  --g-radius:       18px;
  --g-radius-lg:    26px;
  --g-radius-pill:  999px;
  --g-wrap:         1180px;
  --g-wrap-narrow:  760px;
  --g-nav-h:        68px;

  /* --- motion ----------------------------------------------------------- */
  --g-pop:          cubic-bezier(.34, 1.56, .64, 1);   /* overshoot */
  --g-ease:         cubic-bezier(.22, .61, .36, 1);
  --g-fast:         160ms;
  --g-med:          320ms;
  --g-slow:         620ms;

  /* --- elevation -------------------------------------------------------- */
  --g-shadow-sm:    0 3px 0 var(--g-ink), 0 6px 14px rgba(26,18,32,.28);
  --g-shadow:       0 5px 0 var(--g-ink), 0 14px 34px rgba(26,18,32,.34);
  --g-shadow-lg:    0 8px 0 var(--g-ink), 0 26px 60px rgba(26,18,32,.42);
  --g-glow-gold:    0 0 0 4px rgba(255,201,60,.32), 0 0 34px rgba(255,201,60,.55);
  --g-glow-lime:    0 0 0 4px rgba(179,230,9,.32), 0 0 34px rgba(179,230,9,.55);
}

/* --------------------------------------------------------------- reset */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--g-nav-h) + 18px);
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--g-font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--g-on-dark);
  background: var(--g-sky-top);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }

/* The rule above has the same specificity as the UA's [hidden] rule and comes
   later, which would otherwise resurrect any hidden <img>. */
[hidden] { display: none !important; }

a { color: inherit; }

button, input, select, textarea { font: inherit; color: inherit; }

/* Visible focus for keyboard users on every interactive thing. */
:focus-visible {
  outline: 3px solid var(--g-gold);
  outline-offset: 3px;
  border-radius: 6px;
}
:focus:not(:focus-visible) { outline: none; }

.g-sr {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  overflow: hidden; white-space: nowrap;
}

.g-skip {
  position: absolute; left: 12px; top: -100px; z-index: 200;
  background: var(--g-gold); color: var(--g-ink);
  padding: 10px 18px; border-radius: var(--g-radius-pill);
  font-weight: 800; text-decoration: none;
  border: var(--g-stroke) solid var(--g-ink);
  transition: top var(--g-fast) var(--g-ease);
}
.g-skip:focus { top: 12px; }

/* ============================================================ typography */

h1, h2, h3, h4, .g-display {
  font-family: var(--g-font-display);
  font-weight: 800;
  line-height: 1.04;
  margin: 0;
  letter-spacing: -.01em;
}

/* The signature look: chunky rounded type with a hard dark outline and a
   dropped shadow. paint-order lets a single element carry both stroke and
   fill without a duplicated ghost layer. */
/* Stroke and shadow are in em so they scale with the heading. A fixed px
   stroke that reads well at 90px swallows the letterforms at 40px. */
.g-outlined {
  color: var(--g-cream);
  -webkit-text-stroke: .1em var(--g-ink);
  paint-order: stroke fill;
  text-shadow: 0 .085em 0 var(--g-ink), 0 .17em .3em rgba(26,18,32,.45);
}
.g-outlined-sm { -webkit-text-stroke-width: .062em; text-shadow: 0 .05em 0 var(--g-ink); }

.g-gold-fill {
  background: linear-gradient(180deg, var(--g-gold-lt) 0%, var(--g-gold) 48%, var(--g-gold-dk) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* -webkit-text-stroke paints under the clipped fill, so the two compose.
   The shadow moves to a filter because text-shadow would paint over the
   clipped fill rather than behind it. */
.g-outlined.g-gold-fill { text-shadow: none; filter: drop-shadow(0 .08em 0 var(--g-ink)); }

.g-h1 { font-size: clamp(2.6rem, 8vw, 5.4rem); }
.g-h2 { font-size: clamp(2rem, 5.4vw, 3.4rem); }
.g-h3 { font-size: clamp(1.3rem, 3vw, 1.85rem); }

.g-eyebrow {
  font-family: var(--g-font-mono);
  font-size: 12px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--g-gold);
  margin: 0 0 14px;
  font-weight: 500;
}

.g-lead {
  font-size: clamp(1.05rem, 2.1vw, 1.28rem);
  line-height: 1.6;
  max-width: 62ch;
}

.g-mono { font-family: var(--g-font-mono); }

/* Pull quotes used throughout lore / whitepaper. */
.g-quote {
  margin: 34px 0;
  padding: 24px 28px 24px 34px;
  border-left: 8px solid var(--g-gold);
  background: rgba(255,255,255,.09);
  border-radius: 0 var(--g-radius) var(--g-radius) 0;
  font-family: var(--g-font-display);
  font-size: clamp(1.15rem, 2.6vw, 1.6rem);
  font-weight: 700;
  line-height: 1.32;
  color: var(--g-cream);
}
.g-quote cite {
  display: block; margin-top: 12px;
  font-family: var(--g-font-mono); font-size: 12px; font-style: normal;
  letter-spacing: .16em; text-transform: uppercase; color: var(--g-gold-lt);
  font-weight: 400;
}

/* ============================================================== wordmark */

.g-mark {
  display: inline-flex;
  align-items: center;
  /* Wide enough that the wordmark's burst spikes clear the logo badge. */
  gap: 16px;
  position: relative;
  text-decoration: none;
  padding: 6px 10px;
  flex-shrink: 0;
}

/* The logo art itself: a rounded badge with the house outline and a lime
   halo picked from the artwork's own background. */
.g-mark__logo {
  position: relative;
  z-index: 3;
  width: var(--mark-size, 42px);
  height: var(--mark-size, 42px);
  flex-shrink: 0;
  border-radius: 30%;
  object-fit: cover;
  border: var(--g-stroke) solid var(--g-ink);
  box-shadow: 0 3px 0 var(--g-ink), 0 0 20px rgba(179,230,9,.5);
  transition: transform var(--g-med) var(--g-pop), box-shadow var(--g-med) var(--g-ease);
}
.g-mark:hover .g-mark__logo {
  transform: rotate(-6deg) scale(1.08);
  box-shadow: 0 3px 0 var(--g-ink), 0 0 30px rgba(179,230,9,.85);
}
.g-mark--lg .g-mark__logo { --mark-size: clamp(64px, 11vw, 116px); border-width: var(--g-stroke-fat); }
/* Wraps the burst + wordmark so the burst sizes to the text, not to the
   badge sitting beside it. */
.g-mark__word {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.g-mark__text {
  position: relative;
  z-index: 2;
  font-family: var(--g-font-pixel);
  font-size: 19px;
  line-height: 1;
  letter-spacing: .04em;
  background: linear-gradient(180deg, var(--g-gold-lt) 0%, var(--g-gold) 46%, var(--g-gold-dk) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* em-based so the stroke stays proportional: a fixed 4px swallows the
     letterforms of a 19px pixel font almost entirely. */
  -webkit-text-stroke: .13em var(--g-ink);
  paint-order: stroke fill;
  filter: drop-shadow(0 .09em 0 var(--g-ink));
}
/* Jagged red burst behind the wordmark. */
.g-mark__burst {
  position: absolute;
  inset: -30% -11%;
  z-index: 1;
  background: var(--g-jelly);
  clip-path: polygon(
    0% 50%, 7% 30%, 3% 12%, 18% 20%, 24% 3%, 36% 17%, 50% 0%,
    64% 17%, 76% 3%, 82% 20%, 97% 12%, 93% 30%, 100% 50%,
    93% 70%, 97% 88%, 82% 80%, 76% 97%, 64% 83%, 50% 100%,
    36% 83%, 24% 97%, 18% 80%, 3% 88%, 7% 70%
  );
  opacity: .88;
}
.g-mark--lg .g-mark__text { font-size: clamp(28px, 6vw, 54px); }

/* =============================================================== buttons */

/* Fat pressable pill: inner top highlight, solid darker bottom edge that
   collapses on :active so the button physically sinks. */
.g-btn {
  --btn-face:  var(--g-gold);
  --btn-edge:  var(--g-gold-dk);
  --btn-label: var(--g-ink);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 32px;
  border: var(--g-stroke-fat) solid var(--g-ink);
  border-radius: var(--g-radius-pill);
  background: var(--btn-face);
  color: var(--btn-label);
  font-family: var(--g-font-display);
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  isolation: isolate;
  box-shadow: 0 6px 0 var(--btn-edge), 0 9px 0 var(--g-ink), 0 16px 26px rgba(26,18,32,.36);
  transform: translateY(0);
  transition: transform var(--g-fast) var(--g-pop), box-shadow var(--g-fast) var(--g-ease), filter var(--g-fast) linear;
}
/* Lighter inner highlight across the top half. */
.g-btn::before {
  content: '';
  position: absolute;
  inset: 3px 8px auto 8px;
  height: 42%;
  border-radius: var(--g-radius-pill);
  background: linear-gradient(180deg, rgba(255,255,255,.62), rgba(255,255,255,0));
  pointer-events: none;
  z-index: -1;
}
.g-btn:hover { transform: translateY(-3px); filter: saturate(1.08) brightness(1.04); }
.g-btn:active {
  transform: translateY(6px);
  box-shadow: 0 0 0 var(--btn-edge), 0 3px 0 var(--g-ink), 0 6px 12px rgba(26,18,32,.4);
}

.g-btn--lg { padding: 20px 46px; font-size: clamp(1.15rem, 2.4vw, 1.5rem); }
.g-btn--sm { padding: 10px 20px; font-size: .95rem; border-width: var(--g-stroke); box-shadow: 0 4px 0 var(--btn-edge), 0 6px 0 var(--g-ink); }
.g-btn--sm:active { box-shadow: 0 0 0 var(--btn-edge), 0 2px 0 var(--g-ink); transform: translateY(4px); }

.g-btn--choc { --btn-face: var(--g-choc); --btn-edge: var(--g-choc-dk); --btn-label: var(--g-cream); }
.g-btn--choc::before { background: linear-gradient(180deg, rgba(255,255,255,.34), rgba(255,255,255,0)); }

.g-btn--jelly { --btn-face: var(--g-jelly); --btn-edge: var(--g-jelly-dk); --btn-label: #fff; }

/* Lime primary — the logo's own colour, used for the play-flow CTAs. */
.g-btn--lime { --btn-face: var(--g-lime); --btn-edge: var(--g-lime-dk); --btn-label: var(--g-ink); }

/* Tertiary: ghost outline, no fill, no lift edge. */
.g-btn--ghost {
  --btn-label: var(--g-cream);
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.72);
  box-shadow: none;
  backdrop-filter: blur(6px);
}
.g-btn--ghost::before { display: none; }
.g-btn--ghost:hover { background: rgba(255,255,255,.2); border-color: var(--g-gold); color: var(--g-gold); }
.g-btn--ghost:active { transform: translateY(2px); box-shadow: none; }

.g-btn[disabled], .g-btn[aria-disabled='true'] {
  filter: grayscale(.75) brightness(.82);
  cursor: not-allowed;
  pointer-events: none;
  opacity: .75;
}

.g-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}
.g-btn-row--center { justify-content: center; }

/* ================================================================== nav */

.g-nav {
  position: sticky;
  top: 0;
  z-index: 90;
  height: var(--g-nav-h);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 clamp(14px, 3vw, 30px);
  background: rgba(43,127,232,.34);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 2px solid rgba(255,255,255,.18);
  transition: background var(--g-med) var(--g-ease), box-shadow var(--g-med) var(--g-ease), border-color var(--g-med) var(--g-ease);
}
.g-nav.is-stuck {
  background: rgba(20,58,110,.92);
  border-bottom-color: var(--g-ink);
  box-shadow: 0 5px 0 var(--g-lime), 0 8px 0 rgba(26,18,32,.5), 0 18px 40px rgba(26,18,32,.4);
}

.g-nav__links {
  display: flex;
  gap: clamp(6px, 1.4vw, 20px);
  margin-left: auto;
  align-items: center;
}
.g-nav__link {
  position: relative;
  padding: 9px 12px;
  border-radius: var(--g-radius-pill);
  font-family: var(--g-font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .15em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--g-on-dark);
  white-space: nowrap;
  transition: color var(--g-fast) var(--g-ease), background var(--g-fast) var(--g-ease), transform var(--g-fast) var(--g-pop);
}
.g-nav__link:hover, .g-nav__link[aria-current='page'] {
  color: var(--g-ink);
  background: var(--g-gold);
  transform: translateY(-2px);
}
.g-nav__cta { margin-left: 6px; }

.g-nav__burger {
  display: none;
  margin-left: auto;
  width: 48px; height: 48px;
  align-items: center; justify-content: center;
  background: rgba(255,255,255,.14);
  border: var(--g-stroke) solid var(--g-ink);
  border-radius: 14px;
  cursor: pointer;
}
.g-nav__burger span {
  display: block; position: relative;
  width: 22px; height: 3px; border-radius: 2px;
  background: var(--g-cream);
  transition: transform var(--g-med) var(--g-pop), opacity var(--g-fast) linear;
}
.g-nav__burger span::before, .g-nav__burger span::after {
  content: ''; position: absolute; left: 0;
  width: 22px; height: 3px; border-radius: 2px; background: var(--g-cream);
  transition: transform var(--g-med) var(--g-pop);
}
.g-nav__burger span::before { top: -7px; }
.g-nav__burger span::after  { top: 7px; }
.g-nav__burger[aria-expanded='true'] span { background: transparent; }
.g-nav__burger[aria-expanded='true'] span::before { transform: translateY(7px) rotate(45deg); }
.g-nav__burger[aria-expanded='true'] span::after  { transform: translateY(-7px) rotate(-45deg); }

/* Slide-in drawer, mobile only. */
.g-drawer {
  position: fixed;
  inset: var(--g-nav-h) 0 auto 0;
  z-index: 89;
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 18px clamp(14px, 4vw, 26px) 26px;
  background: rgba(16,42,86,.97);
  backdrop-filter: blur(16px);
  border-bottom: var(--g-stroke-fat) solid var(--g-ink);
  box-shadow: 0 22px 50px rgba(26,18,32,.55);
  transform: translateY(-118%);
  transition: transform var(--g-med) var(--g-ease);
  max-height: calc(100vh - var(--g-nav-h));
  overflow-y: auto;
}
.g-drawer.is-open { transform: translateY(0); }
.g-drawer a {
  padding: 14px 16px;
  border-radius: 14px;
  font-family: var(--g-font-display);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--g-cream);
  border: 2px solid transparent;
}
.g-drawer a:hover { background: rgba(255,255,255,.12); border-color: var(--g-gold); }
.g-drawer .g-btn { margin-top: 10px; }

@media (max-width: 900px) {
  .g-nav__links { display: none; }
  .g-nav__burger { display: inline-flex; }
  .g-drawer { display: flex; }
}

/* ======================================================== world / parallax
   Four depth planes built entirely from gradients, blob shapes and inline
   SVG. No external images, so the world renders identically offline.
   --gx / --gy are the mouse-follow offsets, set once on <body> by main.js.  */

body { --gx: 0; --gy: 0; }

.g-world {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.g-layer {
  position: absolute;
  inset: -8% -6%;
  will-change: transform;
  transition: transform 700ms var(--g-ease);
}
/* Depth 1 is furthest, 4 is closest — nearer planes travel further. */
.g-layer--1 { transform: translate3d(calc(var(--gx) * -6px),  calc(var(--gy) * -3px),  0); }
.g-layer--2 { transform: translate3d(calc(var(--gx) * -16px), calc(var(--gy) * -8px),  0); }
.g-layer--3 { transform: translate3d(calc(var(--gx) * 22px),  calc(var(--gy) * 11px),  0); }
.g-layer--4 { transform: translate3d(calc(var(--gx) * 40px),  calc(var(--gy) * 20px),  0); }

/* Scroll-driven vertical drift, layered on top of the mouse offset by
   main.js writing --gsy per layer. */
.g-layer[data-speed] { transition: none; }

.g-sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 70% at 78% 6%, rgba(255,243,176,.55) 0%, rgba(255,216,77,.16) 26%, transparent 58%),
    linear-gradient(180deg, var(--g-sky-top) 0%, var(--g-sky-mid) 46%, var(--g-sky-low) 78%, var(--g-sky-haze) 100%);
}

.g-sun {
  position: absolute;
  top: 4%; right: 8%;
  width: clamp(110px, 15vw, 220px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 38%, var(--g-sun-core) 0%, var(--g-sun) 52%, #ffb01f 100%);
  box-shadow: 0 0 70px 26px rgba(255,216,77,.5), 0 0 160px 70px rgba(255,216,77,.24);
  animation: g-sun-pulse 7s var(--g-ease) infinite;
}
@keyframes g-sun-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.045); } }

/* Fluffy volumetric cloud. The shape itself is an SVG stamped in by art.js —
   overlapping ellipses with a shaded underside — because a border-radius box
   can only ever be a pill. This rule handles placement and drift. */
.g-cloud {
  position: absolute;
  width: var(--cw, 240px);
  filter: drop-shadow(0 12px 18px rgba(43,90,160,.26));
  animation: g-cloud-drift var(--cd, 34s) var(--g-ease) infinite alternate;
  animation-delay: var(--cdelay, 0s);
}
@keyframes g-cloud-drift {
  from { transform: translateX(-5%); }
  to   { transform: translateX(6%); }
}

/* Distant mountain range + volcano, as one SVG per layer. */
.g-ridge { position: absolute; inset: auto 0 0 0; width: 100%; }

/* Mossy platform slab: grass cap, rock face, hard outline. */
.g-slab {
  position: absolute;
  border-radius: 26px 26px 14px 14px;
  background:
    linear-gradient(180deg, var(--g-lime) 0 18%, var(--g-grass) 18% 26%, var(--g-grass-deep) 26% 34%, var(--g-rock) 34% 78%, var(--g-rock-dark) 78% 100%);
  border: var(--g-stroke-fat) solid var(--g-ink);
  box-shadow: inset 0 -8px 0 rgba(26,18,32,.24), 0 14px 30px rgba(26,18,32,.32);
}
/* Rocky underside notches. */
.g-slab::after {
  content: '';
  position: absolute;
  inset: auto 8px -1px 8px;
  height: 22%;
  background:
    radial-gradient(circle at 15% 0, transparent 0 60%, var(--g-rock-dark) 61%),
    radial-gradient(circle at 50% 0, transparent 0 55%, var(--g-rock-dark) 56%),
    radial-gradient(circle at 85% 0, transparent 0 60%, var(--g-rock-dark) 61%);
  opacity: .5;
  border-radius: 0 0 12px 12px;
}

/* Foreground grass blades, drawn as a repeating conic sawtooth. */
.g-blades {
  position: absolute;
  inset: auto 0 0 0;
  height: clamp(38px, 6vw, 76px);
  background:
    repeating-conic-gradient(from 218deg at 50% 100%, var(--g-lime) 0deg 8deg, transparent 8deg 22deg),
    linear-gradient(180deg, transparent 0 40%, var(--g-grass) 40%);
  background-size: 34px 100%, 100% 100%;
  opacity: .95;
}

/* Drifting coins in the near foreground. */
.g-coin {
  position: absolute;
  width: var(--coin-size, 26px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, var(--g-gold-lt) 0 26%, var(--g-gold) 55%, var(--g-gold-dk) 100%);
  border: 3px solid var(--g-ink);
  box-shadow: 0 0 16px rgba(255,201,60,.6);
  animation:
    g-coin-spin var(--coin-spin, 2.6s) linear infinite,
    g-coin-bob  var(--coin-bob, 5s) var(--g-ease) infinite alternate;
  animation-delay: var(--coin-delay, 0s), var(--coin-delay, 0s);
}
.g-coin::after {
  content: '';
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  border: 2px solid rgba(26,18,32,.4);
}
@keyframes g-coin-spin { from { transform: rotateY(0deg); } to { transform: rotateY(360deg); } }
@keyframes g-coin-bob  { from { translate: 0 -8px; } to { translate: 0 10px; } }

/* Waterfall ribbon. Kept soft and low-contrast — it sits in a mid-depth
   plane, so hard white stripes would read as a striped box rather than water. */
.g-fall {
  position: absolute;
  width: var(--fw, 54px);
  border-radius: 0 0 46% 46%;
  background: linear-gradient(180deg,
    rgba(255,255,255,.62) 0%,
    rgba(127,216,255,.5) 30%,
    rgba(127,216,255,.28) 78%,
    rgba(127,216,255,.06) 100%);
  overflow: hidden;
  filter: blur(.4px);
}
.g-fall::before {
  content: '';
  position: absolute; inset: -40% 0 0 0;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,.3) 0 6px, transparent 6px 34px);
  animation: g-fall-run 1.3s linear infinite;
}
/* Mist where it lands. */
.g-fall::after {
  content: '';
  position: absolute; inset: auto -60% -18% -60%;
  height: 34%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 50%, rgba(255,255,255,.5), transparent 68%);
}
@keyframes g-fall-run { to { transform: translateY(34px); } }

/* ============================================================ the specimen
   Gloopy — translucent candy-red jelly. Permanent idle wobble, bigger jiggle
   on hover, full squash on click (JS adds .is-poked).                       */

.g-gloopy { display: inline-block; transform-origin: 50% 88%; }
.g-gloopy__body { animation: g-wobble 4.4s var(--g-ease) infinite; transform-origin: 50% 78%; transform-box: fill-box; }
.g-gloopy:hover .g-gloopy__body { animation-duration: 1.5s; }
.g-gloopy.is-poked .g-gloopy__body { animation: g-squash 700ms var(--g-pop); }
.g-gloopy__tent { animation: g-sway 3.2s var(--g-ease) infinite alternate; transform-origin: 50% 6%; transform-box: fill-box; }

@keyframes g-wobble {
  0%, 100% { transform: scale(1, 1); }
  28%      { transform: scale(1.055, .945); }
  56%      { transform: scale(.966, 1.042); }
  80%      { transform: scale(1.022, .982); }
}
@keyframes g-squash {
  0%   { transform: scale(1, 1) translateY(0); }
  20%  { transform: scale(1.38, .62) translateY(16px); }
  46%  { transform: scale(.8, 1.26) translateY(-12px); }
  70%  { transform: scale(1.1, .93) translateY(3px); }
  100% { transform: scale(1, 1) translateY(0); }
}
@keyframes g-sway { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }

/* Bouncing scroll arrow. */
.g-scroll-hint {
  display: inline-flex; flex-direction: column; align-items: center; gap: 8px;
  font-family: var(--g-font-mono); font-size: 11px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--g-cream); text-decoration: none;
  opacity: .9;
}
.g-scroll-hint svg { animation: g-bob 1.7s var(--g-ease) infinite; }
@keyframes g-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(9px); } }

/* ============================================================== layout */

.g-wrap { width: 100%; max-width: var(--g-wrap); margin-inline: auto; padding-inline: clamp(16px, 4vw, 34px); }
.g-wrap--narrow { max-width: var(--g-wrap-narrow); }

.g-section {
  position: relative;
  z-index: 2;
  padding-block: clamp(64px, 9vw, 128px);
  scroll-margin-top: calc(var(--g-nav-h) + 20px);
}
.g-section--tight { padding-block: clamp(44px, 6vw, 78px); }

/* Section skins */
.g-skin-sky   { background: linear-gradient(180deg, var(--g-sky-mid), var(--g-sky-low)); }
.g-skin-deep  { background: linear-gradient(180deg, #1b4f9c, #123a7a); }
.g-skin-dirt  { background: linear-gradient(180deg, var(--g-dirt), var(--g-dirt-dark)); }
.g-skin-choc  { background: linear-gradient(180deg, var(--g-choc), var(--g-choc-dk)); }
.g-skin-night { background: linear-gradient(180deg, #2a1a4a, #170f2c); }
.g-skin-lime  { background: linear-gradient(180deg, var(--g-lime) 0%, #9ccd07 100%); color: var(--g-ink); }
.g-skin-lime .g-eyebrow { color: var(--g-ink); opacity: .78; }
.g-skin-lime .g-lead, .g-skin-lime .g-card__text { color: #2c3a06; }
.g-skin-lime .g-card { background: linear-gradient(180deg, rgba(255,255,255,.6), rgba(255,255,255,.34)); }
.g-skin-lime .g-card__title { color: var(--g-ink); }
.g-skin-cream { background: linear-gradient(180deg, var(--g-paper), #f2e6cf); color: var(--g-body); }
.g-skin-cream .g-eyebrow { color: var(--g-choc-dk); }
.g-skin-cream .g-outlined { color: var(--g-cream); }

/* Chunky wavy divider between section skins. */
.g-wave { position: relative; z-index: 3; display: block; width: 100%; height: clamp(30px, 4vw, 62px); margin-bottom: -1px; }

.g-grid { display: grid; gap: clamp(16px, 2.2vw, 26px); }
.g-grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g-grid--3 { grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); }
.g-grid--4 { grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); }

/* ================================================================ cards */

.g-card {
  position: relative;
  padding: clamp(22px, 3vw, 32px);
  border: var(--g-stroke-fat) solid var(--g-ink);
  border-radius: var(--g-radius-lg);
  background: linear-gradient(180deg, rgba(255,255,255,.2), rgba(255,255,255,.08));
  box-shadow: var(--g-shadow);
  transform-style: preserve-3d;
  transition: transform var(--g-med) var(--g-pop), box-shadow var(--g-med) var(--g-ease), background var(--g-med) var(--g-ease);
}
.g-card::before {
  content: '';
  position: absolute; inset: 4px 10px auto 10px; height: 34%;
  border-radius: var(--g-radius);
  background: linear-gradient(180deg, rgba(255,255,255,.3), transparent);
  pointer-events: none;
}
.g-card:hover { box-shadow: var(--g-shadow-lg); background: linear-gradient(180deg, rgba(255,255,255,.3), rgba(255,255,255,.12)); }

.g-card--solid { background: var(--g-paper); color: var(--g-body); }
.g-card--solid:hover { background: #fff; }
.g-card--solid .g-card__title { color: var(--g-choc-dk); }

.g-card__icon {
  width: 70px; height: 70px; margin-bottom: 16px;
  display: grid; place-items: center;
  border-radius: 20px;
  border: var(--g-stroke) solid var(--g-ink);
  background: linear-gradient(180deg, var(--g-lime-lt), var(--g-lime));
  box-shadow: 0 4px 0 var(--g-lime-dk);
}
/* Every other icon flips to gold so a row of cards alternates. */
.g-grid > *:nth-child(even) .g-card__icon {
  background: linear-gradient(180deg, var(--g-gold-lt), var(--g-gold));
  box-shadow: 0 4px 0 var(--g-gold-dk);
}
.g-card__title { font-family: var(--g-font-display); font-weight: 800; font-size: 1.3rem; margin: 0 0 8px; color: var(--g-cream); }
.g-card__text { margin: 0; font-size: .98rem; line-height: 1.6; color: var(--g-on-dark-dim); }
.g-card--solid .g-card__text { color: var(--g-body-dim); }

/* Small tag/pill used for threat levels, statuses, labels. */
.g-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 13px;
  border: 2px solid var(--g-ink);
  border-radius: var(--g-radius-pill);
  background: var(--g-gold);
  color: var(--g-ink);
  font-family: var(--g-font-mono);
  font-size: 10.5px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  white-space: nowrap;
}
.g-tag--low   { background: var(--g-lime); color: var(--g-ink); }
.g-tag--mid   { background: var(--g-gold); }
.g-tag--high  { background: var(--g-jelly); color: #fff; }
.g-tag--ghost { background: rgba(255,255,255,.16); color: var(--g-cream); border-color: rgba(255,255,255,.5); }

/* ======================================================= scroll reveals */

.g-reveal {
  opacity: 0;
  transform: translateY(26px) scale(.985);
  transition: opacity var(--g-slow) var(--g-ease), transform var(--g-slow) var(--g-pop);
}
.g-reveal.is-in { opacity: 1; transform: none; }

/* ============================================== the survey console (terminal)
   Restyled as an in-world gadget: chunky outlined bezel, warm glow, sitting
   on a floating platform. Behaviour is unchanged — see assets/js/console.js. */

.g-console-mount { position: relative; z-index: 3; }

.g-console {
  position: relative;
  border: 5px solid var(--g-ink);
  border-radius: 28px;
  background: linear-gradient(180deg, var(--g-term-bg-2), var(--g-term-bg));
  box-shadow:
    0 0 0 6px rgba(255,201,60,.18),
    0 10px 0 var(--g-ink),
    0 30px 70px rgba(26,18,32,.55),
    0 0 90px rgba(255,201,60,.22);
  overflow: hidden;
  font-family: var(--g-font-mono);
  color: var(--g-term-text);
}

.g-console__bar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
  background: var(--g-term-bar);
  border-bottom: 3px solid var(--g-ink);
}
.g-console__lamps { display: flex; gap: 7px; flex-shrink: 0; }
.g-console__lamps i {
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid var(--g-ink);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.3);
}
.g-console__title {
  flex: 1; min-width: 0;
  text-align: center;
  font-size: 11.5px; letter-spacing: .14em;
  color: #a08fc4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.g-console__live { font-size: 11px; color: var(--g-gold); letter-spacing: .1em; flex-shrink: 0; }
.g-console__live b { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--g-gold); margin-right: 6px; animation: g-pulse 1.5s ease-in-out infinite; }
@keyframes g-pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }

.g-console__body {
  display: grid;
  grid-template-columns: 1fr 17rem;
  min-height: 24rem;
  max-height: 30rem;
}
@media (max-width: 900px) { .g-console__body { grid-template-columns: 1fr; max-height: none; } }

.g-console__scroll {
  min-height: 0;
  overflow-y: auto;
  padding: 20px clamp(16px, 2.4vw, 26px);
  font-size: 13px;
  line-height: 1.7;
  cursor: text;
  scrollbar-width: thin;
  scrollbar-color: #5a4585 var(--g-term-bg);
}
.g-console__scroll::-webkit-scrollbar { width: 9px; }
.g-console__scroll::-webkit-scrollbar-track { background: var(--g-term-bg); }
.g-console__scroll::-webkit-scrollbar-thumb { background: #5a4585; border-radius: 99px; }

.g-console__banner {
  font-size: clamp(5px, 1.1vw, 12px);
  line-height: 1.15;
  color: var(--g-gold);
  margin: 0;
  overflow-x: auto;
  white-space: pre;
}

.g-console__line { animation: g-term-in 260ms var(--g-ease) both; white-space: pre-wrap; word-break: break-word; }
@keyframes g-term-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Output colouring, matched to the original React renderer's rules. */
.g-t-head  { color: var(--g-term-hot); font-weight: 500; }
.g-t-num   { color: var(--g-gold-lt); }
.g-t-caps  { color: var(--g-term-bright); font-weight: 500; }
.g-t-body  { color: var(--g-term-text); }
.g-t-ok    { color: var(--g-term-lime); }
.g-t-warn  { color: var(--g-gold); }

.g-console__prompt { color: var(--g-term-hot); flex-shrink: 0; }
.g-console__entry { display: flex; gap: 9px; align-items: center; margin-top: 18px; }
.g-console__input {
  flex: 1; min-width: 0;
  background: transparent; border: 0; outline: none;
  color: var(--g-term-bright);
  caret-color: transparent;
  font-family: inherit; font-size: 13px;
}
.g-console__caret { color: var(--g-gold); animation: g-blink 1.05s steps(1) infinite; }
@keyframes g-blink { 0%,49% { opacity: 1; } 50%,100% { opacity: 0; } }

.g-console__aside {
  border-left: 3px solid var(--g-ink);
  background: var(--g-term-bar);
  padding: 18px;
  overflow-y: auto;
  min-height: 0;
}
@media (max-width: 900px) { .g-console__aside { border-left: 0; border-top: 3px solid var(--g-ink); } }

.g-console__port {
  width: 100%;
  padding: 12px;
  background: radial-gradient(circle at 50% 34%, #3a2a5e, var(--g-term-bg));
  border: 3px solid var(--g-term-line);
  border-radius: 18px;
  cursor: pointer;
  transition: border-color var(--g-fast) var(--g-ease), box-shadow var(--g-fast) var(--g-ease);
}
.g-console__port:hover { border-color: var(--g-gold); box-shadow: 0 0 26px rgba(255,201,60,.35); }

.g-console__stats { margin: 16px 0 0; display: grid; gap: 8px; font-size: 11.5px; }
.g-console__stats > div { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 7px; border-bottom: 1px solid var(--g-term-line); }
.g-console__stats dt { letter-spacing: .14em; text-transform: uppercase; color: #9280b8; }
.g-console__stats dd { margin: 0; color: var(--g-term-text); }

.g-console__foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 13px 18px;
  background: var(--g-term-bar);
  border-top: 3px solid var(--g-ink);
}
.g-console__foot > span { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: #9280b8; margin-right: 4px; }
.g-chip {
  padding: 6px 14px;
  border: 2px solid var(--g-term-line);
  border-radius: var(--g-radius-pill);
  background: transparent;
  color: var(--g-term-text);
  font-family: inherit; font-size: 11.5px;
  cursor: pointer;
  transition: all var(--g-fast) var(--g-ease);
}
.g-chip:hover { border-color: var(--g-gold); color: var(--g-gold); transform: translateY(-2px); }

/* =============================================================== tables */

.g-table-wrap { overflow-x: auto; border-radius: var(--g-radius); border: var(--g-stroke) solid var(--g-ink); box-shadow: var(--g-shadow-sm); }
.g-table { width: 100%; border-collapse: collapse; background: var(--g-paper); color: var(--g-body); font-size: .95rem; min-width: 520px; }
.g-table caption { caption-side: top; padding: 12px 16px; text-align: left; font-family: var(--g-font-mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; background: var(--g-choc-dk); color: var(--g-cream); }
.g-table th, .g-table td { padding: 13px 16px; text-align: left; border-bottom: 2px solid rgba(26,18,32,.12); vertical-align: top; }
.g-table thead th { background: var(--g-lime); color: var(--g-ink); font-family: var(--g-font-display); font-weight: 800; border-bottom: 3px solid var(--g-ink); position: sticky; top: 0; }
.g-table tbody tr:last-child td { border-bottom: 0; }
.g-table tbody tr:nth-child(even) { background: rgba(181,112,30,.07); }
.g-table kbd {
  display: inline-block; padding: 3px 9px; margin-right: 4px;
  font-family: var(--g-font-mono); font-size: .8rem;
  background: var(--g-ink); color: var(--g-gold-lt);
  border-radius: 6px; box-shadow: 0 2px 0 rgba(0,0,0,.5);
}

/* ============================================================ accordion */

.g-acc { border: var(--g-stroke-fat) solid var(--g-ink); border-radius: var(--g-radius-lg); overflow: hidden; box-shadow: var(--g-shadow); background: var(--g-paper); }
.g-acc__item + .g-acc__item { border-top: 3px solid var(--g-ink); }
.g-acc__btn {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px clamp(16px, 3vw, 26px);
  background: var(--g-paper);
  border: 0; cursor: pointer; text-align: left;
  font-family: var(--g-font-display); font-weight: 700; font-size: 1.08rem;
  color: var(--g-body);
  transition: background var(--g-fast) var(--g-ease);
}
.g-acc__btn:hover { background: #fff3d6; }
.g-acc__btn[aria-expanded='true'] { background: var(--g-lime); color: var(--g-ink); }
.g-acc__sign { flex-shrink: 0; width: 30px; height: 30px; display: grid; place-items: center; border: 2px solid var(--g-ink); border-radius: 50%; background: var(--g-gold); transition: transform var(--g-med) var(--g-pop), background var(--g-fast) linear; font-size: 1.1rem; line-height: 1; }
.g-acc__btn[aria-expanded='true'] .g-acc__sign { transform: rotate(135deg); background: var(--g-cream); }
.g-acc__panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--g-med) var(--g-ease); background: #fffdf6; }
.g-acc__panel.is-open { grid-template-rows: 1fr; }
.g-acc__panel > div { overflow: hidden; }
.g-acc__panel p { margin: 0; padding: 4px clamp(16px, 3vw, 26px) 22px; color: var(--g-body-dim); font-size: .98rem; }

/* ========================================================= copy-to-clipboard */

.g-copy {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px 18px;
  border: var(--g-stroke) solid var(--g-ink);
  border-radius: var(--g-radius);
  background: rgba(26,18,32,.4);
  box-shadow: var(--g-shadow-sm);
}
.g-copy code {
  flex: 1; min-width: 180px;
  font-family: var(--g-font-mono); font-size: .86rem;
  color: var(--g-gold-lt);
  word-break: break-all;
}
.g-copy__done { font-family: var(--g-font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--g-lime); opacity: 0; transition: opacity var(--g-fast) linear; }
.g-copy__done.is-on { opacity: 1; }

.g-warn {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 18px 20px;
  border: var(--g-stroke) dashed var(--g-jelly-lt);
  border-radius: var(--g-radius);
  background: rgba(229,35,60,.14);
  color: var(--g-cream);
  font-size: .95rem;
}
.g-warn strong { color: var(--g-jelly-lt); }

/* ============================================================ donut chart */

.g-donut-wrap { display: flex; flex-wrap: wrap; gap: clamp(24px, 4vw, 48px); align-items: center; justify-content: center; }
.g-donut { width: min(340px, 76vw); flex-shrink: 0; }
/* Slices animate their dash offset in from a full-circle gap. */
.g-donut circle { transition: stroke-dasharray 1.4s var(--g-ease), stroke-dashoffset 1.4s var(--g-ease); }
.g-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; min-width: 260px; flex: 1; }
.g-legend li { display: grid; grid-template-columns: 18px 1fr auto; gap: 12px; align-items: center; }
.g-legend i { width: 18px; height: 18px; border-radius: 6px; border: 2px solid var(--g-ink); }
.g-legend b { font-family: var(--g-font-mono); font-size: .95rem; color: var(--g-gold-lt); }
.g-legend span { font-size: .96rem; }

/* ============================================================== roadmap */

.g-path { position: relative; display: grid; gap: 26px; }
@media (min-width: 900px) { .g-path { grid-template-columns: repeat(4, 1fr); gap: 20px; } }
.g-path__node { position: relative; }
/* Winding connector between phase nodes, world-map style. */
@media (min-width: 900px) {
  .g-path__node:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 46px; left: calc(100% - 8px);
    width: calc(100% - 34px); height: 34px;
    border-top: 5px dashed var(--g-gold);
    border-right: 0;
    opacity: .8;
    z-index: 0;
  }
  .g-path__node:nth-child(even)::after { top: 66px; transform: rotate(-6deg); }
  .g-path__node:nth-child(odd)::after  { transform: rotate(5deg); }
  .g-path__node:nth-child(even) { margin-top: 42px; }
}
.g-path__pin {
  position: relative; z-index: 1;
  width: 66px; height: 66px; margin-bottom: 16px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: var(--g-stroke-fat) solid var(--g-ink);
  background: linear-gradient(180deg, var(--g-gold-lt), var(--g-gold));
  box-shadow: 0 5px 0 var(--g-gold-dk), 0 12px 24px rgba(26,18,32,.4);
  font-family: var(--g-font-display); font-weight: 800; font-size: 1.3rem; color: var(--g-ink);
}
.g-path__node--done .g-path__pin { background: linear-gradient(180deg, var(--g-lime-lt), var(--g-lime)); box-shadow: 0 5px 0 var(--g-lime-dk), 0 12px 24px rgba(26,18,32,.4); }
.g-path__node--next .g-path__pin { background: linear-gradient(180deg, var(--g-jelly-lt), var(--g-jelly)); box-shadow: 0 5px 0 var(--g-jelly-dk), 0 12px 24px rgba(26,18,32,.4); color: #fff; }

/* ================================================================ footer */

.g-footer { position: relative; z-index: 2; padding-block: clamp(40px, 6vw, 70px) 34px; background: linear-gradient(180deg, var(--g-dirt-dark), #4a2d14); border-top: 5px solid var(--g-ink); }
.g-footer__grid { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.g-footer h3 { font-family: var(--g-font-display); font-size: 1rem; color: var(--g-gold); margin: 0 0 12px; letter-spacing: .08em; text-transform: uppercase; }
.g-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.g-footer a { color: #f0dcc2; text-decoration: none; font-size: .95rem; }
.g-footer a:hover { color: var(--g-gold); text-decoration: underline; }
.g-footer__legal { margin-top: 34px; padding-top: 22px; border-top: 2px solid rgba(255,255,255,.16); font-size: .82rem; color: #d2b795; line-height: 1.7; }

.g-social { display: flex; gap: 12px; }
.g-social a {
  width: 46px; height: 46px; display: grid; place-items: center;
  border: var(--g-stroke) solid var(--g-ink); border-radius: 14px;
  background: var(--g-choc);
  box-shadow: 0 4px 0 var(--g-choc-dk);
  transition: transform var(--g-fast) var(--g-pop), background var(--g-fast) linear;
}
.g-social a:hover { transform: translateY(-3px); background: var(--g-gold); color: var(--g-ink); }

/* ================================================== reduced motion & print */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .g-reveal { opacity: 1; transform: none; }
  .g-layer { transform: none !important; }
  .g-sun, .g-cloud, .g-coin, .g-fall::after { animation: none !important; }
}

/* ==========================================================================
   PAGE-SPECIFIC BLOCKS
   Everything above is the shared system. Below: the key-art banner, creature
   strip, zone map, whitepaper chrome, the wallet gate and the game HUD.
   ========================================================================== */

/* ====================================================== key-art banner */

.g-banner {
  position: relative;
  overflow: hidden;
  padding-block: clamp(70px, 11vw, 150px);
  background:
    radial-gradient(80% 60% at 50% 22%, rgba(255,216,77,.34), transparent 62%),
    linear-gradient(180deg, var(--g-sky-mid) 0%, var(--g-sky-low) 62%, var(--g-grass) 100%);
  border-block: 5px solid var(--g-ink);
}
.g-banner__head {
  position: relative; z-index: 4;
  text-align: center;
  font-size: clamp(2.4rem, 9.5vw, 7rem);
  line-height: .94;
}
/* Gloopy launching across the screen with a red motion trail. */
.g-banner__hero {
  position: absolute; z-index: 3;
  left: 50%; top: 52%;
  width: clamp(140px, 22vw, 300px);
  translate: -50% -50%;
  animation: g-launch 5.5s var(--g-ease) infinite;
}
@keyframes g-launch {
  0%   { translate: -220% -20%; rotate: -14deg; scale: .8 1.18; }
  42%  { translate: -50% -58%;  rotate: 6deg;   scale: 1.16 .86; }
  62%  { translate: 10% -46%;   rotate: 14deg;  scale: .92 1.1; }
  100% { translate: 220% -6%;   rotate: 26deg;  scale: .84 1.14; }
}
.g-banner__trail {
  position: absolute; z-index: 2;
  left: 0; top: 50%; width: 100%; height: clamp(50px, 8vw, 120px);
  translate: 0 -50%;
  background: linear-gradient(90deg, transparent, rgba(229,35,60,.5) 30%, rgba(255,109,126,.75) 50%, rgba(229,35,60,.5) 70%, transparent);
  filter: blur(16px);
  animation: g-trail 5.5s var(--g-ease) infinite;
}
@keyframes g-trail { 0%,100% { opacity: 0; } 40%,60% { opacity: .85; } }

/* Enemies peeking in from the edges. */
.g-peek { position: absolute; z-index: 4; width: clamp(66px, 9vw, 132px); }
.g-peek--tl { top: 6%;  left: 3%;   animation: g-peek-a 4.2s var(--g-ease) infinite alternate; }
.g-peek--tr { top: 10%; right: 4%;  animation: g-peek-b 3.4s var(--g-ease) infinite alternate; }
.g-peek--bl { bottom: 4%; left: 8%; animation: g-peek-b 3.9s var(--g-ease) infinite alternate; }
.g-peek--br { bottom: 7%; right: 7%; animation: g-peek-a 4.7s var(--g-ease) infinite alternate; }
@keyframes g-peek-a { from { translate: 0 8px; rotate: -5deg; } to { translate: 0 -10px; rotate: 5deg; } }
@keyframes g-peek-b { from { translate: 0 -9px; rotate: 6deg; } to { translate: 0 9px; rotate: -6deg; } }
@media (max-width: 620px) { .g-peek--bl, .g-peek--br { display: none; } }

/* ====================================================== creature strip */

.g-strip {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 8px 4px 26px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--g-gold) rgba(0,0,0,.25);
}
.g-strip::-webkit-scrollbar { height: 10px; }
.g-strip::-webkit-scrollbar-track { background: rgba(0,0,0,.25); border-radius: 99px; }
.g-strip::-webkit-scrollbar-thumb { background: var(--g-gold); border-radius: 99px; }
.g-strip > * { flex: 0 0 clamp(230px, 30vw, 280px); scroll-snap-align: start; }

.g-dossier { display: flex; flex-direction: column; gap: 12px; }
.g-dossier__art {
  height: 132px;
  display: grid; place-items: center;
  border: var(--g-stroke) solid var(--g-ink);
  border-radius: var(--g-radius);
  background: radial-gradient(circle at 50% 62%, rgba(255,255,255,.24), rgba(0,0,0,.2));
}
.g-dossier__art svg { height: 96px; width: auto; }

/* ============================================================ zone map */

.g-zonemap { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.g-zone {
  position: relative;
  padding: 26px 24px;
  border: var(--g-stroke-fat) solid var(--g-ink);
  border-radius: var(--g-radius-lg);
  background: linear-gradient(180deg, var(--zone-a, #2f6fb8), var(--zone-b, #1d4a86));
  box-shadow: var(--g-shadow);
  overflow: hidden;
  transition: transform var(--g-med) var(--g-pop), box-shadow var(--g-med) var(--g-ease);
}
.g-zone:hover { transform: translateY(-6px) rotate(-.5deg); box-shadow: var(--g-shadow-lg); }
.g-zone__n {
  font-family: var(--g-font-pixel); font-size: 13px;
  color: var(--g-gold); letter-spacing: .06em;
}
.g-zone__name { font-family: var(--g-font-display); font-weight: 800; font-size: 1.45rem; margin: 10px 0 4px; color: var(--g-cream); }
.g-zone__alias { font-family: var(--g-font-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.6); margin: 0 0 12px; }
.g-zone__text { margin: 0 0 16px; font-size: .95rem; color: var(--g-on-dark-dim); }
.g-zone__meta { display: flex; flex-wrap: wrap; gap: 8px; }

/* ========================================================== whitepaper */

.g-progress {
  position: fixed; inset: 0 0 auto 0; z-index: 95;
  height: 6px; background: transparent;
}
.g-progress i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--g-lime), var(--g-gold));
  box-shadow: 0 0 12px rgba(179,230,9,.85);
  transition: width 80ms linear;
}

.g-doc { display: grid; gap: clamp(24px, 4vw, 52px); align-items: start; }
@media (min-width: 1000px) { .g-doc { grid-template-columns: 262px 1fr; } }
/* Grid items default to min-width:auto, so the min-content width of a wide
   table inside .g-prose would push the whole column past the viewport. */
.g-doc > * { min-width: 0; }

.g-toc {
  position: sticky;
  top: calc(var(--g-nav-h) + 22px);
  max-height: calc(100vh - var(--g-nav-h) - 44px);
  overflow-y: auto;
  padding: 22px;
  border: var(--g-stroke) solid var(--g-ink);
  border-radius: var(--g-radius);
  background: rgba(26,18,32,.42);
  backdrop-filter: blur(8px);
}
@media (max-width: 999px) { .g-toc { position: static; max-height: none; } }
.g-toc h2 { font-family: var(--g-font-mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--g-gold); margin: 0 0 14px; font-weight: 500; }
.g-toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; display: grid; gap: 3px; }
.g-toc a {
  display: block; padding: 8px 12px; border-radius: 9px;
  font-size: .88rem; text-decoration: none; color: var(--g-on-dark-dim);
  border-left: 3px solid transparent;
  transition: all var(--g-fast) var(--g-ease);
}
.g-toc a::before { counter-increment: toc; content: counter(toc, decimal-leading-zero) '  '; font-family: var(--g-font-mono); font-size: .78rem; color: var(--g-gold-dk); }
.g-toc a:hover { background: rgba(255,255,255,.09); color: var(--g-cream); }
.g-toc a.is-active { background: rgba(255,201,60,.16); border-left-color: var(--g-gold); color: var(--g-gold); }

.g-prose { max-width: 74ch; }
.g-prose h2 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); margin: 52px 0 16px; color: var(--g-cream); scroll-margin-top: calc(var(--g-nav-h) + 24px); }
.g-prose h2:first-child { margin-top: 0; }
.g-prose h3 { font-size: 1.22rem; margin: 32px 0 10px; color: var(--g-gold-lt); }
.g-prose p { margin: 0 0 18px; color: var(--g-on-dark); }
.g-prose ul, .g-prose ol { margin: 0 0 20px; padding-left: 24px; display: grid; gap: 9px; }
.g-prose li { color: var(--g-on-dark); }
.g-prose li::marker { color: var(--g-lime); }
.g-prose a { color: var(--g-gold-lt); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.g-prose strong { color: var(--g-cream); }
.g-prose hr { border: 0; border-top: 3px dashed rgba(255,255,255,.22); margin: 44px 0; }
.g-prose .g-table-wrap { margin: 0 0 24px; }

.g-illus { margin: 30px 0; padding: 20px; border: var(--g-stroke) solid var(--g-ink); border-radius: var(--g-radius); background: rgba(0,0,0,.22); }
.g-illus figcaption { margin-top: 14px; font-family: var(--g-font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--g-on-dark-dim); text-align: center; }

/* Chapter card used on the lore page. */
.g-chapter {
  position: relative;
  padding: clamp(26px, 4vw, 44px);
  border: var(--g-stroke-fat) solid var(--g-ink);
  border-radius: var(--g-radius-lg);
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(0,0,0,.2));
  box-shadow: var(--g-shadow);
  margin-bottom: 26px;
  scroll-margin-top: calc(var(--g-nav-h) + 24px);
}
.g-chapter__n {
  position: absolute; top: -22px; left: clamp(20px, 3vw, 34px);
  padding: 7px 18px;
  border: var(--g-stroke) solid var(--g-ink);
  border-radius: var(--g-radius-pill);
  background: var(--g-gold);
  color: var(--g-ink);
  font-family: var(--g-font-pixel); font-size: 11px;
  box-shadow: 0 4px 0 var(--g-gold-dk);
}
.g-chapter h2 { margin: 14px 0 16px; font-size: clamp(1.5rem, 3.4vw, 2.1rem); color: var(--g-cream); }
.g-chapter p { margin: 0 0 16px; color: var(--g-on-dark); }
.g-chapter p:last-child { margin-bottom: 0; }

/* ============================================== connect.html — wallet gate */

.g-gate {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(20px, 5vh, 60px) 16px;
}
/* The same world, dimmed back so the card carries the page. */
.g-gate__dim { position: absolute; inset: 0; background: rgba(12,26,54,.62); backdrop-filter: blur(3px); z-index: 1; }

.g-gate__card {
  position: relative; z-index: 3;
  width: min(660px, 100%);
  padding: clamp(26px, 4vw, 44px);
  border: 5px solid var(--g-ink);
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(255,255,255,.2), rgba(255,255,255,.09));
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  box-shadow: 0 10px 0 var(--g-ink), 0 40px 90px rgba(12,26,54,.6), inset 0 2px 0 rgba(255,255,255,.4);
}

.g-step { margin-bottom: 30px; }
.g-step__label {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--g-font-mono); font-size: 11px;
  letter-spacing: .2em; text-transform: uppercase; color: var(--g-gold);
  margin-bottom: 12px;
}
.g-step__label b {
  width: 24px; height: 24px; display: grid; place-items: center;
  border: 2px solid var(--g-ink); border-radius: 50%;
  background: var(--g-gold); color: var(--g-ink); font-size: 11px;
}

.g-field {
  width: 100%;
  padding: 15px 18px;
  border: var(--g-stroke) solid var(--g-ink);
  border-radius: 16px;
  background: rgba(255,255,255,.9);
  color: var(--g-body);
  font-size: 1.05rem;
  font-family: var(--g-font-body);
  transition: border-color var(--g-fast) linear, box-shadow var(--g-fast) linear;
}
.g-field::placeholder { color: #9d8fae; }
.g-field:focus { outline: none; border-color: var(--g-gold); box-shadow: var(--g-glow-gold); }
.g-field[aria-invalid='true'] { border-color: var(--g-jelly); box-shadow: 0 0 0 4px rgba(229,35,60,.28); }

.g-hint { margin: 9px 0 0; font-size: .84rem; min-height: 1.3em; color: var(--g-on-dark-dim); font-family: var(--g-font-mono); }
.g-hint.is-bad { color: var(--g-jelly-lt); }
.g-hint.is-good { color: var(--g-lime); }

.g-preview {
  margin-top: 12px; padding: 12px 16px;
  border: 2px dashed rgba(255,255,255,.4);
  border-radius: 12px;
  font-family: var(--g-font-mono); font-size: .84rem;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--g-gold-lt);
}
.g-preview b { color: var(--g-cream); }

/* Wallet picker — role=radiogroup, arrow keys handled in main.js. */
.g-wallets { display: grid; gap: 12px; }
@media (min-width: 620px) { .g-wallets { grid-template-columns: repeat(3, 1fr); } }

.g-wallet {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 20px 14px;
  border: var(--g-stroke) solid var(--g-ink);
  border-radius: 20px;
  background: rgba(255,255,255,.14);
  cursor: pointer;
  text-align: center;
  transition: transform var(--g-fast) var(--g-pop), box-shadow var(--g-fast) var(--g-ease), background var(--g-fast) linear, border-width var(--g-fast) linear;
}
.g-wallet:hover { transform: translateY(-4px); background: rgba(255,255,255,.24); }
.g-wallet img, .g-wallet svg { width: 52px; height: 52px; border-radius: 14px; object-fit: contain; }
.g-wallet__name { font-family: var(--g-font-display); font-weight: 800; font-size: 1.05rem; color: var(--g-cream); }
.g-wallet__status { font-family: var(--g-font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--g-on-dark-dim); line-height: 1.4; }
.g-wallet[aria-checked='true'] {
  border-width: 5px;
  background: rgba(255,201,60,.24);
  box-shadow: var(--g-glow-gold), 0 8px 0 var(--g-ink);
  transform: translateY(-4px);
}
.g-wallet__check {
  position: absolute; top: -12px; right: -10px;
  width: 32px; height: 32px; display: grid; place-items: center;
  border: var(--g-stroke) solid var(--g-ink); border-radius: 50%;
  background: var(--g-lime); color: var(--g-ink); font-size: 1rem; font-weight: 900;
  opacity: 0; scale: .4;
  transition: opacity var(--g-fast) linear, scale var(--g-med) var(--g-pop);
}
.g-wallet[aria-checked='true'] .g-wallet__check { opacity: 1; scale: 1; }

/* Modal — "Phantom not detected" and friends. */
.g-modal {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(12,18,32,.76);
  backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none;
  transition: opacity var(--g-med) var(--g-ease);
}
.g-modal.is-open { opacity: 1; pointer-events: auto; }
.g-modal__box {
  width: min(460px, 100%);
  padding: clamp(24px, 4vw, 36px);
  border: 5px solid var(--g-ink);
  border-radius: 26px;
  background: linear-gradient(180deg, #2f5fa8, #1d4380);
  box-shadow: 0 10px 0 var(--g-ink), 0 40px 90px rgba(0,0,0,.6);
  transform: translateY(24px) scale(.94);
  transition: transform var(--g-med) var(--g-pop);
}
.g-modal.is-open .g-modal__box { transform: none; }
.g-modal h2 { font-size: 1.5rem; margin: 0 0 12px; color: var(--g-cream); }
.g-modal p { margin: 0 0 20px; color: var(--g-on-dark-dim); font-size: .96rem; }

/* Portal transition — Gloopy pulled in, then a screen wipe. */
.g-portal {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 50%, rgba(123,63,160,.5), rgba(12,18,32,.97));
  opacity: 0; pointer-events: none;
  transition: opacity 400ms linear;
}
.g-portal.is-on { opacity: 1; pointer-events: auto; }
.g-portal__swirl {
  position: absolute;
  width: 150vmax; height: 150vmax;
  background: conic-gradient(from 0deg, transparent, rgba(255,201,60,.32), transparent 32%, rgba(229,35,60,.34), transparent 62%, rgba(123,63,160,.4), transparent);
  border-radius: 50%;
  animation: g-swirl 1.6s linear infinite;
}
@keyframes g-swirl { to { rotate: 360deg; } }
.g-portal__gloopy { position: relative; z-index: 2; width: clamp(120px, 22vw, 220px); animation: g-suck 1.5s var(--g-ease) forwards; }
@keyframes g-suck {
  0%   { scale: 1 1; rotate: 0deg; opacity: 1; }
  55%  { scale: .55 1.6; rotate: 220deg; opacity: 1; }
  100% { scale: .02 .3; rotate: 620deg; opacity: 0; }
}
.g-portal__label { position: absolute; bottom: 16%; z-index: 3; font-family: var(--g-font-mono); font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--g-gold); }
/* Wipe panel that slides across once the swirl finishes. */
.g-portal__wipe {
  position: fixed; inset: 0; z-index: 310;
  background: var(--g-ink);
  transform: translateX(-100%);
  transition: transform 460ms var(--g-ease);
}
.g-portal__wipe.is-on { transform: translateX(0); }

/* ============================================== game.html — HUD & overlays */

body.g-game-page { overflow: hidden; height: 100%; background: var(--g-ink); }
body.g-game-page .g-nav { display: none; }

.g-stage {
  position: fixed;
  inset: 0;
  background: var(--g-ink);
}
/* The game's own #app fills this. Its stylesheet already sets width/height. */
.g-stage #app { position: absolute; inset: 0; }

/* The debug panel and DOM hints ship with the game and must stay in the DOM —
   main.js and debug.js both query them and throw on null — but the site frame
   provides its own chrome, so they are hidden rather than removed.
   Backtick still toggles the panel for anyone who wants it. */
.g-stage #panel { display: none !important; }
.g-stage #help  { display: none !important; }

.g-hud {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 12px clamp(12px, 2.4vw, 22px);
  pointer-events: none;
  background: linear-gradient(180deg, rgba(26,18,32,.8), transparent);
}
.g-hud > * { pointer-events: auto; }

.g-hud__id {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px;
  border: var(--g-stroke) solid var(--g-ink);
  border-radius: var(--g-radius-pill);
  background: rgba(26,18,32,.82);
  backdrop-filter: blur(8px);
}
.g-hud__name { font-family: var(--g-font-display); font-weight: 800; font-size: .98rem; color: var(--g-cream); }
.g-hud__addr { font-family: var(--g-font-mono); font-size: 11px; color: var(--g-gold); }
.g-hud__wallet { width: 22px; height: 22px; border-radius: 6px; object-fit: contain; }

.g-hud__stats { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.g-stat {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 15px;
  border: var(--g-stroke) solid var(--g-ink);
  border-radius: var(--g-radius-pill);
  background: rgba(26,18,32,.82);
  backdrop-filter: blur(8px);
  font-family: var(--g-font-mono);
  font-size: 12px;
}
.g-stat u { text-decoration: none; letter-spacing: .14em; text-transform: uppercase; color: #9280b8; font-size: 10px; }
.g-stat b { color: var(--g-gold); font-size: 14px; font-variant-numeric: tabular-nums; }
.g-stat--lives b { color: var(--g-jelly-lt); }
.g-stat--token b { color: var(--g-lime); }
/* Pops when the underlying value changes; class removed on animationend. */
.g-stat.is-bump b { animation: g-bump 420ms var(--g-pop); display: inline-block; }
@keyframes g-bump { 0% { scale: 1; } 40% { scale: 1.45; color: #fff; } 100% { scale: 1; } }

/* Bottom-right, not centred: the game draws its own control hints down the
   middle of the title screen and the two would overlap. */
.g-hud__esc {
  position: fixed; right: 16px; bottom: 14px; z-index: 20;
  padding: 7px 16px;
  border-radius: var(--g-radius-pill);
  background: rgba(26,18,32,.7);
  font-family: var(--g-font-mono); font-size: 11px;
  letter-spacing: .14em; text-transform: uppercase; color: #9280b8;
  pointer-events: none;
}

/* Pause + loading overlays share the same veil treatment. */
.g-veil {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(16,10,30,.86);
  backdrop-filter: blur(10px);
  opacity: 0; pointer-events: none;
  transition: opacity var(--g-med) var(--g-ease);
}
.g-veil.is-on { opacity: 1; pointer-events: auto; }
.g-veil__box { text-align: center; width: min(420px, 100%); }
.g-veil__box h2 { font-size: clamp(2rem, 6vw, 3rem); margin-bottom: 26px; }
.g-veil .g-btn { width: 100%; margin-bottom: 12px; }

#g-loading { z-index: 60; opacity: 1; pointer-events: auto; background: var(--g-ink); }
#g-loading.is-off { opacity: 0; pointer-events: none; }
.g-loadbar {
  width: min(280px, 70vw); height: 16px; margin: 26px auto 0;
  border: var(--g-stroke) solid var(--g-cream);
  border-radius: var(--g-radius-pill);
  overflow: hidden;
  background: rgba(255,255,255,.12);
}
.g-loadbar i { display: block; height: 100%; width: 20%; border-radius: 99px; background: linear-gradient(90deg, var(--g-lime), var(--g-gold)); animation: g-load 1.3s var(--g-ease) infinite; }
@keyframes g-load { 0% { margin-left: -25%; width: 25%; } 50% { width: 55%; } 100% { margin-left: 100%; width: 25%; } }

/* Shown only when the viewport is too small for a keyboard-only game. */
.g-nodesktop { display: none; }
@media (max-width: 820px), (pointer: coarse) {
  body.g-game-page .g-nodesktop {
    display: grid;
    position: fixed; inset: 0; z-index: 80;
    place-items: center; padding: 26px;
    background: linear-gradient(180deg, #1b4f9c, #170f2c);
    text-align: center;
  }
  body.g-game-page.g-force-play .g-nodesktop { display: none; }
}

/* ------------------------------------------------------- hero brand logo */

.g-hero-logo {
  width: clamp(112px, 15vw, 190px);
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  margin: 0 auto clamp(14px, 2vw, 24px);
  border-radius: 28%;
  border: var(--g-stroke-fat) solid var(--g-ink);
  box-shadow:
    0 7px 0 var(--g-ink),
    0 0 0 8px rgba(179,230,9,.25),
    0 22px 54px rgba(26,18,32,.45),
    0 0 60px rgba(179,230,9,.5);
  animation: g-logo-bob 5s var(--g-ease) infinite;
}
@keyframes g-logo-bob {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50%      { transform: translateY(-12px) rotate(1.5deg); }
}
@media (prefers-reduced-motion: reduce) { .g-hero-logo { animation: none; } }
