/* =============================================
   LLITTL.com — Neubrutalist Pastoral HUD
   ============================================= */

/* CSS Custom Properties */
:root {
    --deep-ground: #1a1612;
    --panel-bg: #f4efe6;
    --border-primary: #2d2926;
    --moss-accent: #5a7247;
    --meadow-glow: #a8b545;
    --horizon-blush: #d4944c;
    --sky-wash: #c4cde0;
    --field-mist: rgba(244, 239, 230, 0.7);
    --glitch-accent: #b8f02e;
    --dark-forest: #2a3024;
    --deep-canopy: #1e2418;

    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-accent: 'Cormorant Garamond', serif;
}

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

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--moss-accent) var(--deep-ground);
}

html::-webkit-scrollbar {
    width: 8px;
}

html::-webkit-scrollbar-track {
    background: var(--deep-ground);
}

html::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, var(--moss-accent), var(--meadow-glow));
    border-radius: 0;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.72;
    color: var(--border-primary);
    background: var(--deep-ground);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* =============================================
   Background Gradient Animation
   ============================================= */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--deep-ground), var(--dark-forest), var(--deep-canopy), var(--deep-ground));
    background-size: 400% 400%;
    animation: bg-drift 30s ease-in-out infinite;
    z-index: 0;
}

@keyframes bg-drift {
    0%   { background-position: 0% 50%; }
    25%  { background-position: 100% 25%; }
    50%  { background-position: 100% 50%; }
    75%  { background-position: 0% 75%; }
    100% { background-position: 0% 50%; }
}

/* =============================================
   Scan-line Overlay
   ============================================= */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(0, 0, 0, 0.04) 3px,
        rgba(0, 0, 0, 0.04) 4px
    );
    pointer-events: none;
    z-index: 1;
}

/* =============================================
   Floating Botanical SVGs
   ============================================= */
.floating-botanicals {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.botanical {
    position: absolute;
    color: var(--moss-accent);
    opacity: 0.2;
}

.botanical-1 {
    width: 50px;
    top: 10%;
    left: 5%;
    animation: drift-1 55s ease-in-out infinite;
    opacity: 0.18;
}

.botanical-2 {
    width: 40px;
    top: 30%;
    right: 8%;
    animation: drift-2 70s ease-in-out infinite;
    opacity: 0.25;
}

.botanical-3 {
    width: 60px;
    top: 55%;
    left: 12%;
    animation: drift-3 48s ease-in-out infinite;
    opacity: 0.15;
}

.botanical-4 {
    width: 35px;
    top: 70%;
    right: 15%;
    animation: drift-4 62s ease-in-out infinite;
    opacity: 0.22;
}

.botanical-5 {
    width: 55px;
    top: 85%;
    left: 3%;
    animation: drift-5 80s ease-in-out infinite;
    opacity: 0.3;
}

@keyframes drift-1 {
    0%   { transform: translate(0, 0) rotate(0deg); }
    25%  { transform: translate(30px, -20px) rotate(5deg); }
    50%  { transform: translate(-10px, -40px) rotate(-3deg); }
    75%  { transform: translate(20px, -10px) rotate(8deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes drift-2 {
    0%   { transform: translate(0, 0) rotate(0deg); }
    33%  { transform: translate(-25px, 15px) rotate(-6deg); }
    66%  { transform: translate(15px, -25px) rotate(4deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes drift-3 {
    0%   { transform: translate(0, 0) rotate(0deg); }
    20%  { transform: translate(20px, 10px) rotate(3deg); }
    40%  { transform: translate(-15px, 25px) rotate(-5deg); }
    60%  { transform: translate(25px, -15px) rotate(7deg); }
    80%  { transform: translate(-10px, -20px) rotate(-2deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes drift-4 {
    0%   { transform: translate(0, 0) rotate(0deg); }
    50%  { transform: translate(-20px, 30px) rotate(-8deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes drift-5 {
    0%   { transform: translate(0, 0) rotate(0deg); }
    30%  { transform: translate(15px, -20px) rotate(4deg); }
    60%  { transform: translate(-20px, 10px) rotate(-6deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

/* =============================================
   HUD Overlay — Corner Anchors
   ============================================= */
.hud-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.hud-corner {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 16px 20px;
}

.hud-top-left {
    top: 0;
    left: 0;
    align-items: flex-start;
}

.hud-top-right {
    top: 0;
    right: 0;
    align-items: flex-end;
}

.hud-bottom-left {
    bottom: 0;
    left: 0;
    align-items: flex-start;
}

.hud-bottom-right {
    bottom: 0;
    right: 0;
    align-items: flex-end;
}

.hud-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--meadow-glow);
    opacity: 0.6;
    text-transform: uppercase;
}

.hud-value {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--panel-bg);
    opacity: 0.6;
}

.wind-indicator {
    width: 18px;
    height: 18px;
    color: var(--meadow-glow);
    opacity: 0.6;
    transition: transform 2s ease-in-out;
}

.wind-indicator svg {
    width: 100%;
    height: 100%;
}

/* =============================================
   Floating HUD Data Fragments
   ============================================= */
.hud-fragments {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

.hud-fragment {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--meadow-glow);
    opacity: 0.18;
    letter-spacing: 0.08em;
    white-space: nowrap;
    will-change: transform;
}

/* =============================================
   Side Navigation Rail
   ============================================= */
.side-rail {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    z-index: 15;
}

.rail-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--moss-accent);
    opacity: 0.3;
}

.rail-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1.5px solid var(--moss-accent);
    background: transparent;
    cursor: pointer;
    position: relative;
    z-index: 1;
    transition: all 0.4s ease;
    padding: 0;
}

.rail-dot.active {
    background: var(--meadow-glow);
    border-color: var(--meadow-glow);
    box-shadow: 0 0 8px rgba(168, 181, 69, 0.4);
}

.rail-dot:hover {
    border-color: var(--meadow-glow);
}

/* =============================================
   Compass Rose
   ============================================= */
.compass-rose {
    position: fixed;
    bottom: 20px;
    right: 60px;
    width: 24px;
    height: 24px;
    color: var(--moss-accent);
    opacity: 0.35;
    z-index: 10;
    pointer-events: none;
    animation: compass-spin 120s linear infinite;
}

.compass-rose svg {
    width: 100%;
    height: 100%;
}

@keyframes compass-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* =============================================
   Contour Lines
   ============================================= */
.contour-lines {
    position: fixed;
    top: 0;
    right: 30px;
    width: 60px;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.5;
}

/* =============================================
   Main Section Layout
   ============================================= */
.sections {
    position: relative;
    z-index: 5;
}

.section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 60px;
    position: relative;
}

/* =============================================
   Viewfinder Brackets
   ============================================= */
.viewfinder-brackets {
    position: absolute;
    top: 10%;
    left: 10%;
    right: 10%;
    bottom: 10%;
    pointer-events: none;
    z-index: 6;
}

.bracket {
    position: absolute;
    width: 24px;
    height: 24px;
    opacity: 0.5;
    animation: bracket-pulse 4s ease-in-out infinite;
}

.bracket-tl {
    top: 0;
    left: 0;
    border-top: 1.5px solid var(--meadow-glow);
    border-left: 1.5px solid var(--meadow-glow);
}

.bracket-tr {
    top: 0;
    right: 0;
    border-top: 1.5px solid var(--meadow-glow);
    border-right: 1.5px solid var(--meadow-glow);
    animation-delay: 1s;
}

.bracket-bl {
    bottom: 0;
    left: 0;
    border-bottom: 1.5px solid var(--meadow-glow);
    border-left: 1.5px solid var(--meadow-glow);
    animation-delay: 2s;
}

.bracket-br {
    bottom: 0;
    right: 0;
    border-bottom: 1.5px solid var(--meadow-glow);
    border-right: 1.5px solid var(--meadow-glow);
    animation-delay: 3s;
}

@keyframes bracket-pulse {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 0.8; }
}

/* =============================================
   Observation Panel (Neubrutalist Card)
   ============================================= */
.observation-panel {
    max-width: 680px;
    width: 100%;
    background: var(--panel-bg);
    border: 5px solid var(--border-primary);
    box-shadow: 6px 6px 0 var(--moss-accent);
    padding: 48px 42px;
    position: relative;
    z-index: 7;
    /* Intentional slight offset from center */
    transform: translate(2px, -3px);
    opacity: 0;
    will-change: opacity, transform;
    transition: none;
}

.observation-panel.panel-wide {
    max-width: 960px;
}

.observation-panel.visible {
    opacity: 1;
    transform: translate(2px, -3px);
}

/* =============================================
   Typography
   ============================================= */
h1 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(42px, 6vw, 72px);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--border-primary);
    line-height: 1.1;
    margin-bottom: 24px;
    position: relative;
}

h2 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(24px, 3.5vw, 36px);
    color: var(--border-primary);
    line-height: 1.2;
    margin-bottom: 20px;
    position: relative;
}

.panel-body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.72;
    color: var(--border-primary);
    margin-bottom: 20px;
}

.panel-body:last-of-type {
    margin-bottom: 0;
}

.epigraph {
    font-family: var(--font-accent);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(24px, 3vw, 32px);
    color: var(--moss-accent);
    line-height: 1.4;
    margin-bottom: 28px;
}

.panel-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--horizon-blush);
    text-transform: uppercase;
    margin-bottom: 16px;
    opacity: 0.8;
}

/* =============================================
   Glitch Heading Effect
   ============================================= */
.glitch-heading {
    position: relative;
}

.glitch-heading.glitching::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: -2px;
    width: 100%;
    height: 100%;
    color: var(--border-primary);
    opacity: 0.3;
    clip-path: inset(0 0 0 0);
    animation: glitch-clip 200ms steps(2) forwards;
}

@keyframes glitch-clip {
    0%   { clip-path: inset(20% 0 40% 0); transform: translateX(-2px); }
    50%  { clip-path: inset(60% 0 10% 0); transform: translateX(1px); }
    100% { clip-path: inset(0 0 0 0); transform: translateX(0); opacity: 0; }
}

/* =============================================
   Section Divider
   ============================================= */
.section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 32px;
    padding-top: 24px;
}

.divider-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--moss-accent);
    opacity: 0.5;
}

.divider-dot:nth-child(2) {
    transform: translateY(-4px);
}

/* =============================================
   Image Panel
   ============================================= */
.image-panel {
    margin: 24px -42px;
    position: relative;
}

.nature-image {
    position: relative;
    overflow: hidden;
    border-top: 3px solid var(--border-primary);
    border-bottom: 3px solid var(--border-primary);
}

.nature-image .image-scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(0, 0, 0, 0.04) 3px,
        rgba(0, 0, 0, 0.04) 4px
    );
    pointer-events: none;
    z-index: 2;
}

.nature-image .image-content {
    width: 100%;
    display: block;
}

.nature-image .image-content svg {
    width: 100%;
    height: auto;
    display: block;
}

.nature-image:hover .image-content {
    animation: rgb-shift 300ms ease forwards;
}

@keyframes rgb-shift {
    0%   { filter: none; }
    30%  { filter: hue-rotate(5deg) saturate(1.3); transform: translateX(2px); }
    60%  { filter: hue-rotate(-3deg) saturate(0.9); transform: translateX(-1px); }
    100% { filter: none; transform: translateX(0); }
}

/* =============================================
   Data Readout
   ============================================= */
.data-readout {
    margin: 24px 0;
    border: 2px solid var(--border-primary);
    background: var(--deep-ground);
    padding: 20px 24px;
}

.readout-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(90, 114, 71, 0.2);
}

.readout-row:last-child {
    border-bottom: none;
}

.readout-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--moss-accent);
    opacity: 0.7;
}

.readout-value {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--meadow-glow);
}

/* =============================================
   Specimen Grid
   ============================================= */
.specimen-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin: 24px 0;
}

.specimen-card {
    border: 2px solid var(--border-primary);
    padding: 20px;
    text-align: center;
    background: rgba(244, 239, 230, 0.5);
    box-shadow: 3px 3px 0 var(--moss-accent);
    transition: box-shadow 0.3s ease;
}

.specimen-card:hover {
    box-shadow: 4px 4px 0 var(--horizon-blush);
}

.specimen-svg {
    width: 80px;
    height: 110px;
    color: var(--moss-accent);
    margin-bottom: 12px;
}

.specimen-label {
    display: block;
    font-family: var(--font-accent);
    font-weight: 300;
    font-style: italic;
    font-size: 15px;
    color: var(--border-primary);
    margin-bottom: 4px;
}

.specimen-id {
    display: block;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    color: var(--moss-accent);
    opacity: 0.6;
}

/* =============================================
   Transmission Log
   ============================================= */
.transmission-log {
    margin: 24px 0;
    border: 2px solid var(--border-primary);
    background: var(--deep-ground);
    padding: 16px 24px;
}

.log-entry {
    display: flex;
    gap: 16px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(90, 114, 71, 0.15);
    align-items: baseline;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-time {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--horizon-blush);
    opacity: 0.8;
    white-space: nowrap;
    min-width: 40px;
}

.log-text {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--meadow-glow);
    line-height: 1.5;
    opacity: 0.75;
}

/* =============================================
   Station Status
   ============================================= */
.station-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid rgba(45, 41, 38, 0.15);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--meadow-glow);
    animation: status-blink 2s ease-in-out infinite;
}

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

.status-text {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--moss-accent);
    opacity: 0.7;
}

/* =============================================
   Border Jitter Animation
   ============================================= */
@keyframes border-jitter {
    0%, 95%, 100% { box-shadow: 6px 6px 0 var(--moss-accent); }
    96% { box-shadow: 7px 5px 0 var(--moss-accent); }
    97% { box-shadow: 5px 7px 0 var(--moss-accent); }
    98% { box-shadow: 7px 7px 0 var(--moss-accent); }
    99% { box-shadow: 5px 5px 0 var(--moss-accent); }
}

.observation-panel.visible {
    animation: border-jitter 15s ease-in-out infinite;
}

/* =============================================
   HUD Frosted Glass Panels (used on special sections)
   ============================================= */
.section-1 .observation-panel {
    background: linear-gradient(135deg, rgba(244, 239, 230, 0.92), rgba(196, 205, 224, 0.75));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* =============================================
   Section-specific adjustments
   ============================================= */
.section-1 {
    min-height: 100vh;
}

.section-1 h1 {
    margin-top: 8px;
}

.section-7 .observation-panel {
    text-align: center;
}

.section-7 .epigraph {
    margin-bottom: 20px;
}

.section-7 .station-status {
    justify-content: center;
}

/* =============================================
   Responsive / Mobile
   ============================================= */
@media (max-width: 768px) {
    .section {
        padding: 60px 20px;
    }

    .observation-panel {
        padding: 32px 24px;
        transform: translate(0, 0);
    }

    .observation-panel.visible {
        transform: translate(0, 0);
    }

    .image-panel {
        margin: 24px -24px;
    }

    .hud-top-left,
    .hud-top-right {
        position: absolute;
    }

    .hud-bottom-left,
    .hud-bottom-right {
        position: absolute;
    }

    .side-rail {
        left: 8px;
        gap: 14px;
    }

    .viewfinder-brackets {
        top: 5%;
        left: 5%;
        right: 5%;
        bottom: 5%;
    }

    .bracket {
        width: 16px;
        height: 16px;
    }

    .specimen-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .botanical-3,
    .botanical-4,
    .botanical-5 {
        display: none;
    }

    .contour-lines {
        display: none;
    }

    .compass-rose {
        right: 20px;
        bottom: 60px;
    }

    h1 {
        font-size: clamp(32px, 8vw, 52px);
    }
}

@media (max-width: 480px) {
    .hud-corner {
        padding: 10px 12px;
    }

    .hud-label {
        font-size: 9px;
    }

    .hud-value {
        font-size: 10px;
    }

    .observation-panel {
        padding: 24px 18px;
        border-width: 4px;
        box-shadow: 4px 4px 0 var(--moss-accent);
    }

    .observation-panel.visible {
        animation: none;
        box-shadow: 4px 4px 0 var(--moss-accent);
    }

    .log-entry {
        flex-direction: column;
        gap: 4px;
    }

    .data-readout {
        padding: 12px 16px;
    }
}
