/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-deep: #0a1220;
    --bg-mid: #131e30;
    --accent-verdigris: #5a8a7a;
    --accent-oxidized: #7aaa9a;
    --highlight-frost: #c8dce8;
    --text-pale: #a0b4c8;
    --muted-dust: #5c6a7a;
    --gold-kintsugi: #c4a265;
    --cursor-x: 50%;
    --cursor-y: 50%;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-deep);
    color: var(--text-pale);
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    line-height: 1.75;
    font-size: clamp(0.95rem, 1.4vw, 1.15rem);
    overflow-x: hidden;
    min-height: 100vh;
}

/* ===== SVG FILTERS (hidden) ===== */
#svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ===== NOISE OVERLAY ===== */
#noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* ===== CURSOR GLOW ===== */
#cursor-glow {
    position: fixed;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(200, 220, 232, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 999;
    transform: translate(-50%, -50%);
    left: var(--cursor-x);
    top: var(--cursor-y);
    transition: left 0.1s ease-out, top 0.1s ease-out;
    display: none;
}

body.has-cursor #cursor-glow {
    display: block;
}

/* ===== CIRCUIT SPINE SVG ===== */
#circuit-spine {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.5;
}

.trace-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 2.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.trace-path.drawn {
    stroke-dashoffset: 0;
}

.junction-node {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.junction-node.visible {
    opacity: 1;
    animation: nodePulse 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes nodePulse {
    0% { transform-origin: center; r: 4; opacity: 1; }
    50% { r: 6; opacity: 0.4; }
    100% { r: 4; opacity: 1; }
}

/* ===== HERO ===== */
#hero {
    position: relative;
    z-index: 2;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: linear-gradient(180deg, var(--bg-deep) 0%, #0d1828 100%);
}

.hero-title {
    font-family: 'Cormorant', 'Times New Roman', serif;
    font-weight: 300;
    font-size: clamp(3rem, 8vw, 7rem);
    color: var(--highlight-frost);
    letter-spacing: 0.04em;
    line-height: 1.1;
}

.hero-rule {
    width: clamp(120px, 30vw, 300px);
    height: 1px;
    background: var(--accent-verdigris);
    opacity: 0.4;
    margin: 1.5rem 0;
}

.hero-tagline {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 300;
    font-size: clamp(0.85rem, 1.2vw, 1.05rem);
    color: var(--muted-dust);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ===== HUD PANELS ===== */
.hud-panel {
    position: relative;
    z-index: 2;
    max-width: 640px;
    padding: 2.5rem 3rem;
    margin: 15vh 0;
    border: 1px solid var(--accent-verdigris);
    background: rgba(10, 18, 32, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.0, 0.0, 0.2, 1), transform 0.8s cubic-bezier(0.0, 0.0, 0.2, 1);
}

.hud-panel.visible {
    opacity: 1;
    transform: translateY(0);
}

.panel-left {
    margin-left: 8vw;
}

.panel-right {
    margin-left: auto;
    margin-right: 12vw;
}

.panel-center {
    margin-left: auto;
    margin-right: auto;
}

.panel-label {
    display: block;
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-weight: 300;
    font-size: clamp(0.65rem, 0.9vw, 0.8rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted-dust);
    margin-bottom: 1.5rem;
}

.panel-title {
    font-family: 'Cormorant', 'Times New Roman', serif;
    font-weight: 300;
    font-size: clamp(1.6rem, 3vw, 2.8rem);
    color: var(--highlight-frost);
    letter-spacing: 0.02em;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hud-panel p {
    margin-bottom: 1.2rem;
    color: var(--text-pale);
    font-weight: 300;
}

.hud-panel p:last-child {
    margin-bottom: 0;
}

/* ===== CLOSING SECTION ===== */
#closing {
    position: relative;
    z-index: 2;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.closing-rule {
    width: clamp(100px, 25vw, 250px);
    height: 1px;
    background: var(--accent-verdigris);
    opacity: 0.4;
    margin-bottom: 4rem;
}

.open-pad-container {
    position: relative;
    width: 140px;
    height: 140px;
    margin-bottom: 3rem;
}

.open-pad {
    width: 140px;
    height: 140px;
}

.open-pad circle {
    filter: drop-shadow(0 0 12px rgba(90, 138, 122, 0.4));
}

.orbiting-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    white-space: nowrap;
    font-family: 'Cormorant', 'Times New Roman', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1rem, 2vw, 1.6rem);
    color: var(--highlight-frost);
    letter-spacing: 0.02em;
}

.orbit-separator {
    color: var(--accent-verdigris);
    margin: 0 0.4em;
    transition: color 1s ease;
}

.orbit-separator.gold {
    color: var(--gold-kintsugi);
}

.github-link {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-weight: 300;
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    letter-spacing: 0.08em;
    color: var(--accent-verdigris);
    text-decoration: none;
    border-bottom: 1px solid rgba(90, 138, 122, 0.3);
    padding-bottom: 2px;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.github-link:hover {
    color: var(--accent-oxidized);
    border-color: var(--accent-oxidized);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hud-panel {
        max-width: none;
        margin-left: 5vw;
        margin-right: 5vw;
        padding: 2rem;
    }

    .panel-left,
    .panel-right,
    .panel-center {
        margin-left: 5vw;
        margin-right: 5vw;
    }

    #circuit-spine {
        display: none;
    }
}
