/* ============================================================
   PORTFOLIO — STYLE.CSS
   Purple glassmorphism theme with dark/light mode
   ============================================================ */


/* ---------- DESIGN TOKENS ---------- */
:root {
    /* Purple palette */
    --primary: 270, 70%, 55%;
    --primary-color: hsl(var(--primary));
    --accent: 280, 80%, 65%;
    --accent-color: hsl(var(--accent));
    --glow: hsl(270, 100%, 70%);

    /* Font */
    --font: 'Lexend', system-ui, -apple-system, sans-serif;

    /* Transitions */
    --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);

    /* Spacing */
    --section-pad: clamp(4rem, 10vw, 8rem) clamp(1rem, 5vw, 4rem);
    --container-max: 1200px;
    --radius: 20px;
    --radius-sm: 12px;
}

/* Dark mode (default) */
[data-theme="dark"] {
    --bg-primary: hsl(270, 30%, 6%);
    --bg-secondary: hsl(270, 25%, 10%);
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --border-card: rgba(255, 255, 255, 0.08);
    --border-card-hover: rgba(168, 85, 247, 0.4);
    --text-primary: hsl(270, 10%, 95%);
    --text-secondary: hsl(270, 10%, 65%);
    --text-muted: hsl(270, 10%, 45%);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(168, 85, 247, 0.15);
    --nav-bg: rgba(15, 10, 25, 0.8);
}

/* Light mode */
[data-theme="light"] {
    --bg-primary: hsl(270, 25%, 97%);
    --bg-secondary: hsl(270, 20%, 93%);
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-card-hover: rgba(255, 255, 255, 0.85);
    --border-card: rgba(168, 85, 247, 0.15);
    --border-card-hover: rgba(168, 85, 247, 0.4);
    --text-primary: hsl(270, 30%, 15%);
    --text-secondary: hsl(270, 15%, 40%);
    --text-muted: hsl(270, 10%, 55%);
    --shadow: 0 8px 32px rgba(100, 50, 150, 0.1);
    --shadow-glow: 0 0 40px rgba(168, 85, 247, 0.1);
    --nav-bg: rgba(245, 240, 255, 0.85);
}

/* ---------- RESET & BASE ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    font-size: 16px;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    transition: background var(--transition), color var(--transition);
}

/* ---------- CUSTOM CURSOR ---------- */
@media (pointer: fine) {

    body,
    a,
    button,
    .btn,
    .project-folder-header,
    .skill-card,
    .service-card,
    .contact-card {
        cursor: none !important;
    }

    .custom-cursor-dot {
        position: fixed;
        top: 0;
        left: 0;
        width: 8px;
        height: 8px;
        background-color: var(--primary-color);
        border-radius: 50%;
        z-index: 9999;
        pointer-events: none;
        transform: translate(-50%, -50%) translateZ(0);
        will-change: transform, left, top;
        transition: none;
    }

    .custom-cursor-dot.is-trapped {
        transition: left 0.15s cubic-bezier(0.23, 1, 0.32, 1),
            top 0.15s cubic-bezier(0.23, 1, 0.32, 1);
    }

    .custom-cursor-outline {
        position: fixed;
        top: 0;
        left: 0;
        width: 40px;
        height: 40px;
        border: 2px solid rgba(168, 85, 247, 0.5);
        border-radius: 50%;
        z-index: 9998;
        pointer-events: none;
        transform: translate(-50%, -50%) translateZ(0);
        will-change: transform, left, top, width, height;
        transition: all 0.1s cubic-bezier(0.23, 1, 0.32, 1);
        background: transparent;
    }

    /* When snapped to a bounding box */
    .custom-cursor-outline.is-snapped {
        border-radius: var(--radius);
        border-color: var(--primary-color);
        background: rgba(168, 85, 247, 0.06);
        box-shadow: 0 0 20px rgba(168, 85, 247, 0.15),
            inset 0 0 20px rgba(168, 85, 247, 0.05);
        transform: translate(-50%, -50%);
        box-sizing: border-box;
        /* Disable transition while snapped so JS positioning is exact */
        transition: width 0.2s cubic-bezier(0.23, 1, 0.32, 1),
            height 0.2s cubic-bezier(0.23, 1, 0.32, 1),
            border-radius 0.2s,
            left 0.12s cubic-bezier(0.23, 1, 0.32, 1),
            top 0.12s cubic-bezier(0.23, 1, 0.32, 1);
    }
}

/* ---------- AMBIENT BACKGROUND ---------- */
#ambientCanvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.ambient-orbs {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.12;
    transition: opacity 1s ease;
}

[data-theme="light"] .orb {
    opacity: 0.08;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: hsl(270, 80%, 50%);
    top: 10%;
    left: -5%;
    animation: orbFloat1 20s ease-in-out infinite;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: hsl(290, 80%, 55%);
    top: 50%;
    right: -5%;
    animation: orbFloat2 25s ease-in-out infinite;
}

.orb-3 {
    width: 350px;
    height: 350px;
    background: hsl(260, 70%, 45%);
    bottom: 5%;
    left: 30%;
    animation: orbFloat3 22s ease-in-out infinite;
}

@keyframes orbFloat1 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(80px, 60px) scale(1.1);
    }

    66% {
        transform: translate(-40px, 120px) scale(0.95);
    }
}

@keyframes orbFloat2 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(-60px, -80px) scale(1.05);
    }

    66% {
        transform: translate(50px, -40px) scale(0.9);
    }
}

@keyframes orbFloat3 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(70px, -50px) scale(1.08);
    }

    66% {
        transform: translate(-60px, 30px) scale(0.92);
    }
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    width: 100%;
}

.section {
    padding: var(--section-pad);
    position: relative;
    z-index: 1;
}

/* ---------- GRADIENT TEXT ---------- */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color), hsl(300, 80%, 65%));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    text-align: center;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 3rem;
    font-size: 1.05rem;
}

/* ---------- GLASS CARD ---------- */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    padding: 2rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
    transition: all var(--transition);
}

.glass-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-card-hover);
    box-shadow: var(--shadow), var(--shadow-glow);
    transform: translateY(-4px);
}

/* ---------- BUTTONS ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 50px;
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.35);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(168, 85, 247, 0.5);
    color: white;
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-card-hover);
}

.btn-outline:hover {
    background: rgba(168, 85, 247, 0.1);
    border-color: var(--primary-color);
    transform: translateY(-3px);
    color: var(--text-primary);
}

.btn-lg {
    padding: 18px 42px;
    font-size: 1.1rem;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-card);
    transition: all var(--transition);
}

.navbar.hidden {
    transform: translateY(-100%);
}

.navbar.scrolled {
    padding: 0.7rem 2rem;
    box-shadow: var(--shadow);
}

.nav-logo {
    font-size: 1.8rem;
    font-weight: 900;
    font-family: var(--font-display);
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.logo-dot {
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    position: relative;
    padding: 4px 0;
    transition: color var(--transition);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
    transition: width var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Nav Actions (Lang + Theme) */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lang-toggle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-card);
    background: var(--bg-card);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.85rem;
}

.lang-toggle:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.2);
}

/* Theme Toggle */
.theme-toggle {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-card);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    overflow: hidden;
}

.theme-toggle:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.2);
}

.toggle-icon {
    position: absolute;
    transition: all var(--transition);
    font-size: 1.1rem;
}

[data-theme="dark"] .toggle-icon.sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

[data-theme="dark"] .toggle-icon.moon {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

[data-theme="light"] .toggle-icon.sun {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

[data-theme="light"] .toggle-icon.moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 1001;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition);
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 6rem 2rem 2rem 2rem;
}

#particleCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.hero-orbs {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.5;
    animation: floatOrb 15s ease-in-out infinite alternate;
    will-change: transform;
    transform: translateZ(0);
}

.orb-purple {
    width: 60vw;
    height: 60vw;
    background: rgba(168, 85, 247, 0.2);
    top: -10%;
    right: -10%;
}

.orb-blue {
    width: 50vw;
    height: 50vw;
    background: rgba(59, 130, 246, 0.2);
    bottom: -10%;
    left: -10%;
    animation-delay: -5s;
}

@keyframes floatOrb {
    0% { transform: translate(0, 0) scale(1) translateZ(0); }
    100% { transform: translate(10%, 10%) scale(1.1) translateZ(0); }
}

.hero-grid {
    position: relative;
    z-index: 4;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
}

.hero-text-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: start;
}

.hero-visual-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    width: 100%;
}

/* Floating Badges */
.floating-badge {
    position: absolute;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-glow);
    z-index: 10;
    animation: floatBadge 6s ease-in-out infinite;
    will-change: transform;
    transform: translateZ(0);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.badge-icon {
    font-size: 1.2rem;
}

.badge-1 {
    top: 10%;
    left: -10%;
    animation-delay: 0s;
}

.badge-2 {
    bottom: 20%;
    right: -5%;
    animation-delay: -2s;
}

.badge-3 {
    top: 40%;
    right: -15%;
    animation-delay: -4s;
}

@keyframes floatBadge {
    0%, 100% { transform: translateY(0) translateZ(0); }
    50% { transform: translateY(-15px) translateZ(0); }
}

/* Hero Terminal */
.hero-terminal {
    width: 100%;
    max-width: 500px;
    background: rgba(10, 10, 18, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(168, 85, 247, 0.3);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255,255,255,0.05);
    border-radius: 12px;
    overflow: hidden;
    z-index: 5;
    position: relative;
    transform: perspective(1000px) rotateY(-5deg) rotateX(5deg);
    transition: transform 0.5s ease;
}

.hero-terminal:hover {
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
}

@media (max-width: 968px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    .hero-text-content {
        align-items: center;
        text-align: center;
    }
    .hero-visual-content {
        min-height: 300px;
    }
    .floating-badge {
        display: none;
    }
    .hero-terminal {
        transform: none;
    }
}

.hero-greeting {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 0.5rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hero-name {
    font-size: clamp(3rem, 10vw, 6rem);
    font-weight: 900;
    font-family: var(--font-display);
    line-height: 1.1;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-color) 50%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 200%;
    animation: gradientShift 6s ease-in-out infinite;
    margin-bottom: 1rem;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.hero-tagline-wrapper {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1.5rem;
    min-height: 2em;
}

.cursor-blink {
    animation: blink 1s step-end infinite;
    color: var(--primary-color);
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.hero-sub {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 550px;
    margin: 0 auto 2.5rem;
    line-height: 1.8;
}

.hero-cta-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    animation: float 3s ease-in-out infinite;
}

.scroll-mouse {
    width: 24px;
    height: 38px;
    border: 2px solid var(--text-muted);
    border-radius: 12px;
    position: relative;
}

.scroll-wheel {
    width: 3px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll-anim 2s ease-in-out infinite;
}

@keyframes scroll-anim {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(12px);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    50% {
        transform: translateX(-50%) translateY(-8px);
    }
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
    align-items: start;
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 1.02rem;
}

.about-text p:last-child {
    margin-bottom: 0;
}

.about-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

.about-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stat-card {
    text-align: center;
    padding: 1.5rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: var(--font-display);
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-plus {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================================
   TERMINAL CONSOLE
   ============================================================ */
.terminal-wrap {
    margin-top: 3rem;
}

.terminal-window {
    background: rgba(10, 10, 18, 0.92);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(168, 85, 247, 0.08);
    backdrop-filter: blur(20px);
    font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
}

.terminal-titlebar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(168, 85, 247, 0.12);
}

.term-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.term-red {
    background: #ff5f57;
}

.term-yellow {
    background: #febc2e;
}

.term-green {
    background: #28c840;
}

.term-title {
    margin-left: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

.terminal-body {
    padding: 1.2rem 1.5rem;
    min-height: 220px;
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(168, 85, 247, 0.3) transparent;
}

.term-line {
    font-size: 0.82rem;
    line-height: 1.6;
    white-space: pre-wrap;
    opacity: 0;
    animation: termFadeIn 0.15s forwards;
}

@keyframes termFadeIn {
    to {
        opacity: 1;
    }
}

.term-info {
    color: #7dd3fc;
}

.term-success {
    color: #86efac;
}

.term-warn {
    color: #fde68a;
}

.term-error {
    color: #fca5a5;
}

.term-dim {
    color: rgba(255, 255, 255, 0.3);
}

.term-prompt {
    color: rgba(168, 85, 247, 0.8);
}

.terminal-footer {
    padding: 10px 16px;
    border-top: 1px solid rgba(168, 85, 247, 0.1);
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.terminal-run-btn {
    padding: 8px 20px;
    font-size: 0.82rem;
}

.terminal-run-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ============================================================
   SKILLS (DAG Graph)
   ================*/
.dag-wrap {
    position: relative;
    background: rgba(10, 10, 18, 0.6);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: var(--radius);
    padding: 2rem;
    backdrop-filter: blur(10px);
    margin-top: 2rem;
    min-height: 525px;
    display: flex;
    justify-content: center;
}

.dag-legend {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    display: flex;
    gap: 1rem;
    z-index: 10;
}

.dag-legend-item {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.dag-legend-item::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dag-legend-item[data-cat="lang"]::before {
    background: #3b82f6;
}

.dag-legend-item[data-cat="data"]::before {
    background: #10b981;
}

.dag-legend-item[data-cat="viz"]::before {
    background: #f59e0b;
}

.dag-legend-item[data-cat="infra"]::before {
    background: #8b5cf6;
}

.dag-svg {
    width: 100%;
    height: 400px;
    overflow: visible;
}

.dag-hint {
    position: absolute;
    bottom: 1rem;
    right: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

.node-group {
    cursor: pointer;
    transition: all 0.3s ease;
}

.node-circle {
    transition: all 0.3s ease;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 2;
}

.node-text {
    fill: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    pointer-events: none;
    transition: all 0.3s ease;
}

.node-icon {
    font-size: 16px;
    pointer-events: none;
}

.edge-line {
    stroke: rgba(168, 85, 247, 0.2);
    stroke-width: 2;
    transition: all 0.3s ease;
}

/* Hover States */
.dag-wrap.is-hovering .node-group {
    opacity: 0.3;
}

.dag-wrap.is-hovering .edge-line {
    opacity: 0.1;
}

.node-group.active {
    opacity: 1 !important;
}

.node-group.active .node-circle {
    stroke: #fff;
    stroke-width: 3;
    filter: drop-shadow(0 0 10px currentColor);
}

.node-group.active .node-text {
    fill: #fff;
}

.edge-line.active {
    stroke: var(--primary-color);
    stroke-width: 3;
    opacity: 1 !important;
}

/* skill-fill width is set by JS based on data-level */

/* ============================================================
   EDUCATION
   ============================================================ */
.education-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: stretch;
}

.edu-card {
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.edu-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

.edu-badge {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.edu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.edu-type {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--primary-color);
    background: rgba(168, 85, 247, 0.1);
    padding: 4px 14px;
    border-radius: 50px;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.edu-date {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.edu-school {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

.edu-major {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.edu-philosophy {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    border-left: 2px solid rgba(168, 85, 247, 0.3);
    font-style: italic;
}

.edu-details {
    margin-bottom: 1.5rem;
    flex: 1;
}

.edu-details h5 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.8rem;
}

.edu-courses {
    list-style: none;
    padding: 0;
}

.edu-courses li {
    position: relative;
    padding-left: 1.4rem;
    margin-bottom: 0.45rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.edu-courses li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: 700;
}

.edu-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}

@media (max-width: 768px) {
    .education-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   EXPERIENCE / TIMELINE
   ============================================================ */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding-left: 50px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 19px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--primary-color), var(--accent-color), transparent);
}

.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -38px;
    top: 2rem;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 3px solid var(--bg-primary);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.5), 0 0 0 3px rgba(168, 85, 247, 0.2);
    z-index: 1;
}

.timeline-card {
    padding: 2rem;
}

.timeline-date {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.timeline-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-top: 0.5rem;
}

.timeline-card h4 {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.8rem;
}

.timeline-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.timeline-highlights {
    list-style: disc;
    padding-left: 1.2rem;
    margin-bottom: 1rem;
}

.timeline-highlights li {
    list-style: disc;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

.timeline-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    padding: 4px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50px;
    background: rgba(168, 85, 247, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(168, 85, 247, 0.2);
}

/* ============================================================
   PROJECTS (Accordion Folders)
   ============================================================ */
.projects-accordion {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.project-folder {
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    overflow: hidden;
    position: relative;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.project-folder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color), hsl(300, 80%, 65%));
    opacity: 0;
    transition: opacity 0.3s;
}

.project-folder.is-open::before,
.project-folder:hover::before {
    opacity: 1;
}

.project-folder.is-open {
    border-color: rgba(168, 85, 247, 0.3);
    box-shadow: 0 8px 40px rgba(168, 85, 247, 0.1);
}

/* Folder Header (always visible) */
.project-folder-header {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1.5rem 2rem;
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background 0.2s;
}

.project-folder-header:hover {
    background: rgba(168, 85, 247, 0.04);
}

.project-folder-header .project-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.project-folder-meta {
    flex: 1;
    min-width: 0;
}

.project-folder-meta h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.project-folder-meta .project-tagline {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 0;
}

.project-folder.is-open .project-folder-meta .project-tagline {
    -webkit-line-clamp: unset;
    overflow: visible;
}

.project-folder-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

/* Chevron */
.project-chevron {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(168, 85, 247, 0.1);
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), background 0.2s;
}

.project-chevron svg {
    width: 16px;
    height: 16px;
    fill: var(--primary-color);
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.project-folder.is-open .project-chevron {
    background: rgba(168, 85, 247, 0.2);
}

.project-folder.is-open .project-chevron svg {
    transform: rotate(180deg);
}

/* Collapsible body — uses grid row trick for smooth height animation */
.project-folder-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.45s cubic-bezier(0.23, 1, 0.32, 1);
}

.project-folder.is-open .project-folder-body {
    grid-template-rows: 1fr;
}

.project-folder-body-inner {
    overflow: hidden;
}

.project-folder-content {
    padding: 0 2rem 2rem;
}

/* Re-use existing sub-component styles */
.project-folder-content .project-architecture {
    margin-bottom: 2rem;
}

.project-folder-content .project-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.project-folder-content .project-tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.project-folder-content .project-actions {
    display: flex;
    gap: 1rem;
}

@media (max-width: 768px) {
    .project-folder-header {
        padding: 1.2rem 1.2rem;
        gap: 0.8rem;
    }

    .project-folder-content {
        padding: 0 1.2rem 1.5rem;
    }

    .project-folder-content .project-details-grid {
        grid-template-columns: 1fr;
    }

    .project-folder-meta h3 {
        font-size: 1.1rem;
    }
}

/* Keep existing sub-component styles that are shared */
.project-showcase {
    max-width: 900px;
    margin: 0 auto;
}

.project-card {
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color), hsl(300, 80%, 65%));
}

.project-header {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.project-icon {
    font-size: 3rem;
    flex-shrink: 0;
}

.project-header h3 {
    font-size: 1.6rem;
    font-weight: 800;
}

.project-tagline {
    color: var(--text-secondary);
    margin-top: 0.3rem;
    font-size: 1rem;
}

/* Pipeline Architecture */
.project-architecture {
    margin-bottom: 2rem;
}

.project-architecture h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1.2rem;
}

.pipeline-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pipeline-step {
    text-align: center;
    padding: 1.2rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border-card);
    flex: 1;
    min-width: 110px;
    transition: all var(--transition);
}

.pipeline-step:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.15);
    transform: translateY(-3px);
}

.step-icon {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
}

.step-label {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.step-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.pipeline-arrow {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
    flex-shrink: 0;
}

/* Project details */
.project-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.project-detail h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.project-detail ul {
    list-style: disc;
    padding-left: 1.2rem;
}

.project-detail ul li {
    list-style: disc;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

.impact-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.impact-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.impact-value {
    font-size: 1.5rem;
    font-weight: 800;
    font-family: var(--font-display);
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    min-width: 70px;
}

.impact-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Tech badges */
.project-tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.tech-badge {
    padding: 6px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 50px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(192, 100, 255, 0.1));
    color: var(--accent-color);
    border: 1px solid rgba(168, 85, 247, 0.2);
    transition: all var(--transition);
}

.tech-badge:hover {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(192, 100, 255, 0.2));
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.2);
}

.project-actions {
    display: flex;
    gap: 1rem;
}

/* ============================================================
   SERVICES
   ============================================================ */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.service-card {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.service-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
}

.service-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    flex: 1;
}

.service-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.service-card:hover .service-icon-wrap {
    background: rgba(168, 85, 247, 0.18);
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.2);
    transform: scale(1.05);
}

.service-icon {
    font-size: 1.6rem;
}

.service-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

/* stagger */
.services-grid .service-card:nth-child(1) {
    transition-delay: 0s;
}

.services-grid .service-card:nth-child(2) {
    transition-delay: 0.1s;
}

.services-grid .service-card:nth-child(3) {
    transition-delay: 0.2s;
}

.services-grid .service-card:nth-child(4) {
    transition-delay: 0.3s;
}

.services-grid .service-card:nth-child(5) {
    transition-delay: 0.4s;
}

.services-grid .service-card:nth-child(6) {
    transition-delay: 0.5s;
}

@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.contact-card {
    text-align: center;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.contact-card:hover {
    color: var(--text-primary);
}

.contact-icon {
    width: 32px;
    height: 32px;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    transition: transform var(--transition);
}

.contact-card:hover .contact-icon {
    transform: scale(1.2);
}

.contact-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.contact-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* CTA */
.cta-section {
    text-align: center;
}

.cta-card {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(168, 85, 247, 0.12), transparent 60%);
    pointer-events: none;
}

.cta-card h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.8rem;
}

.cta-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-card);
}

/* ============================================================
   SCROLL REVEAL ANIMATIONS
   ============================================================ */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* stagger children */
.skills-grid .skill-card:nth-child(1) {
    transition-delay: 0s;
}

.skills-grid .skill-card:nth-child(2) {
    transition-delay: 0.06s;
}

.skills-grid .skill-card:nth-child(3) {
    transition-delay: 0.12s;
}

.skills-grid .skill-card:nth-child(4) {
    transition-delay: 0.18s;
}

.skills-grid .skill-card:nth-child(5) {
    transition-delay: 0.24s;
}

.skills-grid .skill-card:nth-child(6) {
    transition-delay: 0.30s;
}

.skills-grid .skill-card:nth-child(7) {
    transition-delay: 0.36s;
}

.skills-grid .skill-card:nth-child(8) {
    transition-delay: 0.42s;
}

.skills-grid .skill-card:nth-child(9) {
    transition-delay: 0.48s;
}

.skills-grid .skill-card:nth-child(10) {
    transition-delay: 0.54s;
}

.skills-grid .skill-card:nth-child(11) {
    transition-delay: 0.60s;
}

.skills-grid .skill-card:nth-child(12) {
    transition-delay: 0.66s;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: var(--nav-bg);
        backdrop-filter: blur(30px);
        -webkit-backdrop-filter: blur(30px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transition: right var(--transition);
        border-left: 1px solid var(--border-card);
    }

    .nav-links.active {
        right: 0;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .about-stats {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .stat-card {
        flex: 1;
        min-width: 120px;
    }

    .skills-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }

    .timeline {
        padding-left: 40px;
    }

    .timeline::before {
        left: 14px;
    }

    .timeline-dot {
        left: -33px;
    }

    .project-details-grid {
        grid-template-columns: 1fr;
    }

    .pipeline-flow {
        flex-direction: column;
    }

    .pipeline-arrow {
        transform: rotate(90deg);
    }

    .pipeline-step {
        width: 100%;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-cta-group {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .about-stats {
        flex-direction: column;
    }

    .stat-card {
        min-width: unset;
    }
}

/* ============================================================
   RTL (ARABIC) OVERRIDES
   ============================================================ */
[dir="rtl"] {
    font-family: 'Tajawal', var(--font);
}

[dir="rtl"] .hero-name,
[dir="rtl"] .nav-logo {
    font-family: 'Tajawal', var(--font-display);
}

[dir="rtl"] .edu-philosophy {
    padding-left: 0;
    padding-right: 1rem;
    border-left: none;
    border-right: 2px solid rgba(168, 85, 247, 0.3);
}

[dir="rtl"] .edu-courses li {
    padding-left: 0;
    padding-right: 1.4rem;
}

[dir="rtl"] .edu-courses li::before {
    left: auto;
    right: 0;
    content: '◂';
}

[dir="rtl"] .timeline {
    padding-left: 0;
    padding-right: 50px;
}

[dir="rtl"] .timeline::before {
    left: auto;
    right: 19px;
}

[dir="rtl"] .timeline-dot {
    left: auto;
    right: -38px;
}

[dir="rtl"] .pipeline-arrow {
    transform: scaleX(-1);
}

@media (max-width: 768px) {
    [dir="rtl"] .nav-links {
        right: auto;
        left: -100%;
        border-right: 1px solid var(--border-card);
        border-left: none;
    }

    [dir="rtl"] .nav-links.active {
        left: 0;
    }

    [dir="rtl"] .timeline {
        padding-right: 40px;
    }

    [dir="rtl"] .timeline::before {
        right: 14px;
    }

    [dir="rtl"] .timeline-dot {
        right: -33px;
    }

    [dir="rtl"] .pipeline-arrow {
        transform: rotate(90deg);
    }
}

@media (max-width: 480px) {
    .node-text {
        font-size: 10px;
    }

    .node-icon {
        font-size: 12px;
    }

    .node-circle {
        r: 18;
    }

    .dag-legend {
        flex-wrap: wrap;
    }
}

/* ============================================================
   UI/UX MICRO-INTERACTIONS
   ============================================================ */

/* 1. Dynamic Glass Glare */
.glass-card,
.terminal-window {
    position: relative;
    overflow: hidden;
}

.glass-card::after,
.terminal-window::after {
    content: '';
    position: absolute;
    inset: 0;
    /* The mouse X/Y vars will be injected by JS */
    background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
            rgba(168, 85, 247, 0.08),
            transparent 40%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 0;
    /* Keep it behind the text */
}

.glass-card:hover::after,
.terminal-window:hover::after {
    opacity: 1;
}

/* 2. Magnetic Button Smoothness */
.btn-primary {
    transition: transform 0.1s ease-out, background 0.3s, box-shadow 0.3s !important;
    will-change: transform;
}

/* ============================================================
   UI/UX PHASE 2: STAGGERED REVEALS & TIMELINE
   ============================================================ */

/* Staggered Reveals (Fades in items sequentially) */
.reveal:nth-child(1) {
    transition-delay: 0s;
}

.reveal:nth-child(2) {
    transition-delay: 0.1s;
}

.reveal:nth-child(3) {
    transition-delay: 0.2s;
}

.reveal:nth-child(4) {
    transition-delay: 0.3s;
}

.reveal:nth-child(5) {
    transition-delay: 0.4s;
}

.reveal:nth-child(6) {
    transition-delay: 0.5s;
}

/* Timeline Pipeline */
.education-grid {
    position: relative;
    padding-left: 3rem;
    /* Make room for the line */
}

.timeline-svg-container {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 50px;
    z-index: 1;
}

.timeline-svg {
    width: 100%;
    height: 100%;
}

/* ============================================================
   UI/UX PHASE 3: MARQUEE & FILTERS
   ============================================================ */

/* Infinite Marquee */
.marquee-container {
    overflow: hidden;
    display: flex;
    background: rgba(168, 85, 247, 0.05);
    border-top: 1px solid rgba(168, 85, 247, 0.1);
    border-bottom: 1px solid rgba(168, 85, 247, 0.1);
    padding: 1rem 0;
    white-space: nowrap;
    position: relative;
    z-index: 5;
}

.marquee-content {
    display: flex;
    animation: scroll 25s linear infinite;
    will-change: transform;
    transform: translateZ(0);
}

.marquee-content span {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 2rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

@keyframes scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

/* Project Filters */
.project-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-muted);
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.filter-btn:hover {
    border-color: rgba(168, 85, 247, 0.5);
    color: var(--text-primary);
}

.filter-btn.active {
    background: rgba(168, 85, 247, 0.15);
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

/* Hide animation for filtered projects */
.project-folder {
    transition: all 0.4s ease, max-height 0.4s ease;
}
.project-folder.hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
    margin: 0;
    padding: 0;
    border: none;
    max-height: 0;
    overflow: hidden;
}

/* ============================================================
   UI/UX PHASE 4: DEEP POLISH
   ============================================================ */

/* Themed Text Selection */
::selection {
    background: rgba(168, 85, 247, 0.4);
    color: #fff;
    text-shadow: 0 0 5px rgba(255,255,255,0.5);
}

/* Global Scroll Progress Bar */
.scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #a855f7, #3b82f6);
    z-index: 9999;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.8);
    transition: width 0.1s ease-out;
    will-change: width;
    transform: translateZ(0);
}

/* Empty Filter State Terminal */
.empty-filter-state {
    margin-top: 1rem;
    transition: all 0.4s ease;
}
.empty-filter-state.hidden {
    display: none;
    opacity: 0;
}
.empty-state-terminal {
    max-width: 600px;
    margin: 0 auto;
    border: 1px solid rgba(168, 85, 247, 0.2);
}
.spinning-gear {
    animation: spin-gear 2s linear infinite;
    transform-origin: center;
}
@keyframes spin-gear {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Hover Peek Tooltip */
.hover-peek-tooltip {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    background: rgba(10, 10, 18, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(168, 85, 247, 0.3);
    padding: 8px 12px;
    border-radius: 8px;
    color: #fff;
    font-size: 0.85rem;
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    opacity: 0;
    transform: translateY(10px) translateX(15px);
    transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}
.hover-peek-tooltip.visible {
    opacity: 1;
    transform: translateY(0) translateX(15px);
}

/* ===== LUCIDE ICON SIZING ===== */
.step-icon i,
.step-icon svg {
    width: 28px;
    height: 28px;
    stroke: var(--primary-color);
}

.project-icon i,
.project-icon svg {
    width: 32px;
    height: 32px;
    stroke: var(--primary-color);
}

.service-icon i,
.service-icon svg {
    width: 36px;
    height: 36px;
    stroke: var(--primary-color);
}

.edu-badge i,
.edu-badge svg {
    width: 28px;
    height: 28px;
    stroke: var(--primary-color);
}

.badge-icon i,
.badge-icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    vertical-align: middle;
}

.toggle-icon i,
.toggle-icon svg {
    width: 18px;
    height: 18px;
}

/* ===== NAV CV BUTTON ===== */
.nav-cv-btn {
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
    white-space: nowrap;
}

/* ===== HERO CV BUTTON ===== */
.btn-ghost {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.55rem 1.1rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.btn-ghost:hover {
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.btn-ghost i {
    width: 15px;
    height: 15px;
}

/* ===== CONTACT FORM ===== */
.contact-form-wrap {
    max-width: 720px;
    margin: 2.5rem auto 0 auto;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    padding: 2rem;
}

.contact-form h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input,
.form-group textarea {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

.contact-form .btn {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.contact-form .btn i {
    width: 16px;
    height: 16px;
}

/* ===== MOBILE RESPONSIVE FIXES ===== */
@media (max-width: 600px) {
    /* Stack pipeline steps vertically on phones */
    .pipeline-flow {
        flex-direction: column;
        align-items: center;
    }

    .pipeline-arrow {
        transform: rotate(90deg);
    }

    /* Contact form single column */
    .form-row {
        grid-template-columns: 1fr;
    }

    /* Nav CV button hidden on very small screens — hero button covers it */
    .nav-cv-btn {
        display: none;
    }

    /* Marquee smaller font */
    .marquee-content span {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    /* Ensure hero sub text wraps cleanly */
    .hero-sub {
        font-size: 0.9rem;
        line-height: 1.65;
    }

    /* Hero CTA stack vertically */
    .hero-cta-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-cta-group .btn {
        width: 100%;
        justify-content: center;
    }
}