:root {
    /* --- Variables del Primer Bloque --- */
    --bg-color: #000;
    --bg-color-2: #ececec;
    --bg-deep-dark: #040200;
    --bg-spotlight: #0f0704;
    --bg-overlay: #080808;
    --bg-btn-transparent: rgba(0, 0, 0, 0.3);
    --bg-item-base: #333;
    --color-text-light: #fff;
    --color-text-dark: #000;
    --color-text-secondary: #aaa;
    --color-text-muted: #ccc;
    --color-accent: #dd8e4e;
    --color-accent-light: #ffc2aa;
    --color-portal-inner: #461c00;
    --color-portal-outer: #9a5318;
    --border-item: #999999;
    --border-footer: #6c3109;
    --shadow-spotlight: rgba(255, 157, 100, 0.4);

    /* --- Variables del Segundo Bloque --- */
    font-size: 14px;
    --color-text: #fff;
    --color-bg: #000;
    --color-link: #aaa;
    --color-link-hover: #fff;
    --anim-time: 4.5s;
    --anim-delay-first: 1s;
    --anim-delay-second: calc(var(--anim-delay-first) + var(--anim-time));
    --anim-time-total: calc(var(--anim-time) + var(--anim-delay-first)/3 + var(--anim-delay-second));
    --color-title: #fff;
}

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

body {
    margin: 0;
    color: var(--color-text);
    background-color: #161413;
    font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif;
    background-size: cover;
    background-position: 50% 50%;
}

a {
    text-decoration: none;
    color: var(--color-link);
    outline: none;
}

a:hover,
a:focus {
    color: var(--color-link-hover);
    outline: none;
}

.webgl
{
    position: fixed;
    top: 400vh;
    left: 0;
    outline: none;
}

.button {
    -moz-appearance: none;
    -webkit-appearance: none;
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    color: var(--color-text);
    cursor: pointer;
}

.button:hover,
.button:focus {
    outline: none;
    color: var(--color-link-hover);
}

.btn {
    display: inline-block;
    text-decoration: none;
    padding: 12px 28px;
    margin: 0 10px;
    border: 2px solid var(--color-text-light);
    color: var(--color-text-light);
    background: var(--bg-btn-transparent);
    font-weight: bold;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.btn-h1 {
    display: inline-block;
    text-decoration: none;
    padding: 15px 32px;
    margin: 0 10px;
    border: 2px solid #0000006b;
    color: #1e1b00;
    background: rgb(255 233 176 / 85%);
    font-weight: bold;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-size: 1.3rem;
    border-radius: 30px;
}

.btn:hover,
.btn-h1:hover {
    background: var(--color-text-light);
    color: var(--bg-color);
}

hr {
    color: var(--color-text-secondary);
}

/* === Estructura Principal y Título === */

.backgrounds {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: url('../img/z.webp') no-repeat center center/cover;
    z-index: -1;
}

.backgrounds::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: radial-gradient(circle at center,
            rgba(255, 255, 255, 0.712) 0%,
            rgba(255, 255, 255, 0.397) 30%,
            rgba(0, 0, 0, 0.3) 70%,
            rgba(0, 0, 0, 0.6) 100%);
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 1;
}

.title-section {
    height: 110vh;
    display: flex;
    justify-content: center;
    align-items: start;
    padding-bottom: 10vh;
}

.background-title {
    position: absolute;
    top: 95vh;
    left: 0;
    width: 100%;
    height: 25vh;
    background: rgb(7, 3, 0);
    z-index: 100;
    mask-image: linear-gradient(to bottom, transparent, black 20%);
}

.hidden {
    position: absolute;
    overflow: hidden;
    width: 0;
    height: 0;
    pointer-events: none;
}

.frame-volume {
    padding: 3rem 5vw;
    text-align: center;
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 1500;
    text-transform: uppercase;
}

.toggle__icon {
    position: relative;
    display: block;
    width: 1.6rem;
    height: 1.6rem;
    margin: 0 auto;
    fill: currentColor;
}

.toggle__icon--off {
    display: none;
}

.toggle--on .toggle__icon--on {
    display: none;
}

.toggle--on .toggle__icon--off {
    display: block;
}

.start-anim .toggle {
    pointer-events: auto;
}

.content {
    display: flex;
    flex-direction: column;
    padding: 0 1.5rem 20vh;
    width: 100vw;
    position: relative;
    justify-content: center;
    align-items: center;
    z-index: 1200;
    margin: auto 0;
}

.title-hero {
    font-family: "Shadows Into Light", sans-serif;
    font-weight: 500;
    font-size: 8vw;
    letter-spacing: 0.08em;
    text-align: center;
    margin: 0;
    color: var(--color-text-dark);
    text-shadow: 3px 3px 0 rgb(255, 198, 124);
    position: relative;
    will-change: transform;
}

.title-hero .char {
    display: inline-block;
    visibility: hidden;
}

.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: var(--color-bg);
    z-index: 1600;
}

.screen--grid {
    display: grid;
    grid-template-columns: 100%;
    grid-template-rows: 100%;
    justify-items: center;
    align-items: center;
}

.screen--flex {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.intro {
    text-transform: uppercase;
    font-style: italic;
}

.start-anim .intro {
    animation: fadeOut 1s var(--anim-time-total) linear forwards;
}

.intro__content {
    font-size: 4vw;
    grid-area: 1 / 1 / 2 / 2;
    text-align: center;
    pointer-events: none;
    margin: 0;
    opacity: 0;
}

.intro__content-line {
    display: block;
    margin: 1rem 0;
}

.intro__content-line--small {
    font-size: 1.5rem;
}

.start-anim .intro__content {
    animation: fadeInOut var(--anim-time) var(--anim-delay-first) linear forwards;
}

.start-anim .intro__content:nth-child(2) {
    animation-delay: var(--anim-delay-second);
}

.action__line {
    margin: 1rem 0;
    cursor: default;
}

.button--box {
    pointer-events: auto;
    background: var(--color-link);
    color: var(--color-bg);
    padding: 0.5rem 2rem;
    font-family: inherit;
    margin: 2rem;
    border-radius: 1.25rem;
    font-size: 1rem;
}

.button--box:hover,
.button--box:focus {
    background: var(--color-link-hover);
    color: var(--color-bg);
}

.start-anim .button--box {
    pointer-events: none;
}

.start-anim .action {
    transition: opacity 0.3s;
    opacity: 0;
    pointer-events: none;
}

.p5_loading {
    background: var(--color-bg);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.p5_loading__inner {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    opacity: 0.4;
    background: var(--color-link);
    animation: loaderAnim 0.7s linear infinite alternate forwards;
}

/* === Sección Spotlight === */

.spotlight {
    padding: 10vh 20px;
    background: var(--bg-color-2);
}

.spotlight-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    max-width: 1200px;
    margin: auto;
    align-items: center;
    gap: 50px;
}

.spotlight-image-container {
    position: relative;
    display: inline-block;
    z-index: 0;
}

.spotlight-image-container::before {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 15px;
    background: radial-gradient(circle at center,
            rgba(0, 0, 0, 0.8) 0%,
            rgba(0, 0, 0, 0.5) 50%,
            rgba(0, 0, 0, 0.2) 80%,
            rgba(0, 0, 0, 0) 100%);
    filter: blur(10px);
    opacity: 0.9;
    z-index: -1;
}

.spotlight-image-container img {
    width: 100%;
    max-width: 450px;
    height: auto;
    border-radius: 15px;
    position: relative;
    z-index: 1;
}


.spotlight-details h2 {
    font-size: 3.5rem;
    margin: 0;
    color: var(--color-text-dark);
}

.spotlight-details p {
    font-size: 1.1rem;
    color: var(--color-text-dark);
    margin: 20px 0;
}

.news-tag {
    background-color: var(--color-accent);
    color: var(--color-text-light);
    padding: 8px 16px;
    border-radius: 5px;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 30px;
}

/* === Sección Novels === */

.novels {
    width: 100%;
    height: 90vh;
    padding: 40px;
    background: var(--bg-color);
}

.novels h2.upcoming_title {
    position: relative;
    display: flex;
    text-align: center;
    word-spacing: 6px;
    letter-spacing: 3px;
    justify-content: center;
    align-items: center;
    z-index: 3;
    font-size: 3em;
    color: var(--color-text-light);
}

.upcoming {
    position: relative;
    display: flex;
    justify-content: center;
    transform-style: preserve-3d;
    perspective: 600px;
    width: 100%;
    height: 70vh;
    margin: 0 auto;
}

.upcoming .item {
    position: absolute;
    top: calc(50% - 300px);
    width: 400px;
    height: 600px;
    background: var(--bg-item-base);
    transition: 0.5s;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    transform-style: preserve-3d;
    transform-origin: bottom;
    user-select: none;
    border: 3px solid var(--border-item);
}

.upcoming .item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upcoming .item:nth-child(1) {
    transform: translateX(-350px) scale(0.90) rotateY(20deg);
    z-index: 2;
    opacity: 0.4;
}

.upcoming .item:nth-child(2) {
    transform: translate3d(-250px, 0, 0) scale(0.95) rotateY(10deg);
    z-index: 3;
    opacity: 0.9;
}

.upcoming .item:nth-child(3) {
    transform: translate3d(0px, 0, 0) scale(1) rotateY(0deg);
    z-index: 5;
}

.upcoming .item:nth-child(4) {
    transform: translate3d(250px, 0, 0) scale(0.95) rotateY(-10deg);
    z-index: 3;
    opacity: 0.9;
}

.upcoming .item:nth-child(5) {
    transform: translate3d(350px, 0, 0) scale(0.90) rotateY(-20deg);
    z-index: 2;
    opacity: 0.4;
}

.buttons {
    position: relative;
    bottom: 20px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
}

.buttons span {
    content: "<";
    position: relative;
    width: 50px;
    height: 50px;
    border: 2px solid var(--color-text);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.buttons span:hover {
    opacity: 1;
}

/* === Secciones Readers Advice y Gateway === */

.readers-advice {
    padding: 40px 20px;
    text-align: center;
    background: var(--bg-color);
}

.readers-advice p {
    font-size: 1.3rem;
    color: var(--color-text-secondary);
    margin: 0;
}

.readers-advice b {
    color: var(--color-accent-light);
    font-weight: 600;
}

.gateway {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    background: var(--bg-deep-dark) url('https://www.transparenttextures.com/patterns/stardust.png');
}

.gateway::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle, rgba(10, 5, 20, 0.5) 0%, var(--bg-deep-dark) 70%);
}

.gateway-content {
    color: var(--color-text-dark);
    position: relative;
    z-index: 2;
}

.gateway h2 {
    font-size: 3rem;
    margin-top: 2rem;
}

.gateway p {
    color: var(--color-text-dark);
    margin-bottom: 2rem;
}

/* === Footer === */

.main-footer {
    padding: 30px;
    text-align: center;
    background: var(--bg-deep-dark);
    border-top: 1px solid var(--border-footer);
}

.footer-links a {
    color: var(--color-text-secondary);
    margin: 0 15px;
    text-decoration: none;
}

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

/* === Animaciones y Media Queries === */

@keyframes loaderAnim {
    to {
        opacity: 1;
        transform: scale3d(0.5, 0.5, 1);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        pointer-events: none;
    }
}

@keyframes pulse {
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@media(max-width: 768px) {
    .spotlight-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .spotlight-image-container {
        margin-bottom: 30px;
    }

    .gateway h2,
    .spotlight-details h2 {
        font-size: 2.5rem;
    }
}