/* ==========================================================
   Energía para el mundo — estilos
   ========================================================== */
:root {
  --forest: #10302a;
  --forest-2: #183f35;
  --forest-3: #24584a;
  --paper: #f6f1e4;
  --paper-2: #ede4cd;
  --card: #fffcf4;
  --ink: #10302a;
  --muted: #4c5e55;
  --sun: #f2b33d;
  --sun-soft: #fbe3a6;
  --ember: #b0431f;
  --ember-bright: #e0683a;
  --leaf: #3f7d4f;
  --leaf-soft: #dcebd6;
  --water: #2c7891;
  --water-soft: #d4eaef;
  --soil: #e6e2c4;
  --line: rgba(16, 48, 42, .14);
  --line-strong: rgba(16, 48, 42, .28);
  --focus: #e0683a;

  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;

  --gutter: clamp(16px, 5vw, 72px);
  --max: 1280px;
  --radius: 22px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.02; letter-spacing: -.02em; margin: 0; font-optical-sizing: auto; }
h2 { font-size: clamp(2.3rem, 5.4vw, 4.4rem); }
h2 em, h1 em { font-style: italic; font-weight: 300; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; top: -100px; left: 16px; z-index: 200;
  background: var(--forest); color: var(--paper); padding: 12px 18px; border-radius: 10px; font-weight: 700;
}
.skip:focus { top: 12px; }

/* ---------- Elementos comunes ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font: 700 .75rem/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 22px;
}
.eyebrow::before { content: ''; width: 26px; height: 2px; background: currentColor; opacity: .5; }
.eyebrow .dot { display: none; }
.eyebrow-light { color: var(--sun-soft); }

.button {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 15px 24px; border-radius: 999px; border: 1.5px solid transparent;
  font: 700 .95rem/1 var(--sans); text-decoration: none;
  transition: transform .35s var(--ease), background-color .3s, color .3s, box-shadow .35s var(--ease), border-color .3s;
}
.button span { transition: transform .35s var(--ease); }
.button:hover span { transform: translate(3px, 3px); }
.button-primary { background: var(--forest); color: var(--paper); box-shadow: 0 10px 30px -12px rgba(16,48,42,.6); }
.button-primary:hover { background: var(--forest-3); transform: translateY(-2px); box-shadow: 0 16px 36px -14px rgba(16,48,42,.7); }
.button-ghost { border-color: var(--line-strong); }
.button-ghost:hover { border-color: var(--forest); background: var(--card); }
.button-sun { background: var(--sun); color: var(--forest); }
.button-sun:hover { background: #ffc955; transform: translateY(-2px); }
.button-sun:hover span { transform: translateY(-3px); }
.button-small { padding: 10px 16px; font-size: .85rem; background: transparent; border-color: var(--line-strong); }
.button-small:hover:not(:disabled) { background: var(--forest); color: var(--paper); border-color: var(--forest); }
.button-small:disabled { opacity: .45; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 700;
  text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  transition: text-decoration-color .3s, gap .3s var(--ease);
}
.link-arrow:hover { text-decoration-color: currentColor; gap: 10px; }

.section {
  position: relative;
  max-width: var(--max); margin: 0 auto;
  padding: clamp(80px, 11vw, 150px) var(--gutter);
}
.section-head {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px 60px; align-items: end;
  margin-bottom: clamp(40px, 6vw, 72px);
}
.section-lead { color: var(--muted); max-width: 42ch; font-size: 1.08rem; }

/* ---------- Encabezado ---------- */
.header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background-color .3s;
}
.header.is-scrolled { border-bottom-color: var(--line); background: color-mix(in srgb, var(--paper) 92%, transparent); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--forest); }
.brand-mark { width: 38px; height: 38px; flex: none; }
.brand-rays { transform-box: fill-box; transform-origin: center; transition: transform .8s var(--ease); }
.brand:hover .brand-rays { transform: rotate(45deg); }
.brand-text { font: 800 1.25rem/.85 var(--sans); letter-spacing: -.04em; }
.brand-text span { display: block; font: 600 .66rem/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; margin-top: 5px; opacity: .75; }

.nav { display: flex; gap: 4px; }
.nav a {
  position: relative; padding: 10px 14px; border-radius: 999px;
  font-size: .9rem; font-weight: 600; text-decoration: none; color: var(--muted);
  transition: color .25s, background-color .25s;
}
.nav a:hover { color: var(--forest); background: rgba(16,48,42,.06); }
.nav a.is-active { color: var(--forest); }
.nav a::after {
  content: ''; position: absolute; left: 50%; bottom: 3px; width: 5px; height: 5px; border-radius: 50%;
  background: var(--ember-bright); transform: translateX(-50%) scale(0); transition: transform .35s var(--ease);
}
.nav a.is-active::after { transform: translateX(-50%) scale(1); }

.menu-toggle {
  display: none; width: 46px; height: 46px; border-radius: 50%;
  border: 1.5px solid var(--line-strong); background: transparent; place-items: center;
}
.menu-icon { display: grid; gap: 6px; width: 18px; }
.menu-icon i { display: block; height: 2px; background: var(--forest); border-radius: 2px; transition: transform .35s var(--ease); }
.menu-open .menu-icon i:first-child { transform: translateY(4px) rotate(45deg); }
.menu-open .menu-icon i:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 5vw, 80px); align-items: center;
  padding: clamp(36px, 6vw, 80px) var(--gutter) clamp(60px, 8vw, 110px);
}
.hero-title { font-size: clamp(3.1rem, 8.2vw, 7.4rem); line-height: .94; letter-spacing: -.035em; margin-bottom: 30px; }
.hero-title .line { display: block; }
.hero-title em { color: var(--ember); position: relative; white-space: nowrap; }
.hero-title em::after {
  content: ''; position: absolute; left: 2%; right: 4%; bottom: .04em; height: .12em; z-index: -1;
  background: var(--sun); border-radius: 999px; opacity: .85;
  transform-origin: left; transform: scaleX(var(--underline, 1));
  transition: transform 1.1s .6s var(--ease);
}
.js .hero-title:not(.is-in) em::after { --underline: 0; }
.lead { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--muted); max-width: 40ch; margin-bottom: 36px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 44px; }
.ods { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.ods-badge {
  display: flex; align-items: center; gap: 12px; padding: 8px 16px 8px 8px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--line); font-size: .82rem; line-height: 1.25; max-width: 250px;
}
.ods-badge strong {
  flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px;
  font: 800 .78rem/1 var(--sans); color: #fff; text-align: center;
}
.ods-7 strong { background: #a8790a; }
.ods-13 strong { background: var(--leaf); }

.hero-art { position: relative; margin: 0; }
.hero-art svg { width: 100%; height: auto; filter: drop-shadow(0 30px 50px rgba(176, 67, 31, .18)); }
.art-tag {
  position: absolute; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px; font: 700 .72rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase;
  background: var(--card); box-shadow: 0 10px 30px -14px rgba(16,48,42,.4);
}
.art-tag-top { top: 9%; left: -4%; animation: float 7s ease-in-out infinite; }
.art-tag-top span { color: var(--ember-bright); font-size: 1.1rem; }
.art-tag-bottom { bottom: 6%; right: -2%; background: var(--forest); color: var(--paper); animation: float 7s -3.5s ease-in-out infinite; }

/* Movimiento de ilustraciones */
.spin, .spin-slow, .sway, .pulse { transform-box: fill-box; transform-origin: center; }
.spin { animation: spin 7s linear infinite; }
.spin-delay { animation-duration: 9s; animation-delay: -2s; }
.spin-slow { animation: spin 60s linear infinite; }
.sway { transform-origin: bottom center; animation: sway 6s ease-in-out infinite; }
.pulse { animation: pulse 5s ease-in-out infinite; }
.waves { animation: waves 4s ease-in-out infinite; }
.drift { animation: drift 4s ease-in-out infinite; }
.sun-core { animation: glow 6s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes waves { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(14px); } }
@keyframes drift { 0% { transform: translateX(-8px); opacity: .4; } 50% { opacity: 1; } 100% { transform: translateX(10px); opacity: .4; } }
@keyframes glow { 0%, 100% { opacity: 1; } 50% { opacity: .88; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ---------- Ticker ---------- */
.ticker-wrap { overflow: hidden; padding: 14px 0; }
.ticker { background: var(--forest); color: var(--sun-soft); overflow: hidden; padding: 20px 0; transform: rotate(-1.2deg) scale(1.02); }
.ticker-track { display: flex; align-items: center; gap: 32px; width: max-content; animation: marquee 40s linear infinite; }
.ticker span { font: 300 clamp(1.6rem, 3.4vw, 2.6rem)/1 var(--serif); font-style: italic; white-space: nowrap; }
.ticker b { color: var(--sun); font-weight: 400; font-size: 1.4rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- 01 Intro ---------- */
.intro { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px clamp(40px, 7vw, 110px); align-items: start; }
.section-index {
  position: absolute; top: clamp(30px, 5vw, 60px); right: var(--gutter);
  font: 300 clamp(8rem, 20vw, 17rem)/1 var(--serif); color: transparent;
  -webkit-text-stroke: 1.5px var(--line-strong); pointer-events: none; user-select: none;
}
.intro-copy { display: grid; gap: 22px; font-size: 1.12rem; padding-top: 50px; position: relative; }
.intro-copy > p:first-child::first-letter {
  float: left; font: 400 4.3rem/.8 var(--serif); color: var(--ember); margin: 6px 10px 0 0;
}
.key-note {
  margin-top: 10px; padding: 26px 28px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line); position: relative; overflow: hidden;
  display: grid; gap: 12px;
}
.key-note::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 6px; background: linear-gradient(var(--sun), var(--ember-bright)); }
.key-label { font: 700 .72rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ember); }
.key-note p { font: 400 1.35rem/1.35 var(--serif); }

/* ---------- 02 Energías ---------- */
.energies::before {
  content: ''; position: absolute; inset: 0 calc(50% - 50vw); z-index: -1;
  background: var(--paper-2);
  border-radius: 48px 48px 0 0;
}
.energy-layout { display: grid; grid-template-columns: minmax(250px, .75fr) 2fr; gap: 20px; align-items: stretch; }
.energy-tabs { display: grid; gap: 10px; align-content: start; }
.energy-tab {
  --accent: var(--sun);
  display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: 16px; align-items: center;
  text-align: left; padding: 18px 20px; border-radius: 18px;
  background: transparent; border: 1.5px solid var(--line-strong);
  transition: background-color .35s, border-color .35s, transform .35s var(--ease), color .35s;
}
.energy-tab[data-theme='eolica'] { --accent: #8fc1a0; }
.energy-tab[data-theme='hidro'] { --accent: #7cc3cf; }
.energy-tab[data-theme='biomasa'] { --accent: #b9c27a; }
.energy-tab:hover { border-color: var(--forest); transform: translateX(4px); }
.energy-tab .tab-num { grid-row: span 2; font: 400 1.6rem/1 var(--serif); color: var(--muted); font-style: italic; }
.energy-tab strong { font: 700 1.15rem/1.2 var(--sans); }
.energy-tab .tab-res { grid-column: 2; font-size: .8rem; color: var(--muted); }
.energy-tab .tab-arrow { grid-row: 1 / span 2; grid-column: 3; font-size: 1.2rem; transition: transform .35s var(--ease); }
.energy-tab[aria-selected='true'] { background: var(--forest); border-color: var(--forest); color: var(--paper); }
.energy-tab[aria-selected='true'] .tab-num { color: var(--accent); }
.energy-tab[aria-selected='true'] .tab-res { color: rgba(246, 241, 228, .75); }
.energy-tab[aria-selected='true'] .tab-arrow { transform: rotate(-45deg); color: var(--accent); }

.energy-detail {
  --tint: var(--sun-soft);
  display: grid; grid-template-columns: minmax(180px, .85fr) 1.15fr; gap: clamp(24px, 4vw, 56px); align-items: center;
  padding: clamp(24px, 4vw, 52px); border-radius: 32px;
  background: var(--card); border: 1px solid var(--line); min-height: 420px; position: relative; overflow: hidden;
  transition: background-color .5s;
}
.energy-detail::after {
  content: ''; position: absolute; width: 360px; height: 360px; border-radius: 50%;
  background: var(--tint); right: -160px; bottom: -200px; opacity: .55; transition: background-color .6s;
}
.energy-detail[data-theme='eolica'] { --tint: var(--leaf-soft); }
.energy-detail[data-theme='hidro'] { --tint: var(--water-soft); }
.energy-detail[data-theme='biomasa'] { --tint: var(--soil); }
.energy-detail > * { position: relative; z-index: 1; }
.energy-visual svg { width: 100%; max-width: 300px; margin: 0 auto; }
.energy-kicker { display: block; font: 700 .72rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; }
.energy-body h3 { font-size: clamp(2.1rem, 4vw, 3.4rem); margin-bottom: 18px; }
.energy-desc { font: 400 clamp(1.15rem, 1.7vw, 1.4rem)/1.4 var(--serif); margin-bottom: 10px; }
.energy-body > p:not(.energy-desc):not(.energy-source) { color: var(--muted); }
.energy-meta { display: flex; flex-wrap: wrap; gap: 12px 32px; margin: 24px 0; padding: 18px 0; border-block: 1px solid var(--line); }
.energy-meta dt { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.energy-meta dd { margin: 4px 0 0; font-weight: 700; }
.energy-source { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.energy-source small { color: var(--muted); font-size: .85rem; }
.loading, .load-error { color: var(--muted); }
.load-error { padding: 18px 20px; border-radius: 14px; background: #fbe4da; color: #7a2b12; }
.energy-detail.swap .energy-visual { animation: popIn .7s var(--ease) both; }
.energy-detail.swap .energy-body > * { animation: riseIn .6s var(--ease) both; }
.energy-detail.swap .energy-body > *:nth-child(2) { animation-delay: .05s; }
.energy-detail.swap .energy-body > *:nth-child(3) { animation-delay: .1s; }
.energy-detail.swap .energy-body > *:nth-child(n+4) { animation-delay: .15s; }
@keyframes popIn { from { opacity: 0; transform: scale(.85) rotate(-6deg); } to { opacity: 1; transform: none; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- 03 Campaña ---------- */
.campaign {
  display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(36px, 6vw, 90px); align-items: center;
  color: var(--paper);
}
.campaign::before {
  content: ''; position: absolute; inset: 0 calc(50% - 50vw); z-index: -1;
  background:
    radial-gradient(circle at 85% 15%, rgba(242,179,61,.22), transparent 40%),
    radial-gradient(circle at 10% 90%, rgba(63,125,79,.4), transparent 45%),
    var(--forest);
}
.campaign h2 em { color: var(--sun); }
.campaign-copy { display: grid; gap: 22px; justify-items: start; }
.campaign-copy > p:not(.eyebrow) { color: rgba(246,241,228,.82); max-width: 40ch; font-size: 1.1rem; }
.poster {
  display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 18px;
  margin-top: 14px; padding: 10px 22px 10px 10px; border-radius: 20px; text-decoration: none;
  background: rgba(246,241,228,.08); border: 1px solid rgba(246,241,228,.18);
  transition: background-color .3s, transform .4s var(--ease), border-color .3s;
}
.poster img { width: 96px; height: 96px; border-radius: 12px; transform: rotate(-4deg); transition: transform .5s var(--ease); box-shadow: 0 10px 24px -10px rgba(0,0,0,.5); }
.poster:hover { background: rgba(246,241,228,.14); border-color: var(--sun); transform: translateY(-3px); }
.poster:hover img { transform: rotate(0) scale(1.05); }
.poster-label { display: grid; grid-template-columns: 1fr auto; column-gap: 20px; align-items: center; }
.poster-label span { font-weight: 800; }
.poster-label small { grid-row: 2; color: rgba(246,241,228,.7); font-size: .8rem; }
.poster-label b {
  grid-column: 2; grid-row: 1 / span 2; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  background: var(--sun); color: var(--forest); transition: transform .4s var(--ease);
}
.poster:hover .poster-label b { transform: translateY(3px); }

.player {
  --scene-ms: 4500ms;
  background: #0a211c; border-radius: 28px; padding: 14px; border: 1px solid rgba(246,241,228,.12);
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.6);
}
.player-top { display: flex; justify-content: space-between; gap: 12px; padding: 6px 10px 14px; font: 700 .7rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: rgba(246,241,228,.7); }
.rec { display: inline-flex; align-items: center; gap: 8px; }
.rec i { width: 8px; height: 8px; border-radius: 50%; background: rgba(246,241,228,.4); }
.is-playing .rec i { background: #ff6b4a; animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }

.screen {
  position: relative; aspect-ratio: 16 / 10; border-radius: 18px; overflow: hidden;
  display: grid; place-items: center; padding-bottom: 10%;
  background: linear-gradient(140deg, #1d5240, #3f7d4f);
  transition: background .8s var(--ease);
}
.screen[data-scene='1'] { background: linear-gradient(140deg, #f2b33d, #e0683a); }
.screen[data-scene='2'] { background: linear-gradient(140deg, #3f7d4f, #8bb55c); }
.screen[data-scene='3'] { background: linear-gradient(140deg, #1f5e72, #4f9fb8); }
.screen[data-scene='4'] { background: linear-gradient(140deg, #10302a, #b0431f); }
.screen-bg { position: absolute; inset: 0; pointer-events: none; }
.screen-bg span {
  position: absolute; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.18);
  left: 50%; top: 42%; translate: -50% -50%; animation: ring 6s ease-out infinite;
}
.screen-bg span:nth-child(1) { width: 40%; aspect-ratio: 1; }
.screen-bg span:nth-child(2) { width: 65%; aspect-ratio: 1; animation-delay: -2s; }
.screen-bg span:nth-child(3) { width: 90%; aspect-ratio: 1; animation-delay: -4s; }
@keyframes ring { from { transform: scale(.8); opacity: 0; } 30% { opacity: 1; } to { transform: scale(1.2); opacity: 0; } }
.slide-icon {
  position: relative; font: 300 clamp(5rem, 13vw, 9rem)/1 var(--serif); color: #fff;
  text-shadow: 0 10px 40px rgba(0,0,0,.2);
}
.slide-kicker {
  position: absolute; top: 16px; left: 18px; padding: 6px 10px; border-radius: 999px;
  background: rgba(0,0,0,.28); color: #fff; font: 700 .72rem/1 var(--sans); letter-spacing: .12em;
}
.subtitle {
  position: absolute; left: 50%; bottom: 7%; translate: -50% 0; width: min(88%, 560px);
  padding: 10px 16px; border-radius: 10px; text-align: center;
  background: rgba(6, 20, 16, .82); color: #fff; font: 600 clamp(.95rem, 1.6vw, 1.15rem)/1.4 var(--sans);
}
.screen.enter .slide-icon { animation: iconIn .9s var(--ease) both; }
.screen.enter .subtitle { animation: subIn .6s .15s var(--ease) both; }
@keyframes iconIn { from { opacity: 0; transform: scale(.6) rotate(-40deg); } to { opacity: 1; transform: none; } }
@keyframes subIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.progress { display: flex; gap: 6px; padding: 14px 4px 4px; }
.seg { flex: 1; padding: 8px 0; border: 0; background: none; border-radius: 4px; }
.seg i { display: block; height: 4px; border-radius: 4px; background: rgba(246,241,228,.2); position: relative; overflow: hidden; }
.seg i::after { content: ''; position: absolute; inset: 0; background: var(--sun); transform-origin: left; transform: scaleX(0); }
.seg.done i::after, .seg.current i::after { transform: scaleX(1); }
.is-playing .seg.current i::after { animation: fill var(--scene-ms) linear both; }
.seg:hover i { background: rgba(246,241,228,.4); }
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.player-controls { display: flex; align-items: center; gap: 8px; padding: 8px 4px 4px; }
.ctrl {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; min-width: 48px; padding: 0 14px;
  border-radius: 999px; border: 1px solid rgba(246,241,228,.22); background: transparent; color: var(--paper);
  transition: background-color .25s, transform .25s var(--ease), border-color .25s;
}
.ctrl svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ctrl:hover { background: rgba(246,241,228,.1); border-color: rgba(246,241,228,.5); }
.ctrl:active { transform: scale(.94); }
.ctrl-play { background: var(--sun); color: var(--forest); border-color: var(--sun); font-weight: 800; padding: 0 22px; }
.ctrl-play:hover { background: #ffc955; border-color: #ffc955; }
.ctrl-play svg { fill: currentColor; stroke: none; }
.ctrl-play .i-pause, .is-playing .ctrl-play .i-play { display: none; }
.is-playing .ctrl-play .i-pause { display: block; }
.cc { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font: 700 .7rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: rgba(246,241,228,.7); }
.cc abbr { text-decoration: none; padding: 4px 6px; border: 1.5px solid currentColor; border-radius: 5px; letter-spacing: 0; }
.player :focus-visible, .campaign :focus-visible, .closing :focus-visible { outline-color: var(--sun); }

/* ---------- 04 Acciones ---------- */
.actions-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 28px; }
.filter { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 10px; padding: 11px 16px 11px 20px; border-radius: 999px;
  border: 1.5px solid var(--line-strong); background: transparent; font-weight: 700; font-size: .92rem;
  transition: background-color .3s, color .3s, border-color .3s, transform .3s var(--ease);
}
.chip:hover { border-color: var(--forest); transform: translateY(-1px); }
.chip .count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: rgba(16,48,42,.08); font-size: .75rem; }
.chip.is-selected { background: var(--forest); border-color: var(--forest); color: var(--paper); }
.chip.is-selected .count { background: var(--sun); color: var(--forest); }
.tally { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.tally-ring { width: 44px; height: 44px; transform: rotate(-90deg); }
.tally-ring circle { fill: none; stroke-width: 5; }
.tally-ring circle:first-child { stroke: var(--line); }
#tally-arc { stroke: var(--ember-bright); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .7s var(--ease); }

.action-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 16px; }
.action-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 250px;
  padding: 24px; border-radius: var(--radius); background: var(--card); border: 1.5px solid var(--line);
  cursor: pointer; isolation: isolate; overflow: hidden;
  transition: transform .4s var(--ease), border-color .3s, box-shadow .4s var(--ease), color .3s;
  animation: cardIn .6s calc(var(--i, 0) * 70ms) var(--ease) both;
}
.action-card::before {
  content: ''; position: absolute; inset: 0; z-index: -1; background: var(--forest);
  clip-path: circle(0% at calc(100% - 40px) 40px); transition: clip-path .6s var(--ease);
}
.action-card:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: 0 20px 40px -24px rgba(16,48,42,.45); }
.action-card:has(.action-check:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.action-check { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.action-top { display: flex; justify-content: space-between; align-items: start; margin-bottom: auto; }
.action-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--sun-soft); color: var(--forest); transition: background-color .3s; }
.action-card[data-level='Media'] .action-icon { background: var(--leaf-soft); }
.action-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.action-tick { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--line-strong); position: relative; transition: background-color .3s, border-color .3s; }
.action-tick::after {
  content: ''; position: absolute; left: 9px; top: 6px; width: 8px; height: 13px;
  border: solid var(--forest); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) scale(0); transition: transform .35s var(--ease);
}
.action-title { font: 400 1.55rem/1.1 var(--serif); margin-top: 22px; }
.action-desc { color: var(--muted); font-size: .98rem; transition: color .3s; }
.action-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag { padding: 5px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; border: 1px solid var(--line-strong); transition: border-color .3s; }
.tag-level { background: var(--paper-2); border-color: transparent; }

.action-card:has(.action-check:checked) { color: var(--paper); border-color: var(--forest); }
.action-card:has(.action-check:checked)::before { clip-path: circle(150% at calc(100% - 40px) 40px); }
.action-card:has(.action-check:checked) .action-desc { color: rgba(246,241,228,.8); }
.action-card:has(.action-check:checked) .action-tick { background: var(--sun); border-color: var(--sun); }
.action-card:has(.action-check:checked) .action-tick::after { transform: rotate(45deg) scale(1); }
.action-card:has(.action-check:checked) .tag { border-color: rgba(246,241,228,.35); }
.action-card:has(.action-check:checked) .tag-level { background: rgba(246,241,228,.14); }
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }

.action-context { margin-top: 28px; max-width: 70ch; color: var(--muted); }
.action-context strong { color: var(--ink); }
.action-context .link-arrow { color: var(--ink); }
.privacy-note {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 28px;
  padding: 16px 18px; border-radius: 16px; border: 1px dashed var(--line-strong); font-size: .95rem;
}
.privacy-note svg { width: 22px; height: 22px; fill: none; stroke: var(--leaf); stroke-width: 2; }
.privacy-note p { flex: 1 1 220px; }

/* ---------- 05 Bibliografía ---------- */
.sources { display: grid; grid-template-columns: .8fr 1.2fr; gap: 40px clamp(40px, 7vw, 100px); align-items: start; }
.sources::before { content: ''; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); height: 1px; background: var(--line-strong); }
.sources-head { position: sticky; top: calc(var(--header-h) + 30px); }
.sources-head > p:last-child { color: var(--muted); margin-top: 22px; max-width: 38ch; }
.source-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); }
.source { border-bottom: 1px solid var(--line-strong); }
.source.reveal { transition-delay: calc(var(--i, 0) * 90ms); }
.source-link {
  display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center;
  padding: 28px 8px; text-decoration: none; position: relative;
  transition: padding .4s var(--ease), background-color .3s;
}
.source-link::before { content: ''; position: absolute; inset: 0; background: var(--card); transform: scaleY(0); transform-origin: bottom; transition: transform .45s var(--ease); z-index: -1; border-radius: 14px; }
.source-link:hover::before { transform: scaleY(1); }
.source-link:hover { padding-inline: 20px; }
.source-link { isolation: isolate; }
.source-num { font: 300 2.4rem/1 var(--serif); font-style: italic; color: var(--ember); align-self: start; }
.source-body { display: grid; gap: 6px; }
.source-org { font: 700 .72rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.source-body strong { font: 400 clamp(1.3rem, 2.2vw, 1.75rem)/1.2 var(--serif); }
.source-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: .85rem; color: var(--muted); }
.source-meta span + span::before { content: '·'; margin-right: 18px; }
.source-arrow {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--line-strong);
  font-size: 1.1rem; transition: background-color .3s, color .3s, transform .45s var(--ease), border-color .3s;
}
.source-link:hover .source-arrow { background: var(--forest); color: var(--paper); border-color: var(--forest); transform: rotate(45deg); }

/* ---------- Cierre ---------- */
.closing {
  position: relative; overflow: hidden; text-align: center; color: var(--paper);
  background: var(--forest); padding: clamp(90px, 13vw, 170px) var(--gutter);
  border-radius: 48px 48px 0 0; display: grid; justify-items: center; gap: 14px;
}
.closing-sun { position: absolute; width: clamp(260px, 40vw, 520px); left: 50%; top: 50%; translate: -50% -50%; opacity: .14; pointer-events: none; }
.closing > *:not(.closing-sun) { position: relative; }
.closing h2 { font-size: clamp(3rem, 10vw, 8.5rem); line-height: .95; margin-bottom: 30px; }
.closing h2 em { color: var(--sun); }

/* ---------- Pie ---------- */
.footer {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 28px; align-items: start;
  padding: 44px var(--gutter) 52px; background: #0a211c; color: rgba(246,241,228,.78); font-size: .9rem;
}
.brand-footer { color: var(--paper); }

/* ---------- Revelado al desplazarse ---------- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }
.hero .reveal:nth-child(2) { transition-delay: .08s; }
.hero .reveal:nth-child(3) { transition-delay: .16s; }
.hero .reveal:nth-child(4) { transition-delay: .24s; }
.hero .reveal:nth-child(5) { transition-delay: .32s; }
.js .hero-art.reveal { transform: translateY(26px) scale(.96); transition-delay: .2s; }
.js .hero-art.reveal.is-in { transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .nav a { padding: 10px 10px; font-size: .85rem; }
}
@media (max-width: 960px) {
  .menu-toggle { display: grid; }
  .nav {
    position: absolute; top: calc(var(--header-h) - 4px); left: 12px; right: 12px;
    flex-direction: column; gap: 2px; padding: 10px; border-radius: 20px;
    background: var(--card); border: 1px solid var(--line); box-shadow: 0 30px 60px -30px rgba(16,48,42,.5);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .3s, transform .35s var(--ease), visibility 0s .35s;
  }
  .menu-open .nav { opacity: 1; visibility: visible; transform: none; transition: opacity .3s, transform .35s var(--ease), visibility 0s; }
  .nav a { padding: 14px 16px; font-size: 1rem; border-radius: 12px; }
  .nav a::after { left: auto; right: 16px; top: 50%; bottom: auto; transform: translateY(-50%) scale(0); }
  .nav a.is-active::after { transform: translateY(-50%) scale(1); }

  .hero { grid-template-columns: 1fr; }
  .hero-art { max-width: 460px; width: 100%; margin: 0 auto; }
  .section-head, .intro, .sources, .campaign { grid-template-columns: 1fr; }
  .intro-copy { padding-top: 0; }
  .sources-head { position: static; }
  .energy-layout { grid-template-columns: 1fr; }
  .energy-tabs { grid-template-columns: repeat(2, 1fr); }
  .energy-tab:hover { transform: translateY(-2px); }
  .footer { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  :root { --header-h: 64px; --radius: 18px; }
  .hero { padding-top: 20px; }
  .hero-art { max-width: 340px; }
  .art-tag-top { left: -2%; }
  .art-tag-bottom { right: 0; }
  .hero-actions .button { flex: 1 1 auto; justify-content: center; }
  .energy-detail { grid-template-columns: 1fr; min-height: 0; }
  .energy-visual svg { max-width: 170px; }
  .energy-tab { padding: 14px; column-gap: 10px; }
  .energy-tab .tab-arrow { display: none; }
  .energy-tab .tab-num { font-size: 1.25rem; }
  .energy-tab strong { font-size: 1rem; }
  .player { padding: 10px; border-radius: 22px; }
  .screen { aspect-ratio: 1 / 1; padding-bottom: 16%; }
  .slide-icon { font-size: 5rem; }
  .player-top span:first-child { display: none; }
  .cc { font-size: 0; gap: 0; }
  .cc abbr { font-size: .7rem; }
  .ctrl-play { padding: 0 18px; }
  .source-link { grid-template-columns: auto 1fr; gap: 16px; }
  .source-arrow { display: none; }
  .source-num { font-size: 1.8rem; min-width: 1.6em; }
  .source-meta { flex-direction: column; }
  .source-meta span + span::before { content: none; }
  .actions-bar { flex-direction: column; align-items: stretch; }
  .section-index { display: none; }
  .closing, .energies::before { border-radius: 32px 32px 0 0; }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    animation-delay: 0s !important; transition-duration: .01ms !important; transition-delay: 0s !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .ticker-track { animation: none; }
}
