/* Lugunica Pulse · Fase 29 — plataforma dual Anime 2006-2026 / IA.
   Emilia vive integrada al fondo del Hero con máscara radial: cero marcos cuadrados. */
:root {
  /* Fase 31 · armonía real con las ilustraciones de Emilia: Aguamarina Cristal (#5eead4),
     Plata Élfica (#f8fafc) y Amatista Real (#9333ea), sobre obsidiana azulada. */
  --bg: #06070d;
  --bg-2: #0b1120;
  --ink: #f8fafc;
  --muted: #cbd5e1;
  --dim: #94a3b8;
  --ice: #5eead4;
  --ice-soft: rgba(94, 234, 212, 0.20);
  --mint: #5eead4;
  --emerald: #10b981;
  --amethyst: #9333ea;
  --amethyst-2: #e9d5ff;
  --violet: #6d28d9;
  --royal: #7c3aed;
  --rose: #f9a8d4;
  --gold: #fbbf24;
  --cyan: #38bdf8;
  --silver: #f8fafc;
  --card: rgba(13, 16, 28, 0.42);
  --line: rgba(94, 234, 212, 0.18);
  --line-strong: rgba(248, 250, 252, 0.26);
  --radius: 22px;
  --shadow: 0 30px 90px rgba(3, 5, 12, 0.65);
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --sans: "Segoe UI Variable", "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(1100px 720px at 84% -6%, rgba(147, 51, 234, 0.22), transparent 62%),
    radial-gradient(880px 620px at 4% 16%, rgba(94, 234, 212, 0.12), transparent 60%),
    radial-gradient(760px 520px at 46% 58%, rgba(56, 189, 248, 0.09), transparent 64%),
    radial-gradient(900px 700px at 96% 82%, rgba(147, 51, 234, 0.16), transparent 66%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 44%, #05060c 100%);
  overflow-x: hidden;
}
body.mode-ai {
  background:
    radial-gradient(1000px 680px at 84% -6%, rgba(56, 189, 248, 0.22), transparent 62%),
    radial-gradient(900px 640px at 6% 16%, rgba(147, 51, 234, 0.20), transparent 60%),
    radial-gradient(700px 520px at 50% 70%, rgba(94, 234, 212, 0.10), transparent 64%),
    linear-gradient(180deg, #060a16 0%, #0d0a1e 48%, #05060c 100%);
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button, a, [role="button"] { touch-action: manipulation; -webkit-user-select: none; user-select: none; }
:focus-visible { outline: 2px solid var(--ice); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

#ice-field { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.aurora {
  position: fixed; inset: -24% -12% auto -12%; height: 78vh; pointer-events: none; z-index: 0;
  background:
    conic-gradient(from 120deg at 30% 20%, rgba(168, 85, 247, 0.34), transparent 42%),
    conic-gradient(from 300deg at 70% 10%, rgba(94, 234, 212, 0.24), transparent 40%),
    conic-gradient(from 30deg at 52% 60%, rgba(16, 185, 129, 0.16), transparent 38%);
  filter: blur(64px) saturate(1.25); opacity: 0.95;
  animation: aurora-drift 22s ease-in-out infinite alternate;
}
@keyframes aurora-drift {
  0% { transform: translate3d(-2%, -1%, 0) rotate(-2deg) scale(1.02); }
  50% { transform: translate3d(2%, 1.5%, 0) rotate(1.5deg) scale(1.08); }
  100% { transform: translate3d(-1%, 2%, 0) rotate(-1deg) scale(1.04); }
}

/* ------------------------------------------------------------------ barra */
.portal-bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px; flex-wrap: nowrap;
  height: 48px; min-height: 48px; max-height: 48px;
  padding: 0 clamp(10px, 2.5vw, 28px); padding-top: env(safe-area-inset-top, 0px);
  background: rgba(8, 6, 20, 0.38); border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(22px) saturate(180%); -webkit-backdrop-filter: blur(22px) saturate(180%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
}
.portal-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; min-width: 0; flex: 0 1 auto; }
.brand-crystal {
  width: 22px; height: 22px; border-radius: 6px; flex: 0 0 auto;
  background: linear-gradient(140deg, #dff7ff, var(--amethyst) 55%, #4d2a9c);
  box-shadow: 0 0 18px rgba(157, 108, 255, 0.55), inset 0 0 8px rgba(255, 255, 255, 0.6);
  transform: rotate(45deg);
}
.brand-copy { display: grid; line-height: 1.05; min-width: 0; }
.brand-copy strong { letter-spacing: 0.14em; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-copy small { color: var(--dim); letter-spacing: 0.20em; font-size: 8px; margin-top: 3px; white-space: nowrap; }
.mode-switch {
  display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; height: 34px;
  border: 1px solid var(--line-strong); background: rgba(12, 9, 28, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05); min-width: 0; flex: 0 0 auto;
}
.mode-short { display: none; }
.mode-btn {
  display: inline-flex; align-items: center; gap: 5px;
  border: 0; background: transparent; color: var(--muted);
  height: 28px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 650;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
  white-space: nowrap;
}
.mode-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; }
.icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.btn-primary .icon, .btn-ghost .icon { width: 15px; height: 15px; }
.icon-star { fill: currentColor; stroke: none; width: 12px; height: 12px; }
.mode-btn.is-on {
  color: #0b0714;
  background: linear-gradient(120deg, #ecfeff 0%, #5eead4 30%, #e9d5ff 66%, #f8fafc 100%);
  box-shadow: 0 8px 26px rgba(94, 234, 212, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.4) inset;
}
.theme-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border-radius: 50%; border: 1px solid var(--line-strong); background: rgba(20, 10, 40, 0.55);
  color: var(--mint); box-shadow: 0 0 18px rgba(94, 234, 212, 0.12);
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.theme-btn:hover { transform: rotate(12deg); box-shadow: 0 0 26px rgba(94, 234, 212, 0.3); }
.theme-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; }
.theme-btn .icon-moon, body.theme-light .theme-btn .icon-sun { display: none; }
body.theme-light .theme-btn .icon-moon { display: block; }
.portal-nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: nowrap; align-items: center; flex: 0 0 auto; }
.portal-nav a {
  display: inline-flex; align-items: center; text-decoration: none; color: var(--muted);
  height: 30px; padding: 0 8px; font-size: 12px; border-radius: 999px;
  border: 1px solid transparent; white-space: nowrap;
}
.portal-nav a:hover { color: var(--ink); border-color: var(--line); }
.portal-nav a.is-active { color: var(--ink); border-color: var(--line-strong); background: rgba(157, 108, 255, 0.12); }

/* ------------------------------------------------------------------ hero */
main { position: relative; z-index: 1; }
.mode-view[hidden] { display: none !important; }
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: clamp(600px, 86vh, 860px);
  display: grid; align-items: center;
  /* Fase 33: la barra fija de 48 px ya no muerde el título «Historias que se quedan». */
  padding: clamp(78px, 9vh, 110px) clamp(18px, 6vw, 92px) clamp(60px, 8vw, 110px);
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(900px 560px at 78% 38%, rgba(120, 70, 220, 0.20), transparent 65%),
    linear-gradient(90deg, rgba(8, 7, 17, 0.95) 0%, rgba(8, 7, 17, 0.62) 46%, transparent 72%);
}
.hero-ai::before {
  background:
    radial-gradient(900px 560px at 78% 38%, rgba(54, 198, 255, 0.16), transparent 65%),
    linear-gradient(90deg, rgba(6, 9, 20, 0.95) 0%, rgba(6, 9, 20, 0.60) 46%, transparent 72%);
}
.hero-emilia-wrap {
  position: absolute; z-index: -1; top: 0; right: 0; bottom: 0; width: min(62vw, 980px);
  pointer-events: none; perspective: 1100px;
  transform: translateY(calc(var(--scroll, 0) * -26px));
}
/* Fundido real al fondo: evita el corte horizontal del borde inferior del Hero. */
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 26%; z-index: 0;
  background: linear-gradient(0deg, var(--bg) 0%, rgba(8, 5, 18, 0.94) 26%,
    rgba(8, 5, 18, 0.55) 58%, transparent 100%);
  pointer-events: none;
}
.hero-emilia {
  position: absolute; right: 2%; bottom: -2%;
  height: 100%; width: auto; object-fit: contain; object-position: right bottom;
  transform-style: preserve-3d; will-change: transform;
  transition: transform 200ms ease-out;
  /* Aura real sobre el canal alfa: no hay recuadro ni corte duro. */
  /* Aura de profundidad: sombra desplazada hacia abajo, no un contorno que enmarque la figura. */
  filter:
    drop-shadow(0 24px 30px rgba(40, 18, 90, 0.55))
    drop-shadow(0 4px 14px rgba(56, 189, 248, 0.10))
    saturate(1.04) contrast(1.02);
  -webkit-mask-image: linear-gradient(0deg, transparent 0%, #000 13%, #000 100%);
  mask-image: linear-gradient(0deg, transparent 0%, #000 13%, #000 100%);
  opacity: 1;
}
.hero-sequence {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0.9; mix-blend-mode: screen; pointer-events: none;
}
.hero-emilia-back {
  right: max(16vw, 180px); bottom: 2%; height: 86%; opacity: 0.24;
  filter: blur(1.5px) drop-shadow(0 0 60px rgba(157, 108, 255, 0.4)) saturate(0.9);
  z-index: -1;
}
.hero-aura {
  position: absolute; right: 8%; bottom: 8%; width: 56%; aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 48%, rgba(157, 108, 255, 0.34), transparent 62%),
    radial-gradient(circle at 62% 62%, rgba(56, 189, 248, 0.20), transparent 58%);
  filter: blur(46px); opacity: 0.95;
}
.emilia-shine {
  position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0.85;
  mix-blend-mode: screen;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0) 44%,
    rgba(255, 255, 255, 0.72) 50%, rgba(94, 234, 212, 0.38) 54%, transparent 61%);
  background-size: 240% 100%;
  animation: emilia-shine 6.8s cubic-bezier(.4, 0, .2, 1) infinite;
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: right 2% bottom 2%; mask-position: right 2% bottom 2%;
}
.shine-anime {
  -webkit-mask-image: url("/static/portal/emilia_hero_anime.png");
  mask-image: url("/static/portal/emilia_hero_anime.png");
}
.shine-ai {
  -webkit-mask-image: url("/static/portal/emilia_hero_ai.png");
  mask-image: url("/static/portal/emilia_hero_ai.png");
}
@keyframes emilia-shine {
  0%, 55% { background-position: 140% 0; opacity: 0; }
  62% { opacity: 0.9; }
  88%, 100% { background-position: -40% 0; opacity: 0; }
}
.hero-emilia { animation: emilia-float 8s ease-in-out infinite; }
@keyframes emilia-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -10px; }
}
.hero-specular {
  position: absolute; width: 560px; height: 560px; left: var(--mxpx, 52%);
  top: var(--mypx, 42%); transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.24) 0%,
    rgba(168, 85, 247, 0.10) 38%, rgba(94, 234, 212, 0.05) 58%, transparent 72%);
  mix-blend-mode: screen; opacity: 0.9; pointer-events: none;
  transition: left 120ms linear, top 120ms linear;
}
.hero-glow { display: none; }
.hero-halo {
  position: absolute; right: 2%; top: 12%; width: 66%; aspect-ratio: 1; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(168, 85, 247, 0.34), rgba(94, 234, 212, 0.24),
    rgba(16, 185, 129, 0.18), rgba(249, 168, 212, 0.22), rgba(168, 85, 247, 0.34));
  filter: blur(28px) saturate(1.3); opacity: 0.55;
  animation: halo-spin 26s linear infinite;
}
@keyframes halo-spin { to { transform: rotate(360deg); } }
.hero-beam {
  position: absolute; right: -8%; top: -18%; width: 42%; height: 150%;
  background: linear-gradient(104deg, transparent 18%, rgba(255, 255, 255, 0.16) 44%,
    rgba(157, 243, 255, 0.10) 52%, transparent 76%);
  transform: rotate(12deg); filter: blur(8px); opacity: 0.7;
  animation: beam-sweep 9s ease-in-out infinite alternate;
}
@keyframes beam-sweep {
  0% { transform: translateX(-4%) rotate(10deg); opacity: 0.45; }
  100% { transform: translateX(7%) rotate(15deg); opacity: 0.8; }
}
.hero-shards { position: absolute; inset: 0; overflow: hidden; }
.hero-shards i {
  position: absolute; width: 9px; height: 9px; border-radius: 2px;
  background: linear-gradient(140deg, #ffffff, var(--mint) 48%, var(--amethyst));
  box-shadow: 0 0 16px rgba(157, 243, 255, 0.85), 0 0 30px rgba(168, 85, 247, 0.45);
  transform: rotate(45deg); animation: shard-float 8s ease-in-out infinite;
}
.hero-shards i:nth-child(1) { left: 8%; top: 18%; animation-delay: -1s; }
.hero-shards i:nth-child(2) { left: 22%; top: 62%; width: 6px; height: 6px; animation-delay: -3s; }
.hero-shards i:nth-child(3) { left: 38%; top: 32%; width: 12px; height: 12px; animation-delay: -5s; }
.hero-shards i:nth-child(4) { left: 54%; top: 74%; animation-delay: -2s; }
.hero-shards i:nth-child(5) { left: 68%; top: 16%; width: 7px; height: 7px; animation-delay: -6s; }
.hero-shards i:nth-child(6) { left: 12%; top: 82%; width: 5px; height: 5px; animation-delay: -4s; }
.hero-shards i:nth-child(7) { left: 46%; top: 8%; width: 6px; height: 6px; animation-delay: -7s; }
.hero-shards i:nth-child(8) { left: 78%; top: 48%; width: 10px; height: 10px; animation-delay: -2.5s; }
@keyframes shard-float {
  0%, 100% { transform: translateY(0) rotate(45deg) scale(1); opacity: 0.45; }
  50% { transform: translateY(-26px) rotate(120deg) scale(1.25); opacity: 1; }
}
.hero-scroll {
  position: absolute; z-index: 3; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent;
  color: var(--muted); font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase;
  animation: scroll-bob 2.4s ease-in-out infinite;
}
.hero-scroll svg { width: 16px; height: 16px; fill: none; stroke: var(--mint); stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
@keyframes scroll-bob {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.55; }
  50% { transform: translateX(-50%) translateY(7px); opacity: 1; }
}
.scroll-progress {
  position: fixed; left: 0; top: 0; z-index: 40; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--mint), var(--ice), var(--amethyst), var(--rose));
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.75);
  transition: width 80ms linear;
}
.cursor-glow {
  position: fixed; z-index: 0; left: 0; top: 0; width: 520px; height: 520px;
  margin-left: -260px; margin-top: -260px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.14), rgba(94, 234, 212, 0.06) 42%,
    transparent 70%);
  mix-blend-mode: screen; opacity: 0.9; will-change: transform;
}
@media (pointer: coarse) { .cursor-glow { display: none; } }
.hero-frost {
  position: absolute; width: 10px; height: 10px; border-radius: 2px; transform: rotate(45deg);
  background: linear-gradient(140deg, #f0fbff, var(--ice) 40%, rgba(157, 108, 255, 0.7));
  box-shadow: 0 0 18px rgba(167, 230, 255, 0.8); opacity: 0.8;
  animation: frost-float 9s ease-in-out infinite;
}
.hero-frost.f1 { left: 12%; top: 24%; animation-delay: -1s; }
.hero-frost.f2 { left: 34%; bottom: 22%; width: 16px; height: 16px; animation-delay: -3s; }
.hero-frost.f3 { right: 18%; top: 18%; width: 7px; height: 7px; animation-delay: -5s; }
.hero-frost.f4 { right: 42%; top: 58%; width: 13px; height: 13px; animation-delay: -7s; }
@keyframes frost-float {
  0%, 100% { transform: translateY(0) rotate(45deg); opacity: 0.55; }
  50% { transform: translateY(-22px) rotate(75deg); opacity: 0.95; }
}
.hero-copy { position: relative; z-index: 2; max-width: 640px; }
.hero-copy > * { animation: rise-in 900ms cubic-bezier(.16, 1, .3, 1) both; }
.hero-copy > .hero-kicker { animation-delay: 80ms; }
.hero-copy > h1 { animation-delay: 180ms; }
.hero-copy > .hero-sub { animation-delay: 300ms; }
.hero-copy > .hero-actions { animation-delay: 420ms; }
.hero-copy > .hero-stats { animation-delay: 540ms; }
@keyframes rise-in {
  from { opacity: 0; transform: translateY(34px) scale(0.985); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
.hero-kicker {
  margin: 0 0 18px; color: var(--ice); letter-spacing: 0.32em; font-size: 10.5px; font-weight: 700;
}
.hero h1 {
  margin: 0; font-family: var(--serif); font-weight: 600; line-height: 1.02;
  font-size: clamp(44px, 6.4vw, 86px); letter-spacing: -0.02em;
  text-shadow: 0 10px 44px rgba(5, 2, 20, 0.65);
}
.hero h1 em {
  font-style: italic;
  background: linear-gradient(100deg, #f3f8ff 5%, var(--ice) 38%, var(--amethyst-2) 72%, var(--rose));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub {
  max-width: 540px; margin: 22px 0 0; color: var(--muted); font-size: clamp(15px, 1.35vw, 17px);
  line-height: 1.65;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.btn-primary, .btn-ghost {
  border-radius: 999px; padding: 12px 22px; font-weight: 700; font-size: 14px;
  border: 1px solid transparent; text-decoration: none; display: inline-flex; align-items: center;
  gap: 8px; white-space: nowrap;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.btn-primary > svg, .btn-ghost > svg {
  width: 15px; height: 15px; flex: 0 0 15px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.btn-primary {
  position: relative; overflow: hidden; color: #0b0714;
  background: linear-gradient(115deg, #5eead4 0%, #f8fafc 46%, #e9d5ff 78%, #c4b5fd 100%);
  box-shadow: 0 14px 34px rgba(94, 234, 212, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.4) inset;
}
.btn-primary::after {
  content: ""; position: absolute; inset: -40% -80%;
  background: linear-gradient(100deg, transparent 38%, rgba(255, 255, 255, 0.75) 50%, transparent 62%);
  transform: translateX(-60%) rotate(8deg); transition: transform 650ms ease; opacity: 0.7;
}
.btn-primary:hover::after { transform: translateX(60%) rotate(8deg); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 20px 48px rgba(168, 85, 247, 0.62); }
.btn-ghost {
  color: var(--ink); border-color: var(--line-strong);
  background: linear-gradient(180deg, rgba(94, 234, 212, 0.08), rgba(25, 13, 52, 0.72));
  backdrop-filter: blur(10px);
}
.btn-ghost:hover {
  border-color: var(--mint); transform: translateY(-2px);
  box-shadow: 0 0 26px rgba(94, 234, 212, 0.22);
}
.btn-small { padding: 8px 14px; font-size: 12.5px; }
.hero-stats {
  display: flex; flex-wrap: wrap; gap: clamp(18px, 4vw, 46px); margin: 38px 0 0;
}
.hero-stats .stat {
  padding: 12px 16px; border-radius: 22px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.20) 0%, rgba(255, 255, 255, 0.04) 36%,
    rgba(10, 18, 34, 0.34) 36.5%, rgba(7, 13, 26, 0.44) 100%);
  backdrop-filter: blur(28px) saturate(210%) brightness(1.08);
  -webkit-backdrop-filter: blur(28px) saturate(210%) brightness(1.08);
  border: 1px solid rgba(165, 243, 252, 0.38);
  border-top-color: rgba(255, 255, 255, 0.65);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 0 28px rgba(56, 189, 248, 0.16), 0 18px 44px rgba(2, 8, 24, 0.55);
}
body.theme-light .hero-stats .stat, :root[data-theme="light"] .hero-stats .stat {
  background: rgba(255, 255, 255, 0.44);
  border-color: rgba(125, 211, 252, 0.55);
  box-shadow: inset 0 1px 0 #ffffff, 0 14px 30px rgba(24, 16, 48, 0.10);
}
.hero-stats dt { color: var(--dim); font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; }
.hero-stats dd {
  margin: 6px 0 0; font-family: var(--serif); font-size: clamp(30px, 3.4vw, 44px);
  background: linear-gradient(100deg, #ffffff 0%, var(--ice) 34%, var(--mint) 58%, var(--amethyst-2) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px rgba(94, 234, 212, 0.35));
}
.hero-quote {
  position: absolute; z-index: 3; right: clamp(20px, 6vw, 92px); bottom: 30px; margin: 0;
  font-family: var(--serif); font-style: italic; color: rgba(228, 220, 255, 0.66);
  font-size: 14px; text-align: right;
}

/* ------------------------------------------------------------------ catálogo */
.catalog { position: relative; padding: 10px clamp(18px, 5vw, 72px) 84px; scroll-margin-top: 90px; }
.catalog-emilia {
  position: absolute; right: -3vw; top: 18%; width: min(34vw, 520px); height: auto;
  opacity: 0.16; pointer-events: none; z-index: 0;
  filter: drop-shadow(0 0 60px rgba(157, 108, 255, 0.5));
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
}
.catalog > *:not(.catalog-emilia) { position: relative; z-index: 1; }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; flex-wrap: wrap;
  margin-bottom: 22px;
}
.card-kicker { margin: 0 0 8px; color: var(--ice); letter-spacing: 0.26em; font-size: 10px; font-weight: 700; }
.section-head h2 { margin: 0; font-family: var(--serif); font-size: clamp(28px, 3.6vw, 46px); font-weight: 600; }
.section-lead { margin: 8px 0 0; max-width: 560px; color: var(--muted); font-size: 13.5px;
  line-height: 1.6; }
.catalog-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.catalog-search select {
  appearance: none; padding: 10px 34px 10px 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: rgba(16, 12, 34, 0.8);
  color: var(--ink); font-size: 13px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ice) 50%),
    linear-gradient(135deg, var(--ice) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.year-rail {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 16px; scrollbar-width: thin;
}
.year-chip {
  flex: 0 0 auto; border: 1px solid var(--line); background: rgba(14, 11, 30, 0.7);
  color: var(--muted); border-radius: 999px; padding: 9px 15px; font-size: 12.5px;
  transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease;
}
.year-chip:hover { border-color: var(--line-strong); color: var(--ink); }
.year-chip.is-on {
  color: #12061f; border-color: transparent;
  background: linear-gradient(120deg, #ecfeff, #a7f3d0 30%, #d8b4fe 68%, #f9a8d4);
  box-shadow: 0 8px 26px rgba(168, 85, 247, 0.42);
}
.year-chip .count { opacity: 0.55; font-size: 10px; margin-left: 5px; }
.catalog-status { color: var(--dim); font-size: 13px; margin: 4px 0 18px; }
.anime-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px;
}
.anime-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(38, 20, 76, 0.40), rgba(12, 7, 28, 0.46)) padding-box,
    linear-gradient(140deg, rgba(94, 234, 212, 0.45), rgba(168, 85, 247, 0.35),
      rgba(249, 168, 212, 0.3)) border-box;
  box-shadow: 0 18px 50px rgba(3, 1, 18, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  transition: transform 220ms var(--ease-out, ease), border-color 220ms ease, box-shadow 220ms ease;
  transform-style: preserve-3d;
}
.anime-card::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0;
  background: radial-gradient(260px at var(--card-x, 50%) var(--card-y, 30%),
    rgba(255, 255, 255, 0.12), transparent 68%);
  transition: opacity 180ms ease;
}
.anime-card:hover::before { opacity: 1; }
.anime-card:hover {
  border-color: rgba(94, 234, 212, 0.55);
  box-shadow: 0 34px 80px rgba(3, 1, 18, 0.7), 0 0 44px rgba(168, 85, 247, 0.22),
    0 0 70px rgba(94, 234, 212, 0.12);
}
/* Póster 2:3 completo: la cabeza y la sinopsis nunca se recortan. */
.anime-cover { position: relative; aspect-ratio: 2 / 3; overflow: hidden; background: #120d26; }
.anime-cover img { width: 100%; height: 100%; object-fit: cover; object-position: center top;
  transition: transform 500ms cubic-bezier(.2,.7,.2,1); }
.anime-card:hover .anime-cover img { transform: scale(1.04); }
.anime-cover::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(10, 7, 24, 0.9));
}
.affinity-badge {
  position: absolute; z-index: 2; left: 14px; top: 14px;
  display: inline-flex; align-items: baseline; gap: 4px;
  padding: 7px 11px; border-radius: 999px; font-size: 12px; font-weight: 800;
  color: #07130f; background: linear-gradient(115deg, #ecfeff, #5eead4 42%, #d8b4fe 78%, #f9a8d4);
  box-shadow: 0 8px 24px rgba(94, 234, 212, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.35) inset;
}
.affinity-badge small { font-weight: 700; opacity: 0.7; font-size: 9px; }
.anime-body { display: flex; flex-direction: column; gap: 10px; padding: 18px 18px 20px; }
.anime-body h3 { margin: 0; font-family: var(--serif); font-size: 21px; line-height: 1.2; }
.anime-meta { margin: 0; color: var(--dim); font-size: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.anime-meta span { padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(157, 108, 255, 0.08); }
.anime-synopsis-wrap { display: grid; gap: 4px; }
.anime-synopsis {
  margin: 2px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.62;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; transition: -webkit-line-clamp 180ms ease;
}
.anime-synopsis.is-open { -webkit-line-clamp: unset; display: block; overflow: visible; }
.synopsis-toggle {
  justify-self: start; display: inline-flex; align-items: center; gap: 5px;
  border: 0; background: transparent; color: var(--ice); font-size: 12px; font-weight: 650;
  padding: 2px 0;
}
.synopsis-toggle .icon-chevron { width: 13px; height: 13px; transition: transform 180ms ease; }
.synopsis-toggle.is-open .icon-chevron { transform: rotate(180deg); }
.anime-meta .anime-score { display: inline-flex; align-items: center; gap: 4px; color: #ffe7a8;
  border-color: rgba(255, 214, 120, 0.3); background: rgba(255, 214, 120, 0.08); }
.anime-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.anime-actions > * {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: rgba(18, 13, 38, 0.85); color: var(--ink);
  border-radius: 10px; padding: 8px 11px; font-size: 12px; text-decoration: none;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}
.anime-actions > *:hover { border-color: var(--ice); transform: translateY(-1px); }
.anime-actions svg { width: 14px; height: 14px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.anime-actions .act-trailer svg { fill: currentColor; stroke: none; }
.anime-actions .act-source { color: var(--ice); border-color: rgba(167, 230, 255, 0.28); }
.anime-actions .act-trailer { border-color: rgba(255, 158, 203, 0.45); color: #ffd3e7; }
.anime-actions .act-tv { border-color: rgba(157, 108, 255, 0.55); color: #e5d7ff; }
.anime-actions .act-watched { border-color: rgba(120, 255, 190, 0.4); color: #c6ffe6; }
.anime-actions .act-watched.is-done { background: rgba(69, 214, 150, 0.16); border-color: rgba(120, 255, 190, 0.75); }
.anime-actions .act-tv.is-busy { opacity: 0.6; pointer-events: none; }
.anime-card.is-watched { opacity: 0.78; }
.card-enter { animation: card-rise 640ms cubic-bezier(.16, 1, .3, 1) both; }
@keyframes card-rise {
  from { opacity: 0; transform: translateY(28px) rotateX(6deg) scale(0.97); filter: blur(5px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

.news-block { margin-top: 42px; border-top: 1px solid var(--line); padding-top: 24px; }
.news-block h3 { margin: 0 0 12px; font-family: var(--serif); font-size: 24px; }
.news-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.news-list a {
  display: flex; gap: 10px; align-items: baseline; text-decoration: none; color: var(--muted);
  padding: 10px 12px; border-radius: 12px; border: 1px solid transparent; font-size: 13.5px;
}
.news-list a:hover { border-color: var(--line); background: rgba(157, 108, 255, 0.06); color: var(--ink); }
.news-source { color: var(--ice); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; flex: 0 0 auto; }
.empty-slot { color: var(--dim); font-size: 13px; }

/* ------------------------------------------------------------------ modo IA */
.hero-ai .hero-emilia {
  filter:
    drop-shadow(0 24px 30px rgba(8, 30, 70, 0.55))
    drop-shadow(0 4px 14px rgba(168, 85, 247, 0.12))
    saturate(1.05) contrast(1.03);
}
.ai-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px;
  padding: 10px clamp(18px, 5vw, 72px) 84px;
}
.card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(38, 20, 76, 0.38), rgba(14, 8, 32, 0.46)) padding-box,
    linear-gradient(140deg, rgba(94, 234, 212, 0.35), rgba(168, 85, 247, 0.28)) border-box;
  box-shadow: var(--shadow); padding: 24px; backdrop-filter: blur(14px) saturate(1.15);
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}
.ai-grid .card { border-top: 2px solid var(--mint); }
.ai-grid .card:nth-child(2) { border-top-color: var(--amethyst); }
.ai-grid .card:nth-child(3) { border-top-color: var(--emerald); }
.ai-grid .card:nth-child(4) { border-top-color: var(--rose); }
.ai-grid .card:hover { transform: translateY(-4px); border-color: var(--mint);
  box-shadow: 0 34px 80px rgba(3, 0, 18, 0.7), 0 0 40px rgba(94, 234, 212, 0.14); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.card-head h2 { margin: 0; font-family: var(--serif); font-size: clamp(24px, 2.4vw, 32px); font-weight: 600; }
.chip {
  flex: 0 0 auto; padding: 6px 11px; border-radius: 999px; font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.08em; color: #ffd9ec; border: 1px solid rgba(255, 158, 203, 0.4);
  background: rgba(255, 158, 203, 0.10);
}
.chip-ice { color: #d6f6ff; border-color: rgba(167, 230, 255, 0.4); background: rgba(167, 230, 255, 0.10); }
.paper-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 6px; }
.paper-list a { display: grid; gap: 6px; padding: 12px; border-radius: 14px; text-decoration: none;
  border: 1px solid transparent; }
.paper-list a:hover { border-color: var(--line); background: rgba(167, 230, 255, 0.05); }
.paper-title { font-weight: 650; font-size: 14.5px; }
.paper-summary { color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.paper-meta { color: var(--dim); font-size: 11px; }
.repo-list { display: grid; gap: 10px; margin-top: 18px; }
.repo-card { border: 1px solid var(--line); border-radius: 15px; padding: 15px; background: rgba(10, 8, 24, 0.38); }
.repo-card h3 { margin: 0 0 6px; font-size: 15px; }
.repo-card h3 a { text-decoration: none; }
.repo-card h3 a:hover { color: var(--ice); }
.repo-desc { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.repo-stats { display: flex; gap: 10px; margin-top: 8px; color: var(--dim); font-size: 11px; }
.repo-why { margin: 8px 0 0; color: var(--ice); font-size: 11.5px; }
.apis-note { color: var(--muted); font-size: 13px; line-height: 1.6; }
.platform-list { display: flex; flex-wrap: wrap; gap: 8px; }
.platform-list a {
  text-decoration: none; font-size: 12px; padding: 8px 12px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); background: rgba(14, 11, 30, 0.7);
}
.platform-list a:hover { border-color: var(--ice); color: var(--ink); }

/* ------------------------------------------------------------------ modal y toast */
.trailer-modal {
  width: min(980px, 94vw); border: 1px solid var(--line-strong); border-radius: 20px;
  background: #0b081b; color: var(--ink); padding: 16px; box-shadow: var(--shadow);
}
.trailer-modal::backdrop { background: rgba(3, 2, 10, 0.78); backdrop-filter: blur(6px); }
.trailer-modal header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.trailer-modal h2 { margin: 0; font-family: var(--serif); font-size: 24px; }
.trailer-frame { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.trailer-frame video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
.trailer-status {
  position: absolute; left: 14px; right: 14px; bottom: 14px; z-index: 2; margin: 0;
  padding: 9px 12px; border-radius: 10px; background: rgba(6, 4, 16, 0.82);
  color: var(--muted); font-size: 12px; line-height: 1.45; backdrop-filter: blur(6px);
}
.trailer-status:empty { display: none; }
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 60;
  max-width: min(680px, 92vw); padding: 13px 18px; border-radius: 14px;
  border: 1px solid var(--line-strong); background: rgba(15, 11, 32, 0.96);
  color: var(--ink); font-size: 13.5px; box-shadow: var(--shadow);
}
.toast.is-error { border-color: rgba(255, 120, 150, 0.55); color: #ffd6df; }

.glb-section { padding: 0 clamp(18px, 5vw, 72px) 84px; }
.glb-stage {
  position: relative; height: clamp(340px, 52vh, 560px); border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--line-strong);
  background:
    radial-gradient(720px 420px at 50% 30%, rgba(168, 85, 247, 0.18), transparent 70%),
    linear-gradient(180deg, rgba(16, 8, 36, 0.9), rgba(5, 3, 14, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), var(--shadow);
}
#glb-canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.glb-status {
  position: absolute; left: 16px; top: 16px; margin: 0; padding: 8px 12px;
  border-radius: 999px; background: rgba(6, 3, 16, 0.72); color: var(--muted);
  font-size: 12px; border: 1px solid var(--line);
}
.glb-hint {
  position: absolute; right: 16px; bottom: 14px; color: var(--dim); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
}

.portal-foot {
  position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; padding: 26px clamp(18px, 5vw, 72px); border-top: 1px solid var(--line);
  color: var(--dim); font-size: 12px;
}
.foot-glow { color: var(--amethyst-2); }

.reveal { opacity: 1; }
.reveal.is-in { animation: reveal-up 620ms cubic-bezier(.2,.7,.2,1) both; }
@keyframes reveal-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

@media (max-width: 1080px) {
  .hero-emilia-wrap { width: 74vw; opacity: 0.88; }
  .ai-grid { grid-template-columns: 1fr; }
  .catalog-emilia { display: none; }  /* decoración que desbordaba en horizontal */
}
/* Fase 31: modo IA visual con banners 16:9 y miniaturas reales */
.ai-repos { grid-column: 1 / -1; }
.repo-visual-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 14px; }
.repo-visual { display: flex; flex-direction: column; gap: 8px; }
.repo-banner { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); background: #0b1020; }
.paper-visual-list { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 14px; }
.paper-item { list-style: none; }
.paper-link { display: flex; flex-direction: column; gap: 6px; text-decoration: none; }
.paper-thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); background: #0b1020; }
.paper-title { font-weight: 650; line-height: 1.35; }
.paper-details summary { cursor: pointer; color: var(--mint); font-size: 12px; font-weight: 600; }
.news-visual-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 14px; }
.news-card { list-style: none; }
.news-link { display: flex; flex-direction: column; gap: 6px; text-decoration: none; }
.news-thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); background: #0b1020; }
.news-title { font-weight: 600; line-height: 1.35; }

/* Fase 31: Descubrimiento del Día · selección rotativa */
.daily-picks { padding: 34px clamp(14px, 4vw, 48px) 14px; }
#daily-picks { scroll-margin-top: 78px; }
.daily-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.daily-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; margin-top: 16px; }

@media (max-width: 760px) {
  .daily-picks { padding-left: 14px; padding-right: 14px; }
  .daily-grid { grid-template-columns: 1fr; gap: 14px; }
  .repo-visual-grid, .news-visual-grid { grid-template-columns: 1fr; }
  .portal-bar { gap: 6px; backdrop-filter: blur(14px) saturate(150%);
    -webkit-backdrop-filter: blur(14px) saturate(150%); }
  .brand-copy { display: none; }  /* en el celular basta el cristal para no robar ancho */
  .mode-btn { font-size: 10.5px; padding: 0 7px; gap: 4px; }
  .mode-btn svg { width: 12px; height: 12px; }
  .theme-btn { width: 30px; height: 30px; }
  .portal-nav { gap: 2px; }
  .portal-nav a { padding: 0 6px; font-size: 11px; }
  .hero { min-height: 0; padding-top: 24px; }
  .hero-emilia-wrap { position: relative; width: 100%; height: min(62vh, 430px); order: -1; margin-bottom: -20px;
    transform: none; }
  .hero-emilia { right: 50%; transform: translateX(50%); height: 108%; }
  .hero-emilia-back { right: 50%; transform: translateX(50%); height: 88%; opacity: 0.16; }
  .hero-specular { display: none; }
  .hero h1 { font-size: clamp(32px, 10vw, 50px); }
  .hero-quote { position: static; margin-top: 18px; text-align: left; }
  .anime-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .anime-card { min-width: 0; }
  .anime-body { padding: 12px 12px 14px; }
  .anime-body h3 { font-size: 15px; overflow-wrap: anywhere; }
  .anime-actions { gap: 6px; flex-wrap: wrap; }
  .anime-actions > * { padding: 7px 9px; font-size: 11px; }
  .catalog-emilia { display: none; }
  .catalog, .ai-grid { padding-left: 14px; padding-right: 14px; }
  .section-head h2 { font-size: clamp(24px, 7vw, 34px); }
}
@media (max-width: 430px) {
  .portal-brand { display: none; }  /* libera ~24px; el modo y la nav caben en una fila */
  .mode-long { display: none; }
  .mode-short { display: inline; }
  .mode-btn { font-size: 10.5px; padding: 0 6px; }
  .mode-btn svg { display: none; }
  .portal-bar { padding-left: 8px; padding-right: 8px; gap: 4px; }
  .portal-nav a { padding: 0 5px; }
  .anime-grid { grid-template-columns: 1fr; }
}

/* Tipografía y números: títulos equilibrados, cuerpo sin viudas y cifras tabulares. */
h1, h2, h3, .hero h1 { text-wrap: balance; }
p, .section-lead, .anime-synopsis, .paper-summary { text-wrap: pretty; }
.stat-value, .affinity-badge, .manga-score, .rank-chip, [data-counter] { font-variant-numeric: tabular-nums; }

/* Fase 31: cristal pizarra nocturno uniforme (sin tintes violeta sucios). */
:root:not([data-theme="light"]) .anime-card,
:root:not([data-theme="light"]) .manga-card,
:root:not([data-theme="light"]) .card,
:root:not([data-theme="light"]) .repo-card,
:root:not([data-theme="light"]) .news-card {
  background: linear-gradient(165deg, rgba(14, 21, 35, 0.76), rgba(8, 12, 22, 0.86));
  border: 1px solid rgba(94, 234, 212, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10), var(--shadow);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}
@media (max-width: 760px) {
  :root:not([data-theme="light"]) .anime-card,
  :root:not([data-theme="light"]) .manga-card,
  :root:not([data-theme="light"]) .card,
  :root:not([data-theme="light"]) .repo-card,
  :root:not([data-theme="light"]) .news-card {
    backdrop-filter: blur(12px) saturate(145%);
    -webkit-backdrop-filter: blur(12px) saturate(145%);
  }
}

/* ------------------------------------------------------------------ TEMA CLARO */
/* Modo claro exacto: Marfil Cálido Editorial + Aguamarina Pálido + Lavanda Seda. */
:root[data-theme="light"] body, body.theme-light {
  --bg: #faf8f5;
  --bg-2: #f6f1ea;
  --ink: #12101b;
  --muted: #4b4463;
  --dim: #6c6486;
  --ice: #0d9488;
  --ice-soft: rgba(13, 148, 136, 0.12);
  --mint: #0d9488;
  --amethyst: #9333ea;
  --amethyst-2: #6b21a8;
  --rose: #be185d;
  --cyan: #0284c7;
  --silver: #ffffff;
  --card: #ffffff;
  --line: rgba(109, 40, 217, 0.14);
  --line-strong: rgba(109, 40, 217, 0.26);
  background:
    radial-gradient(900px 620px at 10% -6%, rgba(45, 212, 191, 0.10), transparent 62%),
    radial-gradient(880px 640px at 96% 4%, rgba(147, 51, 234, 0.08), transparent 64%),
    radial-gradient(760px 520px at 46% 64%, rgba(45, 212, 191, 0.05), transparent 64%),
    var(--bg);
  color: var(--ink);
}
/* Partículas WebGL en modo claro: destellos de cristal, nunca manchas grises. */
:root[data-theme="light"] #ice-field, body.theme-light #ice-field { opacity: 0.35; }
:root[data-theme="light"] .hero::before, body.theme-light .hero::before {
  background:
    radial-gradient(900px 560px at 78% 38%, rgba(147, 51, 234, 0.08), transparent 65%),
    linear-gradient(90deg, rgba(250, 248, 245, 0.98) 0%, rgba(250, 248, 245, 0.92) 36%,
      rgba(250, 248, 245, 0.55) 58%, transparent 78%);
}
:root[data-theme="light"] .hero-ai::before, body.theme-light .hero-ai::before {
  background:
    radial-gradient(900px 560px at 78% 38%, rgba(2, 132, 199, 0.08), transparent 65%),
    linear-gradient(90deg, rgba(250, 248, 245, 0.98) 0%, rgba(250, 248, 245, 0.92) 36%,
      rgba(250, 248, 245, 0.55) 58%, transparent 78%);
}
:root[data-theme="light"] .hero-manga::before, body.theme-light .hero-manga::before {
  background:
    radial-gradient(900px 560px at 78% 38%, rgba(94, 234, 212, 0.10), transparent 65%),
    linear-gradient(90deg, rgba(250, 248, 245, 0.98) 0%, rgba(250, 248, 245, 0.92) 36%,
      rgba(250, 248, 245, 0.55) 58%, transparent 78%);
}
body.theme-light .portal-bar { background: rgba(255, 255, 255, 0.46); }
body.theme-light .mode-switch { background: rgba(255, 255, 255, 0.42); }
body.theme-light .mode-btn { color: var(--muted); }
body.theme-light .theme-btn { background: rgba(255, 255, 255, 0.42); color: #7c3aed; }
body.theme-light .hero::before {
  background:
    radial-gradient(900px 560px at 78% 38%, rgba(147, 51, 234, 0.08), transparent 65%),
    linear-gradient(90deg, rgba(250, 248, 245, 0.98) 0%, rgba(250, 248, 245, 0.92) 36%,
      rgba(250, 248, 245, 0.55) 58%, transparent 78%);
}
body.theme-light .hero-ai::before {
  background:
    radial-gradient(900px 560px at 78% 38%, rgba(2, 132, 199, 0.08), transparent 65%),
    linear-gradient(90deg, rgba(250, 248, 245, 0.98) 0%, rgba(250, 248, 245, 0.92) 36%,
      rgba(250, 248, 245, 0.55) 58%, transparent 78%);
}
body.theme-light .hero-manga::before {
  background:
    radial-gradient(900px 560px at 78% 38%, rgba(94, 234, 212, 0.10), transparent 65%),
    linear-gradient(90deg, rgba(250, 248, 245, 0.98) 0%, rgba(250, 248, 245, 0.92) 36%,
      rgba(250, 248, 245, 0.55) 58%, transparent 78%);
}
body.theme-light .hero h1 { text-shadow: 0 10px 40px rgba(90, 60, 130, 0.18); }
body.theme-light .hero h1 em {
  background: linear-gradient(100deg, #3b0764 0%, #7c3aed 34%, #0d9488 68%, #be185d 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
body.theme-light .hero-kicker { color: #0e7490; }
body.theme-light .hero-sub { color: var(--muted); }
body.theme-light .hero-emilia {
  filter: drop-shadow(0 26px 32px rgba(70, 40, 110, 0.22))
    drop-shadow(0 4px 16px rgba(13, 148, 136, 0.10)) saturate(1.05) contrast(1.02);
}
body.theme-light .hero-ai .hero-emilia {
  filter: drop-shadow(0 26px 32px rgba(20, 60, 90, 0.20))
    drop-shadow(0 4px 16px rgba(124, 58, 237, 0.10)) saturate(1.05) contrast(1.02);
}
body.theme-light .hero::after {
  background: linear-gradient(0deg, var(--bg) 0%, rgba(250, 248, 245, 0.94) 26%,
    rgba(250, 248, 245, 0.55) 58%, transparent 100%);
}
body.theme-light .hero-sequence { opacity: 0.45; mix-blend-mode: multiply; }
body.theme-light .hero-halo { opacity: 0.35; }
body.theme-light .hero-specular { mix-blend-mode: soft-light; opacity: 0.6; }
body.theme-light .hero-sub, body.theme-light .hero-stats dt, body.theme-light .hero-stats dd {
  color: var(--ink);
}
body.theme-light .hero-stats dd {
  background: linear-gradient(100deg, #3b0764, #7c3aed 40%, #0d9488 100%);
  -webkit-background-clip: text; background-clip: text;
}
body.theme-light .btn-ghost { background: rgba(255, 255, 255, 0.74); color: var(--ink); }
body.theme-light .anime-card, body.theme-light .card, body.theme-light .manga-card,
body.theme-light .news-card {
  background: rgba(255, 255, 255, 0.44);
  border: 1px solid rgba(109, 40, 217, 0.14);
  box-shadow: 0 12px 32px -8px rgba(24, 16, 48, 0.09);
}
body.theme-light .anime-body h3, body.theme-light .card-head h2 { color: #1a0d2e; }
body.theme-light .anime-meta span { background: rgba(124, 58, 237, 0.06); }
body.theme-light .anime-synopsis { color: #4b3568; }
body.theme-light .anime-actions > * { background: rgba(255, 255, 255, 0.86); color: #2a1746; }
body.theme-light .affinity-badge { color: #052e2b; }
body.theme-light .year-chip { background: rgba(255, 255, 255, 0.76); color: #4b3568; }
body.theme-light .catalog-status { color: #6b5a8a; }
body.theme-light .news-list a { color: #4b3568; }
body.theme-light .trailer-modal { background: #fbf8ff; color: #1a0d2e; }
body.theme-light .trailer-status { background: rgba(255, 255, 255, 0.9); color: #4b3568; }
body.theme-light .portal-foot { color: #6b5a8a; }
body.theme-light .toast { background: rgba(255, 255, 255, 0.96); color: #1a0d2e; }
body.theme-light .chip { color: #9d174d; background: rgba(190, 24, 93, 0.06); }
body.theme-light .chip-ice { color: #0e7490; background: rgba(14, 116, 144, 0.06); }
body.theme-light .platform-list a { background: rgba(255, 255, 255, 0.8); color: #4b3568; }
body.theme-light .repo-card { background: rgba(255, 255, 255, 0.8); }
body.theme-light .glb-stage {
  background:
    radial-gradient(720px 420px at 50% 30%, rgba(168, 85, 247, 0.12), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 238, 255, 0.98));
}
body.theme-light .glb-status { background: rgba(255, 255, 255, 0.9); color: #4b3568; }
body.theme-light .emilia-shine { mix-blend-mode: soft-light; opacity: 0.55; }
body.theme-light .hero-emilia { animation: emilia-float 8s ease-in-out infinite; }

/* ============================================================ FASE 31
   Pestañas de categoría, ranking dual, biblioteca de manga/manhwa/manhua y noticias visuales. */
.category-tabs {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px;
  margin: 22px 0 12px;
}
.category-tab {
  border: 1px solid var(--line-strong); background: rgba(13, 16, 28, 0.62);
  color: var(--muted); border-radius: 14px; padding: 11px 12px; font-size: 12px;
  font-weight: 650; line-height: 1.25; text-align: left; cursor: pointer;
  backdrop-filter: blur(14px);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease,
    color 160ms ease, box-shadow 160ms ease;
}
.category-tab:hover { color: var(--ink); transform: translateY(-1px); border-color: var(--ice); }
.category-tab[aria-selected="true"] {
  color: #0b0714; border-color: transparent;
  background: linear-gradient(120deg, #5eead4 0%, #f8fafc 52%, #e9d5ff 100%);
  box-shadow: 0 10px 28px rgba(94, 234, 212, 0.28);
}
.order-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.order-btn {
  border: 1px solid var(--line); background: rgba(13, 16, 28, 0.55); color: var(--muted);
  border-radius: 999px; padding: 8px 14px; font-size: 12px; font-weight: 650; cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}
.order-btn:hover { color: var(--ink); border-color: var(--line-strong); }
.order-btn.is-on {
  color: #0b0714; border-color: transparent;
  background: linear-gradient(110deg, #5eead4, #c4b5fd);
  box-shadow: 0 8px 22px rgba(94, 234, 212, 0.24);
}
.year-rail[hidden] { display: none; }
.category-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em;
  color: #052e2b; background: linear-gradient(110deg, #5eead4, #a7f3d0);
}
.prota-chip {
  display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 700; color: #e9d5ff; border: 1px solid rgba(147, 51, 234, 0.45);
  background: rgba(147, 51, 234, 0.12);
}
.rank-chip { font-size: 10px; font-weight: 800; letter-spacing: 0.08em; color: #fbbf24; }
.verdict {
  margin: 0; padding: 8px 10px; border-radius: 10px; font-size: 12px; line-height: 1.5;
  color: var(--muted); background: rgba(94, 234, 212, 0.06);
  border-left: 2px solid var(--ice);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; transition: -webkit-line-clamp 180ms ease;
}
.verdict.is-open { -webkit-line-clamp: unset; display: block; overflow: visible; }
.verdict-wrap { display: grid; gap: 2px; }
.verdict-toggle { margin-top: 0; }
.affinity-decimal { font-variant-numeric: tabular-nums; }

/* Hero de manga: misma Emilia, lectura en tinta. */
.hero-manga::before {
  background:
    radial-gradient(900px 560px at 78% 38%, rgba(94, 234, 212, 0.18), transparent 65%),
    linear-gradient(90deg, rgba(6, 8, 14, 0.95) 0%, rgba(6, 8, 14, 0.62) 46%, transparent 72%);
}
.shine-manga {
  background: linear-gradient(115deg, transparent 30%, rgba(94, 234, 212, 0.22) 48%,
    rgba(248, 250, 252, 0.18) 54%, transparent 70%);
}
.manga-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 18px;
  margin-top: 8px;
}
.manga-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  border-radius: var(--radius); border: 1px solid rgba(94, 234, 212, 0.18);
  background: var(--card); backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: var(--shadow);
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}
.manga-card:hover {
  transform: translateY(-4px); border-color: rgba(94, 234, 212, 0.5);
  box-shadow: 0 26px 70px rgba(3, 5, 12, 0.72), 0 0 30px rgba(94, 234, 212, 0.10);
}
.manga-cover { position: relative; aspect-ratio: 2 / 3; overflow: hidden; background: #0b1120; }
.manga-cover img {
  width: 100%; height: 100%; object-fit: cover; object-position: center top;
  transition: transform 500ms ease;
}
.manga-card:hover .manga-cover img { transform: scale(1.045); }
.manga-kind {
  position: absolute; left: 10px; top: 10px; padding: 4px 9px; border-radius: 999px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  color: #0b0714; background: linear-gradient(110deg, #f8fafc, #5eead4);
  box-shadow: 0 4px 14px rgba(3, 5, 12, 0.4);
}
.manga-score {
  position: absolute; right: 10px; top: 10px; padding: 5px 9px; border-radius: 12px;
  font-size: 13px; font-weight: 800; color: #0b0714;
  background: linear-gradient(120deg, #5eead4, #f8fafc);
  box-shadow: 0 8px 20px rgba(94, 234, 212, 0.35);
}
.manga-body { display: flex; flex-direction: column; gap: 9px; padding: 15px 15px 18px; }
.manga-body h3 { margin: 0; font-family: var(--serif); font-size: 19px; line-height: 1.2; }
.manga-meta { display: flex; flex-wrap: wrap; gap: 6px; color: var(--dim); font-size: 11.5px; }
.manga-synopsis {
  margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.manga-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.manga-actions > * {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; border-radius: 9px;
  border: 1px solid var(--line); background: rgba(9, 11, 20, 0.55); color: var(--muted);
  font-size: 11px; font-weight: 650; text-decoration: none; cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, transform 140ms ease;
}
.manga-actions > *:hover { border-color: var(--ice); color: var(--ink); transform: translateY(-1px); }
.manga-actions .act-read-done { color: #052e2b; background: linear-gradient(110deg, #5eead4, #a7f3d0); border-color: transparent; }

/* Noticias: tarjetas visuales 16:9, etiqueta de relevancia y resumen en español. */
.news-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.news-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; margin-top: 14px;
}
.news-card {
  display: flex; flex-direction: column; overflow: hidden; border-radius: 18px;
  border: 1px solid var(--line); background: var(--card);
  text-decoration: none; color: var(--ink);
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}
.news-card:hover { transform: translateY(-3px); border-color: var(--ice); box-shadow: 0 20px 50px rgba(3, 5, 12, 0.5); }
.news-thumb { aspect-ratio: 16 / 9; overflow: hidden; background: linear-gradient(135deg, #0b1120, #1b1030); }
.news-thumb img { width: 100%; height: 100%; object-fit: cover; }
.news-thumb.is-empty { display: grid; place-items: center; color: var(--dim); font-size: 12px; }
.news-card-body { display: flex; flex-direction: column; gap: 7px; padding: 14px; }
.news-label {
  align-self: flex-start; padding: 4px 9px; border-radius: 999px; font-size: 10px;
  font-weight: 800; letter-spacing: 0.04em; color: #052e2b;
  background: linear-gradient(110deg, #5eead4, #a7f3d0);
}
.news-card-body strong { font-size: 14px; line-height: 1.35; }
.news-summary { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.news-source-line { color: var(--dim); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; }

/* Repos: módulo de Aris y plan de integración. */
.repo-module {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 4px 9px;
  border-radius: 999px; font-size: 10.5px; font-weight: 800; color: #052e2b;
  background: linear-gradient(110deg, #5eead4, #e9d5ff);
}
.repo-plan { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.repo-plan strong { color: var(--ice); }

@media (max-width: 1080px) {
  .category-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .category-tabs { grid-template-columns: 1fr; }
  .manga-grid, .news-grid { grid-template-columns: 1fr; }
  .mode-btn { font-size: 11.5px; padding: 8px 11px; }
}
body.theme-light .category-tab { background: #ffffff; color: #4b4463; }
body.theme-light .category-tab[aria-selected="true"] { color: #0b0714; }
body.theme-light .order-btn { background: #ffffff; }
body.theme-light .manga-actions > * { background: #ffffff; color: #4b4463; }
body.theme-light .verdict { background: rgba(13, 148, 136, 0.06); color: #4b4463; }
.anime-cover .anime-rank {
  position: absolute; left: 10px; bottom: 10px; padding: 4px 8px; border-radius: 999px;
  background: rgba(6, 7, 13, 0.72); backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px rgba(3, 5, 12, 0.5); border: 1px solid rgba(251, 191, 36, 0.4);
}
.manga-card.is-watched { opacity: 0.82; }
.manga-meta .manga-affinity { color: var(--ice); border-color: rgba(94,234,212,0.4); background: rgba(94,234,212,0.08); }
.manga-card .act-read-done { color: #052e2b !important; }

/* =========================================================================================
   FASE 32 · DARK AERO GLASS en el portal (Windows 7 estilizado a 2026)
   ========================================================================================= */
.portal-bar, .card, .anime-card, .manga-card, .mode-switch, .portal-nav a,
.anime-actions > *, .manga-actions > *, .hero-stats > *, .news-card, .repo-card, .paper-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.04) 36%,
    rgba(10, 18, 34, 0.72) 36.5%, rgba(7, 13, 26, 0.85) 100%);
  backdrop-filter: blur(28px) saturate(190%) brightness(1.06);
  -webkit-backdrop-filter: blur(28px) saturate(190%) brightness(1.06);
  border: 1px solid rgba(125, 211, 252, 0.32);
  border-top: 1px solid rgba(255, 255, 255, 0.55);
  border-left: 1px solid rgba(255, 255, 255, 0.40);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 0 24px rgba(56, 189, 248, 0.14),
    0 20px 48px rgba(2, 6, 18, 0.72), 0 0 22px rgba(56, 189, 248, 0.12);
}
.portal-bar { border-bottom: 1px solid rgba(125, 211, 252, 0.32); }
.anime-actions > *:hover, .manga-actions > *:hover, .portal-nav a:hover {
  border-color: rgba(94, 234, 212, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 0 26px rgba(56, 189, 248, 0.30);
}
body.theme-light .portal-bar, body.theme-light .card, body.theme-light .anime-card,
body.theme-light .manga-card, body.theme-light .mode-switch, body.theme-light .portal-nav a,
body.theme-light .anime-actions > *, body.theme-light .manga-actions > *,
body.theme-light .hero-stats > *, body.theme-light .news-card,
body.theme-light .repo-card, body.theme-light .paper-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.46) 0%, rgba(255, 255, 255, 0.34) 40%,
    rgba(240, 248, 255, 0.38) 40.5%, rgba(248, 250, 252, 0.46) 100%);
  backdrop-filter: blur(24px) saturate(150%) brightness(1.02);
  -webkit-backdrop-filter: blur(24px) saturate(150%) brightness(1.02);
  border: 1px solid rgba(125, 211, 252, 0.52);
  border-top: 1px solid rgba(255, 255, 255, 0.98);
  border-left: 1px solid rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 1px 0 #ffffff, inset 0 0 24px rgba(56, 189, 248, 0.10),
    0 18px 40px rgba(24, 16, 48, 0.14), 0 0 20px rgba(56, 189, 248, 0.10);
}
.ui-sfx-toggle {
  width: 32px; height: 32px; border-radius: 50%; flex: 0 0 auto;
  border: 1px solid rgba(165, 243, 252, 0.38); background: rgba(10, 18, 34, 0.38);
  color: var(--ice); font: 700 14px/1 var(--mono); cursor: pointer;
  backdrop-filter: blur(18px) saturate(200%);
  transition: transform 120ms ease, border-color 120ms ease, opacity 120ms ease;
}
.ui-sfx-toggle:hover { transform: scale(1.06); border-color: var(--ice); }
.ui-sfx-toggle:active { transform: scale(0.94); }
.ui-sfx-toggle.is-muted { opacity: 0.55; }

/* Fase 33 · PV instantáneo: iframe oficial montado antes de cualquier descarga. */
.trailer-frame iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000;
}
#trailer-mp4 { position: absolute; top: 12px; right: 12px; z-index: 3; }
#trailer-mp4[hidden] { display: none; }

/* =========================================================================================
   FASE 34 · PV / Trailer 16:9 real en móvil y PC. El iframe y el video llenan el marco;
   nunca se quedan en su tamaño intrínseco ni con bandas laterales.
   ========================================================================================= */
.trailer-frame {
  position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 16px;
  overflow: hidden; background: #000;
}
/* #trailer-frame es el iframe oficial que crea portal.js; #trailer-video es el MP4 directo. */
.trailer-frame iframe, .trailer-frame video,
#trailer-frame, #trailer-video {
  position: absolute; inset: 0; width: 100% !important; height: 100% !important;
  border: 0; border-radius: 16px; object-fit: contain;
}
@media (max-width: 760px) {
  dialog.trailer-modal {
    width: min(96vw, 680px); padding: 14px; max-height: 92dvh; overflow: auto;
  }
  .trailer-frame, .trailer-frame iframe, .trailer-frame video { border-radius: 14px; }
  .trailer-modal h2 { font-size: 20px; }
}
/* El botón «Ver análisis ▾» conserva un área táctil de 40 px y no se solapa con los enlaces. */
.verdict-toggle { min-height: 40px; padding: 4px 2px; }
.verdict-toggle span { pointer-events: none; }
