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

:root {
    --deep-ground: #0c0a14;
    --page-surface: #16121f;
    --aurora-teal: #82e6c8;
    --aurora-violet: #c8a0ff;
    --aurora-rose: #ff6b9d;
    --foxed-paper: #2a2235;
    --whisper-gray: #9b90b0;
    --foil-gold: #d4b896;
    --warm-surface: #1a1525;
    --aurora-gradient: linear-gradient(135deg, #82e6c8 0%, #c8a0ff 40%, #ff6b9d 70%, #d4b896 100%);
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--deep-ground);
    color: var(--whisper-gray);
    font-family: 'Source Serif 4', serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.005em;
    overflow-x: hidden;
    background-image: url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.015'/%3E%3C/svg%3E");
}

/* === CURSOR ORB === */
#cursor-orb {
    position: fixed;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(130, 230, 200, 0.08) 0%, rgba(200, 160, 255, 0.04) 40%, transparent 70%);
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, opacity 0.3s;
    will-change: left, top;
}

#cursor-orb.focused {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(130, 230, 200, 0.12) 0%, rgba(200, 160, 255, 0.06) 40%, transparent 70%);
}

/* === SCAN LINE === */
#scan-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(130, 230, 200, 0.06);
    z-index: 9998;
    animation: scanDown 12s linear infinite;
    pointer-events: none;
}

@keyframes scanDown {
    0% { top: 0; }
    100% { top: 100%; }
}

/* === HUD NAVIGATION === */
.hud-nav {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border: 1.5px solid rgba(130, 230, 200, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
    transition: box-shadow 0.3s, border-color 0.3s;
}

.hud-nav:hover {
    box-shadow: 0 0 0 8px rgba(130, 230, 200, 0.1);
    border-color: var(--aurora-teal);
}

.hud-nav-number {
    font-family: 'Caveat Brush', cursive;
    font-size: 1.1rem;
    color: var(--aurora-teal);
}

/* === TABLE OF CONTENTS === */
.toc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(12, 10, 20, 0.96);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s;
}

.toc-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.toc-content {
    max-width: 480px;
    width: 90%;
}

.toc-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: 2.5rem;
    color: var(--aurora-teal);
    margin-bottom: 2rem;
    letter-spacing: 0.02em;
}

.toc-entry {
    display: flex;
    align-items: baseline;
    padding: 0.8rem 0;
    cursor: pointer;
    transition: color 0.3s;
}

.toc-entry:hover .toc-name {
    color: var(--aurora-teal);
}

.toc-name {
    font-family: 'Caveat Brush', cursive;
    font-size: 1.4rem;
    color: var(--whisper-gray);
    transition: color 0.3s;
}

.toc-dots {
    flex: 1;
    border-bottom: 1px dotted rgba(180, 160, 220, 0.3);
    margin: 0 0.8rem;
}

.toc-page {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    color: rgba(130, 230, 200, 0.7);
}

/* === MAIN CONTAINER === */
.main-container {
    scroll-snap-type: y mandatory;
    overflow-y: auto;
    height: 100vh;
}

/* === SPREAD BASE === */
.spread {
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
}

.spread-inner {
    height: 100%;
    position: relative;
    padding: 3rem;
}

/* === CORNER BRACKETS === */
.corner-bracket {
    position: absolute;
    width: 24px;
    height: 24px;
    opacity: 0;
    transition: opacity 0.6s, transform 0.6s;
}

.corner-bracket.tl {
    top: 2rem;
    left: 2rem;
    border-top: 1px solid rgba(130, 230, 200, 0.3);
    border-left: 1px solid rgba(130, 230, 200, 0.3);
    transform: translate(-8px, -8px);
}

.corner-bracket.tr {
    top: 2rem;
    right: 2rem;
    border-top: 1px solid rgba(130, 230, 200, 0.3);
    border-right: 1px solid rgba(130, 230, 200, 0.3);
    transform: translate(8px, -8px);
}

.corner-bracket.bl {
    bottom: 2rem;
    left: 2rem;
    border-bottom: 1px solid rgba(130, 230, 200, 0.3);
    border-left: 1px solid rgba(130, 230, 200, 0.3);
    transform: translate(-8px, 8px);
}

.corner-bracket.br {
    bottom: 2rem;
    right: 2rem;
    border-bottom: 1px solid rgba(130, 230, 200, 0.3);
    border-right: 1px solid rgba(130, 230, 200, 0.3);
    transform: translate(8px, 8px);
}

.spread.in-view .corner-bracket {
    opacity: 1;
    transform: translate(0, 0);
}

/* === HUD READOUT === */
.hud-readout {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(130, 230, 200, 0.7);
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.4s 0.2s, transform 0.4s 0.2s;
    margin-bottom: 1.5rem;
}

.spread.in-view .hud-readout {
    opacity: 1;
    transform: translateY(0);
}

/* === HERO SPREAD === */
.spread-hero {
    background: var(--deep-ground);
}

.spread-hero .spread-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.hero-content {
    text-align: center;
    opacity: 0;
    animation: heroReveal 1.2s ease-out 0.6s forwards;
}

@keyframes heroReveal {
    to { opacity: 1; }
}

.hero-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(4rem, 10vw, 9rem);
    letter-spacing: 0.02em;
    line-height: 1.05;
    color: var(--whisper-gray);
}

.hero-title .letter {
    display: inline-block;
    opacity: 0;
    animation: letterIn 0.5s ease-out forwards;
    clip-path: inset(0 100% 0 0);
}

.hero-title .letter:nth-child(1) { animation-delay: 0.8s; }
.hero-title .letter:nth-child(2) { animation-delay: 0.92s; }
.hero-title .letter:nth-child(3) { animation-delay: 1.04s; }
.hero-title .letter:nth-child(4) { animation-delay: 1.16s; }
.hero-title .letter:nth-child(5) { animation-delay: 1.28s; }

@keyframes letterIn {
    to {
        opacity: 1;
        clip-path: inset(0 0% 0 0);
    }
}

.hero-tagline {
    font-family: 'Caveat Brush', cursive;
    font-size: clamp(1.3rem, 2.5vw, 2rem);
    color: var(--aurora-violet);
    margin-top: 1.5rem;
    opacity: 0;
    animation: fadeUp 0.8s ease-out 1.6s forwards;
    transform: rotate(-1.5deg);
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px) rotate(-1.5deg); }
    to { opacity: 1; transform: translateY(0) rotate(-1.5deg); }
}

.hero-readout {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    margin-bottom: 0;
}

.spread-hero.in-view .hero-readout {
    transform: translateX(-50%) translateY(0);
}

/* === EDITORIAL SPREAD === */
.editorial-spread {
    display: grid;
    grid-template-columns: 1fr 3px 1fr;
    align-items: center;
    gap: 0;
}

.editorial-spread.reverse {
    direction: ltr;
}

.gutter {
    width: 3px;
    height: 70%;
    align-self: center;
    border-left: 1px solid rgba(180, 160, 220, 0.15);
    box-shadow: 0 0 12px rgba(120, 80, 200, 0.08);
}

.verso, .recto {
    padding: 2rem 3rem;
    position: relative;
}

/* === PROJECT VISUALS === */
.project-visual {
    width: 100%;
    aspect-ratio: 4/5;
    max-height: 70vh;
    position: relative;
    border-radius: 2px;
    overflow: hidden;
    filter: sepia(0.08) contrast(1.05) saturate(0.92);
}

.project-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 70%, rgba(180, 150, 100, 0.12) 0%, transparent 60%);
    z-index: 2;
}

.project-visual::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(42, 34, 53, 0.7) 0%, transparent 15%, transparent 85%, rgba(42, 34, 53, 0.7) 100%);
    z-index: 2;
}

.visual-1 {
    background: 
        linear-gradient(160deg, #1a1525 0%, #2a2235 30%, #16121f 60%),
        radial-gradient(circle at 70% 30%, rgba(130, 230, 200, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 30% 80%, rgba(200, 160, 255, 0.1) 0%, transparent 40%);
}

.visual-2 {
    background: 
        linear-gradient(200deg, #2a2235 0%, #1a1525 40%, #0c0a14 80%),
        radial-gradient(circle at 50% 50%, rgba(255, 107, 157, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(130, 230, 200, 0.1) 0%, transparent 35%);
}

.visual-3 {
    background: 
        linear-gradient(135deg, #16121f 0%, #2a2235 50%, #1a1525 100%),
        radial-gradient(ellipse at 20% 60%, rgba(212, 184, 150, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 75% 40%, rgba(200, 160, 255, 0.08) 0%, transparent 40%);
}

.visual-4 {
    background: 
        linear-gradient(180deg, #0c0a14 0%, #2a2235 50%, #16121f 100%),
        radial-gradient(circle at 40% 30%, rgba(130, 230, 200, 0.1) 0%, transparent 45%),
        radial-gradient(circle at 60% 70%, rgba(255, 107, 157, 0.08) 0%, transparent 40%);
}

/* === PROJECT TYPOGRAPHY === */
.project-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(2.4rem, 5.5vw, 5rem);
    letter-spacing: 0.02em;
    line-height: 1.05;
    color: var(--whisper-gray);
    margin-bottom: 1rem;
}

.project-title.gradient-text {
    background: var(--aurora-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.project-body {
    line-height: 1.72;
    max-width: 480px;
    margin-top: 1.2rem;
}

.drop-cap {
    font-family: 'Cormorant Garamond', serif;
    font-size: 4.5em;
    float: left;
    line-height: 0.8;
    margin-right: 0.08em;
    color: var(--aurora-teal);
    font-weight: 600;
}

/* === FOIL DIVIDER === */
.foil-divider {
    display: flex;
    align-items: center;
    margin: 1rem 0;
    transform: scaleX(0);
    transition: transform 0.8s ease-out 0.3s;
    transform-origin: center;
}

.foil-divider::before,
.foil-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--foil-gold);
}

.foil-diamond {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.7rem;
    color: var(--foil-gold);
    padding: 0 0.8rem;
    transition: background 0.4s;
}

.foil-divider:hover .foil-diamond {
    background: var(--aurora-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.spread.in-view .foil-divider {
    transform: scaleX(1);
}

/* === ANNOTATIONS === */
.annotation {
    font-family: 'Caveat Brush', cursive;
    font-size: clamp(1.1rem, 2.5vw, 1.8rem);
    letter-spacing: 0.01em;
    color: var(--aurora-violet);
    position: absolute;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.5s, transform 0.5s;
}

.spread.in-view .annotation {
    opacity: 1;
    transform: scale(1);
}

.annotation-1 {
    top: 15%;
    right: 2rem;
    transform: rotate(-2deg) scale(0.95);
    color: var(--aurora-violet);
}

.spread.in-view .annotation-1 {
    transform: rotate(-2deg) scale(1);
    transition-delay: 0.3s;
}

.annotation-2 {
    bottom: 20%;
    right: 3rem;
    transform: rotate(1.5deg) scale(0.95);
    color: var(--aurora-rose);
}

.spread.in-view .annotation-2 {
    transform: rotate(1.5deg) scale(1);
    transition-delay: 0.4s;
}

.annotation-3 {
    top: 20%;
    left: 2rem;
    transform: rotate(-1deg) scale(0.95);
}

.spread.in-view .annotation-3 {
    transform: rotate(-1deg) scale(1);
    transition-delay: 0.35s;
}

.annotation-4 {
    bottom: 25%;
    left: 3rem;
    transform: rotate(2deg) scale(0.95);
    color: var(--aurora-rose);
}

.spread.in-view .annotation-4 {
    transform: rotate(2deg) scale(1);
    transition-delay: 0.45s;
}

.annotation-5 {
    top: 18%;
    right: 2rem;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(130, 230, 200, 0.5);
}

.spread.in-view .annotation-5 {
    transform: scale(1);
    transition-delay: 0.3s;
}

.annotation-6 {
    bottom: 22%;
    right: 2rem;
    transform: rotate(-1.5deg) scale(0.95);
}

.spread.in-view .annotation-6 {
    transform: rotate(-1.5deg) scale(1);
    transition-delay: 0.4s;
}

.annotation-7 {
    top: 15%;
    left: 2rem;
    transform: rotate(1deg) scale(0.95);
}

.spread.in-view .annotation-7 {
    transform: rotate(1deg) scale(1);
    transition-delay: 0.3s;
}

.annotation-8 {
    bottom: 20%;
    left: 2.5rem;
    transform: rotate(-2deg) scale(0.95);
    color: var(--aurora-rose);
}

.spread.in-view .annotation-8 {
    transform: rotate(-2deg) scale(1);
    transition-delay: 0.4s;
}

.crossed-out {
    text-decoration: line-through;
    text-decoration-color: var(--aurora-rose);
}

.annotation-underline {
    position: absolute;
    bottom: 18%;
    right: 2rem;
    opacity: 0;
    transition: opacity 0.3s 0.5s;
}

.svg-ul-2 {
    bottom: 20%;
}

.spread.in-view .annotation-underline {
    opacity: 1;
}

.spread.in-view .annotation-underline line {
    animation: drawLine 0.5s ease-out 0.6s forwards;
}

@keyframes drawLine {
    to { stroke-dashoffset: 0; }
}

/* === COLOPHON === */
.spread-colophon {
    background: var(--warm-surface);
}

.annotation-spread {
    display: grid;
    grid-template-columns: 1fr 3px 1fr;
    align-items: center;
}

.colophon-verso, .colophon-recto {
    padding: 3rem;
}

.colophon-annotation {
    font-family: 'Caveat Brush', cursive;
    font-size: clamp(1.1rem, 2.5vw, 1.6rem);
    color: var(--aurora-violet);
    transform: rotate(-1.5deg);
    margin: 2rem 0;
    letter-spacing: 0.01em;
}

.colophon-annotation.large {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    color: var(--aurora-teal);
}

.colophon-annotation.final-note {
    color: var(--aurora-rose);
    margin-top: 3rem;
}

.colophon-annotation.small-note {
    font-size: 1.2rem;
    color: var(--foil-gold);
    opacity: 0.8;
}

.colophon-body {
    max-width: 420px;
    margin: 1.5rem 0;
    line-height: 1.72;
}

.colophon-info {
    margin: 3rem 0;
}

.colophon-studio,
.colophon-location,
.colophon-email {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    margin: 0.8rem 0;
}

.colophon-studio {
    color: var(--whisper-gray);
    font-size: 1rem;
}

.colophon-location {
    color: rgba(130, 230, 200, 0.7);
}

.colophon-email {
    color: var(--foil-gold);
}

/* === MOBILE ADAPTATION === */
@media (max-width: 768px) {
    .editorial-spread,
    .annotation-spread {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        gap: 0;
    }

    .gutter {
        width: 60%;
        height: 1px;
        margin: 1rem auto;
        border-left: none;
        border-top: 1px solid rgba(180, 160, 220, 0.15);
        box-shadow: none;
    }

    .verso, .recto {
        padding: 1.5rem;
    }

    .project-visual {
        aspect-ratio: 16/9;
        max-height: 35vh;
    }

    .spread-inner {
        padding: 1.5rem;
    }

    .annotation {
        position: relative;
        top: auto;
        bottom: auto;
        left: auto;
        right: auto;
        margin: 1rem 0;
    }

    .annotation-underline {
        position: relative;
        bottom: auto;
        right: auto;
    }

    #cursor-orb {
        display: none;
    }

    .corner-bracket {
        display: none;
    }
}
