/* ============================================================
   mosoon.xyz — Surreal Botanical Observatory
   Jewel-tone palette, Commissioner + Inconsolata, HUD overlay
   ============================================================ */

:root {
    /* Jewel-tone palette */
    --bg-primary: #0D0F14;       /* Obsidian night */
    --bg-alt: #111822;           /* Deep monsoon */
    --gold: #E8C547;             /* Monsoon gold */
    --jade: #2A7A5E;             /* Deep jade */
    --amethyst: #7B6DAA;         /* Twilight amethyst */
    --parchment: #F0E6D2;        /* Warm parchment */
    --sage: #8A9B8E;             /* Misted sage */
    --ruby: #C44B5C;             /* Ruby monsoon */

    --hud-frame-color: rgba(42, 122, 94, 0.6);
    --hud-frame-inset: 16px;

    --max-text-width: 680px;

    --font-display: "Commissioner", "Inter", system-ui, sans-serif;
    --font-mono: "Inconsolata", "Space Mono", "Courier New", monospace;
}

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

html {
    scroll-behavior: smooth;
    background: var(--bg-primary);
}

body {
    background-color: var(--bg-primary);
    color: var(--parchment);
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 19px;
    line-height: 1.7;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    background-image:
        radial-gradient(ellipse at center top, rgba(232, 197, 71, 0.04), transparent 60%),
        radial-gradient(ellipse at center, var(--bg-primary) 0%, var(--bg-alt) 100%);
}

/* Noise texture overlay */
.noise-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0.06;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/></svg>");
    background-size: 220px 220px;
}

/* ============================================================
   HUD FRAME
   ============================================================ */

.hud-frame {
    position: fixed;
    inset: var(--hud-frame-inset);
    pointer-events: none;
    z-index: 80;
}

.hud-border {
    position: absolute;
    background-color: var(--hud-frame-color);
    transition: opacity 0.6s ease;
}

.hud-border-top    { top: 0; left: 0; right: 0; height: 1px; transform-origin: left; animation: drawX 1.4s ease-out 0.2s both; }
.hud-border-bottom { bottom: 0; left: 0; right: 0; height: 1px; transform-origin: right; animation: drawX 1.4s ease-out 0.5s both; }
.hud-border-left   { top: 0; bottom: 0; left: 0; width: 1px; transform-origin: top; animation: drawY 1.4s ease-out 0.35s both; }
.hud-border-right  { top: 0; bottom: 0; right: 0; width: 1px; transform-origin: bottom; animation: drawY 1.4s ease-out 0.6s both; }

@keyframes drawX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes drawY { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.corner-bracket {
    position: absolute;
    width: 40px;
    height: 40px;
    animation: bracketIn 0.7s ease-out both;
}
.corner-bracket svg { width: 100%; height: 100%; display: block; }

.corner-tl { top: -1px; left: -1px; animation-delay: 0.05s; }
.corner-tr { top: -1px; right: -1px; transform-origin: top right; animation-delay: 0.15s; }
.corner-bl { bottom: -1px; left: -1px; animation-delay: 0.25s; }
.corner-br { bottom: -1px; right: -1px; animation-delay: 0.35s; }

@keyframes bracketIn {
    from { opacity: 0; transform: scale(0.5); }
    to   { opacity: 1; transform: scale(1); }
}

.hud-panel {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--amethyst);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.4;
    animation: panelFade 1s ease-out 1.2s both;
}

.hud-tl { top: 18px; left: 56px; }
.hud-tr { top: 18px; right: 56px; align-items: flex-end; }
.hud-bl { bottom: 18px; left: 56px; }
.hud-br { bottom: 12px; right: 12px; }

.hud-meta {
    color: var(--jade);
    font-size: 10px;
    letter-spacing: 0.18em;
}

.hud-value {
    color: var(--gold);
    font-size: 13px;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
}

@keyframes panelFade {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hud-leaf-spinner {
    width: 32px;
    height: 32px;
    animation: leafSpin 60s linear infinite;
}

@keyframes leafSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ============================================================
   PROGRESS INDICATOR
   ============================================================ */

.progress-indicator {
    position: fixed;
    left: 36px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 26px;
    z-index: 90;
    pointer-events: auto;
}

.progress-line {
    position: absolute;
    top: 8px;
    bottom: 8px;
    width: 1px;
    background: rgba(42, 122, 94, 0.3);
    z-index: 0;
}

.progress-dot {
    position: relative;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid var(--jade);
    background: var(--bg-primary);
    z-index: 1;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.4s ease, transform 0.3s ease, box-shadow 0.4s ease;
}

.progress-dot.active {
    background: var(--jade);
    box-shadow: 0 0 0 3px rgba(42, 122, 94, 0.18);
}

.progress-dot.passed {
    background: var(--jade);
}

.progress-dot:hover {
    transform: scale(1.25);
}

/* ============================================================
   RAINFALL
   ============================================================ */

.rainfall-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.raindrop {
    position: absolute;
    top: -40px;
    width: 2px;
    height: 18px;
    border-radius: 2px;
    background: var(--gold);
    will-change: transform, opacity;
}

.rainfall-zone {
    position: relative;
    height: 30vh;
    width: 100%;
    overflow: hidden;
    z-index: 2;
}

.rainfall-zone-light { height: 18vh; }

/* ============================================================
   CONTENT FLOW & CHAMBERS
   ============================================================ */

.content-flow {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
}

.chamber {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20vh 8vw 15vh;
    overflow: hidden;
}

.chamber-first-rain { min-height: 120vh; }
.chamber-deluge { min-height: 110vh; background-color: var(--bg-alt); background-image: radial-gradient(ellipse at center, rgba(123, 109, 170, 0.06), transparent 65%); }
.chamber-calm {
    background-color: #131A24;
    background-image:
        radial-gradient(ellipse at center, rgba(232, 197, 71, 0.05), transparent 70%);
}
.chamber-renewal {
    min-height: 80vh;
    background-color: #0F1620;
    background-image:
        radial-gradient(ellipse at center, rgba(42, 122, 94, 0.10), transparent 60%);
}

.chamber-inner {
    position: relative;
    z-index: 5;
    width: 100%;
    max-width: var(--max-text-width);
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ============================================================
   TYPOGRAPHY ELEMENTS
   ============================================================ */

.section-marker {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.18em;
    color: var(--jade);
    text-transform: uppercase;
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.bracket-mark { color: var(--gold); opacity: 0.7; }

.section-eyebrow {
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.20em;
    color: var(--jade);
    text-transform: uppercase;
    font-weight: 500;
    margin-bottom: 6px;
}

.title-mono {
    font-family: var(--font-mono);
    font-size: clamp(36px, 6vw, 68px);
    color: var(--gold);
    letter-spacing: 0.04em;
    font-weight: 500;
    line-height: 1.05;
    display: flex;
    align-items: baseline;
    gap: 4px;
    flex-wrap: wrap;
}

.section-heading {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(36px, 4.4vw, 60px);
    line-height: 1.07;
    letter-spacing: -0.03em;
    color: var(--gold);
}

.closing-statement {
    font-family: var(--font-mono);
    font-size: clamp(22px, 2.8vw, 34px);
    color: var(--gold);
    letter-spacing: 0.02em;
    font-weight: 500;
    line-height: 1.4;
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 2px;
}

.hero-subtitle {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(17px, 1.4vw, 21px);
    color: var(--parchment);
    line-height: 1.55;
    letter-spacing: 0.005em;
    max-width: 540px;
    opacity: 0.92;
}

.body-text {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 19px;
    line-height: 1.75;
    color: var(--parchment);
    letter-spacing: 0.01em;
}

.body-text-secondary {
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.7;
    color: var(--sage);
    letter-spacing: 0.05em;
}

.manifesto {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 8px 0 12px;
}

.manifesto-line {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(34px, 4.6vw, 64px);
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--gold);
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.9s ease, transform 0.9s ease;
}

.manifesto-line.in-view { opacity: 1; transform: translateY(0); }

/* Typewriter cursor */
.typewriter {
    display: inline;
}
.typewriter .char {
    opacity: 0;
    transition: opacity 0.05s linear;
}
.typewriter .char.visible { opacity: 1; }

.cursor {
    display: inline-block;
    width: 0.6ch;
    height: 1.05em;
    background: var(--gold);
    margin-left: 4px;
    transform: translateY(0.12em);
    animation: cursorBlink 1.06s steps(1, end) infinite;
}
.cursor-closing { background: var(--gold); }

@keyframes cursorBlink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* ============================================================
   DATA STRIPS / RETICLES
   ============================================================ */

.data-strip {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.data-strip-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.strip-bar {
    width: 80px;
    height: 2px;
    background: var(--jade);
    flex-shrink: 0;
}

.strip-bar-amethyst { background: var(--amethyst); }
.strip-bar-ruby { background: var(--ruby); }

.strip-text {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.10em;
    color: var(--sage);
    text-transform: uppercase;
}

.strip-num {
    color: var(--gold);
    font-variant-numeric: tabular-nums;
}

.reticle-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.reticle {
    width: 28px;
    height: 28px;
    animation: leafSpin 20s linear infinite;
}

.reticle-text {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--amethyst);
    text-transform: uppercase;
}

.footer-strip {
    margin-top: 30px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

/* ============================================================
   LEAVES & SCANNERS (SVG decoration)
   ============================================================ */

.leaf-bg {
    position: absolute;
    pointer-events: none;
    z-index: 1;
    will-change: transform;
}

.leaf-monstera-large {
    width: 60vw;
    height: auto;
    top: 8vh;
    right: -12vw;
    transform: rotate(-12deg);
    opacity: 0.85;
}

.leaf-monstera-medium {
    width: 38vw;
    height: auto;
    bottom: -8vh;
    left: -8vw;
    transform: rotate(8deg);
}

.leaf-monstera-bright {
    width: 42vw;
    height: auto;
    top: -10vh;
    right: -10vw;
    transform: rotate(15deg);
}

.leaf-banana-side {
    width: 18vw;
    height: auto;
    bottom: 0;
    left: -4vw;
}

.leaf-banana {
    width: 26vw;
    height: auto;
}

.leaf-left-2 { top: 5vh; left: -8vw; transform: rotate(-15deg); }
.leaf-right-2 { bottom: 4vh; right: -8vw; transform: rotate(12deg); }

.leaf-banana-bright {
    width: 24vw;
    height: auto;
    bottom: -10vh;
    left: -6vw;
}

.leaf-fern {
    width: 14vw;
    height: auto;
}

.fern-1 { top: 6vh; left: 4vw; transform: rotate(-8deg); }
.fern-2 { bottom: 8vh; right: 4vw; transform: rotate(180deg); }

.scanner-motif {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

.scanner-1 {
    width: 280px;
    height: 280px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: scanRotate 20s linear infinite;
    opacity: 0.5;
}

.scanner-large {
    width: min(680px, 75vw);
    height: min(680px, 75vw);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: scanRotate 20s linear infinite;
    opacity: 0.55;
}

@keyframes scanRotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}

.scanner-sweep {
    transform-origin: 300px 300px;
    animation: sweepRotate 20s linear infinite;
}

@keyframes sweepRotate {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.vein-network {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.10;
    pointer-events: none;
}

/* ============================================================
   SPORE FIELD (Calm section)
   ============================================================ */

.spore-field {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.spore {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--gold);
    opacity: 0.30;
    will-change: transform, opacity;
}

/* ============================================================
   REVEAL ANIMATIONS
   ============================================================ */

.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.9s ease, transform 0.9s ease;
}

.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ============================================================
   RENEWAL PULSE
   ============================================================ */

.hud-frame.pulse-gold .hud-border {
    background-color: rgba(232, 197, 71, 0.85);
    transition: background-color 0.5s ease;
}
.hud-frame.pulse-gold .corner-bracket svg path {
    stroke: var(--gold);
    transition: stroke 0.5s ease;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 720px) {
    :root { --hud-frame-inset: 10px; }

    .progress-indicator { left: 18px; gap: 18px; }
    .progress-dot { width: 8px; height: 8px; }

    .hud-tl { left: 44px; top: 14px; font-size: 10px; }
    .hud-tr { right: 44px; top: 14px; font-size: 10px; }
    .hud-bl { left: 44px; bottom: 14px; font-size: 10px; }
    .hud-br { right: 8px; bottom: 8px; }
    .hud-leaf-spinner { width: 24px; height: 24px; }

    .chamber { padding: 15vh 6vw 12vh; }

    .leaf-monstera-large { width: 90vw; opacity: 0.55; }
    .scanner-large { width: 95vw; height: 95vw; }
}
