/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    background: #0a0e1a;
    color: #e2e8f0;
    font-family: 'Cormorant Garamond', Georgia, serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* Film grain overlay */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

/* === Magazine Container === */
.magazine {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    height: 100vh;
    width: 100vw;
    scroll-behavior: smooth;
}

/* Glitch effect */
.magazine.glitch::before,
.magazine.glitch::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    mix-blend-mode: screen;
    animation: glitch-shift 150ms steps(3) forwards;
}

.magazine.glitch::before {
    background: rgba(255, 51, 102, 0.08); /* #FF3366 */
    transform: translateX(-3px);
}

.magazine.glitch::after {
    background: rgba(0, 255, 204, 0.08); /* #00FFCC */
    transform: translateX(3px);
}

@keyframes glitch-shift {
    0% { transform: translateX(0); opacity: 0; box-shadow: inset 0 0 0 transparent; }
    33% { transform: translateX(-4px); opacity: 1; box-shadow: inset 0 0 80px rgba(255,51,102,0.02); }
    66% { transform: translateX(3px); opacity: 0.7; box-shadow: inset 0 0 80px rgba(0,255,204,0.02); }
    100% { transform: translateX(0); opacity: 0; box-shadow: inset 0 0 0 transparent; }
}

/* Glitch palette: #FF3366 signal bleed, #00FFCC chromatic spill, #B8C6DB iridescent silver */

/* === Spread Base === */
.spread {
    scroll-snap-align: start;
    height: 100vh;
    width: 100vw;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === Watermarks === */
.watermark {
    position: absolute;
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(8rem, 20vw, 25rem);
    opacity: 0.035;
    color: #5edbd5;
    pointer-events: none;
    z-index: 0;
    animation: watermark-drift 20s ease-in-out infinite;
    will-change: transform;
}

.watermark--1 { top: 10%; right: 15%; }
.watermark--2 { bottom: 5%; left: 5%; }
.watermark--3 { top: 15%; left: 10%; }
.watermark--4 { bottom: 10%; right: 10%; }
.watermark--5 { top: 5%; left: 20%; }

@keyframes watermark-drift {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* === Labels === */
.spread-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #5edbd5;
}

.label-num {
    color: #e8725a;
    margin-right: 0.5em;
}

.spread-label--center {
    text-align: center;
    margin-bottom: 2rem;
}

.spread-label--top {
    position: absolute;
    top: 3rem;
    left: 5%;
}

/* === Typography === */
.hero-title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(5rem, 15vw, 18rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 0.9;
    color: #e2e8f0;
    position: relative;
    z-index: 2;
}

.letter {
    display: inline-block;
    animation: float 3s ease-in-out infinite, shimmer 6s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.15s), calc(var(--i) * 0.15s);
    will-change: transform;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

@keyframes shimmer {
    0%, 100% { text-shadow: 0 0 20px rgba(94, 219, 213, 0.3), 0 0 40px rgba(94, 219, 213, 0.1); } /* #5edbd5 */
    50% { text-shadow: 0 0 20px #b8c6db, 0 0 40px rgba(184, 198, 219, 0.1); } /* #B8C6DB */
}

.korean-overlay {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(4rem, 10vw, 12rem);
    color: #5edbd5;
    position: absolute;
    top: 50%;
    left: 10%;
    transform: translateY(-50%);
    z-index: 1;
    animation: ghost 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes ghost {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 0.45; }
}

.body-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.1rem, 1.4vw, 1.35rem);
    line-height: 1.72;
    color: #c8d6e5;
    margin-bottom: 1.5em;
}

.body-text em {
    font-style: italic;
    font-weight: 600;
    color: #5edbd5;
}

.scroll-hint {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #5edbd5;
    opacity: 0.6;
    animation: hint-pulse 2s ease-in-out infinite;
}

@keyframes hint-pulse {
    0%, 100% { opacity: 0.6; transform: translateX(-50%) translateY(0); }
    50% { opacity: 0.3; transform: translateX(-50%) translateY(5px); }
}

/* === Spread 1 — Surface === */
.spread--surface {
    background: #0a0e1a;
}

.surface-layout {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    padding: 0 5%;
    position: relative;
}

.surface-left {
    width: 60%;
    position: relative;
    z-index: 2;
}

.surface-left .spread-label {
    margin-top: 2rem;
}

.surface-right {
    width: 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 800px;
}

/* === Crystal Wireframe === */
.crystal {
    width: 160px;
    height: 160px;
    position: relative;
    transform-style: preserve-3d;
    animation: spin 30s linear infinite;
}

.crystal--large {
    width: 200px;
    height: 200px;
}

.crystal-face {
    position: absolute;
    width: 80px;
    height: 80px;
    border: 1px solid #5edbd5;
    background: transparent;
    top: 50%;
    left: 50%;
    margin-top: -40px;
    margin-left: -40px;
    transform: rotateX(var(--rx)) rotateY(var(--ry)) translateZ(var(--tz));
    box-shadow: 0 0 15px rgba(94, 219, 213, 0.15);
}

.crystal--large .crystal-face {
    width: 100px;
    height: 100px;
    margin-top: -50px;
    margin-left: -50px;
    border-color: #e8725a;
    box-shadow: 0 0 15px rgba(232, 114, 90, 0.15);
}

@keyframes spin {
    0% { transform: rotateX(0) rotateY(0) rotateZ(0); }
    100% { transform: rotateX(360deg) rotateY(360deg) rotateZ(0); }
}

/* === Spread 2 — Descent === */
.spread--descent {
    background: #121829;
}

.descent-layout {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    padding: 5% 5%;
}

.descent-left {
    width: 25%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vertical-korean {
    writing-mode: vertical-rl;
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.5rem, 2.5vw, 2.5rem);
    color: #5edbd5;
    opacity: 0.2;
    letter-spacing: 0.5em;
    line-height: 2;
}

.descent-gutter {
    width: 10%;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60%;
}

.sonar-line {
    width: 1px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, #5edbd5, transparent);
    animation: sonar-pulse 3s ease-in-out infinite;
}

@keyframes sonar-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

.descent-right {
    width: 65%;
    padding-left: 2%;
}

.descent-right .spread-label {
    margin-bottom: 2rem;
}

/* === Spread 3 — Deep === */
.spread--deep {
    background: #0a0e1a;
    flex-direction: column;
}

.sonar-rings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
}

.sonar-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(94, 219, 213, 0.3);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    animation: sonar-expand 4s ease-out infinite;
    width: 300px;
    height: 300px;
}

.sonar-ring--2 { animation-delay: 1s; }
.sonar-ring--3 { animation-delay: 2s; }

@keyframes sonar-expand {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0.6; }
    100% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
}

.deep-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.deep-quote {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.2rem, 1.8vw, 1.6rem);
    line-height: 1.8;
    color: #e2e8f0;
    max-width: 38ch;
    margin: 0 auto;
    font-style: italic;
    font-weight: 500;
}

/* === Spread 4 — Refraction === */
.spread--refraction {
    background: #121829;
    flex-direction: column;
    padding: 5%;
}

.refraction-layout {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.refraction-columns {
    display: flex;
    align-items: flex-start;
    gap: 0;
    width: 100%;
}

.refraction-col {
    flex: 1;
    padding: 2rem;
}

.col-rule {
    width: 1px;
    align-self: stretch;
    background: linear-gradient(to bottom, #5edbd5, transparent);
    opacity: 0.3;
}

.col-title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(2.5rem, 5vw, 5rem);
    font-weight: 900;
    letter-spacing: -0.02em;
    color: #e2e8f0;
    margin-bottom: 1.5rem;
}

/* === Spread 5 — Surfacing === */
.spread--surfacing {
    background: #1a2238;
    flex-direction: column;
}

.surfacing-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    position: relative;
    perspective: 800px;
}

.surfacing-title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(6rem, 18vw, 22rem);
    font-weight: 900;
    color: #e2e8f0;
    letter-spacing: -0.03em;
    line-height: 0.9;
    margin-bottom: 1rem;
    z-index: 2;
}

.surfacing-layout .crystal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-style: preserve-3d;
    margin-top: -100px;
    margin-left: -100px;
    z-index: 1;
}

.surfacing-layout .spread-label {
    margin-bottom: 1.5rem;
    z-index: 2;
}

.surfacing-close {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.1rem, 1.6vw, 1.4rem);
    color: #8899aa;
    font-style: italic;
    z-index: 2;
}

/* === Scrollbar === */
.magazine::-webkit-scrollbar {
    display: none;
}

.magazine {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
