@font-face {
    font-family: 'portal';
    src: url(./fonts/portal.ttf);
}

/* ============================================================
   OKUPAS — Estética grunge / street-art
   ============================================================ */

:root {
    --red: #E01111;
    --red-deep: #8B0000;
    --red-dark: #3a0707;
    --red-glow: rgba(224, 17, 17, 0.55);
    --bg: #0b0b0c;
    --bg-2: #121214;
    --panel: #161111;
    --panel-2: #1d1414;
    --line: #2e1d1d;
    --text: #f2ece7;
    --muted: #9d918a;
    --font-title: 'Archivo Black', 'portal', system-ui, sans-serif;
    --font-accent: 'Special Elite', 'Courier New', monospace;
    --font-body: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(139, 0, 0, 0.25), transparent 60%),
        repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, 0.012) 3px 4px);
    color: var(--text);
    line-height: 1.6;
}

::selection {
    background: var(--red);
    color: #fff;
}

/* ============================================================
   HERO
   ============================================================ */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 42%, rgba(224, 17, 17, 0.18), transparent 55%),
        radial-gradient(circle at 15% 85%, rgba(139, 0, 0, 0.22), transparent 45%),
        linear-gradient(180deg, #0d0b0b 0%, #0a0a0b 100%);
    padding: 80px 20px;
}

/* Ruido de grano */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
    pointer-events: none;
}

/* Franjas de peligro en la base */
.hero::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 22px;
    background: repeating-linear-gradient(
        -45deg,
        var(--red) 0 22px,
        var(--bg) 22px 44px
    );
    opacity: 0.85;
}

.hero-kicker {
    font-family: var(--font-accent);
    letter-spacing: 0.5em;
    text-transform: uppercase;
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 24px;
    padding: 6px 16px;
    border: 1px dashed var(--line);
    background: rgba(0, 0, 0, 0.35);
}

.hero-title {
    font-family: var(--font-title);
    font-size: clamp(4.5rem, 20vw, 15rem);
    line-height: 0.9;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--red);
    text-shadow:
        3px 3px 0 #000,
        6px 6px 0 rgba(0, 0, 0, 0.6),
        0 0 42px var(--red-glow);
    animation: flicker 5s linear infinite;
    user-select: none;
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    3%  { opacity: 0.85; }
    4%  { opacity: 1; }
    37% { opacity: 1; }
    38% { opacity: 0.75; }
    39% { opacity: 1; }
    62% { opacity: 1; }
    63% { opacity: 0.9; }
    64% { opacity: 1; }
    91% { opacity: 1; }
    92% { opacity: 0.8; }
    93% { opacity: 1; }
}

.hero-subtitle {
    font-family: var(--font-accent);
    color: #cfc4bd;
    font-size: clamp(1rem, 2.6vw, 1.4rem);
    letter-spacing: 0.08em;
    margin: 26px 0 60px;
}

.scroll-hint {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text);
    text-decoration: none;
    font-family: var(--font-accent);
    letter-spacing: 0.35em;
    text-transform: uppercase;
    font-size: 0.8rem;
    transition: color 0.3s ease;
}

.scroll-hint:hover {
    color: var(--red);
}

.scroll-chevron {
    animation: bounce 1.8s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* ============================================================
   CAPÍTULOS
   ============================================================ */

.chapters {
    max-width: 1100px;
    margin: 0 auto;
    padding: 110px 24px 80px;
}

.chapters-header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

.chapters-stamp {
    display: inline-block;
    font-family: var(--font-accent);
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-size: 0.75rem;
    color: #fff;
    background: var(--red);
    padding: 6px 16px;
    transform: rotate(-2deg);
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.8);
    margin: 0 0 20px;
}

.chapters-title {
    display: block;
    font-family: var(--font-title);
    font-size: clamp(2.4rem, 6vw, 4rem);
    text-transform: uppercase;
    color: var(--text);
    position: relative;
}

.chapters-sub {
    margin-top: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.episode-card {
    position: relative;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: linear-gradient(160deg, var(--panel-2) 0%, var(--panel) 100%);
    border: 1px solid var(--line);
    border-left: 4px solid var(--red);
    border-radius: 4px;
    padding: 26px 24px;
    overflow: hidden;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.episode-card::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 120px;
    height: 120px;
    border: 1px dashed rgba(224, 17, 17, 0.22);
    border-radius: 50%;
}

.episode-card:hover {
    transform: translateY(-5px);
    border-color: var(--red);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55), 0 0 24px rgba(224, 17, 17, 0.18);
}

.episode-number {
    font-family: var(--font-accent);
    color: var(--red);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-size: 0.8rem;
    margin-bottom: 12px;
}

.episode-title {
    font-family: var(--font-title);
    font-size: 1.25rem;
    color: var(--text);
    margin-bottom: 10px;
    line-height: 1.25;
}

.episode-description {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.55;
    margin-bottom: 18px;
}

.episode-meta {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--muted);
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.episode-watch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--red);
    font-family: var(--font-accent);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 0.78rem;
    transition: transform 0.25s ease;
}

.episode-card:hover .episode-watch {
    transform: translateX(4px);
}

/* ============================================================
   DONACIÓN
   ============================================================ */

.donation {
    display: flex;
    align-items: center;
    gap: 18px;
    max-width: 520px;
    margin: 0 auto;
    padding: 14px 18px;
    background: linear-gradient(160deg, var(--panel-2) 0%, var(--panel) 100%);
    border: 1px solid var(--line);
    border-radius: 4px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.donation:hover {
    transform: translateY(-3px);
    border-color: var(--red);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5), 0 0 20px rgba(224, 17, 17, 0.15);
}

.donation-icon {
    flex-shrink: 0;
    border-radius: 20px;
    border: 1px solid var(--line);
}

.donation-text {
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.5;
}

@media (max-width: 640px) {
    .donation {
        margin: 0 18px;
    }
}

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
    background: var(--bg-2);
    border-top: 3px solid var(--red);
    padding: 44px 24px;
    text-align: center;
}

.footer-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.footer-logo {
    font-family: var(--font-title);
    color: var(--red);
    text-decoration: none;
    font-size: 1.6rem;
    letter-spacing: 0.14em;
}

.footer-links {
    display: flex;
    gap: 34px;
}

.footer-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    transition: color 0.25s ease;
}

.footer-links a:hover {
    color: var(--red);
}

.footer-copyright {
    color: #5f5650;
    font-size: 0.8rem;
    margin-top: 8px;
}

/* ============================================================
   MODAL DE CONTACTO
   ============================================================ */

.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 999;
    backdrop-filter: blur(3px);
}

.overlay.active {
    display: block;
}

.card {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(480px, 90vw);
    background: var(--panel-2);
    border: 1px solid var(--red);
    border-radius: 6px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(224, 17, 17, 0.15);
    padding: 34px 30px;
    z-index: 1000;
    text-align: left;
}

.card.active {
    display: block;
}

.card h2 {
    font-family: var(--font-title);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--red);
    margin-bottom: 18px;
    font-size: 1.5rem;
}

.card p {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 2;
}

.card p a {
    color: var(--text);
    text-decoration: underline;
    text-decoration-color: var(--red);
    text-underline-offset: 3px;
    transition: color 0.25s ease;
}

.card p a:hover {
    color: var(--red);
}

.card .close {
    position: absolute;
    top: 8px;
    right: 16px;
    font-size: 1.7rem;
    cursor: pointer;
    color: var(--muted);
    transition: color 0.25s ease;
}

.card .close:hover {
    color: var(--red);
}

.card-cta {
    display: inline-block;
    margin-top: 22px;
    color: #fff;
    background: var(--red);
    text-decoration: none;
    padding: 12px 22px;
    border-radius: 3px;
    font-family: var(--font-accent);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.85rem;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.6);
    transition: background 0.25s ease, transform 0.25s ease;
}

.card-cta:hover {
    background: #ff1f1f;
    transform: translateY(-2px);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 640px) {
    .hero {
        padding: 60px 16px;
    }

    .hero-kicker {
        letter-spacing: 0.3em;
        font-size: 0.7rem;
    }

    .chapters {
        padding: 70px 18px 80px;
    }

    .episodes-grid {
        grid-template-columns: 1fr;
    }

    .footer-links {
        flex-direction: column;
        gap: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .hero-title,
    .scroll-chevron {
        animation: none;
    }
}
