/* ============================================
   rust.quest — Translucent Frost HUD
   ============================================ */

/* Palette reference: #A3C4D9 #D1DCE6 #E8EFF5 */

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

html {
    scroll-snap-type: y proximity;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    color: #3d5066;
    background: radial-gradient(ellipse at center, #eaf1f7 0%, #e8eff5 30%, #d1dce6 70%, #d4dfe8 100%);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Background isometric grid */
.bg-grid {
    position: fixed;
    inset: 0;
    z-index: 0;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cpath d='M30 0 L60 15 L60 45 L30 60 L0 45 L0 15Z' fill='none' stroke='%233d5066' stroke-width='0.5'/%3E%3C/svg%3E");
    background-size: 60px 60px;
    animation: gridDrift 120s linear infinite;
    pointer-events: none;
}

@keyframes gridDrift {
    0% { transform: translateX(0) translateY(0); }
    100% { transform: translateX(40px) translateY(20px); }
}

/* HUD Frame */
.hud-frame {
    position: fixed;
    inset: 24px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    z-index: 100;
    pointer-events: none;
}

.hud-status {
    position: absolute;
    top: 16px;
    left: 24px;
    right: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hud-status-label,
.hud-status-info {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(26, 42, 58, 0.5);
}

/* Navigation dots */
.hud-nav {
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 16px;
    pointer-events: auto;
}

.hud-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(163, 196, 217, 0.5); /* #A3C4D9 */
    background: rgba(163, 196, 217, 0.2);
    cursor: pointer;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                background 0.3s ease,
                border-color 0.3s ease;
    pointer-events: auto;
}

.hud-dot.active {
    transform: scale(1.4);
    background: #5b8fb9;
    border-color: #5b8fb9;
}

.hud-dot:hover {
    background: rgba(91, 143, 185, 0.5);
    border-color: #5b8fb9;
}

/* Crosshair */
.crosshair {
    position: fixed;
    z-index: 99;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

body:hover .crosshair {
    opacity: 1;
}

.crosshair-h {
    left: 24px;
    right: 24px;
    height: 1px;
    background: rgba(26, 42, 58, 0.08);
    top: 50%;
}

.crosshair-v {
    top: 24px;
    bottom: 24px;
    width: 1px;
    background: rgba(26, 42, 58, 0.08);
    left: 50%;
}

.crosshair.warm {
    background: rgba(212, 113, 78, 0.15);
}

/* Spring branch */
.spring-branch {
    position: fixed;
    bottom: 40px;
    left: 40px;
    width: 60px;
    height: 90px;
    z-index: 101;
    pointer-events: none;
}

/* Scroll container */
.scroll-container {
    position: relative;
    z-index: 1;
}

/* Chamber */
.chamber {
    height: 100vh;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 64px;
    position: relative;
}

.chamber-content {
    display: grid;
    gap: 20px;
    width: 100%;
    max-width: 1100px;
    height: 100%;
    max-height: 700px;
}

/* Panel base */
.panel {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(240, 248, 255, 0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.1);
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    animation: panelIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.panel:hover {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255,255,255,0.08);
}

@keyframes panelIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chamber .panel:nth-child(1) { animation-delay: 0s; }
.chamber .panel:nth-child(2) { animation-delay: 0.08s; }
.chamber .panel:nth-child(3) { animation-delay: 0.16s; }

/* Panel label */
.panel-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(26, 42, 58, 0.5);
    margin-bottom: 16px;
}

/* Typography */
.chamber-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3.6rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #1a2a3a;
    margin-bottom: 20px;
}

h2.chamber-title {
    font-size: clamp(1.8rem, 3.5vw, 3rem);
}

.chamber-text {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.7;
    letter-spacing: 0.005em;
    color: #3d5066;
    max-width: 480px;
}

.accent-word {
    color: #d4714e;
    font-weight: 500;
}

/* Code blocks */
.code-block {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 400;
    color: #2c4a62;
    background: rgba(180, 200, 220, 0.15);
    border-radius: 8px;
    padding: 16px;
    line-height: 1.6;
    overflow-x: auto;
}

.code-block:hover {
    background: rgba(180, 200, 220, 0.22);
}

.code-keyword { color: #5b8fb9; font-weight: 500; }
.code-string { color: #d4714e; }
.code-comment { color: #7a8fa3; font-style: italic; }

/* Crate labels in ecosystem SVG */
.crate-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 9px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    fill: rgba(26, 42, 58, 0.4);
}

/* Isometric icons */
.iso-icon {
    width: 100%;
    height: 100%;
    max-height: 280px;
    display: block;
    margin: 0 auto;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.panel:hover .iso-icon {
    transform: translateY(-8px);
}

/* Gear rotation */
.gear-1 { animation: gearSpin 30s linear infinite; transform-origin: center; }
.gear-2 { animation: gearSpin 20s linear infinite reverse; transform-origin: center; }
.gear-3 { animation: gearSpin 25s linear infinite; transform-origin: center; }

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

/* Status lines (horizon) */
.status-lines {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.status-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

.status-key {
    color: #7a8fa3;
    font-weight: 400;
}

.status-val {
    color: #3d5066;
    font-weight: 500;
}

/* ============================================
   Grid Layouts per Chamber
   ============================================ */

/* Origin: large panel left, two small stacked right */
.chamber-grid-origin {
    grid-template-columns: 1.5fr 1fr;
    grid-template-rows: 1fr 1fr;
    grid-template-areas:
        "main code"
        "main icon";
}

.panel-origin-main { grid-area: main; }
.panel-origin-code { grid-area: code; }
.panel-origin-icon { grid-area: icon; }

/* Ownership: large panel left-top, wide visual bottom, small code right */
.chamber-grid-ownership {
    grid-template-columns: 1.5fr 1fr;
    grid-template-rows: 1.2fr 1fr;
    grid-template-areas:
        "main code"
        "visual visual";
}

.panel-ownership-main { grid-area: main; }
.panel-ownership-code { grid-area: code; }
.panel-ownership-visual { grid-area: visual; }

/* Fearless: large left, icon right-top, code right-bottom */
.chamber-grid-fearless {
    grid-template-columns: 1.5fr 1fr;
    grid-template-rows: 1fr 1fr;
    grid-template-areas:
        "main icon"
        "main code";
}

.panel-fearless-main { grid-area: main; }
.panel-fearless-icon { grid-area: icon; }
.panel-fearless-code { grid-area: code; }

/* Ecosystem: large top-left, wide cityscape bottom */
.chamber-grid-ecosystem {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1.2fr;
    grid-template-areas:
        "main"
        "city";
}

.panel-ecosystem-main { grid-area: main; }
.panel-ecosystem-city { grid-area: city; }

/* Horizon: large left, icon right-top, status right-bottom */
.chamber-grid-horizon {
    grid-template-columns: 1.5fr 1fr;
    grid-template-rows: 1fr 1fr;
    grid-template-areas:
        "main icon"
        "main status";
}

.panel-horizon-main { grid-area: main; }
.panel-horizon-icon { grid-area: icon; }
.panel-horizon-status { grid-area: status; }

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

    .hud-frame {
        inset: 12px;
    }

    .chamber-content {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto !important;
        grid-template-areas: none !important;
        max-height: none;
    }

    .panel {
        grid-area: auto !important;
    }

    .hud-status-info {
        display: none;
    }

    .hud-nav {
        right: -4px;
    }

    .spring-branch {
        display: none;
    }

    .chamber {
        height: auto;
        min-height: 100vh;
    }
}
