/* layer-2.quest - Decommissioned Orbital Relay Station */

:root {
    --deep-space: #080c14;
    --aurora-indigo: #1a1040;
    --aurora-teal: #0d4f4a;
    --aurora-green: #4dd0a0;
    --aurora-violet: #7b5ea7;
    --ice-blue: #b8c6db;
    --grain-white: #d4dce8;
    --pure-borealis: #00ffaa;
    --font-display: 'Space Mono', monospace;
    --font-body: 'Inter', sans-serif;
    --font-hud: 'IBM Plex Mono', monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(
        180deg,
        #1a1040 0%,
        #0d4f4a 40%,
        #1a1040 70%,
        #080c14 100%
    );
    color: var(--ice-blue);
    overflow-x: hidden;
    min-height: 300vh;
}

/* Grain Overlay */
#grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.04;
}

#grain-overlay svg {
    width: 100%;
    height: 100%;
}

/* Progress Indicator - HUD Altitude Gauge */
#progress-track {
    position: fixed;
    right: 20px;
    top: 10%;
    height: 80%;
    width: 2px;
    background: rgba(77, 208, 160, 0.15);
    z-index: 100;
}

#progress-fill {
    width: 100%;
    height: 0%;
    background: var(--aurora-green);
    transition: height 0.1s linear;
    box-shadow: 0 0 8px rgba(0, 255, 170, 0.4);
}

/* Layer Sections */
.layer {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.layer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    position: relative;
}

/* ============================================
   LAYER 0 - THE SUBSTRATE
   ============================================ */

.layer-0-content {
    flex-direction: column;
    perspective: 1200px;
}

/* HUD Reticle */
#hud-reticle {
    position: absolute;
    width: clamp(350px, 55vw, 620px);
    height: clamp(350px, 55vw, 620px);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

#reticle-svg {
    width: 100%;
    height: 100%;
    animation: hudRotate 120s linear infinite;
}

.reticle-ring {
    fill: none;
    stroke: var(--aurora-green);
    stroke-width: 1;
    opacity: 0.4;
}

.reticle-inner {
    opacity: 0.25;
    stroke-dasharray: 8 4;
}

.reticle-tick {
    stroke: var(--aurora-green);
    stroke-width: 2;
    opacity: 0.6;
}

.reticle-tick-minor {
    stroke: var(--aurora-green);
    stroke-width: 1;
    opacity: 0.3;
}

@keyframes hudRotate {
    to {
        transform: rotate(360deg);
    }
}

/* Inflated 3D Text */
.inflated-text {
    font-family: var(--font-display);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--aurora-green);
    position: relative;
    z-index: 2;
}

#domain-name {
    font-size: clamp(2.5rem, 8vw, 7rem);
    transform: translateZ(40px);
    text-shadow:
        0 1px 0 #0d4f4a,
        0 2px 0 #0b4742,
        0 3px 0 #093f3a,
        0 4px 0 #073733,
        0 5px 0 #052f2b,
        0 6px 0 #032723,
        0 0 20px rgba(0, 255, 170, 0.12),
        0 0 60px rgba(0, 255, 170, 0.06);
    filter: drop-shadow(0 0 30px rgba(0, 255, 170, 0.12));
    background: linear-gradient(180deg, rgba(77, 208, 160, 0.15), transparent);
    -webkit-background-clip: text;
    background-clip: text;
    text-align: center;
}

.layer-label {
    margin-top: 3rem;
    z-index: 2;
}

.hud-label {
    font-family: var(--font-hud);
    font-weight: 400;
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--aurora-green);
    opacity: 0.7;
}

/* ============================================
   LAYER 1 - THE SETTLEMENT
   ============================================ */

.layer-1-content {
    display: flex;
    align-items: center;
    gap: 4rem;
}

.layer-1-left {
    flex: 0 0 60%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.layer-1-right {
    flex: 0 0 35%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.inflated-numeral {
    font-size: clamp(8rem, 25vw, 20rem);
    line-height: 1;
    text-shadow:
        0 1px 0 #0d4f4a,
        0 2px 0 #0b4742,
        0 3px 0 #093f3a,
        0 4px 0 #073733,
        0 5px 0 #052f2b,
        0 6px 0 #032723,
        0 0 30px rgba(0, 255, 170, 0.12),
        0 0 80px rgba(0, 255, 170, 0.06);
    filter: drop-shadow(0 0 40px rgba(0, 255, 170, 0.12));
    background: linear-gradient(180deg, rgba(77, 208, 160, 0.15), transparent);
    -webkit-background-clip: text;
    background-clip: text;
}

.body-text {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    line-height: 1.75;
    letter-spacing: 0.02em;
    color: var(--ice-blue);
    max-width: 520px;
}

.text-block {
    padding: 0.5rem 0;
}

/* Scan Lines */
.scan-line {
    width: 100%;
    height: 1px;
    background: rgba(77, 208, 160, 0.25);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-around;
}

.scan-notch {
    display: block;
    width: 1px;
    height: 4px;
    background: rgba(77, 208, 160, 0.4);
    transform: translateY(-1.5px);
}

/* ============================================
   LAYER 2 - THE APPLICATION
   ============================================ */

.layer-2-content {
    flex-direction: column;
    position: relative;
    min-height: 80vh;
}

.inflated-numeral-2 {
    font-size: clamp(12rem, 40vw, 30rem);
    mix-blend-mode: screen;
    opacity: 0.85;
    text-shadow:
        0 1px 0 #0d4f4a,
        0 2px 0 #0b4742,
        0 3px 0 #093f3a,
        0 4px 0 #073733,
        0 5px 0 #052f2b,
        0 6px 0 #032723,
        0 0 40px rgba(0, 255, 170, 0.15),
        0 0 100px rgba(0, 255, 170, 0.08);
    filter: drop-shadow(0 0 60px rgba(0, 255, 170, 0.15));
}

/* HUD Data Pods */
.data-pod {
    position: absolute;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.data-pod::before,
.data-pod::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
}

/* Top-left corner bracket */
.data-pod::before {
    top: 0;
    left: 0;
    border-top: 1px solid rgba(77, 208, 160, 0.5);
    border-left: 1px solid rgba(77, 208, 160, 0.5);
}

/* Bottom-right corner bracket */
.data-pod::after {
    bottom: 0;
    right: 0;
    border-bottom: 1px solid rgba(77, 208, 160, 0.5);
    border-right: 1px solid rgba(77, 208, 160, 0.5);
}

.data-pod-n {
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
}

.data-pod-e {
    right: 10%;
    top: 50%;
    transform: translateY(-50%);
}

.data-pod-s {
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
}

.data-pod-w {
    left: 10%;
    top: 50%;
    transform: translateY(-50%);
}

.pod-text {
    font-family: var(--font-hud);
    font-weight: 400;
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--aurora-green);
    opacity: 0.7;
}

/* Extra corner brackets using additional pseudo-elements on pod-text */
.pod-text::before,
.pod-text::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
}

.data-pod .pod-text {
    position: relative;
}

/* Glitch Effect */
@keyframes glitch {
    0% {
        transform: translateZ(40px);
        clip-path: none;
        color: var(--aurora-green);
    }
    20% {
        transform: translateZ(40px) translateX(2px);
        clip-path: inset(30% 0 40% 0);
        color: var(--aurora-violet);
    }
    40% {
        transform: translateZ(40px) translateX(-2px);
        clip-path: inset(60% 0 10% 0);
        color: var(--aurora-green);
    }
    60% {
        transform: translateZ(40px) translateX(1px);
        clip-path: inset(10% 0 70% 0);
        color: var(--aurora-violet);
    }
    80% {
        transform: translateZ(40px) translateX(-1px);
        clip-path: inset(50% 0 20% 0);
        color: var(--aurora-green);
    }
    100% {
        transform: translateZ(40px);
        clip-path: none;
        color: var(--aurora-green);
    }
}

.glitch-active {
    animation: glitch 150ms steps(3) forwards !important;
}

/* Responsive */
@media (max-width: 768px) {
    .layer-1-content {
        flex-direction: column;
        gap: 2rem;
    }

    .layer-1-left {
        flex: none;
    }

    .layer-1-right {
        flex: none;
        padding: 0 1rem;
    }

    .data-pod-e {
        right: 5%;
    }

    .data-pod-w {
        left: 5%;
    }

    #progress-track {
        right: 10px;
    }
}
