/* ============================================
   martialaw.quest - Styles
   Ethereal Authoritarianism / Aurora Documentary
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --color-earth-dark: #2d2318;
    --color-earth-deep: #3d3225;
    --color-earth-mid: #8a7a62;
    --color-parchment: #d4c4a8;
    --color-parchment-light: #f2e6d4;
    --color-aurora-green: #5ee8a0;
    --color-forest: #2d7a5e;
    --color-sage: #6b8f71;
    --color-ember: #c45c3e;
    --color-violet: #9b6ed4;
    --color-abyss: #1a1410;

    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Source Serif 4', 'Georgia', serif;
    --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    background-color: var(--color-abyss);
}

body {
    font-family: var(--font-body);
    color: var(--color-parchment);
    background-color: var(--color-abyss);
    overflow-x: hidden;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* --- Grain Overlay --- */
#grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.08;
    filter: url(#grain-filter);
    background: rgba(242, 230, 212, 0.3);
    mix-blend-mode: overlay;
}

/* --- Aurora Canvas --- */
#aurora-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 1.5s ease;
}

#aurora-canvas.visible {
    opacity: 0.4;
}

/* --- Curfew Clock --- */
#curfew-clock {
    position: fixed;
    top: 24px;
    right: 32px;
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    opacity: 0.6;
    transition: opacity 0.5s ease;
}

#curfew-clock:hover {
    opacity: 1;
}

#clock-label {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 4px;
    color: var(--color-ember);
    text-transform: uppercase;
}

#clock-time {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 2px;
    color: var(--color-parchment);
    opacity: 0.7;
}

/* --- Scroll Progress --- */
#scroll-progress {
    position: fixed;
    left: 0;
    top: 0;
    width: 3px;
    height: 100vh;
    z-index: 900;
    background: rgba(45, 35, 24, 0.3);
}

#scroll-progress-bar {
    width: 100%;
    height: 0%;
    background: linear-gradient(
        to bottom,
        var(--color-ember),
        var(--color-aurora-green),
        var(--color-violet)
    );
    transition: height 0.1s linear;
}

/* --- Strata (Sections) --- */
.stratum {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 1;
}

.stratum-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 900px;
    padding: 80px 40px;
    margin: 0 auto;
}

/* Stratum fade edges */
.stratum-fade {
    position: absolute;
    left: 0;
    width: 100%;
    height: 120px;
    z-index: 3;
    pointer-events: none;
}

.stratum-fade-top {
    top: 0;
    background: linear-gradient(to bottom, var(--color-abyss), transparent);
}

.stratum-fade-bottom {
    bottom: 0;
    background: linear-gradient(to top, var(--color-abyss), transparent);
}

/* --- Stratum I: Proclamation --- */
#stratum-proclamation {
    background: radial-gradient(ellipse at center bottom, var(--color-earth-deep) 0%, var(--color-abyss) 70%);
    min-height: 100vh;
}

.proclamation-date {
    text-align: center;
    margin-bottom: 24px;
}

.date-text {
    font-family: var(--font-display);
    font-size: clamp(40px, 10vw, 120px);
    font-weight: 300;
    font-variation-settings: 'WONK' 0, 'opsz' 72;
    color: var(--color-parchment-light);
    letter-spacing: -0.02em;
    line-height: 1.1;
    display: inline-block;
    transition: font-weight 0.3s ease;
}

.proclamation-subtitle {
    text-align: center;
    margin-top: 16px;
}

.proclamation-subtitle .mono-text {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 6px;
    color: var(--color-ember);
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 1.2s ease 0.5s, transform 1.2s ease 0.5s;
}

.proclamation-subtitle .mono-text.revealed {
    opacity: 0.8;
    transform: translateY(0);
}

/* --- Stratum II: Silence --- */
#stratum-silence {
    background: linear-gradient(180deg, var(--color-abyss) 0%, #1e180f 50%, var(--color-abyss) 100%);
    min-height: 120vh;
}

.silence-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-bottom: 80px;
}

.body-text {
    font-family: var(--font-body);
    font-size: clamp(15px, 1.8vw, 18px);
    font-weight: 400;
    line-height: 1.8;
    color: var(--color-parchment);
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.body-text.visible {
    opacity: 0.9;
    transform: translateY(0);
}

/* Redacted blocks */
.redacted-block {
    padding: 32px 24px;
    border-left: 2px solid var(--color-ember);
    margin-bottom: 16px;
    background: rgba(45, 35, 24, 0.2);
}

.redacted-line {
    display: block;
    height: 12px;
    background: var(--color-earth-mid);
    margin-bottom: 10px;
    border-radius: 1px;
    opacity: 0.5;
}

.redacted-line.short {
    width: 60%;
}

.mono-caption {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 3px;
    color: var(--color-ember);
    text-transform: uppercase;
    opacity: 0.6;
}

.silence-quote {
    text-align: center;
    padding: 40px 0;
}

.silence-quote blockquote {
    font-family: var(--font-display);
    font-size: clamp(24px, 5vw, 56px);
    font-weight: 300;
    font-variation-settings: 'WONK' 1, 'opsz' 72;
    color: var(--color-parchment-light);
    font-style: italic;
    line-height: 1.3;
    transition: font-weight 0.3s ease;
}

/* --- Stratum III: Aurora --- */
#stratum-aurora {
    background: linear-gradient(180deg, var(--color-abyss) 0%, #0d1a12 30%, #0a1520 60%, var(--color-abyss) 100%);
    min-height: 120vh;
}

.aurora-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background:
        radial-gradient(ellipse 80% 50% at 30% 20%, rgba(94, 232, 160, 0.12) 0%, transparent 70%),
        radial-gradient(ellipse 60% 40% at 70% 40%, rgba(155, 110, 212, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 90% 30% at 50% 10%, rgba(45, 122, 94, 0.15) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 2s ease;
    animation: aurora-shift 8s ease-in-out infinite alternate;
}

.aurora-glow.active {
    opacity: 1;
}

@keyframes aurora-shift {
    0% {
        background-position: 0% 0%, 100% 50%, 50% 0%;
        filter: hue-rotate(0deg);
    }
    50% {
        filter: hue-rotate(15deg);
    }
    100% {
        background-position: 100% 20%, 0% 30%, 50% 10%;
        filter: hue-rotate(-10deg);
    }
}

.aurora-title {
    font-family: var(--font-display);
    font-size: clamp(36px, 8vw, 96px);
    font-weight: 300;
    font-variation-settings: 'WONK' 0, 'opsz' 72;
    color: var(--color-aurora-green);
    text-align: center;
    margin-bottom: 48px;
    text-shadow: 0 0 60px rgba(94, 232, 160, 0.3);
    transition: font-weight 0.3s ease;
}

.aurora-body {
    max-width: 700px;
    margin: 0 auto 48px;
}

.accent-green {
    color: var(--color-aurora-green);
    text-shadow: 0 0 20px rgba(94, 232, 160, 0.4);
}

.accent-purple {
    color: var(--color-violet);
    text-shadow: 0 0 20px rgba(155, 110, 212, 0.4);
}

.aurora-data-strip {
    display: flex;
    justify-content: center;
    gap: 32px;
    padding: 20px 0;
    border-top: 1px solid rgba(138, 122, 98, 0.2);
    border-bottom: 1px solid rgba(138, 122, 98, 0.2);
    flex-wrap: wrap;
}

.data-item {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 1px;
    color: var(--color-earth-mid);
}

.data-label {
    color: var(--color-sage);
    margin-right: 6px;
    font-weight: 500;
}

.status-blink {
    color: var(--color-ember);
    animation: blink-status 2s step-end infinite;
}

@keyframes blink-status {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* --- Stratum IV: Resistance --- */
#stratum-resistance {
    background: linear-gradient(180deg, var(--color-abyss) 0%, #1a1510 50%, var(--color-abyss) 100%);
    min-height: 130vh;
}

.resistance-title {
    font-family: var(--font-display);
    font-size: clamp(36px, 8vw, 96px);
    font-weight: 300;
    font-variation-settings: 'WONK' 0, 'opsz' 72;
    color: var(--color-ember);
    text-align: center;
    margin-bottom: 64px;
    transition: font-weight 0.3s ease;
}

.resistance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 64px;
}

.resistance-cell {
    padding: 32px;
    border: 1px solid rgba(138, 122, 98, 0.15);
    background: rgba(45, 35, 24, 0.15);
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease, border-color 0.5s ease;
}

.resistance-cell.visible {
    opacity: 1;
    transform: translateY(0);
}

.resistance-cell:hover {
    border-color: rgba(196, 92, 62, 0.4);
}

.cell-number {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 3px;
    color: var(--color-ember);
    margin-bottom: 16px;
    opacity: 0.7;
}

.resistance-counter {
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid rgba(138, 122, 98, 0.15);
}

.counter-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 4px;
    color: var(--color-earth-mid);
    margin-bottom: 12px;
}

.counter-value {
    font-family: var(--font-display);
    font-size: clamp(48px, 10vw, 96px);
    font-weight: 200;
    color: var(--color-parchment-light);
    letter-spacing: -0.02em;
}

/* --- Stratum V: Reckoning --- */
#stratum-reckoning {
    background: linear-gradient(180deg, var(--color-abyss) 0%, #1e1a12 40%, #1a1410 70%, var(--color-abyss) 100%);
    min-height: 120vh;
}

.reckoning-title {
    font-family: var(--font-display);
    font-size: clamp(36px, 8vw, 96px);
    font-weight: 300;
    font-variation-settings: 'WONK' 0, 'opsz' 72;
    color: var(--color-parchment-light);
    text-align: center;
    margin-bottom: 48px;
    transition: font-weight 0.3s ease;
}

.reckoning-body {
    max-width: 700px;
    margin: 0 auto 48px;
}

.final-text {
    color: var(--color-parchment-light);
    font-weight: 500;
    font-style: italic;
}

.reckoning-date {
    text-align: center;
    margin: 48px 0;
}

.reckoning-date .mono-text {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 6px;
    color: var(--color-sage);
    opacity: 0.7;
}

.reckoning-coda {
    text-align: center;
    padding: 60px 0 40px;
}

.coda-text {
    font-family: var(--font-display);
    font-size: clamp(48px, 12vw, 140px);
    font-weight: 300;
    font-variation-settings: 'WONK' 1, 'opsz' 144;
    color: var(--color-aurora-green);
    text-shadow: 0 0 80px rgba(94, 232, 160, 0.25);
    letter-spacing: -0.02em;
    line-height: 1;
    display: inline-block;
    transition: font-weight 0.3s ease;
}

/* --- Footer --- */
#site-footer {
    position: relative;
    z-index: 1;
    padding: 60px 40px;
    background: var(--color-abyss);
    border-top: 1px solid rgba(138, 122, 98, 0.1);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-domain {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 3px;
    color: var(--color-earth-mid);
}

.footer-line {
    width: 40px;
    height: 1px;
    background: var(--color-earth-mid);
    opacity: 0.3;
}

.footer-note {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 2px;
    color: var(--color-earth-mid);
    opacity: 0.5;
}

/* --- Mono text shared --- */
.mono-text {
    font-family: var(--font-mono);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .silence-columns {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .resistance-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .stratum-inner {
        padding: 60px 24px;
    }

    .aurora-data-strip {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    #curfew-clock {
        top: 16px;
        right: 16px;
    }
}

@media (max-width: 480px) {
    .stratum-inner {
        padding: 48px 16px;
    }

    .resistance-cell {
        padding: 24px 16px;
    }
}