/* ========================================
   Root Variables & General Styles
   ======================================== */

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

:root {
    /* Color Palette */
    --color-dark: #121418;
    --color-dark-secondary: #2A2830;
    --color-light: #F8F4E8;
    --color-dark-alt: #1E2028;
    --color-gold: #E8C868;
    --color-cyan: #00D4FF;
    --color-tan: #A89078;
    --color-sage: #7A8B6B;
    --color-slate: #6B7B8B;
    --color-accent: #FF4444;

    /* Typography */
    --font-mono: 'Space Mono', monospace;
    --font-sans: 'Source Sans 3', sans-serif;
    --font-serif: 'Literata', serif;
}

html, body {
    width: 100%;
    height: 100%;
    background-color: var(--color-dark);
    color: var(--color-light);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ========================================
   Page Container & Layout
   ======================================== */

.page-container {
    width: 100%;
    position: relative;
    background-color: var(--color-dark);
    padding-bottom: 4rem;
}

/* ========================================
   Sections & Spacing
   ======================================== */

.section {
    position: relative;
    padding: 3rem 2rem;
    margin-bottom: 2rem;
}

.trailhead {
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 10vw;
    position: relative;
    overflow: hidden;
}

.trailhead-content {
    position: relative;
    z-index: 2;
}

.domain-marker {
    font-family: var(--font-mono);
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-light);
    margin-bottom: 3rem;
    line-height: 1.1;
}

.korean-title-container {
    position: relative;
    display: inline-block;
}

.korean-title {
    font-family: var(--font-sans);
    font-size: clamp(3rem, 12vw, 8rem);
    font-weight: 700;
    color: var(--color-gold);
    line-height: 1;
    text-shadow: 0 0 30px rgba(232, 200, 104, 0.2);
}

/* ========================================
   Content Blocks - S-Curve Positioning
   ======================================== */

.content-block {
    margin-left: calc(var(--path-offset, 10) * 1vw);
    max-width: 500px;
    position: relative;
    padding: 2rem;
    z-index: 1;
}

.content-text h3 {
    font-family: var(--font-mono);
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-cyan);
    margin-bottom: 1rem;
}

.content-text p {
    font-family: var(--font-sans);
    font-size: clamp(1rem, 2vw, 1.125rem);
    color: var(--color-light);
    line-height: 1.8;
    opacity: 0.9;
}

/* ========================================
   Lens Flares
   ======================================== */

.lens-flare {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.trailhead-flare {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle at 50% 50%, rgba(232, 200, 104, 0.3) 0%, transparent 70%);
    top: 35vh;
    right: 15vw;
    animation: pulse-flare 4s ease-in-out infinite;
}

.midpath-flare {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle at 50% 50%, rgba(232, 200, 104, 0.2) 0%, transparent 70%);
    top: 45%;
    right: 5%;
    animation: pulse-flare-mid 5s ease-in-out infinite;
    animation-delay: 0.5s;
}

.final-flare {
    width: 800px;
    height: 800px;
    background: radial-gradient(circle at 50% 50%, rgba(0, 212, 255, 0.08) 0%, transparent 70%);
    top: 70%;
    right: -10%;
    animation: pulse-flare-large 6s ease-in-out infinite;
    animation-delay: 1s;
}

/* ========================================
   Animations
   ======================================== */

@keyframes pulse-flare {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.8;
    }
}

@keyframes pulse-flare-mid {
    0%, 100% {
        transform: scale(1);
        opacity: 0.4;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.6;
    }
}

@keyframes pulse-flare-large {
    0%, 100% {
        transform: scale(1);
        opacity: 0.2;
    }
    50% {
        transform: scale(1.08);
        opacity: 0.35;
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ========================================
   SVG Connecting Paths
   ======================================== */

.connecting-path {
    width: 100%;
    height: 300px;
    display: block;
    margin: 1rem 0 2rem 0;
    opacity: 0.6;
}

.path-line {
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ========================================
   Responsive Design - Mobile
   ======================================== */

@media (max-width: 768px) {
    .content-block {
        margin-left: 5vw !important;
        margin-right: 5vw;
        max-width: 100%;
    }
    
    .trailhead {
        height: 60vh;
        padding-left: 5vw;
        justify-content: center;
    }
    
    .domain-marker {
        font-size: clamp(1.5rem, 4vw, 2.5rem);
        margin-bottom: 2rem;
    }
    
    .korean-title {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }
    
    .connecting-path {
        height: 200px;
        margin: 1rem 0 1.5rem 0;
    }
    
    .trailhead-flare {
        width: 150px;
        height: 150px;
        right: 10vw;
    }
    
    .midpath-flare {
        width: 250px;
        height: 250px;
        right: 0%;
        top: 40%;
    }
    
    .final-flare {
        width: 400px;
        height: 400px;
        right: -5%;
        top: 60%;
    }
    
    .section {
        padding: 2rem 1rem;
        margin-bottom: 1.5rem;
    }
    
    .content-text h3 {
        font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    }
    
    .content-text p {
        font-size: clamp(0.95rem, 1.8vw, 1rem);
    }
}

@media (max-width: 480px) {
    .content-block {
        margin-left: 3vw !important;
        margin-right: 3vw;
        padding: 1.5rem 1rem;
    }
    
    .trailhead {
        height: 50vh;
        padding-left: 3vw;
    }
    
    .domain-marker {
        font-size: 1.3rem;
        margin-bottom: 1.5rem;
        letter-spacing: 0.1em;
    }
    
    .korean-title {
        font-size: 2.5rem;
    }
    
    .connecting-path {
        height: 150px;
        margin: 0.75rem 0 1rem 0;
    }
    
    .trailhead-flare {
        width: 100px;
        height: 100px;
        right: 5vw;
    }
    
    .midpath-flare {
        width: 150px;
        height: 150px;
        top: 35%;
    }
    
    .final-flare {
        width: 250px;
        height: 250px;
        top: 55%;
    }
}

/* ========================================
   Scroll & Interaction Enhancements
   ======================================== */

.content-block {
    opacity: 0;
    animation: fade-in 0.8s ease-out forwards;
}

#block-1 { animation-delay: 0.1s; }
#block-2 { animation-delay: 0.2s; }
#block-3 { animation-delay: 0.3s; }
#block-4 { animation-delay: 0.4s; }
#block-5 { animation-delay: 0.5s; }
#block-6 { animation-delay: 0.6s; }
#block-7 { animation-delay: 0.7s; }

/* ========================================
   Smooth Scrolling
   ======================================== */

html {
    scroll-behavior: smooth;
}

/* ========================================
   Typography Details
   ======================================== */

h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
}

p {
    margin-bottom: 1rem;
}

p:last-child {
    margin-bottom: 0;
}

/* ========================================
   Code & Special Elements
   ======================================== */

code, pre {
    font-family: var(--font-mono);
    background-color: var(--color-dark-secondary);
    padding: 0.2em 0.4em;
    border-radius: 4px;
}

pre {
    padding: 1rem;
    overflow-x: auto;
}

/* ========================================
   Links & Interactive Elements
   ======================================== */

a {
    color: var(--color-cyan);
    text-decoration: none;
    border-bottom: 1px solid var(--color-cyan);
    transition: color 0.3s ease, border-color 0.3s ease;
}

a:hover {
    color: var(--color-gold);
    border-bottom-color: var(--color-gold);
}

/* ========================================
   Utility Classes
   ======================================== */

.hidden {
    display: none;
}

.invisible {
    visibility: hidden;
}
