:root {
  --bg: #0f0e17;
  --surface: #1a1926;
  --text: #fffffe;
  --muted: #a7a9be;
  --accent: #ff8906;
  --accent-2: #f25f4c;
  --radius: 14px;
  --font-display: 'Fredoka', 'Space Grotesk', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  background:
    radial-gradient(60% 50% at 50% 20%, rgba(255, 137, 6, .14), transparent 65%),
    radial-gradient(50% 40% at 50% 100%, rgba(242, 95, 76, .07), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

main { max-width: 960px; margin: 0 auto; padding: 0 24px; }

.hero {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100svh - 80px); /* fill the screen above the footer, content centred */
  padding: 64px 0;
}

.footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 24px;
  color: var(--muted);
  font-size: .85rem;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

/* ---------- Entrance ---------- */
@keyframes pop-in {
  0% { opacity: 0; transform: translateY(14px) scale(.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Mascot ---------- */
.hero-visual {
  --frame-w: min(320px, 70vw);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: pop-in .7s cubic-bezier(.34, 1.56, .64, 1) backwards;
  animation-delay: .12s;
}
.hero-visual::before {
  content: "";
  position: absolute;
  left: 50%;
  width: min(420px, 95%);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 137, 6, .22), transparent 70%);
  filter: blur(10px);
  top: 32%;
}

.mascot-frame {
  position: relative;
  z-index: 1;
  width: var(--frame-w);
  aspect-ratio: 209 / 224;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.mascot-svg { position: relative; z-index: 1; display: block; width: 100%; height: 100%; overflow: visible; }

/* Floating blobs: a wide layer centred on Mando, behind him. Only the
   blobs themselves catch the pointer (to be dragged), not the empty layer. */
.blob-field {
  position: absolute;
  z-index: 0;
  left: 50%;
  top: calc(var(--frame-w) * 224 / 209 / 2); /* Mando's vertical centre */
  width: calc(var(--frame-w) * 2.5);
  aspect-ratio: 800 / 500;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: .5;
  overflow: visible;
}
.blob-field circle {
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
}
.blob-field.is-dragging circle { cursor: grabbing; }
/* Dragging goo out of Mando: no page scroll/zoom while pulling on touch
   screens, and he eases back from his lean once let go. */
.mascot-frame { touch-action: none; }
.mascot-actor { transition: translate .35s cubic-bezier(.34, 1.56, .64, 1); }
.mascot-frame.is-dragging { cursor: grabbing; }
.mascot-frame.is-dragging .mascot-actor { transition: none; }
.mascot-frame:focus-visible { outline: 2px solid var(--accent); outline-offset: 10px; border-radius: 50%; }

/* The SVG's viewBox starts at 0 0, so these px origins are plain
   coordinates in Mando's own artwork space. */
.mascot-body {
  transform-origin: 104px 198px; /* bottom of the body, just above the feet */
  animation: breathe 3.2s ease-in-out infinite;
}
.mascot-shadow {
  transform-origin: 104px 216px;
  animation: shadow-pulse 3.2s ease-in-out infinite;
}
.arm-left {
  transform-origin: 22px 140px;
  --sway-angle: 8deg;
  animation: sway 3.6s ease-in-out infinite reverse backwards;
  animation-delay: 1.2s;
}
.arm-right {
  transform-origin: 196px 145px;
  --sway-angle: 8deg;
  animation: sway 3.6s ease-in-out infinite backwards;
}
/* Waving: the resting hand tucks into the body while a raised copy grows
   out beside the head and wags around its own base — both stay attached
   instead of the hand sliding across the body. Started from script.js
   (on load and as a click reaction), so it also plays when the OS asks
   for reduced motion — it's short and one-off. */
.arm-wave {
  transform-origin: 200px 88px; /* where the raised hand meets the body */
  transform: scale(0);
}
.mascot-frame.is-waving .arm-right { animation: hand-tuck 2.6s ease-in-out 1; }
.mascot-frame.is-waving .arm-wave { animation: wave-hello 2.6s ease-in-out 1; }

.eye { transform-box: fill-box; transform-origin: center; }
.eye.is-blinking { animation: eye-blink .2s ease-in-out; }

.pupil {
  transform: translate(var(--eye-x, 0px), var(--eye-y, 0px));
  transition: transform .15s ease-out;
}

/* Happy face while the burst plays (toggled from script.js) */
.eye-happy { display: none; }
.mascot-frame.is-happy .eye-white,
.mascot-frame.is-happy .pupil { display: none; }
.mascot-frame.is-happy .eye-happy { display: block; }
.mouth {
  transform-origin: 104.5px 103px;
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1);
}
.mascot-frame.is-happy .mouth { transform: scale(1.4); }

/* Click reactions — one is picked at random per click (see script.js) */
/* Reactions move .mascot-actor (feet + body) only, so the shadow stays put.
   Origins and distances are in the artwork's own units. */
.mascot-actor { transform-origin: 104px 214px; } /* between the feet, on the ground */
.mascot-frame.react-squash .mascot-actor { animation: react-squash .45s cubic-bezier(.34, 1.56, .64, 1); }
.mascot-frame.react-jump .mascot-actor { animation: react-jump .7s cubic-bezier(.3, .8, .4, 1); }
.mascot-frame.react-spin .mascot-actor { animation: react-spin .8s cubic-bezier(.5, 0, .3, 1); transform-origin: 104px 110px; }
.mascot-frame.react-wiggle .mascot-actor { animation: react-wiggle .6s ease-in-out; }
.mascot-frame.react-jump .mascot-shadow { animation: shadow-jump .7s cubic-bezier(.3, .8, .4, 1); }
.mascot-frame.react-spin .mascot-shadow { animation: shadow-jump .8s cubic-bezier(.5, 0, .3, 1); }

@keyframes breathe {
  0%, 100% { transform: scale(1, 1); }
  50% { transform: scale(1.015, .985); }
}
@keyframes shadow-pulse {
  0%, 100% { transform: scaleX(1); opacity: .35; }
  50% { transform: scaleX(1.04); opacity: .3; }
}
@keyframes sway {
  0%, 100% { transform: rotate(calc(var(--sway-angle) * -1)); }
  50% { transform: rotate(var(--sway-angle)); }
}
@keyframes hand-tuck {
  0%, 100% { transform: scale(1); }
  10%, 90% { transform: scale(0); }
}
@keyframes wave-hello {
  0% { transform: scale(0) rotate(0deg); }
  12% { transform: scale(1) rotate(-14deg); }
  26% { transform: scale(1) rotate(14deg); }
  40% { transform: scale(1) rotate(-14deg); }
  54% { transform: scale(1) rotate(14deg); }
  68% { transform: scale(1) rotate(-12deg); }
  80% { transform: scale(1) rotate(6deg); }
  92%, 100% { transform: scale(0) rotate(0deg); }
}
@keyframes eye-blink {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(.05); }
}
@keyframes react-squash {
  0%, 100% { transform: scale(1, 1); }
  30% { transform: scale(1.1, .88); }
  60% { transform: scale(.95, 1.06); }
}
@keyframes react-jump {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  15% { transform: translateY(0) scale(1.1, .88); }
  45% { transform: translateY(-32px) scale(.94, 1.08); }
  80% { transform: translateY(0) scale(1.08, .92); }
}
@keyframes react-spin {
  0% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-16px) rotate(200deg); }
  100% { transform: translateY(0) rotate(360deg); }
}
@keyframes shadow-jump {
  0%, 100% { transform: scaleX(1); opacity: .35; }
  45%, 50% { transform: scaleX(.7); opacity: .18; }
}
@keyframes react-wiggle {
  0%, 100% { transform: rotate(0deg); }
  15% { transform: rotate(-9deg); }
  35% { transform: rotate(8deg); }
  55% { transform: rotate(-6deg); }
  75% { transform: rotate(4deg); }
}

/* Speech bubble — text and timing set from script.js */
.bubble {
  position: absolute;
  top: 0;
  left: 94%; /* just past the head, so longer lines grow away from Mando */
  width: max-content;
  max-width: 220px;
  padding: 8px 16px;
  border-radius: 18px 18px 18px 4px;
  background: var(--text);
  color: var(--bg);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.25;
  text-wrap: balance;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .6);
  transform-origin: 0% 100%;
  pointer-events: none;
  opacity: 0;
}
.bubble.is-showing { animation: bubble-pop var(--bubble-duration, 2s) cubic-bezier(.34, 1.56, .64, 1) 1 both; }
@keyframes bubble-pop {
  0% { opacity: 0; transform: scale(.4) rotate(-8deg); }
  12% { opacity: 1; transform: scale(1) rotate(0deg); }
  85% { opacity: 1; transform: scale(1) rotate(0deg); }
  100% { opacity: 0; transform: scale(.8) translateY(-6px); }
}

.mascot-name {
  position: relative;
  margin-top: 28px;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 8.5vw, 5.4rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.01em;
  text-align: center;
}
.tagline {
  position: relative;
  margin-top: 12px;
  min-height: 1.6em; /* keeps the page from jumping as lines swap */
  color: var(--muted);
  font-size: 1.15rem;
  text-align: center;
}
/* Rotating line — swapped every few seconds by script.js */
.tagline-text {
  display: inline-block;
  transition: opacity .3s ease, transform .3s ease;
}
.tagline-text.is-out { opacity: 0; transform: translateY(-10px); }
.tagline-text.is-in { opacity: 0; transform: translateY(10px); transition: none; }
.tagline a { color: var(--accent); font-weight: 500; }
.tagline a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* The "o" in Mandoline is the logo in the text colour, sized to sit like a lowercase letter */
.title-o {
  display: inline-block;
  width: .5em;
  height: .5em;
  margin: 0 .015em;
  vertical-align: -0.01em;
  transition: transform .6s cubic-bezier(.34, 1.56, .64, 1);
}
.mascot-name:hover .title-o { transform: rotate(360deg); }

.mascot-name span {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Shapes fired on click: fixed to the viewport, animated and removed by script.js */
.burst-particle {
  position: fixed;
  pointer-events: none;
  z-index: 20;
  will-change: transform, opacity;
}
.burst-particle svg { display: block; width: 100%; height: 100%; }

@media (prefers-reduced-motion: reduce) {
  .mascot-body, .mascot-shadow, .arm-left, .arm-right { animation: none; }
}

@media (max-width: 760px) {
  /* Not enough room beside Mando on phones: sit above his head instead */
  .bubble { top: auto; left: auto; bottom: calc(100% + 6px); right: 0; max-width: 70vw; transform-origin: 100% 100%; border-radius: 18px 18px 4px 18px; }
  .hero { padding: 84px 0 48px; }
}

::selection { background: var(--accent); color: var(--bg); }
