/* yongjoon.net - Goblincore x Sci-Fi HUD */
/* Colors: #0a0e0d, #f0ede3, #7dffba, #c45e3a, #b8a67e */
/* Fonts: Space Grotesk, IBM Plex Mono, Overpass Mono, Cormorant Garamond */

:root {
    --dark: #0a0e0d;
    --light: #f0ede3;
    --green: #7dffba;
    --rust: #c45e3a;
    --fungal: #b8a67e;
    --panel-bg: rgba(10, 14, 13, 0.82);
    --glow: rgba(125, 255, 186, 0.2);
    --morph-duration: 800ms;
    --morph-easing: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background: var(--dark);
    color: var(--light);
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    line-height: 1.7;
    overflow: hidden;
}

/* Dot grid overlay */
#dot-grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    background-image: radial-gradient(circle, var(--fungal) 0.5px, transparent 0.5px);
    background-size: 24px 24px;
    opacity: 0.04;
}

/* Scroll container */
#scroll-container {
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

/* Spread base */
.spread {
    width: 100%;
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(184, 166, 126, 0.15);
}

/* ===== SPREAD 0: Opening ===== */
.spread-opening {
    display: flex;
    align-items: center;
    justify-content: center;
}

.spread-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.spread-bg-art {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.opening-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
    clip-path: inset(0);
    transition: clip-path 1.5s var(--morph-easing);
}

.opening-content.revealed {
    clip-path: inset(5% 8% 10% 8%);
}

.opening-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 8vw, 6rem);
    letter-spacing: -0.03em;
    color: var(--light);
    margin-bottom: 0.5rem;
    text-shadow: 0 0 40px rgba(125, 255, 186, 0.15);
}

.title-accent {
    color: var(--green);
}

.opening-subtitle {
    font-family: 'Overpass Mono', monospace;
    font-weight: 300;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--fungal);
    margin-top: 1rem;
}

/* HUD Labels */
.hud-label {
    position: absolute;
    z-index: 3;
}

.hud-label-top-left {
    top: 2rem;
    left: 2rem;
}

.hud-label-top-right {
    top: 2rem;
    right: 2rem;
}

.hud-label-bottom-left {
    bottom: 2rem;
    left: 2rem;
}

.hud-label-bottom-right {
    bottom: 2rem;
    right: 2rem;
}

.coord-text {
    font-family: 'Overpass Mono', monospace;
    font-weight: 300;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--green);
    opacity: 0.6;
}

/* Scan line effect */
.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--green), transparent);
    opacity: 0.3;
    animation: scanMove 4s linear infinite;
    z-index: 2;
}

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

/* ===== Spread Inner Layouts ===== */
.spread-inner {
    display: flex;
    width: 100%;
    height: 100%;
    padding: 4rem;
    gap: 3rem;
    position: relative;
    z-index: 2;
}

.asymmetric-left {
    flex-direction: row;
}

.asymmetric-right {
    flex-direction: row;
}

.asymmetric-center {
    justify-content: center;
    align-items: center;
}

.three-column {
    flex-direction: row;
    gap: 2rem;
}

/* Spread columns */
.spread-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.spread-col-image {
    flex: 0 0 45%;
}

.spread-col-text {
    flex: 1;
    padding: 2rem 0;
}

.col-narrow {
    flex: 0 0 35%;
}

.spread-col-gallery {
    flex: 1;
}

.spread-col-note {
    flex: 1;
    padding: 1rem 0;
}

/* Specimen badge */
.specimen-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Overpass Mono', monospace;
    font-weight: 300;
    font-size: 12px;
    color: var(--green);
    margin-bottom: 1.5rem;
    background: rgba(125, 255, 186, 0.05);
}

/* Headings */
.spread-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3.6rem);
    letter-spacing: -0.03em;
    color: var(--light);
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

/* Body text */
.spread-body {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    line-height: 1.7;
    color: var(--light);
    opacity: 0.85;
    margin-bottom: 1.25rem;
    max-width: 540px;
}

/* Pull quotes */
.pull-quote {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    color: var(--fungal);
    border-left: 2px solid var(--rust);
    padding-left: 1.5rem;
    margin: 2rem 0;
    line-height: 1.5;
}

/* HUD Panel with bracket corners */
.hud-panel {
    position: relative;
    overflow: hidden;
}

.bracket-corner {
    position: absolute;
    width: 16px;
    height: 16px;
    z-index: 3;
}

.bracket-tl {
    top: 0;
    left: 0;
    border-top: 1px solid rgba(125, 255, 186, 0.4);
    border-left: 1px solid rgba(125, 255, 186, 0.4);
}

.bracket-tr {
    top: 0;
    right: 0;
    border-top: 1px solid rgba(125, 255, 186, 0.4);
    border-right: 1px solid rgba(125, 255, 186, 0.4);
}

.bracket-bl {
    bottom: 0;
    left: 0;
    border-bottom: 1px solid rgba(125, 255, 186, 0.4);
    border-left: 1px solid rgba(125, 255, 186, 0.4);
}

.bracket-br {
    bottom: 0;
    right: 0;
    border-bottom: 1px solid rgba(125, 255, 186, 0.4);
    border-right: 1px solid rgba(125, 255, 186, 0.4);
}

/* Image frame */
.image-frame {
    width: 100%;
    height: 70vh;
    background: var(--panel-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.image-frame .specimen-art {
    width: 100%;
    height: 100%;
}

/* HUD coordinates on images */
.hud-coord {
    position: absolute;
    font-family: 'Overpass Mono', monospace;
    font-weight: 300;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--green);
    opacity: 0.5;
    z-index: 4;
}

.top-left-coord {
    top: 8px;
    left: 8px;
}

.bottom-right-coord {
    bottom: 8px;
    right: 8px;
}

/* HUD Data Panel */
.hud-data-panel {
    position: relative;
    background: var(--panel-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 1.25rem;
    margin-top: 2rem;
}

.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(184, 166, 126, 0.1);
}

.data-row:last-child {
    border-bottom: none;
}

.data-label {
    font-family: 'Overpass Mono', monospace;
    font-weight: 300;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--fungal);
}

.data-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    color: var(--light);
}

.data-value-active {
    color: var(--green);
    text-shadow: 0 0 8px rgba(125, 255, 186, 0.3);
}

/* Gallery grid */
.gallery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1.5fr 1fr;
    gap: 1rem;
    height: 70vh;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    background: var(--panel-bg);
}

.gallery-item .specimen-art {
    width: 100%;
    height: 100%;
}

.gallery-item-large {
    grid-column: 1 / -1;
}

/* Note cards */
.note-card {
    position: relative;
    background: var(--panel-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.note-date {
    font-family: 'Overpass Mono', monospace;
    font-weight: 300;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--green);
    opacity: 0.6;
    display: block;
    margin-bottom: 0.75rem;
}

.note-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.03em;
    color: var(--light);
    margin-bottom: 0.75rem;
}

.note-body {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--light);
    opacity: 0.75;
}

/* Signal section */
.signal-container {
    max-width: 600px;
    text-align: center;
}

.signal-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 2rem 0;
    align-items: center;
}

.signal-link {
    font-family: 'Overpass Mono', monospace;
    font-weight: 300;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--green);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    display: inline-block;
}

.signal-link:hover {
    box-shadow: 0 0 12px rgba(125, 255, 186, 0.3);
    background: rgba(125, 255, 186, 0.05);
}

.link-bracket {
    color: var(--fungal);
    opacity: 0.5;
}

.link-text {
    margin: 0 0.5rem;
}

.signal-status {
    max-width: 350px;
    margin: 2rem auto 0;
}

/* Mycelium network */
.mycelium-network {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    z-index: 1;
    opacity: 0.4;
}

.mycelium-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 2s ease;
}

.spread.visible .mycelium-path {
    stroke-dashoffset: 0;
}

/* Mycelium background (signal spread) */
.mycelium-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* Nav pill */
#spread-nav {
    position: fixed;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
}

.nav-pill {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 6px;
    background: var(--panel-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 20px;
}

.nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid var(--fungal);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.nav-dot:hover {
    border-color: var(--green);
    box-shadow: 0 0 8px rgba(125, 255, 186, 0.3);
}

.nav-dot.active {
    background: var(--green);
    border-color: var(--green);
    box-shadow: 0 0 8px rgba(125, 255, 186, 0.4);
}

/* Morph elements */
.morph-element {
    opacity: 0;
    transform: translateY(30px) scale(0.97);
    transition: opacity var(--morph-duration) var(--morph-easing),
                transform var(--morph-duration) var(--morph-easing);
}

.spread.visible .morph-element {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.spread.visible .morph-element:nth-child(2) {
    transition-delay: 100ms;
}

.spread.visible .morph-element:nth-child(3) {
    transition-delay: 200ms;
}

.spread.visible .morph-element:nth-child(4) {
    transition-delay: 300ms;
}

.spread.visible .morph-element:nth-child(5) {
    transition-delay: 400ms;
}

/* Responsive */
@media (max-width: 768px) {
    .spread-inner {
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
    }
    
    .spread-col-image {
        flex: 0 0 auto;
    }
    
    .image-frame {
        height: 40vh;
    }
    
    .gallery-grid {
        height: auto;
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    
    .gallery-item-large {
        grid-column: 1;
        min-height: 200px;
    }
    
    .gallery-item-small {
        min-height: 150px;
    }
    
    .three-column {
        flex-direction: column;
    }
    
    #spread-nav {
        right: 0.75rem;
    }
    
    .hud-label-top-left,
    .hud-label-top-right,
    .hud-label-bottom-left,
    .hud-label-bottom-right {
        display: none;
    }
    
    .signal-container {
        padding: 0 1rem;
    }
}