:root {
  --night: #12190f;
  --night-2: #1a2415;
  --night-3: #243120;
  --leaf: #2f5d2a;
  --leaf-2: #4c8a3a;
  --gold: #ffd23f;
  --gold-deep: #ffb700;
  --gold-soft: #fff2a8;
  --cream: #fffaf0;
  --cream-2: #fff3cf;
  --ink: #2b2410;
  --ink-soft: #6b5d34;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-hand: "Caveat", "Segoe Script", cursive;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --radius: 22px;
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --shadow-soft: 0 20px 50px -20px rgba(80, 55, 0, 0.35);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--night);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.is-locked,
body.is-modal {
  overflow: hidden;
}

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

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.12;
  margin: 0;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Botones ---------- */
.btn {
  --bg: var(--gold);
  --fg: #3b2a00;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 1.7rem;
  border: 0;
  border-radius: 999px;
  background: var(--bg);
  color: var(--fg);
  font: 700 1rem/1 var(--font-body);
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s;
}

.btn:hover {
  transform: translateY(-2px) scale(1.03);
}

.btn:active {
  transform: scale(0.97);
}

.btn--glow {
  box-shadow: 0 0 0 0 rgba(255, 210, 63, 0.6), 0 12px 30px -10px rgba(255, 183, 0, 0.7);
  animation: pulse-glow 2.8s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 210, 63, 0.45), 0 12px 30px -10px rgba(255, 183, 0, 0.7);
  }
  50% {
    box-shadow: 0 0 0 14px rgba(255, 210, 63, 0), 0 12px 34px -8px rgba(255, 183, 0, 0.9);
  }
}

.btn--ghost {
  --bg: transparent;
  --fg: currentColor;
  box-shadow: inset 0 0 0 2px currentColor;
}

.btn--sm {
  padding: 0.7rem 1.15rem;
  font-size: 0.9rem;
}

/* ---------- Barra superior ---------- */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem clamp(1rem, 3vw, 2rem);
  padding-top: max(0.7rem, env(safe-area-inset-top));
  color: #fff;
  background: linear-gradient(to bottom, rgba(18, 25, 15, 0.55), transparent);
  transition: opacity 0.6s, transform 0.6s var(--ease);
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
}

body.is-ready .topbar {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.topbar__brand {
  font-size: 1.5rem;
  text-decoration: none;
  line-height: 1;
}

.topbar__links {
  display: flex;
  gap: clamp(0.8rem, 2vw, 1.6rem);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.topbar__links a {
  text-decoration: none;
  opacity: 0.85;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
  transition: opacity 0.2s, color 0.2s;
}

.topbar__links a:hover {
  opacity: 1;
  color: var(--gold);
}

@media (max-width: 720px) {
  .topbar__links {
    display: none;
  }
}

.topbar__tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.topbar__btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.topbar__monkeys {
  font-size: 1.35rem;
  line-height: 1;
  transition: opacity 0.3s, filter 0.3s, transform 0.3s var(--ease);
}

.topbar__monkeys:hover {
  transform: rotate(-12deg) scale(1.1);
}

.topbar__monkeys[aria-pressed="false"] {
  opacity: 0.5;
  filter: grayscale(1);
}

.topbar__music[hidden] {
  display: none;
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
}

.bars i {
  width: 3px;
  height: 4px;
  border-radius: 2px;
  background: var(--gold);
}

.topbar__music[aria-pressed="true"] .bars i {
  animation: eq 0.9s ease-in-out infinite;
}

.topbar__music[aria-pressed="true"] .bars i:nth-child(2) {
  animation-delay: -0.3s;
}

.topbar__music[aria-pressed="true"] .bars i:nth-child(3) {
  animation-delay: -0.6s;
}

@keyframes eq {
  0%,
  100% {
    height: 4px;
  }
  50% {
    height: 16px;
  }
}

/* ---------- Efectos globales ---------- */
.petal-rain {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
}

/* ---------- Monos (humor) ---------- */
.monkeys {
  position: fixed;
  inset: 0;
  z-index: 150;
  overflow: hidden;
  pointer-events: none;
}

.monkey {
  position: absolute;
  left: 0;
  top: 0;
  user-select: none;
  will-change: transform;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.28));
}

.monkey--emoji {
  font-size: var(--s, 48px);
  line-height: 1;
}

.monkey--real {
  width: var(--s, 100px);
  height: auto;
}

.burst-petal {
  position: fixed;
  z-index: 200;
  width: 9px;
  height: 17px;
  border-radius: 50%;
  pointer-events: none;
}

.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--d, 0s);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

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