/* ═══════════════════════════════════════════════════════════════════════════
   PORTFOLIO — SCI-FI CINEMATIC REDESIGN
   Author: AKIB | Stack: Vanilla CSS + GSAP + Three.js
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1. DESIGN TOKENS ─────────────────────────────────────────────────────── */
:root {
    /* Colors */
    --bg: #080810;
    --bg-2: #0d0d1a;
    --bg-3: #111125;
    --surface: rgba(13, 13, 30, 0.7);
    --surface-2: rgba(20, 20, 45, 0.8);
    --border: rgba(0, 212, 255, 0.12);
    --border-hover: rgba(0, 212, 255, 0.35);

    /* Accent palette */
    --cyan: #00d4ff;
    --cyan-dim: rgba(0, 212, 255, 0.15);
    --cyan-glow: rgba(0, 212, 255, 0.4);
    --violet: #9b59b6;
    --violet-dim: rgba(155, 89, 182, 0.15);
    --green: #00ff88;
    --green-dim: rgba(0, 255, 136, 0.12);
    --red: #ff3366;

    /* Text */
    --text-primary: #e8eaf6;
    --text-secondary: #8892a4;
    --text-muted: #454d5e;
    --text-mono: #00d4ff;

    /* Fonts */
    --font-display: 'Barlow Condensed', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-body: 'Inter', sans-serif;

    /* Spacing */
    --section-py: 120px;
    --container-w: 1200px;
    --gap: 24px;

    /* Easing */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.87, 0, 0.13, 1);

    /* Z-index layers */
    --z-loading: 1000;
    --z-intro: 900;
    --z-nav: 800;
    --z-dossier: 850;
    --z-cursor: 9999;
    --z-noise: 700;
}

/* ── 2. RESET & BASE ──────────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: auto;
    /* Lenis handles this */
    font-size: 16px;
}

body {
    background: var(--bg);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
    cursor: none;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    cursor: none;
    border: none;
    background: none;
    font-family: inherit;
}

img,
canvas,
svg {
    display: block;
    max-width: 100%;
}

input,
textarea {
    font-family: inherit;
}

::selection {
    background: var(--cyan-dim);
    color: var(--cyan);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--cyan);
    border-radius: 2px;
}

/* ── 3. NOISE GRAIN OVERLAY ───────────────────────────────────────────────── */
#noise-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-noise);
    pointer-events: none;
    opacity: 0.03;
    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.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 128px 128px;
}

/* ── 4. CUSTOM CURSOR ─────────────────────────────────────────────────────── */
#cursor-ring {
    position: fixed;
    width: 32px;
    height: 32px;
    border: 1.5px solid var(--cyan);
    border-radius: 50%;
    pointer-events: none;
    z-index: var(--z-cursor);
    transform: translate(-50%, -50%);
    transition: width 0.2s var(--ease-out),
        height 0.2s var(--ease-out),
        border-color 0.2s ease,
        opacity 0.2s ease;
    will-change: transform;
}

#cursor-dot {
    position: fixed;
    width: 6px;
    height: 6px;
    background: var(--cyan);
    border-radius: 50%;
    pointer-events: none;
    z-index: var(--z-cursor);
    transform: translate(-50%, -50%);
    will-change: transform;
    transition: transform 0.05s linear;
}

body.cursor-hover #cursor-ring {
    width: 52px;
    height: 52px;
    border-color: var(--green);
    background: rgba(0, 255, 136, 0.05);
}

body.cursor-hover #cursor-dot {
    background: var(--green);
}

/* ── 5. LOADING SCREEN ────────────────────────────────────────────────────── */
#loading-screen {
    position: fixed;
    inset: 0;
    z-index: var(--z-loading);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.boot-container {
    width: min(640px, 90vw);
    padding: 40px;
}

.boot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.boot-logo {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
    color: var(--cyan);
    letter-spacing: 4px;
}

.boot-version {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
}

.boot-lines {
    min-height: 200px;
    margin-bottom: 32px;
}

.boot-line {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--green);
    line-height: 2;
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.boot-line.visible {
    opacity: 1;
    transform: translateX(0);
}



.boot-progress-label {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.boot-progress-bar {
    width: 100%;
    height: 3px;
    background: var(--bg-3);
    border-radius: 2px;
    overflow: hidden;
}

.boot-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--cyan), var(--green));
    transition: width 0.05s linear;
    box-shadow: 0 0 12px var(--cyan);
}

/* Glitch strips */
.glitch-strip {
    position: absolute;
    width: 100%;
    height: 2px;
    background: var(--cyan);
    opacity: 0;
    pointer-events: none;
}

.glitch-strip-1 {
    top: 30%;
}

.glitch-strip-2 {
    top: 60%;
    background: var(--green);
}

.glitch-strip-3 {
    top: 80%;
    background: var(--violet);
}

/* ── 6. INTRO SPLASH ──────────────────────────────────────────────────────── */
#intro-screen {
    position: fixed;
    inset: 0;
    z-index: var(--z-intro);
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    opacity: 0;
    pointer-events: none;
}

#intro-screen.visible {
    display: flex;
    opacity: 1;
    pointer-events: all;
}

#particle-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.intro-content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.intro-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--cyan);
    letter-spacing: 4px;
    opacity: 0;
    animation: fadeIn 0.6s 0.4s forwards;
}

.intro-title {
    font-family: var(--font-display);
    font-size: clamp(5rem, 15vw, 12rem);
    font-weight: 900;
    line-height: 0.9;
    color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.15);
    letter-spacing: -2px;
    opacity: 0;
    animation: fadeInUp 0.8s 0.7s var(--ease-out) forwards;
}

.intro-name {
    background: linear-gradient(135deg, #fff 0%, var(--cyan) 60%, var(--green) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    -webkit-text-stroke: 0;
}

.intro-subtitle {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    letter-spacing: 3px;
    opacity: 0;
    animation: fadeIn 0.6s 1.2s forwards;
}

#enter-btn {
    margin-top: 16px;
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 6px;
    color: var(--cyan);
    border: 1px solid var(--cyan);
    padding: 14px 48px;
    background: transparent;
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: fadeIn 0.6s 1.6s forwards;
    transition: color 0.3s ease, box-shadow 0.3s ease;
}

#enter-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--cyan);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s var(--ease-out);
    z-index: -1;
}

#enter-btn:hover {
    color: var(--bg);
    box-shadow: 0 0 30px var(--cyan-glow);
}

#enter-btn:hover::before {
    transform: scaleX(1);
}

.enter-bracket {
    opacity: 0.5;
}

.intro-scan {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(to bottom,
            transparent 0px,
            transparent 3px,
            rgba(0, 212, 255, 0.012) 3px,
            rgba(0, 212, 255, 0.012) 4px);
    pointer-events: none;
}

/* ── 7. HEADER / NAV ──────────────────────────────────────────────────────── */
#site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-nav);
    transform: translateY(-100%);
    transition: transform 0.6s var(--ease-out);
}

#site-header.visible {
    transform: translateY(0);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    height: 64px;
    background: rgba(8, 8, 16, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.header-logo {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 1px;
    position: relative;
}

.logo-bracket {
    color: var(--cyan);
    opacity: 0.7;
}

.logo-name {
    color: var(--text-primary);
}

.logo-pulse {
    position: absolute;
    right: -12px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    animation: pulse 2s ease-in-out infinite;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
}

.nav-indicator {
    position: absolute;
    bottom: -1px;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--cyan), var(--green));
    box-shadow: 0 0 8px var(--cyan);
    transition: left 0.35s var(--ease-out), width 0.35s var(--ease-out);
    pointer-events: none;
    width: 0;
}

.nav-link {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 16px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    color: var(--cyan);
}

.nav-tag {
    font-size: 0.55rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 2px;
    opacity: 0.6;
    transition: color 0.2s ease;
}

.nav-link:hover .nav-tag,
.nav-link.active .nav-tag {
    color: var(--cyan);
    opacity: 1;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 1.5px;
    background: var(--text-primary);
    transition: 0.3s ease;
}

/* ── 8. MAIN SITE VISIBILITY ──────────────────────────────────────────────── */
#main-site {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.8s ease 0.1s, visibility 0.8s ease 0.1s, transform 0.8s ease 0.1s;
}

#main-site.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ── 9. SHARED SECTION STYLES ─────────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 0 40px;
}

section {
    padding: var(--section-py) 0;
    position: relative;
}

.section-head {
    margin-bottom: 64px;
}

.section-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--cyan);
    letter-spacing: 3px;
    display: block;
    margin-bottom: 12px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: -1px;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.section-sub {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

/* ── 10. HERO SECTION ─────────────────────────────────────────────────────── */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 40px 40px;
    position: relative;
    overflow: hidden;
}

#hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-inner {
    position: relative;
    z-index: 2;
    max-width: var(--container-w);
    width: 100%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 60px;
    align-items: center;
}

/* Stat card */
.stat-card {
    order: 2;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 2px solid var(--cyan);
    padding: 28px;
    min-width: 240px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--cyan), transparent);
}

.stat-card-header {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.stat-card-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--cyan);
    letter-spacing: 2px;
    opacity: 0.8;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    gap: 16px;
}

.stat-row:last-of-type {
    border-bottom: none;
}

.stat-key {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 2px;
}

.stat-val {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--green);
    letter-spacing: 1px;
    text-align: right;
}

.stat-card-footer {
    margin-top: 20px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.stat-ping {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--green);
    letter-spacing: 2px;
}

.ping-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    animation: pulse 1.5s ease-in-out infinite;
}

/* Hero content */
.hero-content {
    order: 1;
}

.hero-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--cyan);
    letter-spacing: 3px;
    margin-bottom: 24px;
    opacity: 0.7;
}

.hero-name {
    font-family: var(--font-display);
    font-size: clamp(5rem, 13vw, 11rem);
    font-weight: 900;
    line-height: 0.9;
    letter-spacing: -4px;
    margin-bottom: 28px;
    overflow: hidden;
}

.hero-char {
    display: inline-block;
    color: var(--text-primary);
    will-change: transform, opacity;
}

.hero-role {
    font-family: var(--font-mono);
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    color: var(--text-secondary);
    margin-bottom: 40px;
    min-height: 2em;
    letter-spacing: 1px;
}

.role-prefix {
    color: var(--cyan);
    opacity: 0.6;
}

.role-cursor {
    color: var(--cyan);
    animation: blink 0.8s step-end infinite;
}

/* CTAs */
.hero-ctas {
    display: flex;
    gap: 16px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 14px 32px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s var(--ease-out);
}

.cta-btn svg {
    width: 16px;
    height: 16px;
}

.cta-primary {
    background: transparent;
    border: 1px solid var(--cyan);
    color: var(--cyan);
}

.cta-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--cyan), var(--green));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s var(--ease-out);
    z-index: -1;
}

.cta-primary:hover {
    color: var(--bg);
    box-shadow: 0 0 30px var(--cyan-glow);
}

.cta-primary:hover::before {
    transform: scaleX(1);
}

.cta-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.cta-secondary:hover {
    border-color: var(--violet);
    color: var(--violet);
    box-shadow: 0 0 20px rgba(155, 89, 182, 0.3);
}

/* Social links in hero */
.hero-social {
    display: flex;
    gap: 16px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: all 0.25s ease;
}

.social-link svg {
    width: 18px;
    height: 18px;
}

.social-link:hover {
    border-color: var(--cyan);
    color: var(--cyan);
    box-shadow: 0 0 16px var(--cyan-dim);
}

.hero-scroll-hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 3px;
    color: var(--text-muted);
    animation: floatUp 2s ease-in-out infinite;
}

.hero-scroll-hint svg {
    width: 16px;
    height: 16px;
}

/* ── 11. EDUCATION SECTION ────────────────────────────────────────────────── */
.education {
    background: var(--bg);
}

.timeline {
    position: relative;
    padding-left: 60px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.timeline-track {
    position: absolute;
    left: 20px;
    top: 16px;
    bottom: 16px;
    width: 2px;
    background: var(--bg-3);
}

.timeline-track-fill {
    width: 100%;
    height: 0%;
    background: linear-gradient(180deg, var(--cyan), var(--green));
    box-shadow: 0 0 12px var(--cyan-glow);
    transition: height 0.1s linear;
}

.timeline-node {
    position: relative;
    padding: 0 0 48px 0;
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.5s ease, transform 0.5s var(--ease-out);
}

.timeline-node.active {
    opacity: 1;
    transform: translateX(0);
}

.node-dot {
    position: absolute;
    left: -48px;
    top: 20px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg-3);
    border: 2px solid var(--border);
    transition: all 0.4s ease;
    z-index: 1;
}

.timeline-node.active .node-dot {
    background: var(--cyan);
    border-color: var(--cyan);
    box-shadow: 0 0 16px var(--cyan-glow), 0 0 4px var(--cyan);
}

.node-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 2px solid transparent;
    padding: 28px 32px;
    backdrop-filter: blur(12px);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.node-card:hover,
.timeline-node.active .node-card {
    border-left-color: var(--cyan);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.08);
}

.node-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.node-code {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--cyan);
    letter-spacing: 2px;
}

.node-year {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
}

.node-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.node-institution {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.node-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s var(--ease-out);
}

.node-card:hover .node-details,
.timeline-node.active .node-card .node-details {
    max-height: 200px;
}

.scan-line {
    height: 1px;
    background: linear-gradient(90deg, var(--cyan), transparent);
    margin-bottom: 16px;
    animation: scanSlide 1.5s ease forwards;
}

.node-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
}

.node-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.node-tag {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--green);
    border: 1px solid var(--green-dim);
    padding: 3px 10px;
    letter-spacing: 1px;
}

/* ── 12. SKILLS SECTION ───────────────────────────────────────────────────── */
.skills {
    background: var(--bg-2);
}

.cluster-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 48px;
}

.cluster-btn {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 2px;
    padding: 8px 20px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: all 0.25s ease;
}

.cluster-btn.active,
.cluster-btn:hover {
    border-color: var(--cyan);
    color: var(--cyan);
    background: var(--cyan-dim);
}

.skill-tree-wrap {
    position: relative;
    width: 100%;
}

#skill-tree-canvas {
    width: 100%;
    border: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(8, 8, 16, 0.9), rgba(13, 13, 26, 0.9));
}

.skill-nodes-data {
    display: none;
}

.skill-tooltip {
    position: absolute;
    background: var(--surface-2);
    border: 1px solid var(--border-hover);
    border-left: 2px solid var(--cyan);
    padding: 14px 18px;
    min-width: 200px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10;
    backdrop-filter: blur(12px);
}

.skill-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.tooltip-name {
    display: block;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.tooltip-level {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--cyan);
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.tooltip-desc {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
}

.tooltip-bar {
    height: 2px;
    background: var(--bg-3);
}

.tooltip-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cyan), var(--green));
    transition: width 0.5s var(--ease-out);
}

/* ── 13. PROJECTS SECTION ─────────────────────────────────────────────────── */
.projects {
    background: var(--bg);
}

.projects-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 48px;
}

.filter-btn {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 2px;
    padding: 8px 20px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: all 0.25s ease;
}

.filter-btn.active,
.filter-btn:hover {
    border-color: var(--cyan);
    color: var(--cyan);
    background: var(--cyan-dim);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.project-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: transform 0.3s var(--ease-out), box-shadow 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-6px);
    border-color: var(--cyan);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 212, 255, 0.1);
}

.project-card.hidden {
    display: none;
}

.card-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.card-clearance {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 3px 10px;
}

.clearance-alpha {
    color: var(--cyan);
    border: 1px solid var(--cyan-dim);
}

.clearance-beta {
    color: var(--green);
    border: 1px solid var(--green-dim);
}

.clearance-classified {
    color: var(--red);
    border: 1px solid rgba(255, 51, 102, 0.2);
}

.card-status {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.card-status::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-completed::before {
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
}

.status-in-progress::before {
    background: var(--cyan);
    animation: pulse 1.2s ease infinite;
}

.card-icon {
    font-size: 2.5rem;
    padding: 28px 20px 8px;
    line-height: 1;
}

.card-body {
    padding: 0 20px 20px;
    flex: 1;
}

.card-id {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    display: block;
    margin-bottom: 8px;
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.2;
}

.card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.card-tag {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--violet);
    border: 1px solid rgba(155, 89, 182, 0.2);
    padding: 3px 8px;
    letter-spacing: 1px;
}

.card-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.card-open-prompt {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s ease;
}

.card-open-prompt svg {
    width: 14px;
    height: 14px;
}

.project-card:hover .card-open-prompt {
    color: var(--cyan);
}

/* Shimmer effect */
.card-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            transparent 40%,
            rgba(0, 212, 255, 0.04) 50%,
            transparent 60%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
    pointer-events: none;
}

.project-card:hover .card-shimmer {
    transform: translateX(100%);
}

/* ── 14. DOSSIER OVERLAY ──────────────────────────────────────────────────── */
#dossier-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-dossier);
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#dossier-overlay.open {
    opacity: 1;
    visibility: visible;
}

#dossier-inner {
    position: relative;
    background: var(--bg-2);
    border: 1px solid var(--border-hover);
    border-top: 2px solid var(--cyan);
    max-width: 760px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 48px;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.4s var(--ease-out);
}

#dossier-overlay.open #dossier-inner {
    transform: scale(1) translateY(0);
}

#dossier-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: var(--text-muted);
    padding: 8px;
    transition: color 0.2s ease;
}

#dossier-close:hover {
    color: var(--cyan);
}

#dossier-close svg {
    width: 20px;
    height: 20px;
}

/* Dossier content styles (injected by JS) */
.dossier-tag {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--cyan);
    letter-spacing: 3px;
    display: block;
    margin-bottom: 8px;
}

.dossier-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 24px;
    line-height: 1;
}

.dossier-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.dossier-meta-item {
    font-family: var(--font-mono);
    font-size: 0.7rem;
}

.dossier-meta-item strong {
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
}

.dossier-meta-item span {
    color: var(--text-primary);
}

.dossier-body {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 32px;
}

.dossier-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
}

.dossier-stack-tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--violet);
    border: 1px solid rgba(155, 89, 182, 0.25);
    padding: 5px 14px;
}

.dossier-links {
    display: flex;
    gap: 12px;
}

.dossier-link {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 2px;
    padding: 12px 28px;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
}

.dossier-link:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

.dossier-link svg {
    width: 14px;
    height: 14px;
}

/* ── 15. RECOMMENDATIONS SECTION ─────────────────────────────────────────── */
.recommendations {
    background: var(--bg-2);
    overflow: hidden;
}

.carousel-wrap {
    position: relative;
}

.carousel-track {
    display: flex;
    gap: 24px;
    transition: transform 0.5s var(--ease-out);
}

.debrief-card {
    flex: 0 0 calc(50% - 12px);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 36px;
    position: relative;
    overflow: hidden;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.debrief-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.debrief-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 3px;
}

.debrief-id {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--cyan);
}

.verified-stamp {
    position: absolute;
    top: 28px;
    right: 28px;
    width: 64px;
    height: 64px;
    color: var(--green);
    opacity: 0.25;
    transform: rotate(15deg);
    transition: opacity 0.3s ease;
}

.debrief-card:hover .verified-stamp {
    opacity: 0.5;
}

.debrief-quote {
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.7;
    font-style: italic;
    flex: 1;
}

.debrief-divider {
    height: 1px;
    background: linear-gradient(90deg, var(--cyan-dim), transparent);
}

.debrief-author {
    display: flex;
    align-items: center;
    gap: 14px;
}

.author-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan-dim), var(--violet-dim));
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--cyan);
    flex-shrink: 0;
}

.author-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.author-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.author-title {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.author-company {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--cyan);
    opacity: 0.7;
}

.author-rel {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    text-align: right;
}

.rel-label {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--text-muted);
    letter-spacing: 2px;
}

.rel-value {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
}

.carousel-controls button {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.carousel-controls button svg {
    width: 20px;
    height: 20px;
}

.carousel-controls button:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

.carousel-dots {
    display: flex;
    gap: 8px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bg-3);
    border: 1px solid var(--border);
    transition: all 0.25s ease;
}

.carousel-dot.active {
    background: var(--cyan);
    border-color: var(--cyan);
}

/* ── 16. CONTACT SECTION ──────────────────────────────────────────────────── */
.contact {
    background: var(--bg);
}

.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 60px;
    align-items: start;
}

.contact-info-header {
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.info-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--cyan);
    letter-spacing: 3px;
}

.contact-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}

.contact-item-icon {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cyan);
    flex-shrink: 0;
}

.contact-item-icon svg {
    width: 18px;
    height: 18px;
}

.contact-item-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ci-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 2px;
}

.ci-value {
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

a.ci-value:hover {
    color: var(--cyan);
}

.status-open {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--green) !important;
}

.contact-social {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}

.contact-social-link {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.contact-social-link svg {
    width: 18px;
    height: 18px;
}

.contact-social-link:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

/* Form */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 2px;
}

.form-group input,
.form-group textarea {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 14px 16px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    resize: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 20px var(--cyan-dim);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.form-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--bg);
    background: linear-gradient(135deg, var(--cyan), var(--green));
    padding: 16px 40px;
    position: relative;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.2s ease;
    align-self: flex-start;
}

.form-submit svg {
    width: 16px;
    height: 16px;
}

.form-submit:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.form-submit:disabled {
    opacity: 0.5;
}

.form-status {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 12px 16px;
    border-left: 2px solid transparent;
    display: none;
}

.form-status.success {
    border-left-color: var(--green);
    color: var(--green);
    background: var(--green-dim);
    display: block;
}

.form-status.error {
    border-left-color: var(--red);
    color: var(--red);
    background: rgba(255, 51, 102, 0.1);
    display: block;
}

/* ── 17. FOOTER ───────────────────────────────────────────────────────────── */
.site-footer {
    background: var(--bg);
    border-top: 1px solid var(--border);
    position: relative;
    padding: 40px 0 20px;
    overflow: hidden;
}

.footer-inner {
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 0 40px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer-logo {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--cyan);
    letter-spacing: 3px;
}

.footer-tagline {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    font-style: italic;
}

.footer-center {
    text-align: center;
}

.footer-copy {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
}

.footer-sep {
    color: var(--border);
}

.footer-right {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.footer-social {
    position: relative;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    overflow: hidden;
}

.footer-social svg {
    width: 18px;
    height: 18px;
    position: relative;
    z-index: 1;
}

.footer-social:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

.radar-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.footer-scanlines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(to bottom,
            transparent 0px,
            transparent 2px,
            rgba(255, 255, 255, 0.008) 2px,
            rgba(255, 255, 255, 0.008) 3px);
    pointer-events: none;
}

.signal-end {
    text-align: center;
    padding: 16px;
    border-top: 1px solid var(--border);
}

.signal-end span {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 4px;
    opacity: 0.4;
}

/* ── 18. ANIMATIONS ───────────────────────────────────────────────────────── */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.5);
    }

    50% {
        opacity: 0.6;
        box-shadow: 0 0 0 6px rgba(0, 255, 136, 0);
    }
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@keyframes floatUp {

    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    50% {
        transform: translateX(-50%) translateY(-8px);
    }
}

@keyframes scanSlide {
    from {
        transform: scaleX(0);
        transform-origin: left;
    }

    to {
        transform: scaleX(1);
        transform-origin: left;
    }
}

@keyframes glitchH {
    0% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-6px);
    }

    40% {
        transform: translateX(6px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(4px);
    }

    100% {
        transform: translateX(0);
    }
}

/* Reveal utilities */
.reveal-node,
.reveal-card {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s var(--ease-out);
}

.reveal-node.in-view,
.reveal-card.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* ── 19. RESPONSIVE ───────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .hero-inner {
        grid-template-columns: 1fr;
    }

    .stat-card {
        order: 0;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        min-width: auto;
    }

    .stat-card-header,
    .stat-card-footer {
        grid-column: 1 / -1;
    }

    .contact-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .debrief-card {
        flex: 0 0 calc(80% - 12px);
    }
}

@media (max-width: 768px) {
    :root {
        --section-py: 80px;
    }

    .container {
        padding: 0 20px;
    }

    .header-inner {
        padding: 0 20px;
    }

    .header-nav {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(8, 8, 16, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 40px 20px;
        gap: 0;
        z-index: 100;
        transform: translateY(-110%);
        transition: transform 0.4s var(--ease-out);
        border-bottom: 1px solid var(--border);
    }

    .header-nav.open {
        transform: translateY(0);
    }

    .nav-link {
        flex-direction: row;
        justify-content: space-between;
        padding: 14px 0;
        border-bottom: 1px solid var(--border);
    }

    .nav-toggle {
        display: flex;
    }

    .nav-indicator {
        display: none;
    }

    .hero {
        padding: 120px 20px 60px;
    }

    .hero-inner {
        gap: 32px;
    }

    .hero-ctas {
        flex-direction: column;
    }

    .cta-btn {
        justify-content: center;
    }

    .timeline {
        padding-left: 36px;
    }

    .node-dot {
        left: -30px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-right {
        justify-content: center;
    }

    .debrief-card {
        flex: 0 0 calc(90% - 12px);
    }

    #dossier-inner {
        padding: 28px 20px;
    }

    .dossier-links {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 2.5rem;
        letter-spacing: 0;
    }

    .hero-name {
        font-size: 3.5rem;
        letter-spacing: -2px;
    }

    .hero-role {
        font-size: 1rem;
    }

    .stat-card {
        grid-template-columns: 1fr;
    }
}