:root {
    --paper: #f3e6c8;
    --paper-light: #fff8e7;
    --paper-deep: #e7d2a9;
    --ink: #171717;
    --ink-soft: #34302b;
    --red: #e92d35;
    --red-dark: #b91926;
    --blue: #174ea6;
    --blue-dark: #0d3479;
    --yellow: #f6c945;
    --white: #fffdf3;
    --line: 3px solid var(--ink);
    --shadow: 7px 8px 0 var(--ink);
    --display: "Bangers", Impact, sans-serif;
    --body: "Barlow Condensed", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: var(--body);
    font-size: 16px;
    overflow-x: hidden;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: .16;
    background-image: radial-gradient(var(--ink) .75px, transparent .85px);
    background-size: 5px 5px;
    mix-blend-mode: multiply;
}
button, input { font: inherit; }
button { cursor: pointer; border: 0; background: none; }
button:focus-visible, a:focus-visible, input:focus-visible {
    outline: 3px solid var(--red);
    outline-offset: 4px;
}
h1, h2, h3, .brand, .featured-caption b, .card-bottom h3, .timeline-anio,
.modal-copy h2, .modal-copy blockquote { font-family: var(--display); }

.noise {
    position: fixed; inset: 0; z-index: 50; pointer-events: none;
    opacity: .07; mix-blend-mode: multiply;
    background-image: radial-gradient(var(--ink) 1px, transparent 1px);
    background-size: 7px 7px;
}

/* Header */
.site-header {
    height: 78px; padding: 0 5vw; display: flex; align-items: center; justify-content: space-between;
    position: relative; z-index: 20; background: var(--paper-light); border-bottom: var(--line);
}
.brand {
    color: var(--ink); text-decoration: none; font-size: clamp(1.65rem, 3vw, 2.15rem);
    line-height: 1; letter-spacing: .04em; transform: rotate(-2deg);
    text-shadow: 3px 3px 0 var(--yellow);
}
.brand b { color: var(--red); }
.nav-links { display: flex; gap: clamp(1rem, 3vw, 2.6rem); }
.nav-links a {
    color: var(--ink); text-decoration: none; text-transform: uppercase;
    font-size: 1.02rem; font-weight: 800; letter-spacing: .08em; position: relative;
}
.nav-links a::after {
    content: ""; position: absolute; left: 0; right: 100%; bottom: -7px; height: 3px;
    background: var(--red); transition: right .2s ease;
}
.nav-links a:hover { color: var(--red); }
.nav-links a:hover::after { right: 0; }
.header-actions { display: flex; align-items: center; gap: .7rem; }
.vault-counter, .menu-button {
    min-height: 38px; padding: .42rem .72rem; color: var(--ink); background: var(--yellow);
    border: 2px solid var(--ink); border-radius: 2px; box-shadow: 3px 3px 0 var(--ink);
    font-weight: 900; text-transform: uppercase;
}
.vault-counter:hover, .menu-button:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.menu-button { display: none; font-size: 1.2rem; }

/* Hero */
.hero-stage {
    position: relative; min-height: 650px; padding: 5rem 5vw 4rem; display: flex; align-items: center;
    gap: 3vw; overflow: hidden; background-color: var(--blue); border-bottom: var(--line);
    isolation: isolate;
}
.hero-stage::before {
    content: ""; position: absolute; z-index: -1; width: 66vw; height: 140%; right: -20vw; top: -20%;
    background: var(--red); border-left: var(--line); transform: rotate(12deg);
    box-shadow: inset 18px 0 0 rgba(23,23,23,.12);
}
.stage-grid {
    position: absolute; inset: 0; z-index: -1; opacity: .2;
    background-image: linear-gradient(rgba(255,255,255,.55) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.55) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(90deg, #000, transparent 90%);
}
.hero-content { position: relative; z-index: 2; width: 57%; max-width: 700px; }
.kicker { display: flex; align-items: center; gap: .65rem; color: var(--yellow); font-size: .82rem; font-weight: 900; letter-spacing: .16em; text-shadow: 1px 1px 0 var(--ink); }
.kicker span { width: 32px; height: 3px; background: var(--yellow); box-shadow: 2px 2px 0 var(--ink); }
.hero-content h1 {
    max-width: 760px; margin: 1rem 0 1.2rem; color: var(--white); font-size: clamp(3.65rem, 7.2vw, 7.25rem);
    line-height: .84; letter-spacing: .01em; transform: rotate(-2.5deg); transform-origin: left;
    text-shadow: 5px 5px 0 var(--ink), 9px 9px 0 rgba(246,201,69,.9);
}
.hero-content h1 em { color: var(--yellow); font-style: normal; text-shadow: 4px 4px 0 var(--red), 7px 7px 0 var(--ink); }
.hero-content > p { max-width: 450px; margin: 0; color: var(--white); font-size: 1.18rem; font-weight: 600; line-height: 1.25; }
.hero-cta-row { display: flex; gap: .8rem; }
.primary-action {
    margin-top: 1.6rem; padding: .85rem 1.35rem; color: var(--white); background: var(--red);
    border: 2px solid var(--ink); border-radius: 2px; box-shadow: 5px 5px 0 var(--ink);
    font-size: 1.08rem; font-weight: 900; text-transform: uppercase; letter-spacing: .04em;
    transition: transform .16s ease, box-shadow .16s ease;
}
.primary-action:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.primary-action:active, .save-action:active, .vault-counter:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.hero-metrics { display: flex; gap: clamp(1.5rem, 4vw, 3.3rem); margin-top: 3.2rem; }
.hero-metrics > div { position: relative; }
.hero-metrics > div + div::before { content: ""; position: absolute; left: -1.55rem; top: 4px; height: 42px; border-left: 2px solid rgba(255,255,255,.45); transform: rotate(12deg); }
.hero-metrics b { display: block; color: var(--yellow); font-family: var(--display); font-size: 2.5rem; line-height: .9; text-shadow: 3px 3px 0 var(--ink); }
.hero-metrics span { color: var(--white); font-size: .76rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.featured-visual { position: relative; z-index: 2; width: 43%; display: flex; justify-content: center; align-items: center; perspective: 1200px; }
.orbit { position: absolute; border: 2px solid rgba(246,201,69,.7); border-radius: 50%; pointer-events: none; }
.orbit-a { width: min(440px, 95%); height: 190px; transform: rotate(-22deg); }
.orbit-b { width: min(360px, 80%); height: 145px; border-color: rgba(255,255,255,.65); transform: rotate(31deg); }
.featured-card {
    position: relative; width: min(300px, 80%); aspect-ratio: 280 / 380; background: var(--red);
    border: 3px solid var(--ink); border-radius: 3px; box-shadow: 12px 13px 0 var(--ink), inset 0 0 0 8px var(--yellow), inset 0 0 0 11px var(--ink);
    transform: rotateY(-12deg) rotateX(4deg) rotateZ(2deg); transform-style: preserve-3d;
    transition: transform .4s cubic-bezier(.23,1,.32,1); display: flex; flex-direction: column; overflow: visible;
}
.featured-visual:hover .featured-card { transform: rotateY(-3deg) rotateX(1deg) rotateZ(-1deg) translateY(-8px); }
.featured-canvas { flex: 1; width: 100%; min-height: 0; }
.featured-card .micro-label { position: absolute; top: 16px; left: 16px; z-index: 3; color: var(--white); font-size: .88rem; font-weight: 900; letter-spacing: .08em; text-shadow: 2px 2px 0 var(--ink); }
.featured-caption { position: absolute; z-index: 3; bottom: 14px; left: 16px; right: 16px; display: flex; align-items: end; justify-content: space-between; color: var(--white); text-shadow: 2px 2px 0 var(--ink); }
.featured-caption b { font-size: 1.7rem; }

/* Shared sections */
.destacados-section, .archive-section, .linea-tiempo-section { position: relative; padding: 6rem 5vw; border-bottom: var(--line); overflow: hidden; }
.destacados-section { background: var(--paper-light); }
.archive-section { background: var(--paper); }
.linea-tiempo-section { background: var(--yellow); }
.archive-section::before, .destacados-section::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .42;
    background-image: radial-gradient(var(--ink) .9px, transparent 1px); background-size: 9px 9px;
    mask-image: linear-gradient(120deg, #000, transparent 70%);
}
.archive-header { position: relative; z-index: 1; display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.eyebrow { color: var(--red); font-size: .82rem; font-weight: 900; letter-spacing: .16em; }
.archive-header h2 { margin: .3rem 0 0; font-size: clamp(2.7rem, 5vw, 4.7rem); line-height: .9; letter-spacing: .015em; text-shadow: 3px 3px 0 var(--white); transform: rotate(-1deg); }
.archive-header h2 em { color: var(--blue); font-style: normal; text-shadow: 3px 3px 0 var(--red); }
.archive-meta { font-size: .9rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }

/* Favorites */
.grid-destacados { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 2.4rem; }
.escena-3d { position: relative; aspect-ratio: 3 / 4; overflow: hidden; cursor: pointer; background: var(--blue); border: var(--line); box-shadow: var(--shadow); }
.escena-3d canvas { display: block; width: 100%; height: 100%; }
.escena-3d .escena-nombre { position: absolute; left: 0; right: 0; bottom: 0; padding: .65rem .8rem; color: var(--white); background: rgba(23,23,23,.9); border-top: 2px solid var(--ink); font-family: var(--display); font-size: 1.45rem; letter-spacing: .03em; text-align: center; }
.escena-3d:hover { transform: translate(-2px, -3px) rotate(-1deg); box-shadow: 10px 11px 0 var(--ink); }
.escena-3d img { position: absolute; inset: 0 0 48px; width: 100%; height: calc(100% - 48px); object-fit: contain; padding: 1rem; }
.escena-vacia { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; padding: 1.5rem; color: var(--ink); background: transparent; border-style: dashed; box-shadow: none; text-align: center; }
.escena-vacia:hover { box-shadow: none; transform: translateY(-3px); background: rgba(246,201,69,.25); }
.escena-vacia span { color: var(--red); font-family: var(--display); font-size: 5rem; line-height: .7; }
.escena-vacia p { max-width: 16ch; margin: 0; font-size: 1.05rem; font-weight: 700; }

/* Archive controls */
.control-bar { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1.2rem; margin: 2.5rem 0 1.8rem; }
.filter-pills { display: flex; flex-wrap: wrap; gap: .55rem; }
.filter-pills button { padding: .45rem .85rem; color: var(--ink); background: var(--paper-light); border: 2px solid var(--ink); border-radius: 2px; box-shadow: 3px 3px 0 var(--ink); font-weight: 900; }
.filter-pills button:hover { background: var(--yellow); transform: translate(-1px, -1px); }
.filter-pills button.active { color: var(--white); background: var(--blue); }
.search-box { display: flex; align-items: center; gap: .55rem; min-width: 245px; padding: .5rem .75rem; background: var(--paper-light); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); font-size: 1.1rem; }
.search-box:focus-within { box-shadow: 5px 5px 0 var(--red); }
.search-box input { flex: 1; min-width: 0; color: var(--ink); background: transparent; border: 0; outline: 0; font-size: 1rem; font-weight: 600; }
.search-box input::placeholder { color: #6d6558; }

/* Character cards: preserve layered 3D system */
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2rem 1.55rem; }
.hero-card { perspective: 1000px; cursor: pointer; min-width: 0; }
.card-face { position: relative; height: 340px; overflow: hidden; background: #0d0d0f; border: 3px solid #cfd3d8; border-radius: 14px; box-shadow: 0 0 0 1px var(--ink), 7px 8px 0 var(--ink); transition: transform .3s cubic-bezier(.23,1,.32,1), box-shadow .3s ease; }
.hero-card:hover .card-face { transform: rotateX(3deg) rotateY(-4deg) translateY(-6px); box-shadow: 0 0 0 1px var(--ink), 10px 12px 0 var(--ink); }
.card-face canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.figure-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; width: 96px; height: 96px; margin: auto; color: var(--white); border: 3px solid var(--ink); border-radius: 50%; font-family: var(--display); font-size: 2.5rem; }
.card-vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 50% 30%, transparent 35%, rgba(0,0,0,.72) 100%); }
.card-ribbon { position: absolute; top: 14px; left: 50%; padding: .22rem .8rem; color: var(--yellow); background: linear-gradient(#3a3f47, #1c1f24); border: 1px solid #777; font-size: .7rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; transform: translateX(-50%) skewX(-8deg); }
.card-fav { position: absolute; top: 12px; right: 14px; color: var(--white); text-shadow: 0 1px 3px #000; font-size: 1.25rem; }
.card-bottom { position: absolute; left: 0; right: 0; bottom: 22px; z-index: 1; padding: 0 .6rem; text-align: center; }
.card-bottom h3 { margin: 0; color: var(--white); font-size: 1.8rem; line-height: 1; -webkit-text-stroke: 1.5px var(--ink); text-shadow: 0 3px 0 var(--ink); }
.card-bottom p { margin: .22rem 0 0; color: #f2f2f2; font-size: .82rem; font-weight: 700; font-style: italic; text-shadow: 0 1px 3px #000; }
.card-bottom .card-ribbon { position: static; display: inline-block; margin-top: .38rem; transform: skewX(-8deg); }
.card-footer { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; height: 22px; padding: 0 .7rem; color: #c9c9c9; background: rgba(0,0,0,.6); font-size: .65rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.empty-state { position: relative; z-index: 1; margin-top: 1rem; padding: 3rem; border: 2px dashed var(--ink); text-align: center; }
.empty-state h3 { margin: 0; font-size: 2rem; }
.empty-state p { font-weight: 600; }
.empty-state button { margin-top: 1rem; padding: .55rem 1rem; background: var(--paper-light); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); font-weight: 900; }

/* Timeline */

/* Footer */
.indicia { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .7rem 2rem; padding: 1.2rem 5vw; color: var(--white); background: var(--ink); font-size: .75rem; font-weight: 700; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 1.5rem; background: rgba(23,23,23,.78); backdrop-filter: blur(3px); }
.modal-backdrop[hidden] { display: none; }
.hero-modal { position: relative; display: grid; grid-template-columns: 42% 58%; grid-template-rows: min(560px, 78vh); width: min(920px, 100%); max-height: 90vh; overflow: hidden; background: var(--paper-light); border: var(--line); box-shadow: 13px 14px 0 var(--ink); }
.close-button { position: absolute; top: 12px; right: 12px; z-index: 5; width: 36px; height: 36px; color: var(--white); background: var(--red); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); font-weight: 900; }
.close-button:hover { transform: rotate(5deg) scale(1.05); }
.modal-art { position: relative; display: flex; align-items: center; justify-content: center; height: 100%; overflow: hidden; background: var(--blue); border-right: var(--line); }
.modal-art::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at center, transparent 25%, rgba(0,0,0,.35)); }
.modal-grid { position: absolute; inset: 0; opacity: .22; background-image: linear-gradient(rgba(255,255,255,.7) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.7) 1px, transparent 1px); background-size: 24px 24px; }
.modal-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.modal-rarity, .modal-code { position: absolute; z-index: 2; color: var(--white); font-family: var(--display); font-size: 1.15rem; text-shadow: 2px 2px 0 var(--ink); }
.modal-rarity { top: 16px; left: 16px; }
.modal-code { bottom: 16px; left: 16px; }
.modal-copy { height: 100%; padding: 2.8rem 2rem 2rem; overflow-y: auto; }
.modal-copy h2 { margin: .3rem 0 0; color: var(--ink); font-size: 3.2rem; line-height: .9; text-shadow: 3px 3px 0 var(--yellow); }
.modal-copy h3 { margin: .35rem 0 0; color: var(--blue); font-size: 1.15rem; }
.hero-bio { margin: 1rem 0; font-size: .98rem; line-height: 1.25; }
.modal-copy blockquote { margin: 0 0 1rem; padding-left: .85rem; color: var(--blue); border-left: 5px solid var(--red); font-size: 1.28rem; line-height: 1.05; }
.fact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem 1rem; padding: .8rem 0; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
.fact-item span, .lore-block span { display: block; color: var(--red); font-size: .7rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.fact-item b { font-size: .9rem; line-height: 1.05; }
.lore-block { margin-top: 1rem; }
.lore-block p { margin: .3rem 0 0; font-size: .9rem; line-height: 1.2; }
.stats { display: grid; gap: .5rem; margin-top: 1rem; }
.stat-row { display: grid; grid-template-columns: 80px 1fr 30px; align-items: center; gap: .6rem; font-size: .8rem; font-weight: 800; }
.stat-track { height: 8px; overflow: hidden; background: var(--paper-deep); border: 1px solid var(--ink); border-radius: 0; }
.stat-track i { display: block; height: 100%; background: var(--blue); }
.modal-actions { display: flex; gap: .7rem; margin-top: 1.3rem; }
.modal-actions .primary-action { margin-top: 0; }
.save-action { padding: .72rem 1rem; color: var(--ink); background: var(--yellow); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); font-weight: 900; }
.save-action:hover { background: var(--red); color: var(--white); }
.save-action.selected { color: var(--white); background: var(--red); }

/* Layered card art: do not remove translateZ or clip-path */
.capa-arte { position: absolute; left: 50%; bottom: 13%; height: 100%; aspect-ratio: 922 / 991; transform: translateX(-50%); pointer-events: none; }
.capa-arte img { display: block; width: 100%; height: 100%; user-select: none; transition: transform .5s cubic-bezier(.23,1,.32,1); }
.capa-fondo img { filter: saturate(.9) brightness(.8); -webkit-mask-image: linear-gradient(#000 68%, transparent); mask-image: linear-gradient(#000 68%, transparent); }
.capa-pop { position: absolute; inset: 0; pointer-events: none; clip-path: inset(-30% 3px 3px 3px round 0 0 14px 14px); }
.capa-pop img { filter: drop-shadow(0 14px 12px rgba(0,0,0,.6)); }
.hero-card.carta2d .card-tilt { position: relative; height: 340px; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.23,1,.32,1); }
.hero-card.carta2d .card-face { position: absolute; inset: 0; height: auto; background: linear-gradient(#0d0d0f 60%, #3a2412 88%, #0d0d0f); }
.hero-card.carta2d:hover .card-face { transform: none; }
.hero-card.carta2d .capa-pop { transform: translateZ(20px) scale(.98); }
.hero-card.carta2d .card-encima { position: absolute; inset: 3px; border-radius: 13px; transform: translateZ(30px) scale(.97); pointer-events: none; }
.hero-card.carta2d .card-footer { border-radius: 0 0 13px 13px; }
.hero-card.carta2d.activa .card-tilt, .hero-card.carta2d.activa .capa-arte img { transition: transform .08s linear; }
.brillo { position: absolute; inset: 0; border-radius: 13px; opacity: 0; transition: opacity .3s; mix-blend-mode: color-dodge; background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255,255,255,.35), transparent 45%), linear-gradient(115deg, transparent 25%, rgba(255,80,120,.18) 40%, rgba(80,200,255,.18) 50%, rgba(255,230,90,.16) 60%, transparent 75%); background-size: 100% 100%, 250% 250%; background-position: 0 0, var(--gx, 50%) var(--gy, 50%); }
.hero-card.carta2d.activa .brillo { opacity: 1; }
.destacado-fondo { position: absolute; inset: 11px; z-index: 0; overflow: hidden; background: linear-gradient(#0d0d0f 60%, #3a2412 88%, #0d0d0f); }
.featured-card .capa-pop { inset: 11px; z-index: 1; clip-path: inset(-30% 0 0 0); }
.featured-card.con-carta2d .micro-label, .featured-card.con-carta2d .featured-caption { z-index: 2; }
.featured-card.con-carta2d .micro-label { color: var(--white); text-shadow: 2px 2px 0 var(--ink); }

/* Responsive */
@media (max-width: 900px) {
    .hero-stage { flex-direction: column; padding-top: 4rem; text-align: center; }
    .hero-content, .featured-visual { width: 100%; max-width: 720px; }
    .hero-content { padding-bottom: 1.5rem; }
    .kicker, .hero-metrics, .hero-cta-row { justify-content: center; }
    .hero-content h1 { transform: rotate(-1.5deg); transform-origin: center; }
    .featured-visual { min-height: 400px; }
    .grid-destacados { gap: 1rem; }
    .hero-modal { grid-template-columns: 1fr; grid-template-rows: 320px auto; max-height: 90vh; overflow-y: auto; }
    .modal-art { border-right: 0; border-bottom: var(--line); }
    .modal-copy { height: auto; overflow-y: visible; }
}
@media (max-width: 640px) {
    .site-header { height: 68px; padding: 0 4vw; }
    .brand { font-size: 1.7rem; }
    .nav-links { display: none; position: absolute; top: 68px; left: 0; right: 0; padding: 1.3rem 5vw 1.5rem; flex-direction: column; gap: 1rem; background: var(--paper-light); border-bottom: var(--line); box-shadow: 0 5px 0 var(--ink); }
    .nav-links.is-open { display: flex; }
    .menu-button { display: block; }
    .hero-stage { min-height: auto; padding: 3.5rem 5vw 3rem; }
    .hero-content h1 { font-size: clamp(3.2rem, 16vw, 5rem); }
    .hero-content > p { font-size: 1.05rem; }
    .hero-metrics { gap: 1rem; justify-content: space-between; }
    .hero-metrics > div + div::before { left: -.55rem; }
    .hero-metrics b { font-size: 1.9rem; }
    .hero-metrics span { font-size: .63rem; }
    .featured-visual { min-height: 360px; }
    .featured-card { width: 235px; }
    .destacados-section, .archive-section, .linea-tiempo-section { padding: 4rem 5vw; }
    .grid-destacados { grid-template-columns: 1fr; max-width: 270px; margin-left: auto; margin-right: auto; }
    .control-bar { align-items: stretch; }
    .filter-pills, .search-box { width: 100%; }
    .search-box { min-width: 0; }
    .hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem .85rem; }
    .card-face, .hero-card.carta2d .card-tilt { height: 270px; }
    .card-bottom h3 { font-size: 1.36rem; }
    .card-bottom p { font-size: .7rem; }
    .card-ribbon { font-size: .57rem; }
    .card-footer { padding: 0 .45rem; font-size: .52rem; }
    .fact-grid { grid-template-columns: 1fr; }
    .modal-copy { padding: 2.4rem 1.25rem 1.5rem; }
    .modal-copy h2 { font-size: 2.65rem; }
    .modal-actions { flex-wrap: wrap; }
    .modal-actions > button { flex: 1 1 140px; }
    .indicia { padding: 1rem 5vw; font-size: .67rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
    .hero-card.carta2d .card-tilt, .capa-arte img { transition: none; }
}

/* ===== Línea del tiempo: Historia del Universo ===== */
#linea-tiempo {
    position: relative;
    overflow: hidden;
    padding: clamp(4.5rem, 8vw, 7rem) 5vw;
    background:
        radial-gradient(circle at 12% 18%, rgba(23, 23, 23, .18) 0 1px, transparent 1.5px),
        radial-gradient(circle at 82% 72%, rgba(23, 23, 23, .14) 0 1px, transparent 1.5px),
        var(--yellow);
    background-size: 9px 9px, 13px 13px, auto;
    border-bottom: 3px solid var(--ink);
}
#linea-tiempo::before {
    content: "MARVEL";
    position: absolute; top: 4rem; right: -2rem;
    color: rgba(23, 23, 23, .08);
    font-family: "Bangers", cursive;
    font-size: clamp(7rem, 18vw, 16rem);
    line-height: .8; letter-spacing: .04em;
    transform: rotate(-10deg);
    pointer-events: none;
}
#linea-tiempo .archive-header { position: relative; z-index: 2; max-width: 1180px; margin: 0 auto; }
#linea-tiempo .archive-header h2 { font-size: clamp(3rem, 7vw, 6.5rem); line-height: .84; transform: rotate(-2deg); }
#linea-tiempo .archive-header h2 em { color: var(--blue); text-shadow: 4px 4px 0 var(--red); }

#linea-tiempo .timeline {
    position: relative; z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 92px minmax(0, 1fr);
    gap: 0 2.5rem;
    max-width: 1240px;
    margin: clamp(3.5rem, 7vw, 6rem) auto 0;
    padding: 0;
    list-style: none;
}
#linea-tiempo .timeline::before {
    content: "";
    position: absolute; top: 0; bottom: 0; left: 50%;
    width: 7px;
    background: var(--ink);
    border: 1px solid var(--ink);
    transform: translateX(-50%);
    box-shadow: 3px 0 0 rgba(255, 253, 243, .55);
}

/* Cada evento en su propio renglón y encimados a la mitad para el zigzag escalonado */
#linea-tiempo .timeline-evento {
    position: relative;
    display: flex; align-items: center;
    min-height: 230px;
    margin: 0; padding: 0; background: none; border: 0; box-shadow: none;
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .55s ease, transform .55s cubic-bezier(.23, 1, .32, 1);
}
#linea-tiempo .timeline-evento + .timeline-evento { margin-top: -115px; }
#linea-tiempo .timeline-evento::before { content: none; }
#linea-tiempo .timeline-evento.is-visible { opacity: 1; transform: translateY(0); }

#linea-tiempo .timeline-evento:nth-child(odd) { grid-column: 1; justify-content: flex-end; padding-right: 1rem; }
#linea-tiempo .timeline-evento:nth-child(even) { grid-column: 3; justify-content: flex-start; padding-left: 1rem; }

#linea-tiempo .timeline-evento:nth-child(odd) .timeline-card { transform: rotate(-1.7deg); }
#linea-tiempo .timeline-evento:nth-child(even) .timeline-card { transform: rotate(1.7deg); }
#linea-tiempo .timeline-evento:nth-child(odd) .timeline-card:hover { transform: rotate(-1.7deg) translateY(-7px); }
#linea-tiempo .timeline-evento:nth-child(even) .timeline-card:hover { transform: rotate(1.7deg) translateY(-7px); }

#linea-tiempo .timeline-card {
    position: relative;
    width: min(100%, 510px);
    min-height: 205px;
    padding: 1.45rem 1.6rem 1.35rem;
    overflow: hidden;
    background: var(--paper-light, #fff8e7);
    border: 3px solid var(--ink);
    box-shadow: 9px 10px 0 var(--ink);
    transition: transform .2s ease, box-shadow .2s ease;
}
#linea-tiempo .timeline-card::before {
    content: "";
    position: absolute; inset: 0;
    opacity: .3; pointer-events: none;
    background-image: radial-gradient(var(--ink) .8px, transparent .9px);
    background-size: 7px 7px;
    -webkit-mask-image: linear-gradient(135deg, #000, transparent 75%);
    mask-image: linear-gradient(135deg, #000, transparent 75%);
}
#linea-tiempo .timeline-card::after {
    content: "";
    position: absolute; top: -20px; right: -26px;
    width: 120px; height: 70px;
    background: var(--red);
    border: 3px solid var(--ink);
    transform: rotate(35deg);
    opacity: .9;
}
#linea-tiempo .timeline-anio {
    position: relative; z-index: 1;
    display: block;
    margin: -.2rem 0 .25rem;
    color: var(--red);
    font-family: "Bangers", cursive;
    font-size: clamp(3.1rem, 5vw, 5.4rem);
    line-height: .78; letter-spacing: .02em;
    text-shadow: 4px 4px 0 var(--yellow), 6px 6px 0 var(--ink);
    transform: rotate(-2deg);
}
#linea-tiempo .timeline-evento:nth-child(even) .timeline-anio {
    color: var(--blue);
    text-shadow: 4px 4px 0 var(--red), 6px 6px 0 var(--ink);
    transform: rotate(2deg);
}
#linea-tiempo .timeline-card h3 {
    position: relative; z-index: 1;
    margin: .75rem 0 .35rem;
    color: var(--ink);
    font-family: "Bangers", cursive;
    font-size: clamp(1.8rem, 3vw, 2.65rem);
    line-height: .9; letter-spacing: .025em;
}
#linea-tiempo .timeline-card p {
    position: relative; z-index: 1;
    max-width: 48ch; margin: 0;
    color: var(--ink-soft, #34302b);
    font-family: "Barlow Condensed", sans-serif;
    font-size: clamp(1rem, 1.5vw, 1.16rem);
    font-weight: 600; line-height: 1.22;
}

/* Marcador: centrado sobre la línea central (no sobre la tarjeta) */
#linea-tiempo .timeline-marker {
    position: absolute; z-index: 4; top: 50%;
    display: grid; place-items: center;
    width: 68px; height: 68px;
    color: var(--ink);
    background-color: var(--red);
    background-image: radial-gradient(var(--yellow) 1.5px, transparent 1.7px);
    background-size: 8px 8px;
    border: 4px solid var(--ink);
    border-radius: 50%;
    box-shadow: 4px 4px 0 var(--ink);
    font-family: "Bangers", cursive;
    font-size: 1.55rem; line-height: 1;
    transform: translate(-50%, -50%) rotate(-8deg);
}
#linea-tiempo .timeline-marker b { font-weight: 400; }
#linea-tiempo .timeline-evento:nth-child(odd) .timeline-marker { left: calc(100% + 2.5rem + 46px); }
#linea-tiempo .timeline-evento:nth-child(even) .timeline-marker {
    left: calc(-2.5rem - 46px);
    background-color: var(--blue);
    color: var(--yellow);
    transform: translate(-50%, -50%) rotate(8deg);
}
#linea-tiempo .timeline-marker::before {
    content: "";
    position: absolute; inset: -10px;
    border: 2px dashed var(--ink);
    border-radius: 50%;
    transform: rotate(18deg);
}
#linea-tiempo .timeline-evento:nth-child(3) .timeline-marker::after,
#linea-tiempo .timeline-evento:nth-child(5) .timeline-marker::after {
    content: "POW!";
    position: absolute; top: -23px; right: -42px;
    padding: .18rem .35rem;
    color: var(--ink);
    background: var(--yellow);
    border: 2px solid var(--ink);
    font-family: "Bangers", cursive;
    font-size: .95rem;
    transform: rotate(12deg);
}
/* Evento 4: marcador en rombo, con el número derecho */
#linea-tiempo .timeline-evento:nth-child(4) .timeline-marker { border-radius: 8px; transform: translate(-50%, -50%) rotate(45deg); }
#linea-tiempo .timeline-evento:nth-child(4) .timeline-marker b { transform: rotate(-45deg); }
#linea-tiempo .timeline-evento:nth-child(4) .timeline-marker::before { transform: rotate(-45deg); }

@media (max-width: 900px) {
    #linea-tiempo .timeline { grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1fr); gap: 0 1rem; }
    #linea-tiempo .timeline-card { padding: 1.2rem 1.25rem; }
    #linea-tiempo .timeline-marker { width: 58px; height: 58px; font-size: 1.25rem; }
    #linea-tiempo .timeline-evento:nth-child(odd) .timeline-marker { left: calc(100% + 1rem + 36px); }
    #linea-tiempo .timeline-evento:nth-child(even) .timeline-marker { left: calc(-1rem - 36px); }
}

@media (max-width: 700px) {
    #linea-tiempo { padding-right: 5vw; padding-left: 5vw; }
    #linea-tiempo::before { top: 10rem; right: -2rem; font-size: 8rem; }
    #linea-tiempo .timeline { display: block; margin-top: 3.5rem; padding-left: 3.2rem; }
    #linea-tiempo .timeline::before { left: .8rem; width: 6px; transform: none; }
    #linea-tiempo .timeline-evento,
    #linea-tiempo .timeline-evento + .timeline-evento,
    #linea-tiempo .timeline-evento:nth-child(odd),
    #linea-tiempo .timeline-evento:nth-child(even) {
        display: block; min-height: 0; margin: 0 0 2.4rem; padding: 0;
    }
    #linea-tiempo .timeline-card,
    #linea-tiempo .timeline-evento:nth-child(odd) .timeline-card,
    #linea-tiempo .timeline-evento:nth-child(even) .timeline-card { width: 100%; transform: rotate(0); }
    #linea-tiempo .timeline-card:hover,
    #linea-tiempo .timeline-evento:nth-child(odd) .timeline-card:hover,
    #linea-tiempo .timeline-evento:nth-child(even) .timeline-card:hover { transform: translateY(-5px); }
    #linea-tiempo .timeline-marker,
    #linea-tiempo .timeline-evento:nth-child(odd) .timeline-marker,
    #linea-tiempo .timeline-evento:nth-child(even) .timeline-marker {
        top: 2.25rem; left: -2.4rem; width: 52px; height: 52px;
        transform: translate(-50%, -50%) rotate(-8deg);
    }
    #linea-tiempo .timeline-evento:nth-child(even) .timeline-marker { transform: translate(-50%, -50%) rotate(8deg); }
    #linea-tiempo .timeline-evento:nth-child(4) .timeline-marker { transform: translate(-50%, -50%) rotate(45deg); }
    #linea-tiempo .timeline-anio { font-size: clamp(3rem, 15vw, 4.5rem); }
    #linea-tiempo .timeline-card h3 { font-size: 2rem; }
    #linea-tiempo .timeline-card p { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
    #linea-tiempo .timeline-evento { opacity: 1; transform: none; transition: none; }
    #linea-tiempo .timeline-card,
    #linea-tiempo .timeline-evento:nth-child(odd) .timeline-card,
    #linea-tiempo .timeline-evento:nth-child(even) .timeline-card { transition: none; }
}

/* Degradado detrás del nombre en tarjetas 2D (para que se lea sobre el personaje) */
.hero-card.carta2d .card-encima::before {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 38%;
    border-radius: 0 0 13px 13px; background: linear-gradient(transparent, rgba(0,0,0,.8) 70%);
}
.hero-card.carta2d .card-bottom { z-index: 1; }
