/* lunge.dev v2 — retro-futuristic cyber-shrine
   palette: aurora-gradient + candle amber + glitch chromatic aberration
   layout : immersive vertical scroll
   type   : display-bold (Bebas Neue / Anton) + JetBrains Mono + Space Grotesk
*/

:root {
    /* aurora palette */
    --cosmic-black: #07060C;
    --indigo-deep: #0E0B2E;
    --aurora-violet: #6A2BC4;
    --aurora-magenta: #C0337A;
    --aurora-teal: #2BC4A8;
    --aurora-rose: #E84A6E;
    --candle-amber: #FFB84D;
    --glitch-cyan: #45F0FF;
    --glitch-magenta: #FF3CA0;
    --soft-cream: #F2E7CE;
    --console-green: #6CFF95;

    /* dynamic, set by JS */
    --scroll-velocity: 0;
    --glitch-x: 2px;
    --glitch-y: 0px;

    /* type */
    --font-display: "Bebas Neue", "Anton", "Impact", sans-serif;
    --font-display-alt: "Anton", "Bebas Neue", "Impact", sans-serif;
    --font-mono: "JetBrains Mono", "Menlo", monospace;
    --font-numeric: "Space Grotesk", "Inter", sans-serif;
}

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

html, body {
    background: var(--cosmic-black);
    color: var(--soft-cream);
    font-family: var(--font-mono);
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    position: relative;
    line-height: 1.5;
    cursor: none;
}

/* CRT scanline overlay across the entire site */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100;
    background:
        repeating-linear-gradient(
            0deg,
            rgba(255,255,255,0.035) 0px,
            rgba(255,255,255,0.035) 1px,
            transparent 1px,
            transparent 3px
        ),
        radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.55) 100%);
    mix-blend-mode: screen;
    opacity: 0.85;
}

/* Vignette layer */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 99;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(7,6,12,0.7) 100%);
}

/* Custom cursor halo */
.cursor-halo {
    position: fixed;
    top: 0;
    left: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,184,77,0.85) 0%, rgba(255,184,77,0.15) 60%, transparent 100%);
    mix-blend-mode: screen;
    pointer-events: none;
    z-index: 200;
    transform: translate3d(-50px, -50px, 0);
    transition: width 220ms ease, height 220ms ease, opacity 220ms ease;
    will-change: transform, width, height;
}
.cursor-halo.is-hover {
    width: 38px;
    height: 38px;
    opacity: 0.7;
}
@media (pointer: coarse) {
    .cursor-halo { display: none; }
    body { cursor: auto; }
}

/* Immersive container */
.immersive {
    position: relative;
    width: 100%;
}

.scene {
    position: relative;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(40px, 6vw, 96px) clamp(24px, 5vw, 96px);
}

.scene-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: clamp(20px, 3vw, 48px);
}

/* ---------- Aurora gradient fields ---------- */
.aurora-field {
    position: absolute;
    inset: -10%;
    z-index: 0;
    pointer-events: none;
    filter: saturate(1.1);
    background-size: 140% 140%;
    animation: auroraDrift 22s ease-in-out infinite alternate;
}

.aurora-ignition {
    background:
        radial-gradient(ellipse at 22% 30%, rgba(106,43,196,0.32) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 70%, rgba(192,51,122,0.28) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 100%, rgba(255,184,77,0.18) 0%, transparent 65%),
        radial-gradient(ellipse at 60% 10%, rgba(43,196,168,0.16) 0%, transparent 65%),
        linear-gradient(180deg, var(--cosmic-black) 0%, var(--indigo-deep) 100%);
}

.aurora-vector {
    background:
        radial-gradient(ellipse at 10% 50%, rgba(232,74,110,0.28) 0%, transparent 55%),
        radial-gradient(ellipse at 90% 50%, rgba(43,196,168,0.22) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 110%, rgba(106,43,196,0.20) 0%, transparent 65%),
        linear-gradient(180deg, var(--indigo-deep) 0%, var(--cosmic-black) 100%);
}

.aurora-console {
    background:
        radial-gradient(ellipse at 30% 20%, rgba(106,43,196,0.32) 0%, transparent 55%),
        radial-gradient(ellipse at 70% 80%, rgba(43,196,168,0.26) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 50%, rgba(255,184,77,0.10) 0%, transparent 70%),
        linear-gradient(180deg, var(--cosmic-black) 0%, #110832 60%, var(--cosmic-black) 100%);
}

.aurora-plates {
    background:
        radial-gradient(ellipse at 15% 25%, rgba(232,74,110,0.24) 0%, transparent 60%),
        radial-gradient(ellipse at 85% 75%, rgba(106,43,196,0.26) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 50%, rgba(43,196,168,0.14) 0%, transparent 70%),
        linear-gradient(180deg, var(--cosmic-black) 0%, var(--indigo-deep) 100%);
}

.aurora-beacon {
    background:
        radial-gradient(circle at 50% 50%, rgba(255,184,77,0.30) 0%, rgba(232,74,110,0.18) 30%, rgba(106,43,196,0.10) 60%, transparent 80%),
        radial-gradient(ellipse at 50% 100%, rgba(43,196,168,0.16) 0%, transparent 65%),
        linear-gradient(180deg, var(--indigo-deep) 0%, var(--cosmic-black) 100%);
}

@keyframes auroraDrift {
    0%   { background-position: 0% 0%, 100% 100%, 50% 100%, 60% 0%, 0% 0%; transform: translate3d(0,0,0) scale(1); }
    50%  { background-position: 10% 5%, 90% 95%, 55% 95%, 50% 5%, 0% 0%;  transform: translate3d(0,0,0) scale(1.02); }
    100% { background-position: -5% 5%, 105% 92%, 45% 105%, 65% -5%, 0% 0%; transform: translate3d(0,0,0) scale(1.04); }
}

/* ---------- Common typography ---------- */
.overline {
    font-family: var(--font-mono);
    font-size: clamp(11px, 0.85vw, 13px);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(242,231,206,0.55);
}

.display-headline {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(40px, 7vw, 120px);
    line-height: 0.92;
    letter-spacing: 0.02em;
    color: var(--soft-cream);
    text-transform: lowercase;
}

.hero-mark {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(64px, 12vw, 220px);
    line-height: 0.86;
    letter-spacing: 0.02em;
    color: var(--soft-cream);
    text-transform: lowercase;
    margin-top: 16px;
}

.hero-tagline {
    font-family: var(--font-display-alt);
    font-size: clamp(20px, 2.4vw, 36px);
    letter-spacing: 0.06em;
    color: rgba(242,231,206,0.85);
    text-transform: lowercase;
    margin-top: 6px;
}

/* ---------- Glitch chromatic-aberration headlines ---------- */
.glitch {
    position: relative;
    display: inline-block;
    color: var(--soft-cream);
    isolation: isolate;
}
.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    pointer-events: none;
    mix-blend-mode: screen;
}
.glitch::before {
    color: var(--glitch-cyan);
    transform: translate3d(calc(-1 * var(--glitch-x)), var(--glitch-y), 0);
    opacity: 0.85;
}
.glitch::after {
    color: var(--glitch-magenta);
    transform: translate3d(var(--glitch-x), calc(-1 * var(--glitch-y)), 0);
    opacity: 0.85;
}
.glitch.is-burst::before {
    animation: glitchBurst 0.32s steps(2, end);
}
.glitch.is-burst::after {
    animation: glitchBurst 0.32s steps(2, end) reverse;
}

@keyframes glitchBurst {
    0%   { transform: translate3d(-1px, 0, 0); }
    20%  { transform: translate3d(-7px, 2px, 0); }
    40%  { transform: translate3d(4px, -3px, 0); }
    60%  { transform: translate3d(-5px, 1px, 0); }
    80%  { transform: translate3d(3px, 0, 0); }
    100% { transform: translate3d(-2px, 0, 0); }
}

.glitch-soft {
    position: relative;
    display: inline-block;
}
.glitch-soft::before,
.glitch-soft::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    pointer-events: none;
    mix-blend-mode: screen;
    opacity: 0.55;
}
.glitch-soft::before {
    color: var(--glitch-cyan);
    transform: translate3d(-1px, 0, 0);
}
.glitch-soft::after {
    color: var(--glitch-magenta);
    transform: translate3d(1px, 0, 0);
}

/* ---------- Scene 1: Ignition ---------- */
.scene-ignition .scene-inner {
    align-items: center;
    text-align: center;
    gap: clamp(12px, 1.6vw, 24px);
}
.scene-ignition .led-row { justify-content: center; }
.candle-anchor-hero {
    margin-top: clamp(20px, 4vw, 56px);
    display: flex;
    justify-content: center;
}
.scroll-cue {
    position: absolute;
    bottom: clamp(20px, 3vw, 40px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: rgba(242,231,206,0.55);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
}
.scroll-cue-arrow {
    width: 1px;
    height: 36px;
    background: linear-gradient(180deg, transparent 0%, var(--candle-amber) 100%);
    animation: scrollCueDown 1.6s ease-in-out infinite;
}
@keyframes scrollCueDown {
    0%, 100% { transform: translateY(-6px); opacity: 0.5; }
    50%      { transform: translateY(6px);  opacity: 1; }
}

/* ---------- Scene 2: Vector ---------- */
.scene-vector .two-col {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: clamp(24px, 5vw, 80px);
    align-items: end;
}
.manifesto {
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 1.4vw, 20px);
}
.manifesto-line {
    font-family: var(--font-mono);
    font-size: clamp(13px, 1vw, 16px);
    letter-spacing: 0.04em;
    color: rgba(242,231,206,0.78);
    max-width: 56ch;
}
.readout-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid rgba(242,231,206,0.12);
    padding: clamp(16px, 2vw, 28px);
    background: rgba(7,6,12,0.45);
    backdrop-filter: blur(2px);
}
.readout-line {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-family: var(--font-mono);
    font-size: clamp(11px, 0.85vw, 13px);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.rline-key {
    color: var(--candle-amber);
    font-weight: 700;
}
.rline-val { color: rgba(242,231,206,0.9); }

@media (max-width: 880px) {
    .scene-vector .two-col {
        grid-template-columns: 1fr;
    }
}

/* ---------- LED rows ---------- */
.led-row {
    display: flex;
    gap: 8px;
    padding: 6px 0;
    align-items: center;
}
.led {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    color: var(--console-green);
    box-shadow: 0 0 8px currentColor, 0 0 14px currentColor;
    opacity: 0.35;
    animation: ledBlink var(--led-dur, 1.6s) ease-in-out infinite;
    animation-delay: var(--led-delay, 0s);
}
.led:nth-child(3n)   { color: var(--candle-amber); }
.led:nth-child(4n+1) { color: var(--glitch-cyan); }
.led:nth-child(5n+2) { color: var(--aurora-rose); }

@keyframes ledBlink {
    0%, 100% { opacity: 0.25; transform: scale(0.85); }
    50%      { opacity: 1;    transform: scale(1.1); }
}

/* ---------- Scene 3: Console ---------- */
.scene-console .scene-inner {
    align-items: stretch;
    text-align: left;
}
.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(16px, 2vw, 32px);
    margin-top: clamp(20px, 3vw, 36px);
}
.stat-panel {
    position: relative;
    border: 1px solid rgba(242,231,206,0.14);
    padding: clamp(20px, 2.4vw, 36px);
    background: linear-gradient(160deg, rgba(14,11,46,0.45) 0%, rgba(7,6,12,0.35) 100%);
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: hidden;
}
.stat-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 80% 0%, rgba(255,184,77,0.10) 0%, transparent 60%);
    pointer-events: none;
}
.stat-candle {
    width: 36px;
    height: 54px;
}
.stat-value {
    font-family: var(--font-numeric);
    font-weight: 700;
    font-size: clamp(40px, 5vw, 80px);
    line-height: 1;
    color: var(--soft-cream);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}
.stat-label {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: clamp(11px, 0.85vw, 13px);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(242,231,206,0.85);
    align-self: flex-start;
}

@media (max-width: 880px) {
    .stat-grid { grid-template-columns: 1fr; }
}

/* ---------- Scene 4: Plates ---------- */
.scene-plates .scene-inner {
    align-items: stretch;
}
.plate-stack {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 1.4vw, 20px);
    margin-top: clamp(20px, 3vw, 36px);
}
.plate {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: clamp(16px, 2.4vw, 36px);
    padding: clamp(22px, 3vw, 44px) clamp(20px, 3vw, 40px);
    border: 1px solid rgba(242,231,206,0.16);
    background: linear-gradient(95deg, rgba(7,6,12,0.6) 0%, rgba(14,11,46,0.35) 100%);
    overflow: hidden;
    transition: transform 320ms cubic-bezier(.2,.8,.2,1), box-shadow 320ms ease, background 320ms ease;
    cursor: none;
}
.plate::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.45;
    transition: opacity 320ms ease;
}
.plate-rose::before {
    background: radial-gradient(ellipse at 0% 50%, rgba(232,74,110,0.32) 0%, transparent 60%);
}
.plate-teal::before {
    background: radial-gradient(ellipse at 0% 50%, rgba(43,196,168,0.30) 0%, transparent 60%);
}
.plate-gold::before {
    background: radial-gradient(ellipse at 0% 50%, rgba(255,184,77,0.30) 0%, transparent 60%);
}
.plate-indigo::before {
    background: radial-gradient(ellipse at 0% 50%, rgba(106,43,196,0.34) 0%, transparent 60%);
}
.plate:hover {
    transform: translateX(8px) skewY(-1.2deg);
    box-shadow:
        0 0 0 1px rgba(255,184,77,0.45),
        0 12px 40px rgba(255,184,77,0.18),
        0 4px 24px rgba(232,74,110,0.18);
}
.plate:hover::before { opacity: 1; }
.plate:hover .plate-candle .flame-outer { filter: drop-shadow(0 0 20px rgba(255,184,77,0.85)); }

.plate-num {
    font-family: var(--font-mono);
    font-size: clamp(11px, 0.9vw, 14px);
    letter-spacing: 0.22em;
    color: rgba(242,231,206,0.55);
}
.plate-verb {
    font-family: var(--font-display-alt);
    font-size: clamp(40px, 8vw, 140px);
    line-height: 0.9;
    letter-spacing: 0.02em;
    color: var(--soft-cream);
    text-transform: uppercase;
    text-shadow: 0 0 24px rgba(255,184,77,0.18);
}
.plate-meta {
    font-family: var(--font-mono);
    font-size: clamp(11px, 0.85vw, 13px);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(242,231,206,0.7);
    max-width: 32ch;
    text-align: right;
}
.plate-candle {
    width: 36px;
    height: 54px;
    flex-shrink: 0;
    display: inline-flex;
}

@media (max-width: 880px) {
    .plate {
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto;
    }
    .plate-meta { grid-column: 1 / -1; text-align: left; }
}

/* ---------- Scene 5: Beacon ---------- */
.beacon-inner {
    align-items: center;
    text-align: center;
    gap: clamp(20px, 3vw, 40px);
}
.beacon-core {
    position: relative;
    width: clamp(220px, 30vw, 380px);
    height: clamp(220px, 30vw, 380px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.beacon-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(255,184,77,0.35);
    animation: beaconPulse 4s ease-in-out infinite;
}
.beacon-ring-a { animation-delay: 0s;   inset: 0; }
.beacon-ring-b { animation-delay: 1.2s; inset: 8%; border-color: rgba(232,74,110,0.35); }
.beacon-ring-c { animation-delay: 2.4s; inset: 16%; border-color: rgba(43,196,168,0.35); }

@keyframes beaconPulse {
    0%   { transform: scale(0.85); opacity: 0; }
    30%  { opacity: 1; }
    100% { transform: scale(1.4);  opacity: 0; }
}

.candle-xl {
    width: clamp(80px, 14vw, 160px);
    height: auto;
    z-index: 2;
}

.signoff {
    font-family: var(--font-display);
    font-size: clamp(48px, 8vw, 130px);
    line-height: 0.9;
    letter-spacing: 0.03em;
    color: var(--soft-cream);
    text-transform: lowercase;
    margin-top: clamp(10px, 2vw, 24px);
}
.signoff-line {
    font-family: var(--font-mono);
    font-size: clamp(12px, 0.95vw, 14px);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(242,231,206,0.65);
}
.signoff-meta {
    font-family: var(--font-mono);
    font-size: clamp(10px, 0.8vw, 12px);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(242,231,206,0.4);
}

/* ---------- Candle SVG flames ---------- */
.candle {
    width: 48px;
    height: 72px;
    overflow: visible;
}
.candle-sm { width: 32px; height: 48px; }
.candle-md { width: 44px; height: 66px; }
.candle .flame-outer {
    filter: drop-shadow(0 0 16px rgba(255,184,77,0.55));
    transform-origin: 32px 56px;
    animation: flicker 1.7s ease-in-out infinite;
}
.candle .flame-inner {
    transform-origin: 32px 56px;
    animation: flickerInner 1.3s ease-in-out infinite;
}
@keyframes flicker {
    0%, 100% { transform: scale(1, 1)   rotate(0deg); }
    20%      { transform: scale(0.97, 1.04) rotate(-1deg); }
    50%      { transform: scale(1.03, 0.98) rotate(1deg); }
    80%      { transform: scale(0.99, 1.02) rotate(-0.5deg); }
}
@keyframes flickerInner {
    0%, 100% { transform: scale(1, 1); opacity: 1; }
    50%      { transform: scale(0.95, 1.05); opacity: 0.85; }
}

/* ---------- Reveal transition ---------- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 900ms cubic-bezier(.2,.8,.2,1), transform 900ms cubic-bezier(.2,.8,.2,1);
}
.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Scroll velocity coupling ---------- */
.aurora-field {
    transform: translate3d(0, calc(var(--scroll-velocity, 0) * -12px), 0);
}

/* Prevent text selection halo from hiding under cursor */
::selection {
    background: rgba(255,184,77,0.45);
    color: var(--cosmic-black);
}
