/* ============================================================
   Mi Duende Mágico — Brand stylesheet (rebrand 2026-05-02)
   Tokens locked in /site/design-tokens.json
   Spec source: Cuentos Personalizados WEB.ai (Noelia Olave / La Zona)
   Branch: giuseppe/website-rebrand
   ============================================================ */

/* ---------- 1. TOKENS ---------- */
:root {
  --brand-red: #D8282C;
  --brand-red-deep: #B91933;
  --brand-gold: #AC9450;
  --brand-gold-soft: rgba(172, 148, 80, 0.15);
  --brand-green: #008761;

  --surface-cream: #F4EAE3;
  --surface-parchment: #E1D3AF;
  --surface-card: #FFFFFF;

  --text-body: #1A1A1A;
  --text-muted: #5A5040;
  --text-on-red: #FFFFFF;

  --font-display: 'Rum Raisin', 'Georgia', serif;
  --font-body: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius-card: 16px;
  --radius-pill: 999px;
  --radius-input: 8px;

  --shadow-card: 0 2px 12px rgba(172, 148, 80, 0.15);
  --shadow-cta: 0 4px 16px rgba(216, 40, 44, 0.25);
  --shadow-cta-hover: 0 6px 20px rgba(216, 40, 44, 0.35);

  --container-max: 1280px;
}

/* ---------- 2. RESET / BODY DEFAULTS ---------- */
html {
  font-family: var(--font-body);
  scroll-behavior: smooth;
  background: var(--surface-cream);
}
body {
  font-family: var(--font-body);
  background: var(--surface-cream);
  color: var(--text-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Gold-dust speckle background pattern (decorative, behind content) */
body.brand-bg::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle at 12% 18%, var(--brand-gold) 0.5px, transparent 1.2px),
    radial-gradient(circle at 47% 35%, var(--brand-gold) 0.7px, transparent 1.5px),
    radial-gradient(circle at 78% 22%, var(--brand-gold) 0.4px, transparent 1px),
    radial-gradient(circle at 23% 67%, var(--brand-gold) 0.6px, transparent 1.3px),
    radial-gradient(circle at 91% 78%, var(--brand-gold) 0.5px, transparent 1.2px),
    radial-gradient(circle at 65% 88%, var(--brand-gold) 0.7px, transparent 1.5px),
    radial-gradient(circle at 8% 92%, var(--brand-gold) 0.4px, transparent 1px),
    radial-gradient(circle at 53% 11%, var(--brand-gold) 0.5px, transparent 1.2px);
  background-size: 320px 320px;
  opacity: 0.32;
}

/* ---------- 3. TYPOGRAPHY ---------- */
.font-display { font-family: var(--font-display); font-weight: 400; }
.font-body { font-family: var(--font-body); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--brand-gold);
  line-height: 1.15;
}

.title-display {
  font-family: var(--font-display);
  color: var(--brand-gold);
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.1;
}
.title-hero {
  font-family: var(--font-display);
  color: var(--brand-gold);
  font-size: clamp(48px, 7vw, 88px);
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.title-section {
  font-family: var(--font-display);
  color: var(--brand-gold);
  font-size: clamp(28px, 4vw, 44px);
}

.eyebrow {
  color: var(--brand-red);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.text-muted { color: var(--text-muted); }
.text-on-red { color: var(--text-on-red); }
.text-gold { color: var(--brand-gold); }
.text-red { color: var(--brand-red); }

/* ---------- 4. TOP BAR (red nav) ---------- */
.brand-topbar {
  position: relative;
  z-index: 10;
  background: var(--brand-red);
  color: var(--text-on-red);
  padding: 18px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.brand-topbar-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--text-on-red);
  text-decoration: none;
  font-weight: 400;
}
.brand-logo-mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface-cream);
  border: 2px solid var(--brand-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.brand-nav {
  display: flex;
  gap: 28px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 15px;
}
.brand-nav a,
.brand-nav .nav-link {
  color: var(--text-on-red);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s, color 0.15s;
  cursor: pointer;
}
.brand-nav a.active,
.brand-nav .nav-link.active {
  color: var(--brand-gold);
  border-bottom-color: var(--brand-gold);
}
.brand-nav a:hover,
.brand-nav .nav-link:hover {
  color: var(--brand-gold);
}

@media (max-width: 720px) {
  .brand-topbar-inner { padding: 0 20px; gap: 12px; }
  .brand-logo { font-size: 18px; }
  .brand-logo-mark { width: 36px; height: 36px; font-size: 18px; }
  .brand-nav { gap: 16px; font-size: 13px; }
}

/* ---------- 5. CARDS ---------- */
.brand-card {
  background: var(--surface-card);
  border: 2px solid var(--brand-gold);
  border-radius: var(--radius-card);
  padding: 32px;
  box-shadow: var(--shadow-card);
  position: relative;
}
.brand-card.brand-card-tight { padding: 20px; }
.brand-card.brand-card-wide  { padding: 48px; }

/* Parchment variant (used on story page) */
.brand-card-parchment {
  background: var(--surface-parchment);
  border: 2px solid var(--brand-gold);
  border-radius: var(--radius-card);
  padding: 40px;
  box-shadow: var(--shadow-card);
}

/* ---------- 6. BUTTONS ---------- */
.brand-btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  padding: 14px 32px;
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, color 0.15s;
  line-height: 1.2;
}

.brand-btn-primary {
  background: var(--brand-red);
  color: var(--text-on-red);
  border-color: var(--brand-red);
  box-shadow: var(--shadow-cta);
}
.brand-btn-primary:hover {
  background: var(--brand-red-deep);
  border-color: var(--brand-red-deep);
  transform: translateY(-1px);
  box-shadow: var(--shadow-cta-hover);
  color: var(--text-on-red);
}

.brand-btn-secondary {
  background: transparent;
  color: var(--text-body);
  border-color: var(--brand-gold);
}
.brand-btn-secondary:hover {
  background: var(--brand-gold-soft);
  color: var(--text-body);
}

.brand-btn-ghost {
  background: transparent;
  color: var(--text-body);
  border-color: transparent;
  padding: 10px 18px;
}
.brand-btn-ghost:hover {
  color: var(--brand-red);
}

.brand-btn-large {
  font-size: 17px;
  padding: 18px 44px;
  font-weight: 700;
}

.brand-btn-block {
  display: block;
  width: 100%;
}

/* ---------- 7. CHIPS / PILLS ---------- */
.brand-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-card);
  border: 2px solid var(--brand-gold);
  color: var(--text-body);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
}
.brand-chip:hover { background: var(--brand-gold-soft); }
.brand-chip.active {
  background: var(--brand-red);
  color: var(--text-on-red);
  border-color: var(--brand-red);
}
.brand-chip.active:hover { background: var(--brand-red-deep); }

/* Trust badge variant (smaller, no border) */
.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-card);
  border: 1px solid var(--brand-gold);
  color: var(--text-body);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
}

/* ---------- 8. NAV PILL (legacy compat for index.html nav) ---------- */
.nav-pill {
  display: inline-flex;
  align-items: center;
  background: transparent;
  color: var(--text-on-red);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}
.nav-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-on-red);
}
.nav-pill.active {
  color: var(--brand-gold);
}

/* ---------- 9. SHELL / CONTAINER ---------- */
.brand-shell {
  position: relative;
  z-index: 1;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 48px 32px;
}
.brand-shell-narrow {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 32px;
}

/* ---------- 10. AUDIO PLAYER (preserved IDs/classes from existing) ---------- */
/* Existing classes used by index.html JS: .audio-player, .audio-btn, .progress-track, .progress-fill */
.audio-player {
  background: var(--brand-red);
  border: 2px solid var(--brand-gold);
  border-radius: var(--radius-card);
  padding: 20px 24px;
  box-shadow: 0 4px 16px rgba(216, 40, 44, 0.18);
  color: var(--text-on-red);
}
.audio-btn {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 2px solid var(--surface-cream);
  background: var(--surface-cream);
  color: var(--brand-red);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.1s, background 0.15s;
  flex-shrink: 0;
}
.audio-btn:hover { background: var(--surface-card); transform: scale(1.05); }
.audio-btn:active { transform: scale(0.95); }
.audio-btn.playing { animation: none; }
.audio-btn svg { fill: var(--brand-red); }

.progress-track {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-pill);
  cursor: pointer;
  position: relative;
}
.progress-fill {
  height: 100%;
  background: var(--brand-gold);
  border-radius: var(--radius-pill);
  transition: width 0.1s linear;
}

/* ---------- 11. STEP / NUMBERED LIST ---------- */
.brand-step-card {
  background: var(--surface-card);
  border: 2px solid var(--brand-gold);
  border-radius: var(--radius-card);
  padding: 24px 20px;
  text-align: center;
  position: relative;
}
.brand-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand-red);
  color: var(--text-on-red);
  font-family: var(--font-display);
  font-size: 22px;
  margin-bottom: 12px;
}
.brand-step-card h3 {
  color: var(--brand-gold);
  font-size: 22px;
  margin-bottom: 6px;
}
.brand-step-card p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

/* ---------- 12. FOOTER ---------- */
.brand-footer {
  text-align: center;
  padding: 64px 32px 32px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.7;
  position: relative;
  z-index: 1;
}
.brand-footer-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand-gold), transparent);
  max-width: 320px;
  margin: 0 auto 24px;
}
.brand-footer a {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}
.brand-footer a:hover { border-bottom-color: var(--brand-gold); }

/* ---------- 13. ORNAMENT DIVIDER (between long sections) ---------- */
.brand-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand-gold), transparent);
  max-width: 480px;
  margin: 48px auto;
  position: relative;
}
.brand-divider::after {
  content: '✦';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: var(--surface-cream);
  color: var(--brand-gold);
  padding: 0 12px;
  font-size: 14px;
}

/* ---------- 14. INPUT FIELDS ---------- */
.brand-input {
  font-family: var(--font-body);
  font-size: 15px;
  background: var(--surface-card);
  border: 2px solid var(--brand-gold);
  border-radius: var(--radius-input);
  padding: 14px 16px;
  color: var(--text-body);
  width: 100%;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.brand-input:focus {
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(216, 40, 44, 0.12);
}
.brand-input::placeholder { color: var(--text-muted); opacity: 0.6; }
.brand-label {
  display: block;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-body);
  margin-bottom: 6px;
}

/* ---------- 15. BACKWARD-COMPAT OVERRIDES ---------- */
/* The 6 spec pages currently use legacy color references (#C62828, #F9A825, #FFFDF7, etc.).
   These overrides catch the most common patterns and remap to brand tokens, so brand.css can be
   layered onto existing pages without rewriting every inline style. */
.text-brand-dark, .text-duende-red { color: var(--text-body) !important; }
.text-brand-muted { color: var(--text-muted) !important; }
.bg-brand-cream { background: var(--surface-cream) !important; }

/* End brand.css */
