/* ============================================================
   historical.day — Bauhaus field station / HUD-overlay
   Colors: #1a1410 #2a2016 #2a1f15 #e8d5b7 #9b9178 #c4956a
           #b85c38 #d4a24e #f0e6d3 #8b7355 #3d3225 #5a4d3a
           #6b5e4a #8b7b65
   Fonts:  Nunito Sans (body), Josefin Sans (display),
           Overpass Mono (data)
============================================================ */

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    color: #e8d5b7;
    background: #1a1410;
    line-height: 1.7;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* ---------- Page atmospheric gradient (top→valley) ---------- */
.page-gradient {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 160% 120% at 50% 0%, #1a1410 0%, #1a1410 45%, #23180f 75%, #2a1f15 100%);
    pointer-events: none;
}

/* ============================================================
   LANDSCAPE / RIDGELINES — parallax depth field
============================================================ */
.landscape {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.ridge {
    position: absolute;
    left: -5vw;
    right: -5vw;
    width: 110vw;
    height: 75vh;
    bottom: 0;
    will-change: transform;
    opacity: 0;
    transition: opacity 900ms ease-out;
}

.landscape.ready .ridge { opacity: 1; }

.ridge-horizon  { bottom: 26vh; height: 50vh; transition-delay: 0ms; }
.ridge-distant  { bottom: 18vh; height: 55vh; transition-delay: 180ms; }
.ridge-far      { bottom: 10vh; height: 60vh; transition-delay: 360ms; }
.ridge-mid      { bottom:  4vh; height: 65vh; transition-delay: 540ms; }
.ridge-fore     { bottom:  0;   height: 70vh; transition-delay: 720ms; }

.contour-pattern {
    position: absolute;
    top: 20vh;
    left: 50%;
    width: min(140vh, 110vw);
    height: min(140vh, 110vw);
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 1500ms ease-out 900ms;
    mix-blend-mode: screen;
}
.landscape.ready .contour-pattern { opacity: 0.8; }

/* ============================================================
   HUD INSTRUMENTS — four corner readouts
============================================================ */
.instrument {
    position: fixed;
    z-index: 50;
    padding: 10px 14px;
    background: rgba(42, 32, 22, 0.78);
    border: 1px solid #8b7355;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-family: 'Overpass Mono', monospace;
    color: #c4956a;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    box-shadow:
        inset 0 0 24px rgba(0,0,0,0.35),
        0 2px 14px rgba(0,0,0,0.45);
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 400ms ease-out, transform 400ms ease-out;
}
.instrument.visible { opacity: 1; transform: none; }

.instrument::before,
.instrument::after {
    content: "";
    position: absolute;
    width: 8px; height: 8px;
    border: 1px solid #c4956a;
    opacity: 0.7;
}
.instrument::before { top: 3px; left: 3px; border-right: none; border-bottom: none; }
.instrument::after  { bottom: 3px; right: 3px; border-left: none; border-top: none; }

.instrument-tl { top: 20px; left: 20px; }
.instrument-tr { top: 20px; right: 20px; text-align: right; }
.instrument-bl { bottom: 20px; left: 20px; width: 220px; }
.instrument-br { bottom: 20px; right: 20px; text-align: right; }

.instrument-label {
    display: block;
    color: #9b9178;
    font-size: 0.62rem;
    letter-spacing: 0.3em;
    margin-bottom: 4px;
}

/* Compass */
.instrument-tl {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px;
    transition: transform 300ms ease-out, opacity 400ms ease-out;
}
.instrument-tl:hover { transform: scale(1.08); }
.compass-svg {
    width: 44px; height: 44px;
    overflow: visible;
}
.compass-body { transform-origin: 32px 32px; transition: transform 80ms linear; }
.compass-labels { opacity: 0.25; transition: opacity 300ms ease-out; }
.instrument-tl:hover .compass-labels { opacity: 1; }

/* Altimeter */
.altitude-readout {
    display: inline-flex;
    align-items: baseline;
    font-size: 1.4rem;
    font-weight: 400;
    color: #e8d5b7;
    letter-spacing: 0.15em;
    line-height: 1;
    padding: 2px 0;
}
.altitude-unit {
    font-size: 0.7rem;
    color: #c4956a;
    margin-left: 4px;
    letter-spacing: 0.2em;
}
.altitude-tick {
    margin-top: 6px;
    height: 2px;
    background: linear-gradient(to right,
        #c4956a 0%, #c4956a var(--fill, 0%),
        rgba(139,115,85,0.25) var(--fill, 0%), rgba(139,115,85,0.25) 100%);
}

/* Fuel gauge */
.fuel-gauge {
    position: relative;
    margin-top: 6px;
    width: 100%;
    height: 14px;
    border: 1px solid #8b7355;
    background: rgba(0,0,0,0.3);
}
.gauge-track {
    position: absolute;
    inset: 2px;
    background: linear-gradient(to right, #3d3225, #6b5e4a, #8b7355);
    opacity: 0.5;
}
.gauge-needle {
    position: absolute;
    top: -2px;
    bottom: -2px;
    left: 0;
    width: 2px;
    background: #d4a24e;
    box-shadow: 0 0 6px rgba(212,162,78,0.7);
    transition: left 180ms ease-out;
}
.gauge-marks {
    position: absolute;
    inset: 2px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}
.gauge-marks span {
    width: 1px;
    background: rgba(232,213,183,0.25);
}

/* Date stamp */
.date-display {
    color: #d4a24e;
    font-size: 0.85rem;
    letter-spacing: 0.25em;
    font-weight: 400;
    transition: color 400ms ease-out, opacity 400ms ease-out;
}

/* ============================================================
   CENTER RETICLE & RADIAL NAV
============================================================ */
.reticle {
    position: fixed;
    top: 50%; left: 50%;
    width: 120px; height: 120px;
    transform: translate(-50%, -50%);
    z-index: 40;
    opacity: 0;
    transition: opacity 400ms ease-out;
    cursor: pointer;
}
.reticle.visible { opacity: 0.7; }
.reticle:hover { opacity: 1; }
.reticle-svg { width: 100%; height: 100%; display: block; }

.radial-menu {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 300ms ease-out;
}
.radial-menu.open {
    opacity: 1;
    pointer-events: auto;
}

.radial-item {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: #c4956a;
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.72rem;
    text-decoration: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    transition:
        transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1),
        color 240ms ease-out;
}
.radial-item:hover { color: #b85c38; }
.radial-line {
    display: block;
    width: 24px; height: 1px;
    background: rgba(196,149,106,0.6);
}
.radial-label { display: block; padding: 4px 0; }

/* closed state (collapsed to center) */
.radial-n, .radial-e, .radial-s, .radial-w {
    transform: translate(-50%, -50%) scale(0.4);
    opacity: 0;
}
.radial-menu.open .radial-n { transform: translate(-50%, calc(-50% - 120px)) scale(1); opacity: 1; flex-direction: column-reverse; }
.radial-menu.open .radial-n .radial-line { width: 1px; height: 24px; }
.radial-menu.open .radial-e { transform: translate(calc(-50% + 120px), -50%) scale(1); opacity: 1; }
.radial-menu.open .radial-s { transform: translate(-50%, calc(-50% + 120px)) scale(1); opacity: 1; flex-direction: column; }
.radial-menu.open .radial-s .radial-line { width: 1px; height: 24px; }
.radial-menu.open .radial-w { transform: translate(calc(-50% - 120px), -50%) scale(1); opacity: 1; flex-direction: row-reverse; }

/* ============================================================
   CONTENT / MAIN LAYOUT
============================================================ */
.content {
    position: relative;
    z-index: 10;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 clamp(20px, 4vw, 60px);
}

/* ============================================================
   HERO
============================================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 12vh;
    padding-bottom: 12vh;
    position: relative;
}
.hero-frame {
    text-align: center;
    padding-top: 14vh;
}
.hero-title {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    color: #e8d5b7;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: clamp(2rem, 6.5vw, 5rem);
    line-height: 1.05;
    min-height: 1.2em;
    text-shadow: 0 2px 18px rgba(0,0,0,0.7);
}
.hero-title::after {
    content: "";
    display: inline-block;
    width: 0.08em; height: 0.9em;
    background: #c4956a;
    margin-left: 0.1em;
    vertical-align: -0.08em;
    animation: caret 820ms steps(2) infinite;
}
.hero-title.done::after { display: none; }
@keyframes caret { 50% { opacity: 0; } }

.hero-subtitle {
    margin-top: 28px;
    font-family: 'Overpass Mono', monospace;
    color: #9b9178;
    font-size: 0.85rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 800ms ease-out;
}
.hero-subtitle.visible { opacity: 1; }

.hero-coords {
    margin-top: 34px;
    font-family: 'Overpass Mono', monospace;
    color: #c4956a;
    font-size: 0.72rem;
    letter-spacing: 0.25em;
    opacity: 0;
    transition: opacity 800ms ease-out 200ms;
}
.hero-coords.visible { opacity: 0.9; }

.hero-scroll-hint {
    margin-top: 60px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #c4956a;
    font-family: 'Overpass Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    opacity: 0;
    transition: opacity 800ms ease-out 500ms;
}
.hero-scroll-hint.visible { opacity: 0.9; }
.hero-scroll-hint svg {
    animation: hint-bob 2.4s ease-in-out infinite;
}
@keyframes hint-bob {
    0%, 100% { transform: translateY(0); opacity: 0.7; }
    50% { transform: translateY(6px); opacity: 1; }
}

/* ============================================================
   PANEL GROUPS / HUD CONTENT PANELS
============================================================ */
.panel-group {
    position: relative;
    padding: 89px 0;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
}

.panel {
    position: relative;
    background: rgba(42, 32, 22, 0.85);
    border: 1px solid #8b7355;
    padding: 40px 44px;
    color: #e8d5b7;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow:
        inset 0 0 40px rgba(0,0,0,0.3),
        0 8px 30px rgba(0,0,0,0.45);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 600ms ease-out, transform 600ms ease-out;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(139,115,85,0.04) 0.5px, transparent 1px),
        radial-gradient(circle at 70% 40%, rgba(139,115,85,0.04) 0.5px, transparent 1px),
        radial-gradient(circle at 30% 80%, rgba(139,115,85,0.04) 0.5px, transparent 1px),
        radial-gradient(circle at 90% 65%, rgba(139,115,85,0.04) 0.5px, transparent 1px),
        radial-gradient(circle at 50% 50%, rgba(139,115,85,0.03) 0.5px, transparent 1px);
    background-size: 60px 60px, 80px 80px, 45px 45px, 55px 55px, 35px 35px;
}

/* outer embossed outline */
.panel::before {
    content: "";
    position: absolute;
    inset: -4px;
    border: 1px solid rgba(139,115,85,0.22);
    pointer-events: none;
}

.panel.visible { opacity: 1; transform: translateY(0); }
.panel.exiting { opacity: 0; transform: translateY(20px); transition-timing-function: ease-in; }

/* corner ticks (sextant angle indicators) */
.panel-corner {
    position: absolute;
    width: 14px; height: 14px;
    border-color: #c4956a;
    opacity: 0.6;
    pointer-events: none;
}
.panel-corner-tl { top: 8px;    left: 8px;    border-top: 1px solid; border-left: 1px solid; }
.panel-corner-tr { top: 8px;    right: 8px;   border-top: 1px solid; border-right: 1px solid; }
.panel-corner-bl { bottom: 8px; left: 8px;    border-bottom: 1px solid; border-left: 1px solid; }
.panel-corner-br { bottom: 8px; right: 8px;   border-bottom: 1px solid; border-right: 1px solid; }

.panel-primary {
    grid-column: span 8;
    padding: 48px 52px 52px;
}
.panel-secondary {
    grid-column: span 4;
    padding: 32px 34px;
    align-self: start;
}

.panel-offset-left  { grid-column-start: 1; }
.panel-offset-right { grid-column-start: auto; grid-column-end: 13; margin-left: auto; }
.panel-offset-center { grid-column: 3 / span 8; }

.panel-primary.panel-offset-right { grid-column: 5 / span 8; }
.panel-secondary.panel-offset-right { grid-column: 10 / span 3; }
.panel-secondary.panel-offset-left  { grid-column: 1 / span 3; }

.panel-group:nth-child(odd) .panel-secondary { margin-top: 55px; }
.panel-group:nth-child(even) .panel-secondary { margin-top: 34px; }

/* panel parts */
.panel-date {
    font-family: 'Overpass Mono', monospace;
    color: #c4956a;
    font-size: 0.72rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.panel-triangle {
    width: 0; height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 14px solid #b85c38;
    margin-bottom: 22px;
}

.panel-circle {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #c4956a;
    margin-bottom: 18px;
}

.panel-heading {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    color: #e8d5b7;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: clamp(1.6rem, 3.2vw, 2.6rem);
    line-height: 1.1;
    margin-bottom: 22px;
}

.panel-subheading {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    color: #e8d5b7;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 1.05rem;
    line-height: 1.2;
    margin-bottom: 16px;
}

.panel-rule {
    width: 61.8%;
    height: 1px;
    background: #8b7355;
    margin-bottom: 28px;
    opacity: 0.7;
}

.panel-body p {
    font-family: 'Nunito Sans', sans-serif;
    font-size: clamp(1rem, 1.8vw, 1.125rem);
    line-height: 1.75;
    color: #e8d5b7;
    opacity: 0.9;
    margin-bottom: 18px;
    letter-spacing: 0.01em;
}
.panel-body p:last-child { margin-bottom: 0; }

.panel-body-small {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 0.95rem;
    line-height: 1.65;
    color: #e8d5b7;
    opacity: 0.82;
    margin-bottom: 14px;
}

.panel-annotation {
    position: absolute;
    bottom: 18px;
    right: 22px;
    font-family: 'Overpass Mono', monospace;
    color: #c4956a;
    font-size: 0.65rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    opacity: 0.8;
}

.panel-annotation-small {
    margin-top: 12px;
    font-family: 'Overpass Mono', monospace;
    color: #9b9178;
    font-size: 0.6rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    opacity: 0.75;
}

/* closing / centered panel */
.closing .panel-primary {
    grid-column: 3 / span 8;
    text-align: left;
}

/* ============================================================
   FOOTER
============================================================ */
.field-footer {
    padding: 120px 0 160px;
    text-align: center;
}
.footer-rule {
    width: 61.8%;
    height: 1px;
    background: #8b7355;
    margin: 0 auto 32px;
    opacity: 0.5;
}
.footer-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 32px;
    font-family: 'Overpass Mono', monospace;
    color: #9b9178;
    font-size: 0.65rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 900px) {
    .panel-primary,
    .panel-secondary,
    .panel-primary.panel-offset-right,
    .panel-secondary.panel-offset-right,
    .panel-secondary.panel-offset-left,
    .panel-offset-center,
    .closing .panel-primary {
        grid-column: 1 / span 12;
    }
    .panel-offset-left  { margin-left: 3vw; margin-right: -3vw; }
    .panel-offset-right { margin-right: 3vw; margin-left: -3vw; }
    .panel-group:nth-child(odd) .panel-secondary,
    .panel-group:nth-child(even) .panel-secondary { margin-top: 34px; }

    .instrument-bl { width: 180px; }
    .reticle { width: 88px; height: 88px; }
}

@media (max-width: 600px) {
    .panel-primary { padding: 30px 26px 40px; }
    .panel-secondary { padding: 24px 22px; }
    .panel-annotation { position: static; display: block; margin-top: 18px; }
    .instrument-tl, .instrument-tr, .instrument-bl, .instrument-br {
        font-size: 0.6rem;
        padding: 6px 10px;
    }
    .instrument-bl { width: 150px; }
    .altitude-readout { font-size: 1.05rem; }
    .hero-frame { padding-top: 8vh; }
}

/* Reduced motion — still present, just calmer */
@media (prefers-reduced-motion: reduce) {
    .ridge, .contour-pattern, .instrument, .panel,
    .hero-subtitle, .hero-coords, .hero-scroll-hint, .reticle {
        transition-duration: 200ms;
    }
    .hero-scroll-hint svg { animation: none; }
    .hero-title::after { animation: none; }
}
