
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700;800&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap');

:root {
    --bg: #080607;
    --red: #9e202d;
    --red-bright: #d63c49;
    --red-dark: #481017;
    --text: #eee5df;
    --muted: #a99b98;
    --line: rgba(198, 69, 79, 0.35);
}

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

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    min-height: 100svh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    color: var(--text);
    background:
        radial-gradient(ellipse at 50% 30%, #261014 0%, transparent 45%),
        linear-gradient(180deg, #10090b, var(--bg) 75%);
    font-family: 'Cormorant Garamond', Georgia, serif;
}

.berserk-header,
.berserk-content,
.berserk-footer {
    position: relative;
    z-index: 1;
}

/* Fondo ambiental */

.berserk-background {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.blood-moon {
    position: absolute;
    top: 11%;
    left: 50%;
    width: clamp(150px, 24vw, 290px);
    aspect-ratio: 1;
    transform: translateX(-50%);
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 32%, #d65c61 0%, #9c2734 34%, #5a101b 68%, #24080e 100%);
    box-shadow:
        0 0 30px rgba(190, 34, 49, 0.25),
        0 0 100px rgba(145, 20, 35, 0.19),
        inset -22px -18px 45px rgba(0, 0, 0, 0.55);
    opacity: 0.58;
    animation: moon-breathe 7s ease-in-out infinite;
}

.blood-moon::before,
.blood-moon::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(28, 5, 10, 0.28);
}

.blood-moon::before {
    width: 18%;
    aspect-ratio: 1;
    top: 25%;
    left: 24%;
}

.blood-moon::after {
    width: 27%;
    aspect-ratio: 1;
    right: 17%;
    bottom: 24%;
}

.dark-horizon {
    position: absolute;
    inset: 48% 0 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(8, 6, 7, 0.28) 38%,
        rgba(8, 6, 7, 0.62) 100%
    );
}

.dark-horizon::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, transparent 48%, #080607 49%) 0 0 / 110px 100%,
        linear-gradient(225deg, transparent 48%, #080607 49%) 0 0 / 150px 100%;
    opacity: 0.45;
}

.floating-particles {
    position: absolute;
    inset: 0;
    opacity: 0.6;
    background-image:
        radial-gradient(circle, rgba(239, 104, 109, 0.9) 1px, transparent 1.8px),
        radial-gradient(circle, rgba(255, 215, 191, 0.6) 1px, transparent 1.8px);
    background-size: 83px 97px, 137px 151px;
    background-position: 0 0, 40px 60px;
    animation: particles-drift 24s linear infinite;
}

.rune {
    position: absolute;
    color: rgba(190, 54, 68, 0.22);
    font-family: 'Cinzel', serif;
    font-size: clamp(3rem, 8vw, 7rem);
    animation: rune-float 8s ease-in-out infinite;
}

.rune-one {
    top: 22%;
    left: 9%;
}

.rune-two {
    top: 34%;
    right: 10%;
    animation-delay: -2s;
}

.rune-three {
    bottom: 17%;
    left: 14%;
    animation-delay: -4s;
}

.rune-four {
    bottom: 13%;
    right: 14%;
    animation-delay: -6s;
}

/* Símbolo de espada decorativa */

.sword-symbol {
    position: absolute;
    top: 26%;
    left: 50%;
    width: 70px;
    height: 210px;
    transform: translateX(-50%) rotate(34deg);
    opacity: 0.12;
}

.sword-blade {
    position: absolute;
    top: 0;
    left: 29px;
    width: 12px;
    height: 145px;
    background: linear-gradient(90deg, #3c3030, #c7b8b4, #39272b);
    clip-path: polygon(50% 0, 100% 15%, 65% 100%, 50% 100%, 35% 100%, 0 15%);
}

.sword-guard {
    position: absolute;
    top: 130px;
    left: 8px;
    width: 54px;
    height: 9px;
    border-radius: 50%;
    background: #b8a5a0;
}

.sword-handle {
    position: absolute;
    top: 136px;
    left: 28px;
    width: 14px;
    height: 51px;
    background: repeating-linear-gradient(
        180deg,
        #a18b87 0 5px,
        #39272b 5px 10px
    );
}

/* Encabezado */

.berserk-header {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    width: min(1100px, calc(100% - 48px));
    margin: 0 auto;
    padding: 28px 0;
}

.berserk-back {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #c9b8b5;
    font-family: 'Cinzel', serif;
    font-size: 0.72rem;
    letter-spacing: 0.07em;
    text-decoration: none;
    transition: color 0.25s ease;
}

.berserk-back span {
    color: var(--red-bright);
    font-size: 1.2rem;
    transition: transform 0.25s ease;
}

.berserk-back:hover {
    color: #fff;
}

.berserk-back:hover span {
    transform: translateX(-4px);
}

.chapter-label {
    color: #9f7779;
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
}

/* Contenido principal */

.berserk-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(760px, calc(100% - 36px));
    margin: auto;
    padding: 36px 0 60px;
    text-align: center;
    animation: reveal-content 1.2s ease both;
}

.chapter-number {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-bottom: 25px;
    border: 1px solid var(--line);
    color: #d8a2a1;
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    transform: rotate(45deg);
}

.chapter-number::first-letter {
    transform: rotate(-45deg);
}

.eyebrow {
    margin-bottom: 15px;
    color: #c56a70;
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    letter-spacing: 0.35em;
}

.berserk-content h1 {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-family: 'Cinzel', Georgia, serif;
    font-size: clamp(2.25rem, 7.5vw, 5.2rem);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: 0.045em;
    text-shadow: 0 5px 28px rgba(0, 0, 0, 0.8);
}

.berserk-content h1 span {
    color: #d34b56;
    font-size: 0.74em;
    letter-spacing: 0.12em;
}

.title-divider {
    display: flex;
    align-items: center;
    gap: 15px;
    width: min(310px, 75%);
    margin: 26px 0 18px;
}

.title-divider > span:not(.divider-symbol) {
    height: 1px;
    flex: 1;
    background: linear-gradient(90deg, transparent, var(--red-bright));
}

.title-divider > span:last-child {
    transform: rotate(180deg);
}

.divider-symbol {
    color: #e36b72;
    font-size: 1.1rem;
}

.berserk-name {
    margin-bottom: 25px;
    color: #f0d4ce;
    font-size: clamp(1.7rem, 5vw, 2.4rem);
    font-style: italic;
}

.birthday-message {
    width: min(590px, 100%);
    padding: 27px clamp(20px, 5vw, 42px);
    border: 1px solid rgba(169, 63, 74, 0.23);
    background: rgba(12, 8, 10, 0.68);
    box-shadow: 0 18px 65px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(7px);
}

.birthday-message p {
    margin-bottom: 18px;
    color: #d2c4c0;
    font-size: clamp(1.12rem, 2.8vw, 1.35rem);
    line-height: 1.8;
}

.birthday-message p:last-child {
    margin-bottom: 0;
}

.birthday-message .final-wish {
    color: #e5b8b5;
    font-style: italic;
}

.brand-mark {
    display: flex;
    align-items: center;
    gap: 13px;
    width: 100px;
    margin: 29px 0 17px;
}

.brand-mark span:not(.brand-star) {
    height: 1px;
    flex: 1;
    background: var(--line);
}

.brand-star {
    color: #c44a55;
    font-size: 0.9rem;
}

.closing-line {
    max-width: 440px;
    color: #b6a4a1;
    font-size: 1.12rem;
    font-style: italic;
    line-height: 1.7;
}

.berserk-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 30px;
    padding: 14px 24px;
    border: 1px solid rgba(202, 74, 85, 0.65);
    color: #f2d8d5;
    background: linear-gradient(135deg, #4c1119, #23090e);
    font-family: 'Cinzel', serif;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-decoration: none;
    transition:
        background 0.25s ease,
        border-color 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.berserk-button span {
    font-size: 1.1rem;
}

.berserk-button:hover {
    transform: translateY(-3px);
    border-color: #e05b65;
    background: linear-gradient(135deg, #721925, #350b12);
    box-shadow: 0 8px 28px rgba(139, 23, 38, 0.2);
}

/* Pie de página */

.berserk-footer {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 22px 20px;
    border-top: 1px solid rgba(190, 70, 78, 0.12);
    color: #756365;
    font-family: 'Cinzel', serif;
    font-size: 0.56rem;
    letter-spacing: 0.13em;
    text-align: center;
}

.footer-separator {
    color: #a43b47;
}

/* Animaciones */

@keyframes moon-breathe {
    0%, 100% {
        opacity: 0.48;
        box-shadow: 0 0 30px rgba(190, 34, 49, 0.2),
                    0 0 90px rgba(145, 20, 35, 0.15);
    }

    50% {
        opacity: 0.67;
        box-shadow: 0 0 45px rgba(190, 34, 49, 0.32),
                    0 0 120px rgba(145, 20, 35, 0.23);
    }
}

@keyframes particles-drift {
    from {
        background-position: 0 0, 40px 60px;
    }

    to {
        background-position: 83px -194px, -97px -91px;
    }
}

@keyframes rune-float {
    0%, 100% {
        transform: translateY(0) rotate(-8deg);
    }

    50% {
        transform: translateY(-14px) rotate(8deg);
    }
}

@keyframes reveal-content {
    from {
        opacity: 0;
        transform: translateY(22px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Transición al navegar */

.berserk-content {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.berserk-content.is-leaving {
    opacity: 0;
    transform: translateY(-10px);
}

body.page-leaving {
    pointer-events: none;
}

/* Adaptación a pantallas pequeñas */

@media (max-width: 600px) {
    .berserk-header {
        width: calc(100% - 30px);
        padding: 20px 0;
    }

    .berserk-back {
        font-size: 0.62rem;
    }

    .chapter-label {
        font-size: 0.55rem;
        letter-spacing: 0.1em;
    }

    .berserk-content {
        padding: 45px 0;
    }

    .blood-moon {
        top: 13%;
        width: 190px;
    }

    .sword-symbol {
        top: 31%;
        transform: translateX(-50%) rotate(34deg) scale(0.75);
    }

    .birthday-message {
        padding: 23px 19px;
    }

    .birthday-message p {
        line-height: 1.65;
    }

    .rune-one {
        left: 3%;
    }

    .rune-two {
        right: 3%;
    }

    .berserk-footer {
        gap: 8px;
        font-size: 0.48rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
