/* ============================================
   MonkeyMoney — Design tokens
   "Plataforma gamer de finanzas", no libro contable
   ============================================ */
:root {
  --void: #0D1117;
  --surface: #161B22;
  --surface-2: #1D2430;
  --line: rgba(244, 246, 242, 0.10);
  --line-strong: rgba(244, 246, 242, 0.18);

  --ink: #F4F6F2;
  --ink-soft: #A6AEBB;
  --ink-faint: #707888;

  --acid: #39FF6A;
  --acid-dim: #1F8C3E;
  --pulse: #FF3DAD;
  --pulse-dim: #99205E;
  --gold: #FFC93C;
  --gold-dim: #9C7A1F;

  --paper: #FAF7EF;
  --paper-ink: #16181B;

  --font-display: "Unbounded", "Plus Jakarta Sans", system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "Space Mono", "Courier New", monospace;

  --max-width: 1120px;
  --radius: 16px;
  --radius-sm: 10px;
}

/* legacy aliases so older HTML/JS using these var names still resolve correctly */
:root {
  --ledger-green: #0F1A14;
  --ledger-green-light: #16261D;
  --brass: var(--gold);
  --brass-light: var(--gold);
  --wax-red: var(--pulse);
  --parchment: var(--void);
  --parchment-card: var(--surface);
  --line-strong: rgba(244, 246, 242, 0.18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Manchas de luz ambiental — evita el "negro plano + un acento" */
body::before, body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.30;
}
body::before {
  width: 560px; height: 560px;
  top: -160px; left: -160px;
  background: radial-gradient(circle, var(--acid), transparent 70%);
}
body::after {
  width: 620px; height: 620px;
  bottom: -200px; right: -180px;
  background: radial-gradient(circle, var(--pulse), transparent 70%);
}

img { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0 0 0.4em;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--void);
  background: var(--acid);
  display: inline-block;
  padding: 6px 14px;
  border-radius: 100px;
  transform: rotate(-2deg);
  box-shadow: 3px 4px 0 rgba(0,0,0,0.35);
  position: relative;
  z-index: 1;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.hairline {
  border: none;
  border-top: 1px solid var(--line-strong);
  margin: 0;
}

/* Focus visibility (accessibility) */
a:focus-visible, button:focus-visible, input:focus-visible, .lang-btn:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ============================================
   Header / Nav
   ============================================ */
header.site-header {
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(10px);
  color: var(--ink);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line-strong);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--acid);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--gold);
  flex-shrink: 0;
  overflow: hidden;
  object-fit: cover;
  background: var(--surface);
  box-shadow: 0 0 14px rgba(57,255,106,0.45);
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

nav.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

nav.main-nav a {
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-soft);
  position: relative;
  padding: 4px 0;
}
nav.main-nav a:hover,
nav.main-nav a[aria-current="page"] { color: var(--ink); }
nav.main-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 3px;
  border-radius: 2px;
  background: var(--acid);
  box-shadow: 0 0 8px var(--acid);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

/* Language toggle */
.lang-toggle {
  display: flex;
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: var(--surface);
}
.lang-btn {
  background: transparent;
  border: none;
  color: var(--ink-soft);
  padding: 6px 13px;
  cursor: pointer;
  letter-spacing: 0.04em;
  font-weight: 700;
}
.lang-btn[aria-pressed="true"] {
  background: var(--acid);
  color: var(--void);
}

.menu-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  width: 38px;
  height: 34px;
  cursor: pointer;
  font-size: 1.1rem;
}

@media (max-width: 800px) {
  nav.main-nav {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--void);
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 24px 22px;
    gap: 16px;
    border-bottom: 1px solid var(--line-strong);
    display: none;
  }
  nav.main-nav.open { display: flex; }
  .menu-toggle { display: block; }
}

/* ============================================
   Hero
   ============================================ */
.hero {
  padding: 72px 0 56px;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.3rem, 4.6vw, 3.7rem);
  line-height: 1.04;
  color: var(--ink);
  margin-top: 16px;
}

.hero h1 em {
  font-style: normal;
  color: var(--acid);
  text-shadow: 0 0 18px rgba(57,255,106,0.5);
}

.hero p.lead {
  font-size: 1.08rem;
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 18px 0 28px;
}

.cta-row { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 13px 24px;
  border-radius: 100px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { transform: translate(-2px, -2px); }
.btn-primary {
  background: var(--acid);
  color: var(--void);
  box-shadow: 4px 5px 0 rgba(0,0,0,0.5);
}
.btn-primary:hover { box-shadow: 6px 7px 0 rgba(0,0,0,0.5); }
.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
  box-shadow: 4px 5px 0 rgba(0,0,0,0.35);
}
.btn-secondary:hover { box-shadow: 6px 7px 0 rgba(0,0,0,0.35); border-color: var(--pulse); }

/* Mascota en el hero */
.hero-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  position: relative;
}
.sticker {
  position: absolute;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  padding: 9px 16px;
  border-radius: 100px;
  box-shadow: 4px 5px 0 rgba(0,0,0,0.4);
  z-index: 2;
  white-space: nowrap;
}
.sticker-1 {
  top: -6px; left: -18px;
  background: var(--gold);
  color: var(--void);
  transform: rotate(-8deg);
}
.sticker-2 {
  top: 38%; right: -22px;
  background: var(--pulse);
  color: var(--void);
  transform: rotate(6deg);
}
@media (max-width: 460px) {
  .sticker { font-size: 0.68rem; padding: 7px 12px; }
  .sticker-1 { left: 4px; }
  .sticker-2 { right: 4px; }
}
.mascot-hero-img {
  max-width: 240px;
  width: 100%;
  filter: drop-shadow(0 0 36px rgba(57,255,106,0.35)) drop-shadow(0 18px 30px rgba(0,0,0,0.55));
}
.hero-visual .statement { width: 100%; }

/* Ledger statement card → ahora "panel de stats" estilo HUD */
.statement {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 5px 7px 0 rgba(0,0,0,0.4);
  padding: 22px 24px;
}
.statement-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  border-bottom: 1px dashed var(--line-strong);
  padding-bottom: 10px;
  margin-bottom: 12px;
}
.statement-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
}
.statement-row:last-child { border-bottom: none; }
.statement-row .amount { color: var(--acid); font-weight: 700; }
.statement-row .amount.neg { color: var(--pulse); }

/* ============================================
   Sections / Pillars
   ============================================ */
.section { padding: 64px 0; }
.section-head { max-width: 60ch; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); color: var(--ink); margin-top: 14px; }
.section-head p { color: var(--ink-soft); }

.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.pillar-card {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
  box-shadow: 5px 6px 0 rgba(0,0,0,0.3);
}
.pillar-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 8px 9px 0 rgba(0,0,0,0.35);
  border-color: var(--acid);
}
.pillar-icon {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.08em;
}
.pillar-card h3 { font-size: 1.25rem; color: var(--ink); }
.pillar-card p { color: var(--ink-soft); font-size: 0.92rem; margin: 0; }
.pillar-card .go {
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--pulse);
}

@media (max-width: 800px) {
  .hero-grid { grid-template-columns: 1fr; }
  .pillars { grid-template-columns: 1fr; }
}

/* ============================================
   Badge — "logro desbloqueado" (antes: sello de tinta)
   ============================================ */
.stamp {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.1;
  flex-shrink: 0;
  clip-path: polygon(50% 0%, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%);
  position: relative;
  background: var(--surface-2);
  border: 2px solid currentColor;
}
.stamp-done {
  color: var(--void);
  background: var(--acid);
  box-shadow: 0 0 16px rgba(57,255,106,0.65);
  border-color: var(--acid);
}
.stamp-soon {
  color: var(--ink-faint);
  background: var(--surface-2);
  border-color: var(--line-strong);
  opacity: 0.8;
}
.stamp-new {
  color: var(--void);
  background: var(--pulse);
  box-shadow: 0 0 16px rgba(255,61,173,0.65);
  border-color: var(--pulse);
}

/* ============================================
   Cards grid (games / library)
   ============================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}
.content-card {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  gap: 16px;
  flex-direction: column;
  box-shadow: 5px 6px 0 rgba(0,0,0,0.3);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.content-card:not(.disabled):hover {
  border-color: var(--acid);
  transform: translate(-2px, -2px);
}
.content-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.content-card h3 { font-size: 1.1rem; color: var(--ink); margin: 0; }
.content-card p { margin: 0; color: var(--ink-soft); font-size: 0.9rem; }
.content-card .meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}
.content-card .btn { align-self: flex-start; margin-top: auto; padding: 9px 18px; font-size: 0.85rem; }
.content-card.disabled { opacity: 0.55; }
.content-card.disabled .btn { pointer-events: none; }

/* ============================================
   Game widget
   ============================================ */
.game-frame {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 28px;
}
.budget-row {
  display: grid;
  grid-template-columns: 140px 1fr 70px;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.budget-row label { font-weight: 700; font-size: 0.92rem; color: var(--ink); }
.budget-row input[type="range"] { width: 100%; accent-color: var(--acid); }
.budget-row .val { font-family: var(--font-mono); text-align: right; color: var(--ink-soft); }
.game-feedback {
  margin-top: 18px;
  padding: 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  border: 1px dashed var(--line-strong);
}
.game-feedback.ok { color: var(--acid); border-color: var(--acid); }
.game-feedback.warn { color: var(--pulse); border-color: var(--pulse); }

/* ============================================
   Library reader — excepción: superficie clara
   para lectura larga, como un reflector sobre fondo oscuro
   ============================================ */
.reader {
  background: var(--paper);
  color: var(--paper-ink);
  border-radius: var(--radius);
  padding: 36px;
  display: none;
  user-select: text;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.reader.open { display: block; }
.reader h2 { color: var(--paper-ink); }
.reader .reader-meta {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: #6b6b63;
  margin-bottom: 22px;
}
.reader-body p { margin: 0 0 16px; }
.reader-close { margin-top: 24px; }
.no-copy-note {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #8a8a80;
  margin-top: 30px;
  border-top: 1px dashed rgba(0,0,0,0.15);
  padding-top: 12px;
}

/* ============================================
   Footer
   ============================================ */
footer.site-footer {
  background: var(--void);
  border-top: 1px solid var(--line-strong);
  color: var(--ink);
  padding: 40px 0 28px;
  margin-top: 40px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 0.85rem;
}
.footer-inner a { text-decoration: none; color: var(--ink-soft); }
.footer-inner a:hover { color: var(--acid); }
.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  margin-top: 18px;
}

/* Utility */
.center { text-align: center; }
.mt-0 { margin-top: 0; }
