/* ============================================================
   EVONEG PORTFOLIO — DARK/LIGHT THEME (indigo + pink palette)
   ============================================================ */

:root {
    color-scheme: dark;
    --bg-color: #050505;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-1: #4f46e5;
    --accent-2: #ec4899;
    --accent-glow: rgba(79, 70, 229, 0.4);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.07);
    --font-main: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Theme-aware tokens */
    --h2-color: #e0e7ff;
    --hero-role-color: #c7d2fe;
    --badge-color: #818cf8;
    --badge-bg: rgba(79, 70, 229, 0.06);
    --badge-border: rgba(79, 70, 229, 0.35);
    --outline-btn-color: #a5b4fc;
    --outline-btn-hover-color: #e0e7ff;
    --disabled-border: #4b5563;
    --disabled-color: #6b7280;
    --hud-bg: rgba(5, 5, 5, 0.85);
    --hud-border: rgba(79, 70, 229, 0.3);
    --chip-bg: rgba(79, 70, 229, 0.07);
    --chip-border: rgba(79, 70, 229, 0.22);
    --chip-hover-color: #c7d2fe;
    --chip-hover-border: rgba(79, 70, 229, 0.6);
    --chip-hover-bg: rgba(79, 70, 229, 0.15);
    --scanline-color: rgba(0, 0, 0, 0.035);
    --grid-line-color: rgba(255, 255, 255, 0.025);
    --blob-opacity: 0.25;
    --ring-opacity: 0.18;
    --shine-color: rgba(255, 255, 255, 0.06);
    --core-node-color: #c7d2fe;
    --core-node-glow: rgba(79, 70, 229, 0.6);
    --glass-shadow-1: rgba(0, 0, 0, 0.7);
    --glass-hover-shadow-1: rgba(79, 70, 229, 0.2);
    --glass-hover-shadow-2: rgba(79, 70, 229, 0.5);
    --glass-hover-border: rgba(79, 70, 229, 0.6);
    --cta-shadow: rgba(79, 70, 229, 0.45);
    --cta-hover-shadow: rgba(79, 70, 229, 0.65);
    --mouse-border: rgba(79, 70, 229, 0.6);
}

/* ── Light Theme ───────────────────────────────────────────── */
[data-theme="light"] {
    color-scheme: light;
    --bg-color: #f5f5f7;
    --text-primary: #1e1b4b;
    --text-secondary: #64748b;
    --accent-1: #4338ca;
    --accent-2: #db2777;
    --accent-glow: rgba(67, 56, 202, 0.2);
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(67, 56, 202, 0.12);
    --h2-color: #1e1b4b;
    --hero-role-color: #4338ca;
    --badge-color: #4338ca;
    --badge-bg: rgba(67, 56, 202, 0.08);
    --badge-border: rgba(67, 56, 202, 0.25);
    --outline-btn-color: #4338ca;
    --outline-btn-hover-color: #1e1b4b;
    --disabled-border: #cbd5e1;
    --disabled-color: #94a3b8;
    --hud-bg: rgba(255, 255, 255, 0.85);
    --hud-border: rgba(67, 56, 202, 0.2);
    --chip-bg: rgba(67, 56, 202, 0.06);
    --chip-border: rgba(67, 56, 202, 0.18);
    --chip-hover-color: #312e81;
    --chip-hover-border: rgba(67, 56, 202, 0.5);
    --chip-hover-bg: rgba(67, 56, 202, 0.12);
    --scanline-color: rgba(0, 0, 0, 0.012);
    --grid-line-color: rgba(67, 56, 202, 0.04);
    --blob-opacity: 0.15;
    --ring-opacity: 0.12;
    --shine-color: rgba(255, 255, 255, 0.3);
    --core-node-color: #4338ca;
    --core-node-glow: rgba(67, 56, 202, 0.4);
    --glass-shadow-1: rgba(0, 0, 0, 0.06);
    --glass-hover-shadow-1: rgba(67, 56, 202, 0.1);
    --glass-hover-shadow-2: rgba(67, 56, 202, 0.15);
    --glass-hover-border: rgba(67, 56, 202, 0.35);
    --cta-shadow: rgba(67, 56, 202, 0.3);
    --cta-hover-shadow: rgba(67, 56, 202, 0.45);
    --mouse-border: rgba(67, 56, 202, 0.5);
}

[data-theme="light"] h1 {
    background: linear-gradient(135deg, #312e81 0%, #4338ca 50%, #6366f1 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

[data-theme="light"] .outline-btn:hover {
    background: rgba(67, 56, 202, 0.08);
}

[data-theme="light"] .status-dot {
    background-color: #16a34a;
}

/* Theme transition utility */
body.theme-transitioning,
body.theme-transitioning *,
body.theme-transitioning *::before,
body.theme-transitioning *::after {
    transition: background-color 0.5s ease, color 0.5s ease,
        border-color 0.5s ease, box-shadow 0.5s ease,
        opacity 0.5s ease !important;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* ── Animated Background Blobs ─────────────────────────────── */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -4;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: var(--blob-opacity);
    animation: blobFloat 12s infinite ease-in-out;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: var(--accent-1);
    top: -150px;
    left: -150px;
}

.blob-2 {
    width: 600px;
    height: 600px;
    background: var(--accent-2);
    bottom: -200px;
    right: -200px;
    animation-duration: 15s;
    animation-direction: reverse;
}

@keyframes blobFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(40px, 30px) scale(1.05);
    }
}

/* ── Animated Grid Overlay ──────────────────────────────────── */
.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(var(--grid-line-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line-color) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(circle at center, black 40%, transparent 90%);
    -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 90%);
    animation: gridPan 20s linear infinite;
}

@keyframes gridPan {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 40px 40px;
    }
}

/* ── Ambient System Core Rings ──────────────────────────────── */
.system-core {
    position: fixed;
    top: 50vh;
    left: 50vw;
    width: 0;
    height: 0;
    z-index: -3;
    pointer-events: none;
    opacity: var(--ring-opacity);
}

.core-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.core-ring-1 {
    width: 800px;
    height: 800px;
    border: 1px solid rgba(79, 70, 229, 0.12);
    border-top: 2px solid rgba(79, 70, 229, 0.9);
    animation: rotateRing 40s linear infinite;
}

.core-ring-2 {
    width: 600px;
    height: 600px;
    border: 1px dashed rgba(236, 72, 153, 0.2);
    border-right: 2px solid rgba(236, 72, 153, 0.9);
    animation: rotateRing 25s linear infinite reverse;
}

.core-ring-3 {
    width: 400px;
    height: 400px;
    border: 1px solid rgba(79, 70, 229, 0.12);
    border-bottom: 2px solid rgba(79, 70, 229, 0.9);
    animation: rotateRing 15s linear infinite;
}

.core-node {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--core-node-color);
    border-radius: 50%;
    box-shadow: 0 0 50px 25px var(--core-node-glow);
    animation: pulseNode 3s ease-in-out infinite alternate;
}

@keyframes rotateRing {
    0% {
        transform: translate(-50%, -50%) rotate(0deg) scale(1) rotateX(60deg) rotateY(20deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg) scale(1) rotateX(60deg) rotateY(20deg);
    }
}

@keyframes pulseNode {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.6);
        opacity: 1;
    }
}

/* ── Typography ─────────────────────────────────────────────── */
h1,
h2,
h3 {
    font-family: var(--font-main);
}

/* Canvas (physics bg) */
#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

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

section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 10%;
    position: relative;
}

#phase3 {
    margin-top: 15vh;
    padding-bottom: 60vh;
}

.hero-section {
    align-items: center;
    text-align: center;
}

/* ── Glassmorphism Panels ───────────────────────────────────── */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 3rem;
    max-width: 600px;
    box-shadow:
        0 25px 50px -12px var(--glass-shadow-1),
        0 0 40px var(--accent-glow);
    transform: translateY(30px);
    opacity: 0;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out,
        box-shadow 0.4s ease, border-color 0.4s ease;
    overflow: hidden;
    position: relative;
}

/* Shine sweep */
.glass-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 60%;
    height: 100%;
    background: linear-gradient(to right, transparent, var(--shine-color), transparent);
    transform: skewX(-20deg);
    transition: left 0.7s ease;
    pointer-events: none;
}

.glass-panel.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s ease-out,
        transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        box-shadow 0.4s ease, border-color 0.4s ease;
}

.glass-panel.visible:hover,
.glass-panel.visible.simulated-hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow:
        0 35px 60px -12px var(--glass-hover-shadow-1),
        0 0 60px var(--glass-hover-shadow-2);
    border-color: var(--glass-hover-border);
}

.glass-panel.visible:hover::before {
    left: 150%;
}

.align-left {
    align-self: flex-start;
}

.align-right {
    align-self: flex-end;
}

.text-center {
    align-self: center;
    text-align: center;
}

/* ── Headings ───────────────────────────────────────────────── */
h1 {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #e0e7ff 0%, #a5b4fc 50%, #818cf8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}

h2 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--h2-color);
}

p {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* ── Tech Badge ─────────────────────────────────────────────── */
.tech-badge {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--badge-color);
    letter-spacing: 0.12em;
    margin-bottom: 1.5rem;
    display: inline-block;
    padding: 0.4rem 1rem;
    border: 1px solid var(--badge-border);
    border-radius: 4px;
    background: var(--badge-bg);
    text-transform: uppercase;
}

/* ── Hero Role & Subtitle ───────────────────────────────────── */
.hero-role {
    font-size: 1.5rem;
    color: var(--hero-role-color);
    font-weight: 500;
}

.hero-subtitle {
    margin-top: 1.5rem;
    font-size: 1rem;
    font-family: var(--font-mono);
    white-space: nowrap;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    line-height: 1.6;
}

.hero-subtitle span {
    margin: 0 0.5rem;
    color: var(--accent-1);
    opacity: 0.6;
}

/* ── Scroll Indicator ────────────────────────────────────────── */
.scroll-indicator {
    margin-top: 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-family: var(--font-mono);
}

.mouse {
    width: 26px;
    height: 40px;
    border: 2px solid var(--mouse-border);
    border-radius: 20px;
    display: flex;
    justify-content: center;
    padding-top: 6px;
}

.wheel {
    width: 4px;
    height: 8px;
    background-color: var(--accent-1);
    border-radius: 2px;
    animation: scroll 1.5s infinite;
}

@keyframes scroll {
    0% {
        transform: translateY(0);
        opacity: 1;
    }

    100% {
        transform: translateY(15px);
        opacity: 0;
    }
}

/* ── Footer Section ─────────────────────────────────────────── */
.footer-section {
    min-height: 50vh;
}

/* ── CTA Buttons ────────────────────────────────────────────── */
.cta-btn {
    display: inline-block;
    margin-top: 2rem;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, var(--accent-1) 0%, #818cf8 100%);
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-family: var(--font-main);
    border-radius: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 10px 25px var(--cta-shadow);
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px var(--cta-hover-shadow);
}

.outline-btn {
    background: transparent;
    border: 2px solid rgba(79, 70, 229, 0.7);
    color: var(--outline-btn-color);
    margin-left: 1rem;
    box-shadow: none;
    min-width: 260px;
    text-align: center;
    transition: opacity 0.3s ease, background 0.3s ease,
        transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.outline-btn:hover {
    background: rgba(79, 70, 229, 0.12);
    box-shadow: 0 0 20px rgba(79, 70, 229, 0.4);
    border-color: var(--accent-1);
    color: var(--outline-btn-hover-color);
}

.outline-btn.disabled-btn {
    opacity: 0.5;
    pointer-events: none;
    border-color: var(--disabled-border);
    color: var(--disabled-color);
    animation: pulseDisabled 1.5s infinite alternate;
}

@keyframes pulseDisabled {
    0% {
        opacity: 0.4;
    }

    100% {
        opacity: 0.8;
    }
}

.footer-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-buttons .cta-btn {
    margin-left: 0;
}

/* ── System ID (Top-Left Corner) ────────────────────────────── */
.system-id {
    position: fixed;
    top: 1.75rem;
    left: 2rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-secondary);
    opacity: 0.75;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 100;
    letter-spacing: 0.06em;
    pointer-events: none;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    background: var(--hud-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.status-dot {
    width: 6px;
    height: 6px;
    background-color: #4ade80;
    border-radius: 50%;
    flex-shrink: 0;
    animation: dotPulse 2.5s ease-in-out infinite;
}

@keyframes dotPulse {

    0%,
    100% {
        opacity: 0.4;
        box-shadow: 0 0 0 rgba(74, 222, 128, 0);
    }

    50% {
        opacity: 1;
        box-shadow: 0 0 8px rgba(74, 222, 128, 0.7);
    }
}

/* ── HUD Corner (Top-Right) ─────────────────────────────────── */
.hud-corner-right {
    position: fixed;
    top: 1.75rem;
    right: 2rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--accent-1);
    opacity: 0.5;
    letter-spacing: 0.14em;
    z-index: 100;
    padding: 0.3rem 0.65rem;
    border: 1px solid var(--hud-border);
    border-radius: 3px;
    pointer-events: none;
    background: var(--hud-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* ── Theme Toggle Button ───────────────────────────────────── */
.theme-toggle {
    position: fixed;
    top: 1.65rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 101;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--hud-border);
    background: var(--hud-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-1);
    font-size: 0.85rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, opacity 0.3s ease;
    opacity: 0.7;
    animation: togglePulse 2s ease-in-out 1s 3;
}

@keyframes togglePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 transparent;
    }
    50% {
        box-shadow: 0 0 18px 4px var(--accent-glow);
        border-color: var(--accent-1);
        opacity: 1;
    }
}

.theme-toggle:hover {
    transform: translateX(-50%) scale(1.2);
    box-shadow: 0 0 18px var(--accent-glow);
    opacity: 1;
    border-color: var(--accent-1);
    animation: none;
}

.theme-toggle:active {
    transform: translateX(-50%) scale(0.92);
}

/* Icon visibility per theme */
.theme-toggle .fa-sun {
    display: none;
}

[data-theme="light"] .theme-toggle .fa-moon {
    display: none;
}

[data-theme="light"] .theme-toggle .fa-sun {
    display: inline;
}

/* ── Vertical Side Labels ───────────────────────────────────── */
.side-label {
    position: fixed;
    top: 50%;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--text-secondary);
    opacity: 0.18;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    writing-mode: vertical-rl;
    z-index: 100;
    pointer-events: none;
    user-select: none;
}

.side-label-left {
    left: 0.8rem;
    transform: translateY(-50%) rotate(180deg);
}

.side-label-right {
    right: 0.8rem;
    transform: translateY(-50%);
}

/* ── Scanline Overlay ────────────────────────────────────────── */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 3px,
            var(--scanline-color) 3px,
            var(--scanline-color) 4px);
    pointer-events: none;
    z-index: 9999;
}

/* ── Third Blob (Mid-Purple Center) ─────────────────────────── */
.blob-3 {
    width: 380px;
    height: 380px;
    background: #7c3aed;
    top: 35%;
    left: 25%;
    animation-duration: 18s;
    filter: blur(110px);
    opacity: 0.12;
}

/* ── Phase Number Label ─────────────────────────────────────── */
.phase-num {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--accent-1);
    opacity: 0.55;
    letter-spacing: 0.12em;
    margin-bottom: 0.6rem;
}

/* ── Tech Chips ─────────────────────────────────────────────── */
.tech-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 1.5rem;
}

.chip {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-secondary);
    background: var(--chip-bg);
    border: 1px solid var(--chip-border);
    border-radius: 4px;
    padding: 0.22rem 0.55rem;
    letter-spacing: 0.04em;
    transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
    cursor: default;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.chip i {
    font-size: 0.7em;
    color: var(--accent-1);
    opacity: 0.75;
    transition: opacity 0.25s ease;
}

.chip:hover i {
    opacity: 1;
}

.chip:hover {
    color: var(--chip-hover-color);
    border-color: var(--chip-hover-border);
    background: var(--chip-hover-bg);
}

/* ── Icon Styling ───────────────────────────────────────────── */

/* h2 section icons */
h2>i {
    font-size: 0.75em;
    color: var(--accent-1);
    opacity: 0.7;
    margin-right: 0.3rem;
    vertical-align: middle;
}

/* Tech-badge icon */
.tech-badge i {
    font-size: 0.85em;
    margin-right: 0.25rem;
    opacity: 0.8;
}

/* Button icons */
.cta-btn i {
    font-size: 0.85em;
    margin-right: 0.3rem;
}

/* ── Panel Corner Brackets ──────────────────────────────────── */
.c-tl,
.c-br {
    position: absolute;
    width: 14px;
    height: 14px;
    pointer-events: none;
    opacity: 0.35;
    transition: opacity 0.4s ease;
}

.c-tl {
    top: 12px;
    left: 12px;
    border-top: 2px solid var(--accent-1);
    border-left: 2px solid var(--accent-1);
    border-radius: 2px 0 0 0;
}

.c-br {
    bottom: 12px;
    right: 12px;
    border-bottom: 2px solid var(--accent-1);
    border-right: 2px solid var(--accent-1);
    border-radius: 0 0 2px 0;
}

.glass-panel.visible:hover .c-tl,
.glass-panel.visible:hover .c-br,
.glass-panel.visible.simulated-hover .c-tl,
.glass-panel.visible.simulated-hover .c-br {
    opacity: 0.8;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    .glass-panel {
        padding: 2rem;
    }

    section {
        padding: 0 5%;
    }

    .hero-subtitle {
        white-space: normal;
    }

    .side-label {
        display: none;
    }

    .system-id,
    .hud-corner-right {
        font-size: 0.68rem;
    }
}