/* ═══════════════════════════════════════════════════════════════════
   PORTFOLIO STYLES — "Event Horizon" Edition v2
   Ultra-advanced futuristic, organic, minimal portfolio CSS
   ═══════════════════════════════════════════════════════════════════ */

/* ─── DESIGN TOKENS ─── */
:root {
    /* Core palette */
    --void:           #000000;
    --void-soft:      #020208;
    --surface-1:      #08081a;
    --surface-2:      #0e0e24;
    --surface-3:      #161636;
    --border:         rgba(255,255,255,0.04);
    --border-hover:   rgba(255,255,255,0.10);
    --glass:          rgba(255,255,255,0.015);
    --glass-hover:    rgba(255,255,255,0.04);

    --text-primary:   #e8e8f0;
    --text-secondary: #7a7a9e;
    --text-muted:     #484868;

    --accent:         #6c63ff;
    --accent-rgb:     108, 99, 255;
    --accent-glow:    rgba(108, 99, 255, 0.35);
    --accent-soft:    rgba(108, 99, 255, 0.06);
    --accent-hot:     #a78bfa;
    --accent-hot-rgb: 167, 139, 250;

    --cyan:           #00e5ff;
    --cyan-rgb:       0, 229, 255;

    --emerald:        #34d399;
    --emerald-rgb:    52, 211, 153;

    /* Typography */
    --font-display: 'Space Grotesk', sans-serif;
    --font-body:    'Outfit', sans-serif;
    --font-mono:    'JetBrains Mono', monospace;

    /* Spacing */
    --section-pad: clamp(60px, 10vh, 120px);
    --content-max: 1200px;

    /* Motion */
    --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring:    cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-smooth: 0.4s var(--ease-out-expo);
    --transition-fast:   0.2s var(--ease-out-expo);
}

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

html {
    overflow: hidden;
    height: 100%;
    background: var(--void);
}

body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--void);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    cursor: crosshair;
}

::selection {
    background: var(--accent);
    color: var(--void);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ─── THREE.JS CANVASES ─── */
#portfolio-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    display: block;
}

#fx-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.12;
    mix-blend-mode: screen;
}

/* ─── SCROLL PROGRESS BAR ─── */
.scroll-progress {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 2px;
    z-index: 1000;
    background: rgba(255,255,255,0.02);
}
.scroll-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--cyan), var(--accent-hot));
    background-size: 200% 100%;
    animation: gradient-shift 3s ease infinite;
    transition: width 0.12s linear;
    box-shadow: 0 0 20px var(--accent-glow), 0 0 6px var(--accent);
}
@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ─── NAV RAIL (right side dots) ─── */
.nav-rail {
    position: fixed;
    right: 28px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 28px;
}
.nav-dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}
.nav-dot-ring {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: all 0.5s var(--ease-out-expo);
    position: relative;
}
.nav-dot-ring::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid transparent;
    transition: all 0.5s var(--ease-out-expo);
}
.nav-dot.active .nav-dot-ring {
    width: 10px; height: 10px;
    background: var(--accent);
    box-shadow: 0 0 16px var(--accent-glow), 0 0 4px var(--accent);
}
.nav-dot.active .nav-dot-ring::after {
    border-color: rgba(var(--accent-rgb), 0.3);
    inset: -6px;
}
.nav-dot:hover .nav-dot-ring {
    background: var(--accent-hot);
    transform: scale(1.3);
}
.nav-label {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%) translateX(8px);
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.nav-dot:hover .nav-label {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* ─── DEPTH HUD (bottom-left) ─── */
.depth-indicator {
    position: fixed;
    bottom: 28px; left: 28px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0.7;
}
.depth-hud-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.depth-label {
    min-width: 40px;
}
.depth-value {
    font-size: 0.95rem;
    color: var(--accent);
    font-weight: 500;
    min-width: 48px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.depth-unit {
    font-size: 0.55rem;
    color: var(--text-muted);
}

/* ─── COORD HUD (bottom-right) ─── */
.coord-hud {
    position: fixed;
    bottom: 28px; right: 28px;
    z-index: 500;
    display: flex;
    gap: 16px;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    opacity: 0.5;
}
.coord-item {
    display: flex;
    gap: 4px;
}
.coord-item span {
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    min-width: 36px;
    text-align: right;
}

/* ═══════════════════════════════════════════════════
   SECTIONS (stacked in 3D, controlled by JS)
   ═══════════════════════════════════════════════════ */
.portfolio-section {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 40px;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    will-change: transform, opacity, filter;
    transition: none;
}
.portfolio-section.active {
    pointer-events: auto;
    opacity: 1;
}
.portfolio-section > * {
    position: relative;
    z-index: 2;
}

/* ╔═══════════════════════════════════════════════╗
   ║  SECTION 0 — HERO                            ║
   ╚═══════════════════════════════════════════════╝ */
.section-hero { z-index: 15; }

.hero-content {
    text-align: center;
    max-width: 860px;
}
.hero-greeting {
    margin-bottom: 12px;
}
.greeting-line {
    font-family: var(--font-mono);
    font-size: clamp(0.8rem, 1.4vw, 0.95rem);
    color: var(--accent);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    display: inline-block;
    opacity: 0;
    transform: translateY(40px);
    position: relative;
}
.greeting-line::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 0;
    width: 100%; height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.4;
}

.hero-name {
    margin-bottom: 16px;
    opacity: 0;
    transform: translateY(40px);
    position: relative;
}
.name-first {
    font-family: var(--font-display);
    font-size: clamp(5rem, 14vw, 11rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 0.9;
    background: linear-gradient(
        135deg,
        var(--text-primary) 0%,
        var(--accent-hot) 40%,
        var(--accent) 70%,
        var(--cyan) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 60px rgba(var(--accent-rgb), 0.15));
    position: relative;
    z-index: 2;
}
.name-glow-layer {
    position: absolute;
    top: 0; left: 0;
    font-family: var(--font-display);
    font-size: clamp(5rem, 14vw, 11rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 0.9;
    color: var(--accent);
    z-index: 1;
    filter: blur(40px);
    opacity: 0.2;
    animation: name-pulse 4s ease-in-out infinite;
}
@keyframes name-pulse {
    0%, 100% { opacity: 0.15; filter: blur(40px); }
    50% { opacity: 0.25; filter: blur(50px); }
}

.hero-role {
    font-family: var(--font-mono);
    font-size: clamp(0.75rem, 1.3vw, 0.95rem);
    color: var(--text-secondary);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    margin-bottom: 28px;
    opacity: 0;
    transform: translateY(30px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}
.role-divider {
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.6;
    box-shadow: 0 0 6px var(--accent);
}

.hero-tagline {
    max-width: 560px;
    margin: 0 auto 44px;
    opacity: 0;
    transform: translateY(30px);
}
.hero-tagline p {
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    color: var(--text-secondary);
    line-height: 1.75;
    font-weight: 300;
}

.hero-cta-row {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    opacity: 0;
    transform: translateY(30px);
}

/* ─── BUTTONS ─── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 34px;
    border-radius: 60px;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.92rem;
    letter-spacing: 0.04em;
    background: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.btn-shimmer {
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255,255,255,0.12) 50%,
        transparent 100%
    );
    animation: shimmer 3s ease-in-out infinite;
    z-index: 0;
}
@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 200%; }
}
.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 10px 40px rgba(var(--accent-rgb), 0.45),
        0 0 0 1px rgba(var(--accent-rgb), 0.3),
        inset 0 1px 0 rgba(255,255,255,0.1);
}
.btn-primary.large {
    padding: 18px 42px;
    font-size: 1rem;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 34px;
    border-radius: 60px;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.92rem;
    letter-spacing: 0.04em;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-hover);
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}
.btn-ghost-border {
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: conic-gradient(
        from var(--btn-angle, 0deg),
        transparent 0%,
        rgba(var(--accent-rgb), 0.4) 10%,
        transparent 20%
    );
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease;
    animation: rotate-border 4s linear infinite;
}
@keyframes rotate-border {
    to { --btn-angle: 360deg; }
}
@property --btn-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}
.btn-ghost:hover {
    border-color: rgba(var(--accent-rgb), 0.4);
    color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(var(--accent-rgb), 0.12);
}
.btn-ghost:hover .btn-ghost-border {
    opacity: 1;
}

/* ─── SCROLL HINT ─── */
.scroll-hint {
    position: absolute;
    bottom: 40px; left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
}
.scroll-hint-arrow {
    height: 32px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.scroll-arrow-track {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    animation: arrow-cascade 2.5s ease-in-out infinite;
}
.scroll-arrow-track i {
    font-size: 0.5rem;
    opacity: 0.3;
}
.scroll-arrow-track i:nth-child(2) { opacity: 0.6; }
.scroll-arrow-track i:nth-child(3) { opacity: 1; }
@keyframes arrow-cascade {
    0%, 100% { transform: translateY(-4px); opacity: 0.4; }
    50% { transform: translateY(4px); opacity: 1; }
}

/* ╔═══════════════════════════════════════════════╗
   ║  SECTION 1 — ABOUT                            ║
   ╚═══════════════════════════════════════════════╝ */
.section-about { padding: 60px 40px; }

.about-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: clamp(48px, 7vw, 90px);
    max-width: var(--content-max);
    align-items: center;
    width: 100%;
}

/* ─── PORTRAIT ─── */
.about-portrait-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    opacity: 0;
    transform: translateX(-60px);
}
.portrait-frame {
    position: relative;
    width: clamp(220px, 24vw, 300px);
    height: clamp(220px, 24vw, 300px);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(var(--accent-rgb), 0.15);
    background: var(--surface-1);
}
.portrait-img {
    width: 100%; height: 100%;
    object-fit: cover;
    filter: grayscale(0.12) contrast(1.06) brightness(0.95);
    transition: filter 0.8s var(--ease-out-expo);
}
.portrait-frame:hover .portrait-img {
    filter: grayscale(0) contrast(1.12) brightness(1.05);
}
.portrait-fx-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    mix-blend-mode: screen;
    opacity: 0.6;
    z-index: 2;
}
.portrait-glow {
    position: absolute;
    inset: -4px;
    border-radius: 24px;
    background: conic-gradient(
        from 0deg,
        transparent 0%,
        rgba(var(--accent-rgb), 0.25) 15%,
        transparent 30%,
        rgba(var(--cyan-rgb), 0.15) 55%,
        transparent 70%,
        rgba(var(--accent-hot-rgb), 0.2) 85%,
        transparent 100%
    );
    z-index: -1;
    animation: portrait-rotate-glow 10s linear infinite;
    filter: blur(14px);
}
@keyframes portrait-rotate-glow {
    to { transform: rotate(360deg); }
}

.portrait-scan-line {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.5), transparent);
    animation: scan-down 5s ease-in-out infinite;
    opacity: 0.4;
    z-index: 3;
}
@keyframes scan-down {
    0%   { top: -3px; opacity: 0; }
    10%  { opacity: 0.4; }
    90%  { opacity: 0.4; }
    100% { top: calc(100% + 3px); opacity: 0; }
}

.portrait-hologram-lines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 3px,
        rgba(var(--accent-rgb), 0.015) 3px,
        rgba(var(--accent-rgb), 0.015) 4px
    );
    z-index: 4;
    pointer-events: none;
    animation: hologram-flicker 8s ease-in-out infinite;
}
@keyframes hologram-flicker {
    0%, 90%, 100% { opacity: 1; }
    92% { opacity: 0.7; }
    94% { opacity: 1; }
    95% { opacity: 0.85; }
    96% { opacity: 1; }
}

/* Portrait corner brackets */
.portrait-corner {
    position: absolute;
    width: 16px; height: 16px;
    z-index: 5;
    pointer-events: none;
}
.portrait-corner::before, .portrait-corner::after {
    content: '';
    position: absolute;
    background: rgba(var(--accent-rgb), 0.4);
}
.portrait-corner-tl { top: 6px; left: 6px; }
.portrait-corner-tl::before { top: 0; left: 0; width: 16px; height: 1px; }
.portrait-corner-tl::after  { top: 0; left: 0; width: 1px; height: 16px; }
.portrait-corner-tr { top: 6px; right: 6px; }
.portrait-corner-tr::before { top: 0; right: 0; width: 16px; height: 1px; }
.portrait-corner-tr::after  { top: 0; right: 0; width: 1px; height: 16px; }
.portrait-corner-bl { bottom: 6px; left: 6px; }
.portrait-corner-bl::before { bottom: 0; left: 0; width: 16px; height: 1px; }
.portrait-corner-bl::after  { bottom: 0; left: 0; width: 1px; height: 16px; }
.portrait-corner-br { bottom: 6px; right: 6px; }
.portrait-corner-br::before { bottom: 0; right: 0; width: 16px; height: 1px; }
.portrait-corner-br::after  { bottom: 0; right: 0; width: 1px; height: 16px; }

.portrait-data-strip {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}
.data-tag {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.data-tag i {
    color: var(--accent);
    font-size: 0.6rem;
}
.status-tag {
    color: var(--emerald);
}
.status-dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--emerald);
    display: inline-block;
    animation: status-blink 2s ease-in-out infinite;
    box-shadow: 0 0 6px rgba(var(--emerald-rgb), 0.5);
}
@keyframes status-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ─── ABOUT INFO ─── */
.about-info {
    opacity: 0;
    transform: translateX(60px);
}
.section-heading {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3vw, 2.3rem);
    font-weight: 600;
    margin-bottom: 24px;
    letter-spacing: -0.01em;
}
.section-heading.center { text-align: center; }
.heading-accent {
    color: var(--accent);
    font-family: var(--font-mono);
    margin-right: 8px;
    font-weight: 400;
    opacity: 0.8;
}
.about-bio {
    font-size: clamp(0.92rem, 1.3vw, 1.02rem);
    color: var(--text-secondary);
    line-height: 1.85;
    margin-bottom: 16px;
    font-weight: 300;
}
.about-bio strong {
    color: var(--accent-hot);
    font-weight: 500;
}
.section-subheading {
    text-align: center;
    color: var(--text-secondary);
    font-size: clamp(0.88rem, 1.3vw, 1rem);
    margin-bottom: 48px;
    font-weight: 300;
}

/* ─── TECH PILLS ─── */
.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 28px;
}
.tech-pill {
    padding: 6px 16px;
    border-radius: 40px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    background: var(--accent-soft);
    border: 1px solid var(--border);
    transition: all 0.4s var(--ease-out-expo);
    cursor: default;
    position: relative;
    overflow: hidden;
}
.tech-pill::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.08), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.tech-pill:hover {
    color: var(--accent);
    border-color: rgba(var(--accent-rgb), 0.35);
    box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.12);
    transform: translateY(-2px);
}
.tech-pill:hover::before { opacity: 1; }

/* ╔═══════════════════════════════════════════════╗
   ║  SECTION 2 — PROJECTS                         ║
   ╚═══════════════════════════════════════════════╝ */
.section-projects {
    justify-content: center;
    align-items: center;
    padding-top: var(--section-pad);
    padding-bottom: 80px;
}

/* ─── LAB GATEWAY ─── */
.lab-gateway {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 480px;
    padding: 0 20px;
}

.lab-gateway-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
    padding: 48px 40px 40px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 24px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.6s var(--ease-out-expo);
    overflow: hidden;
    cursor: pointer;
    width: 100%;
    text-decoration: none;
    color: inherit;
}
.lab-gateway-card:hover {
    border-color: rgba(var(--accent-rgb), 0.3);
    background: var(--glass-hover);
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 32px 100px rgba(0,0,0,0.4),
        0 0 80px rgba(var(--accent-rgb), 0.06),
        inset 0 1px 0 rgba(255,255,255,0.04);
}

.lab-gateway-icon {
    position: relative;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--accent);
}
.lab-gateway-icon > i {
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 0 12px rgba(var(--accent-rgb), 0.5));
    transition: all 0.6s var(--ease-out-expo);
}
.lab-gateway-card:hover .lab-gateway-icon > i {
    transform: scale(1.15);
    filter: drop-shadow(0 0 20px rgba(var(--accent-rgb), 0.7));
}

.lab-icon-rings {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lab-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(var(--accent-rgb), 0.15);
    animation: lab-ring-pulse 3s ease-in-out infinite;
}
.lab-ring-1 { width: 50px; height: 50px; animation-delay: 0s; }
.lab-ring-2 { width: 66px; height: 66px; animation-delay: 0.5s; }
.lab-ring-3 { width: 82px; height: 82px; animation-delay: 1s; }

@keyframes lab-ring-pulse {
    0%, 100% { opacity: 0.2; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.08); }
}

.lab-gateway-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.lab-gateway-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.75;
    font-weight: 300;
    max-width: 360px;
}

.lab-gateway-enter {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    border-radius: 40px;
    background: rgba(var(--accent-rgb), 0.08);
    border: 1px solid rgba(var(--accent-rgb), 0.2);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: var(--accent);
    transition: all 0.5s var(--ease-out-expo);
    margin-top: 8px;
}
.lab-gateway-enter i {
    transition: transform 0.4s var(--ease-out-expo);
}
.lab-gateway-card:hover .lab-gateway-enter {
    background: rgba(var(--accent-rgb), 0.15);
    border-color: rgba(var(--accent-rgb), 0.4);
    box-shadow: 0 0 24px rgba(var(--accent-rgb), 0.15);
}
.lab-gateway-card:hover .lab-gateway-enter i {
    transform: translateX(4px);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    max-width: var(--content-max);
    width: 100%;
    padding: 0 20px;
}

/* ─── PROJECT CARD ─── */
.project-card {
    position: relative;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: all 0.5s var(--ease-out-expo);
    overflow: hidden;
    cursor: pointer;
    opacity: 0;
    transform: translateY(40px);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.project-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.5), transparent);
    opacity: 0;
    transition: opacity 0.5s ease;
}
.project-card:hover {
    border-color: rgba(var(--accent-rgb), 0.2);
    background: var(--glass-hover);
    transform: translateY(-6px) scale(1.01);
    box-shadow:
        0 24px 80px rgba(0,0,0,0.35),
        0 0 60px rgba(var(--accent-rgb), 0.04),
        inset 0 1px 0 rgba(255,255,255,0.03);
}
.project-card:hover::before { opacity: 1; }

.card-glow {
    position: absolute;
    top: -80px; right: -80px;
    width: 180px; height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--accent-rgb), 0.06), transparent 70%);
    pointer-events: none;
    transition: opacity 0.6s ease;
    opacity: 0;
}
.project-card:hover .card-glow { opacity: 1; }

.card-noise {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0.03;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 128 128' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.card-border-glow {
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: conic-gradient(
        from 0deg,
        transparent 0%,
        rgba(var(--accent-rgb), 0.15) 8%,
        transparent 16%,
        transparent 50%,
        rgba(var(--cyan-rgb), 0.1) 58%,
        transparent 66%
    );
    z-index: -1;
    opacity: 0;
    transition: opacity 0.6s ease;
    animation: card-border-spin 8s linear infinite;
}
@keyframes card-border-spin { to { transform: rotate(360deg); } }
.project-card:hover .card-border-glow { opacity: 1; }

.card-header {
    display: flex;
    align-items: center;
    gap: 14px;
}
.card-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: var(--accent-soft);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--accent);
    flex-shrink: 0;
    transition: all 0.5s var(--ease-out-expo);
}
.project-card:hover .card-icon {
    background: rgba(var(--accent-rgb), 0.12);
    border-color: rgba(var(--accent-rgb), 0.35);
    box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.2);
    transform: scale(1.05);
}
.card-title {
    font-family: var(--font-display);
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--text-primary);
}
.card-desc {
    font-size: 0.83rem;
    color: var(--text-secondary);
    line-height: 1.7;
    font-weight: 300;
    flex-grow: 1;
}
.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.card-tags span {
    padding: 3px 10px;
    border-radius: 30px;
    font-family: var(--font-mono);
    font-size: 0.58rem;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}
.project-card:hover .card-tags span {
    border-color: rgba(var(--accent-rgb), 0.12);
    color: var(--text-secondary);
}
.card-link-row {
    display: flex;
    justify-content: flex-end;
    padding-top: 4px;
}
.card-link {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.6;
    transition: all 0.3s var(--ease-out-expo);
}
.card-link:hover {
    opacity: 1;
    transform: translateX(4px);
    text-shadow: 0 0 12px rgba(var(--accent-rgb), 0.4);
}

/* ╔═══════════════════════════════════════════════╗
   ║  SECTION 3 — CONTACT                          ║
   ╚═══════════════════════════════════════════════╝ */
.section-contact { justify-content: center; }

.contact-content {
    text-align: center;
    max-width: 620px;
    opacity: 0;
    transform: translateY(30px);
}
.contact-text {
    color: var(--text-secondary);
    font-size: clamp(0.92rem, 1.3vw, 1.05rem);
    line-height: 1.75;
    margin-bottom: 44px;
    font-weight: 300;
}
.contact-links {
    display: flex;
    justify-content: center;
    gap: 36px;
    margin-bottom: 44px;
    flex-wrap: wrap;
}
.contact-icon-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    transition: all 0.5s var(--ease-out-expo);
}
.contact-icon-orb {
    width: 52px; height: 52px;
    border-radius: 50%;
    border: 1px solid var(--border-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.5s var(--ease-out-expo);
    background: var(--glass);
}
.contact-icon-orb i {
    font-size: 1.3rem;
    transition: all 0.5s var(--ease-out-expo);
}
.contact-icon-link span {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.contact-icon-link:hover {
    color: var(--accent);
    transform: translateY(-6px);
}
.contact-icon-link:hover .contact-icon-orb {
    border-color: rgba(var(--accent-rgb), 0.4);
    box-shadow: 0 0 24px rgba(var(--accent-rgb), 0.2), 0 8px 32px rgba(0,0,0,0.3);
    background: rgba(var(--accent-rgb), 0.06);
}
.contact-icon-link:hover .contact-icon-orb i {
    filter: drop-shadow(0 0 10px rgba(var(--accent-rgb), 0.6));
}
.contact-cta { margin-top: 16px; }

.footer-strip {
    position: absolute;
    bottom: 24px; left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    opacity: 0.4;
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .about-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 32px;
    }
    .about-info { transform: translateX(0) !important; }
    .about-portrait-wrapper { transform: translateX(0) !important; }
    .tech-stack { justify-content: center; }
    .projects-grid {
        grid-template-columns: 1fr;
        max-width: 480px;
    }
    .coord-hud { display: none; }
}

@media (max-width: 600px) {
    .nav-rail { right: 14px; gap: 20px; }
    .nav-dot-ring { width: 6px; height: 6px; }
    .depth-indicator { left: 14px; bottom: 14px; }
    .portfolio-section { padding: 40px 20px; }
    .hero-cta-row { flex-direction: column; align-items: center; }
    .portrait-frame { width: 180px; height: 180px; }
    .contact-links { gap: 20px; }
    .contact-icon-orb { width: 44px; height: 44px; }
}

/* ═══════════════════════════════════════════════════
   FX OVERLAYS — Grain + Vignette
   ═══════════════════════════════════════════════════ */

/* Film grain */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    animation: grain-drift 0.5s steps(1) infinite;
}
@keyframes grain-drift {
    0%   { transform: translate(0, 0); }
    25%  { transform: translate(-1px, 1px); }
    50%  { transform: translate(1px, -1px); }
    75%  { transform: translate(-1px, -1px); }
    100% { transform: translate(1px, 1px); }
}

/* Vignette */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,0.55) 100%);
}
