/* ============================================================
   martiallaw.quest — Frutiger Aero x Martial Law Editorial
   ============================================================ */

:root {
    /* Palette from DESIGN.md */
    --bg-paper:      #F4F1EC;
    --text-primary:  #2C3539;
    --text-secondary:#6B7B8D;
    --accent-sage:   #7A9A7E;
    --accent-sky:    #8BA4B8;
    --glass-tint:    #D6E4ED;
    --warm-glow:     #C4A76C;
    --deep-ground:   #1E2A24;
}

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

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

body {
    font-family: 'IBM Plex Mono', monospace;
    background-color: var(--bg-paper);
    color: var(--text-primary);
    line-height: 1.75;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   HERO PANE (100vh)
   ============================================================ */
.hero-pane {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* -- Nature Scene (CSS Gradient Landscapes) -- */
.nature-scene {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.sky-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg,
        #8BA4B8 0%,
        #D6E4ED 55%,
        #F4F1EC 100%
    );
}

.hill-layer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    will-change: transform;
}

/* Hero hills */
.hill-far {
    height: 55%;
    background: radial-gradient(ellipse 160% 100% at 50% 100%, #7A9A7E 0%, transparent 70%);
}

.hill-mid {
    height: 40%;
    background:
        radial-gradient(ellipse 100% 100% at 25% 100%, #1E2A24 0%, transparent 55%),
        radial-gradient(ellipse 90% 100% at 75% 100%, #2C3539 0%, transparent 50%);
}

.hill-near {
    height: 25%;
    background: radial-gradient(ellipse 120% 100% at 60% 100%, #1E2A24 0%, transparent 65%);
}

.mist-layer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(180deg, transparent 0%, rgba(244, 241, 236, 0.4) 100%);
}

/* -- Frutiger Aero Glass Panel -- */
.glass-panel {
    background: rgba(214, 228, 237, 0.3);
    backdrop-filter: blur(12px) saturate(1.6);
    -webkit-backdrop-filter: blur(12px) saturate(1.6);
    border: 1px solid rgba(139, 164, 184, 0.25);
    border-radius: 12px;
    box-shadow:
        0 4px 24px rgba(30, 42, 36, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.hero-glass {
    position: relative;
    z-index: 2;
    padding: 3.5rem 4rem;
    max-width: 560px;
    width: 90%;
    transition: backdrop-filter 0.4s ease, -webkit-backdrop-filter 0.4s ease, background 0.4s ease;
}

/* Dynamic hero glass states driven by JS scroll */
.hero-glass.glass-deep {
    background: rgba(214, 228, 237, 0.55);
    backdrop-filter: blur(20px) saturate(1.6);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
}

.hero-glass.glass-deeper {
    background: rgba(214, 228, 237, 0.65);
    backdrop-filter: blur(24px) saturate(1.6);
    -webkit-backdrop-filter: blur(24px) saturate(1.6);
}

/* -- Water Droplets -- */
.water-droplets {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

.droplet {
    position: absolute;
    left: var(--dx);
    top: var(--dy);
    width: var(--ds);
    height: var(--ds);
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%,
        rgba(255, 255, 255, 0.8) 0%,
        rgba(255, 255, 255, 0.1) 40%,
        transparent 60%
    );
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
    opacity: 0.3;
}

/* -- Hero Content -- */
.hero-content {
    text-align: center;
}

.hero-rule {
    width: 100%;
    height: 1px;
    background: var(--accent-sky);
    opacity: 0.5;
    margin: 0.8rem 0;
}

.hero-title {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(1.4rem, 3.5vw, 2.2rem);
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-primary);
    line-height: 1.2;
    padding: 0.6rem 0;
}

.hero-proclamation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.8rem;
    margin-top: 1.2rem;
    flex-wrap: wrap;
}

.proclamation-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.proclamation-sep {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: var(--accent-sky);
    letter-spacing: 0.1em;
}

/* ============================================================
   EDITORIAL COLUMN
   ============================================================ */
.editorial-column {
    max-width: 720px;
    margin: 0 auto;
    padding: 6rem 2rem 4rem;
    position: relative;
}

/* -- Editorial Section -- */
.editorial-section {
    position: relative;
    margin-bottom: 5rem;
    padding-left: 3rem;
    /* Reveal animation initial state */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 600ms ease-out, transform 600ms ease-out;
}

.editorial-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* -- Vertical Spine -- */
.section-spine {
    position: absolute;
    left: 0;
    top: 0;
    width: 1px;
    height: 100%;
    background: var(--accent-sky);
    opacity: 0.6;
}

/* -- Ghost Section Numbers -- */
.ghost-numeral {
    position: absolute;
    left: -2.5rem;
    top: -0.5rem;
    font-family: 'Instrument Serif', serif;
    font-size: clamp(4rem, 8vw, 7rem);
    font-weight: 400;
    color: var(--accent-sage);
    opacity: 0;
    line-height: 1;
    pointer-events: none;
    user-select: none;
    /* Slide-in animation initial state */
    transform: translateX(-30px);
    transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 400ms ease-out;
}

.editorial-section.visible .ghost-numeral {
    transform: translateX(0);
    opacity: 0.15;
}

/* -- Pressed Leaf Silhouettes -- */
.leaf-decoration {
    position: absolute;
    right: -4rem;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 55px;
    color: var(--accent-sage);
    opacity: 0.08;
    animation: leaf-spin 120s linear infinite;
    pointer-events: none;
}

.leaf-decoration svg {
    width: 100%;
    height: 100%;
}

@keyframes leaf-spin {
    from { transform: translateY(-50%) rotate(0deg); }
    to   { transform: translateY(-50%) rotate(360deg); }
}

.leaf-maple { animation-delay: -20s; }
.leaf-fern  { animation-delay: -45s; right: -3.5rem; }
.leaf-oak-alt { animation-delay: -70s; animation-direction: reverse; }
.leaf-maple-alt { animation-delay: -95s; animation-direction: reverse; }

/* -- Document Stamp (Section Divider) -- */
.document-stamp {
    display: inline-block;
    padding: 0.35rem 1rem;
    border: 1px solid var(--accent-sky);
    margin-bottom: 1.5rem;
}

.stamp-text {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

/* -- Section Heading -- */
.section-heading {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

/* -- Body Text -- */
.body-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.95rem, 1.4vw, 1.1rem);
    font-weight: 300;
    color: var(--text-primary);
    line-height: 1.75;
    letter-spacing: 0.02em;
    margin-bottom: 1.5rem;
}

/* -- Metadata Lines -- */
.metadata-line {
    margin-top: 2rem;
    margin-bottom: 0;
}

.metadata-stamp {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

/* -- Redacted Block -- */
.redacted-block {
    padding: 1.2rem 1.5rem;
    border: 1px solid rgba(139, 164, 184, 0.3);
    background: rgba(107, 123, 141, 0.04);
    margin: 2rem 0;
    position: relative;
}

.redacted-block::before {
    content: 'REDACTED';
    position: absolute;
    top: -0.5rem;
    left: 1rem;
    background: var(--bg-paper);
    padding: 0 0.5rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    color: var(--warm-glow);
    text-transform: uppercase;
}

.redacted-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* -- Curfew Strip -- */
.curfew-strip {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem 2rem;
    border: 1px solid var(--warm-glow);
    background: rgba(196, 167, 108, 0.04);
    margin: 2rem 0;
}

.curfew-block {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.curfew-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.6rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.curfew-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
}

.curfew-active {
    color: var(--warm-glow);
}

.curfew-divider {
    width: 1px;
    height: 36px;
    background: var(--warm-glow);
    opacity: 0.35;
}

/* ============================================================
   NATURE PANORAMA INTERLUDES (Full-bleed)
   ============================================================ */
.nature-panorama {
    position: relative;
    width: 100vw;
    height: 40vh;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    margin-top: 3rem;
    margin-bottom: 3rem;
    overflow: hidden;
    /* Reveal animation */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 600ms ease-out, transform 600ms ease-out;
}

.nature-panorama.visible {
    opacity: 1;
    transform: translateY(0);
}

.panorama-scene {
    will-change: transform;
}

.panorama-glass {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background: rgba(244, 241, 236, 0.35);
    backdrop-filter: blur(8px) saturate(1.4) brightness(1.05);
    -webkit-backdrop-filter: blur(8px) saturate(1.4) brightness(1.05);
    border-radius: 0;
    border: none;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(139, 164, 184, 0.15);
}

/* Panorama sky variants */
.sky-warm {
    background: linear-gradient(180deg,
        #8BA4B8 0%,
        #D6E4ED 40%,
        #E8D8C0 85%,
        #F4F1EC 100%
    );
}

.sky-dusk {
    background: linear-gradient(180deg,
        #6B7B8D 0%,
        #8BA4B8 35%,
        #D6E4ED 65%,
        #C4A76C 90%,
        #F4F1EC 100%
    );
}

.sky-dawn {
    background: linear-gradient(180deg,
        #6B7B8D 0%,
        #8BA4B8 25%,
        #D6E4ED 55%,
        #E8D0B0 85%,
        #F4F1EC 100%
    );
}

.sky-clearing {
    background: linear-gradient(180deg,
        #8BA4B8 0%,
        #D6E4ED 35%,
        #D6E4ED 60%,
        #F4F1EC 100%
    );
}

/* Panorama hill variants */
.panorama-hill-far {
    height: 50%;
    background: radial-gradient(ellipse 140% 100% at 40% 100%, #7A9A7E 0%, transparent 65%);
}

.panorama-hill-mid {
    height: 35%;
    background:
        radial-gradient(ellipse 80% 100% at 20% 100%, #1E2A24 0%, transparent 55%),
        radial-gradient(ellipse 70% 100% at 80% 100%, #2C3539 0%, transparent 50%);
}

.panorama-hill-near {
    height: 20%;
    background: radial-gradient(ellipse 100% 100% at 55% 100%, #1E2A24 0%, transparent 60%);
}

.panorama-hill-far-alt {
    height: 55%;
    background: radial-gradient(ellipse 160% 100% at 60% 100%, #7A9A7E 0%, transparent 60%);
}

.panorama-hill-mid-alt {
    height: 38%;
    background:
        radial-gradient(ellipse 90% 100% at 70% 100%, #1E2A24 0%, transparent 50%),
        radial-gradient(ellipse 75% 100% at 25% 100%, #2C3539 0%, transparent 55%);
}

.panorama-hill-near-alt {
    height: 22%;
    background: radial-gradient(ellipse 110% 100% at 45% 100%, #1E2A24 0%, transparent 55%);
}

.panorama-hill-dawn-far {
    height: 45%;
    background: radial-gradient(ellipse 150% 100% at 50% 100%, #7A9A7E 0%, transparent 65%);
}

.panorama-hill-dawn-near {
    height: 28%;
    background:
        radial-gradient(ellipse 85% 100% at 35% 100%, #1E2A24 0%, transparent 55%),
        radial-gradient(ellipse 70% 100% at 70% 100%, #1E2A24 0%, transparent 45%);
}

.panorama-hill-clearing-far {
    height: 48%;
    background: radial-gradient(ellipse 130% 100% at 45% 100%, #7A9A7E 0%, transparent 68%);
}

.panorama-hill-clearing-near {
    height: 25%;
    background:
        radial-gradient(ellipse 95% 100% at 30% 100%, #1E2A24 0%, transparent 50%),
        radial-gradient(ellipse 80% 100% at 75% 100%, #2C3539 0%, transparent 48%);
}

.mist-light {
    height: 35%;
    background: linear-gradient(180deg, transparent 0%, rgba(244, 241, 236, 0.35) 100%);
}

.mist-heavy {
    height: 55%;
    background: linear-gradient(180deg, transparent 0%, rgba(244, 241, 236, 0.55) 100%);
}

.mist-dawn {
    height: 50%;
    background: linear-gradient(180deg, transparent 0%, rgba(244, 241, 236, 0.5) 100%);
}

.mist-thin {
    height: 30%;
    background: linear-gradient(180deg, transparent 0%, rgba(244, 241, 236, 0.25) 100%);
}

/* ============================================================
   TERMINAL FOOTER
   ============================================================ */
.terminal-footer {
    display: flex;
    justify-content: center;
    padding: 4rem 2rem 6rem;
}

.terminal-block {
    max-width: 480px;
    width: 100%;
    border: 1px solid var(--accent-sky);
    padding: 2rem;
    text-align: center;
}

.terminal-line {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-secondary);
    line-height: 2;
}

.terminal-diamond {
    width: 6px;
    height: 6px;
    background: var(--accent-sky);
    transform: rotate(45deg);
    margin: 1rem auto;
}

.terminal-domain {
    color: var(--text-primary);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    margin-top: 0.5rem;
}

/* ============================================================
   DIAMOND HORIZONTAL RULE (Custom HR treatment)
   ============================================================ */
hr, .diamond-rule {
    border: none;
    height: 1px;
    background: var(--accent-sky);
    position: relative;
    margin: 2rem 0;
    opacity: 0.6;
}

hr::after, .diamond-rule::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: var(--accent-sky);
    transform: translate(-50%, -50%) rotate(45deg);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .editorial-column {
        padding: 4rem 1.5rem 3rem;
    }

    .editorial-section {
        padding-left: 2rem;
    }

    .ghost-numeral {
        left: -1.5rem;
        font-size: clamp(3rem, 7vw, 5rem);
    }

    .leaf-decoration {
        display: none;
    }

    .hero-glass {
        padding: 2.5rem 2rem;
    }

    .curfew-strip {
        flex-wrap: wrap;
        gap: 1rem;
        padding: 1.2rem 1.5rem;
    }

    .curfew-divider {
        display: none;
    }

    .nature-panorama {
        height: 35vh;
    }

    .hero-proclamation {
        flex-direction: column;
        gap: 0.3rem;
    }

    .proclamation-sep {
        display: none;
    }
}

@media (max-width: 480px) {
    .editorial-column {
        padding: 3rem 1rem 2rem;
    }

    .editorial-section {
        padding-left: 1.5rem;
    }

    .ghost-numeral {
        left: -1rem;
        font-size: clamp(2.5rem, 6vw, 4rem);
    }

    .hero-glass {
        padding: 2rem 1.5rem;
    }

    .nature-panorama {
        height: 30vh;
    }

    .curfew-strip {
        padding: 1rem;
    }

    .terminal-block {
        padding: 1.5rem;
    }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .editorial-section,
    .nature-panorama {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .ghost-numeral {
        transform: none;
        transition: none;
        opacity: 0.15;
    }

    .leaf-decoration {
        animation: none;
    }

    html {
        scroll-behavior: auto;
    }

    .hero-glass {
        transition: none;
    }
}
