/* ============================================
   martialaw.quest - Zen Meditation on Martial Law
   Color Palette:
     #F5EDE0 - Warm Parchment (Primary BG)
     #8B4A2A - Burnt Amber (Primary Text)
     #D4785A - Sunset Coral (Accent)
     #B8A090 - Sand Muted (Secondary)
     #5A3018 - Deep Earth (Darkest)
   Fonts: Noto Serif KR (700), Crimson Pro (300, 400, 600)
   ============================================ */

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

html {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: #F5EDE0;
    color: #8B4A2A;
    font-family: 'Crimson Pro', serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.05rem);
    line-height: 1.9;
    overflow-x: hidden;
}

/* Film Grain Overlay */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1000;
}

/* Ghost HUD Corners */
.hud-corners {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 999;
}

.hud-corner {
    position: absolute;
    font-family: 'Crimson Pro', serif;
    font-weight: 300;
    font-size: 1.5rem;
    color: #B8A090;
    opacity: 0.15;
    line-height: 1;
}

.hud-tl {
    top: 20px;
    left: 20px;
}

.hud-tr {
    top: 20px;
    right: 20px;
}

.hud-bl {
    bottom: 20px;
    left: 20px;
}

.hud-br {
    bottom: 20px;
    right: 20px;
}

/* Section Base */
.section {
    width: 100%;
    min-height: 100vh;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #F5EDE0;
    overflow: hidden;
}

/* Section HUD Line (bottom of each section) */
.section-hud-line {
    position: absolute;
    bottom: 0;
    left: 10%;
    width: 80%;
    height: 1px;
    background-color: #B8A090;
    opacity: 0.08;
}

/* ============================================
   Section 1: Hero (Stillness)
   ============================================ */
.section-hero {
    flex-direction: column;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 10;
}

.hero-title {
    font-family: 'Noto Serif KR', serif;
    font-weight: 700;
    font-size: clamp(4rem, 10vw, 8rem);
    color: #8B4A2A;
    opacity: 0;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.hero-title.visible {
    animation: fadeInSlow 1.5s ease-out forwards;
}

.hero-subtitle {
    font-family: 'Crimson Pro', serif;
    font-weight: 300;
    font-size: 0.85rem;
    color: #B8A090;
    letter-spacing: 0.15em;
    opacity: 0;
    text-transform: lowercase;
}

.hero-subtitle.visible {
    animation: fadeInSubtitle 2s ease-out forwards;
}

@keyframes fadeInSlow {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInSubtitle {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Hero Ripple */
.hero-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 500px;
    height: 500px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 5;
}

/* ============================================
   Sections 2-5: Stone Sections
   ============================================ */
.section-stone {
    align-items: flex-start;
    justify-content: center;
}

#section-stone-1 {
    padding-top: 30vh;
    align-items: flex-start;
}

#section-stone-2 {
    padding-top: 50vh;
    align-items: flex-start;
}

#section-stone-3 {
    padding-top: 60vh;
    align-items: flex-start;
}

#section-stone-4 {
    padding-top: 40vh;
    align-items: flex-start;
}

.stone-block {
    max-width: 500px;
    padding: 3rem;
    background-color: #F5EDE0;
    box-shadow: 0 1px 3px rgba(139, 74, 42, 0.08);
    position: relative;
    z-index: 10;
    opacity: 0.3;
    transition: opacity 600ms ease-out;
}

.stone-block.visible {
    opacity: 1;
}

.stone-header {
    font-family: 'Noto Serif KR', serif;
    font-weight: 700;
    font-size: clamp(1.3rem, 2.5vw, 2rem);
    color: #8B4A2A;
    letter-spacing: 0.03em;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

.stone-body {
    font-family: 'Crimson Pro', serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.05rem);
    color: #8B4A2A;
    line-height: 1.9;
}

/* Stone Ripple */
.stone-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 500px;
    height: 500px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 5;
}

/* ============================================
   Ripple Animation
   ============================================ */
.ripple-ring {
    opacity: 0;
}

.ripple-ring.animating {
    animation: rippleExpand 6s ease-out forwards;
}

@keyframes rippleExpand {
    0% {
        r: 0;
        opacity: 0.08;
    }
    100% {
        r: 200;
        opacity: 0;
    }
}

/* ============================================
   Section 6: Raked Lines (Zen Interlude)
   ============================================ */
.section-raked {
    background-color: #F5EDE0;
}

.raked-lines-svg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.raked-line {
    stroke: #B8A090;
    stroke-width: 0.5;
    opacity: 0.2;
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    fill: none;
}

.raked-line.animating {
    animation: drawLine 2s ease-out forwards;
}

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

.raked-stone {
    fill: #8B4A2A;
    opacity: 0;
    transition: opacity 800ms ease-out;
}

.raked-stone.visible {
    opacity: 0.15;
}

/* ============================================
   Section 7: Footer (Return)
   ============================================ */
.section-footer {
    min-height: 50vh;
    background-color: #F5EDE0;
}

.footer-period {
    font-family: 'Crimson Pro', serif;
    font-weight: 400;
    font-size: 3rem;
    color: #B8A090;
    line-height: 1;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
    .stone-block {
        max-width: 90vw;
        padding: 2rem;
    }

    .hero-ripple,
    .stone-ripple {
        width: 300px;
        height: 300px;
    }

    .hud-corner {
        font-size: 1.2rem;
    }

    #section-stone-1 { padding-top: 25vh; }
    #section-stone-2 { padding-top: 35vh; }
    #section-stone-3 { padding-top: 40vh; }
    #section-stone-4 { padding-top: 30vh; }
}

@media (max-width: 480px) {
    .stone-block {
        max-width: 95vw;
        padding: 1.5rem;
    }

    .hud-tl, .hud-tr, .hud-bl, .hud-br {
        display: none;
    }
}
