/* --- THEME ENGINE --- */

/* THEME 1: ZURICH (Atomic Operator - Default) */
:root {
    --bg-color: #F4F4F0;
    --ink-color: #111111;
    --accent: #016B61;      /* Deep Teal */
    --pop-color: #FF0055;   /* Hot Pink */
    --card-bg: #FFFFFF;
    --grid-line: 2px solid var(--ink-color);
    --font-main: 'Uncut Sans', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --shadow-depth: 6px;
    --btn-text: #111111;
}

/* THEME: COMIC (Aged Newsprint — Default) */
[data-theme="comic"] {
    --bg-color: #FFF9EC;
    --ink-color: #0A0A0A;
    --accent: #D62828;
    --pop-color: #F77F00;
    --card-bg: #FFFDF5;
    --grid-line: 3px solid #0A0A0A;
    --font-main: 'Uncut Sans', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --shadow-depth: 8px;
    --btn-text: #0A0A0A;
}

/* THEME 2: REDMOND (Classic Win95 - High Readability) */
[data-theme="redmond"] {
    --bg-color: #008080;    /* Classic Win95 Desktop Teal */
    --ink-color: #000000;   /* Stark Black */
    --accent: #000080;      /* Dark Blue Title Bar */
    --pop-color: #C0C0C0;   /* UI Gray */
    --card-bg: #C0C0C0;     /* Gray Panels */
    --grid-line: 2px solid #FFFFFF; /* Beveled edge illusion */
    --shadow-depth: 2px;
    --btn-text: #000000;
}

/* THEME 3: CUPERTINO (Modern Light/Glass - Very soft on eyes) */
[data-theme="cupertino"] {
    --bg-color: #E9ECEF;    /* Soft Apple Gray */
    --ink-color: #333333;   /* Soft Dark Gray (not pure black) */
    --accent: #007AFF;      /* iOS Blue */
    --pop-color: #FF9500;   /* iOS Orange */
    --card-bg: #FFFFFF;     /* Clean White Cards */
    --grid-line: 1px solid #D1D1D6; /* Very subtle borders */
    --shadow-depth: 10px;   /* Soft, floating shadows */
    --btn-text: #007AFF;
}

/* Cupertino Specific Overrides (Soft Shadows) */
[data-theme="cupertino"] .project-card, 
[data-theme="cupertino"] .hero-section, 
[data-theme="cupertino"] .panel,
[data-theme="cupertino"] .container article {
    box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.08); /* Soft, blurred shadow */
    border-radius: 12px; /* Apple curves */
}
[data-theme="cupertino"] .btn-retro {
    border-radius: 8px;
    box-shadow: 0px 4px 10px rgba(0, 122, 255, 0.2);
}




/* --- BASE & HALFTONE BACKGROUND --- */
* { box-sizing: border-box; }

/* REPLACE THE BODY BLOCK IN style.css */
html { overflow-x: hidden; }

body {
    background-color: var(--bg-color);
    color: var(--ink-color);
    font-family: var(--font-main);
    margin: 0;
    padding: 52px 0 0;
    line-height: 1.5;
    border: 10px solid var(--bg-color);
    overflow-x: hidden;
    opacity: 0;
    transition: opacity 0.18s ease, background-color 0.3s ease, color 0.3s ease;
    
    /* FIX: Made dots larger (1.5px) and slightly more spaced out */
    background-image: radial-gradient(var(--ink-color) 1.5px, transparent 1.5px);
    background-size: 20px 20px;
    background-attachment: fixed; /* Parallax effect */
}
body.page-ready { opacity: 1; }

/* --- LAYOUT GRID --- */
.grid-container {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    /* FIX: Transparent background so dots show through the gaps */
    background: transparent; 
    border: none;
    box-shadow: none;
    max-width: 1400px;
    margin: 0 auto;
    gap: 30px; /* FIX: This creates the "Island" separation between all elements */
}

/* --- HERO SECTION (THE OPERATOR CARD) --- */
.hero-section {
    grid-column: span 12;
    padding: 60px 40px;
    background: var(--card-bg); /* FIX: Give the hero its own solid background */
    border: var(--grid-line); /* FIX: Full border all the way around */
    box-shadow: var(--shadow-depth) var(--shadow-depth) 0px var(--ink-color); /* Island Shadow */
    position: relative;
    overflow: hidden;
}

/* De-Mushing the Text */
h1 { 
    /* FIX: Adjusted clamp to prevent "Huge Text" overflow on mobile */
    font-size: clamp(2.5rem, 8vw, 5rem); 
    margin: 0; 
    line-height: 1.1; /* FIX: Increased from 0.9 to let text breathe */
    text-transform: uppercase; 
    text-shadow: 3px 3px 0 var(--bg-color), 6px 6px 0 var(--ink-color);
    margin-bottom: 10px;
}
h2 { 
    font-family: var(--font-mono); 
    font-size: 1.2rem; 
    background: var(--ink-color);
    color: var(--bg-color);
    display: inline-block;
    padding: 5px 10px;
    margin: 20px 0;
    transform: rotate(-1deg); /* Slight "Comic" tilt */
}

/* Hero intro row — profile pic + name/title */
.hero-intro {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 20px;
}

/* The Profile Picture (Operator Badge) */
.profile-container {
    position: relative;
    display: inline-block;
    border: 3px solid var(--ink-color);
    padding: 5px;
    background: var(--bg-color);
    box-shadow: 5px 5px 0 var(--pop-color);
}
.profile-pic {
    width: 220px;
    height: 220px;
    object-fit: cover;
    display: block;
    filter: grayscale(100%) contrast(120%);
}

/* Hero Grid Layout */
.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Text takes more space */
    gap: 40px;
    margin-top: 40px;
    align-items: start;
}

.summary-box {
    font-size: 1.2rem;
    border-left: 6px solid var(--accent);
    padding-left: 20px;
    background: rgba(255,255,255,0.5);
}

/* Threat Map Panel */
.panel-box {
    border: 2px solid var(--ink-color);
    padding: 20px;
    background: var(--card-bg);
    box-shadow: 4px 4px 0 var(--ink-color);
}

/* --- SKILL TRADING CARDS (NEW!) --- */
.skill-deck {
    grid-column: span 12;
    display: flex;
    gap: 20px;
    padding: 40px;
    overflow-x: auto;
    border-bottom: var(--grid-line);
    background: var(--ink-color); /* Inverted section */
}

.skill-card {
    min-width: 240px;
    width: 240px;       /* fixed width keeps carousel spacing predictable */
    flex-shrink: 0;
    background: var(--bg-color);
    border: 3px solid var(--ink-color);
    padding: 26px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: box-shadow 0.15s, border-color 0.15s;
    box-shadow: 5px 5px 0 var(--pop-color);
}
/* Border/shadow color-pop on hover — NO transform jump */
.skill-card:hover {
    border-color: var(--pop-color);
    box-shadow: 8px 8px 0 var(--pop-color);
}

@media (max-width: 600px) {
    .skill-card { min-width: 180px; width: 180px; padding: 18px 14px; }
    .skill-icon  { font-size: 2rem; }
    .skill-name  { font-size: 0.85rem; }
}

.skill-icon { font-size: 2.8rem; margin-bottom: 14px; }
.skill-name { font-weight: 800; font-size: 1rem; text-transform: uppercase; border-bottom: 2px solid var(--ink-color); width: 100%; padding-bottom: 8px; margin-bottom: 10px;}
.skill-stat { font-family: var(--font-mono); font-size: 0.8rem; width: 100%; display: flex; justify-content: space-between; }

/* --- PROJECT CARDS (COMIC PANELS) --- */
/* --- PROJECT CARDS (COMIC PANELS) --- */
.project-card {
    grid-column: span 6;
    border: var(--grid-line); /* FIX: Full border around the whole card */
    padding: 40px; 
    background: var(--card-bg);
    position: relative;
    box-shadow: var(--shadow-depth) var(--shadow-depth) 0px var(--ink-color); /* Island Shadow */
    margin-bottom: 0px; 
}
/* Caption Box Style — project card corner sticker */
.caption-box {
    background: var(--pop-color);
    color: white;
    padding: 6px 14px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    position: absolute;
    top: 12px;
    right: 14px;
    transform: rotate(2deg);
    border: 2px solid var(--ink-color);
    letter-spacing: 0.04em;
}

/* Project code + card header */
.card-header {
    margin-bottom: 8px;
}
.prj-id {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.06em;
}

.tech-stack .chip {
    background: var(--ink-color);
    color: var(--bg-color);
    padding: 4px 8px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    margin-right: 5px;
    border: 1px solid var(--bg-color);
}

/* --- SPLIT-FLAP SERVICES BOARD --- */
.flap-board {
    grid-column: span 12;
    background: #111;
    border: 3px solid var(--ink-color);
    box-shadow: var(--shadow-depth) var(--shadow-depth) 0 var(--ink-color);
    padding: 0;
    overflow: hidden;
}
.flap-header {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #ff6600;
    background: #0a0a0a;
    padding: 12px 24px;
    border-bottom: 2px solid #222;
    cursor: pointer;
    user-select: none;
}
.flap-dot {
    display: inline-block;
    width: 8px; height: 8px;
    background: #00ff41;
    border-radius: 50%;
    margin-right: 8px;
    animation: flap-pulse 2s ease-in-out infinite;
}
@keyframes flap-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

.flap-grid {
    display: flex;
    flex-wrap: wrap;
}
.flap-tile {
    flex: 1;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 28px 16px;
    background: #111;
    border-right: 1px solid #222;
    border-bottom: 1px solid #222;
    text-decoration: none;
    color: #fff;
    transition: background 0.2s;
    position: relative;
    /* Split-flap line across middle */
}
.flap-tile::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    top: 50%;
    height: 1px;
    background: rgba(255,255,255,0.06);
    pointer-events: none;
}
.flap-tile:hover {
    background: #1a1a2e;
}
.flap-tile:last-child { border-right: none; }
.flap-icon {
    width: 24px; height: 24px;
    opacity: 0.7;
    filter: brightness(1.2);
}
.flap-name {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #eee;
    text-transform: uppercase;
}
.flap-tag {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: #666;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.flap-tile--soon {
    opacity: 0.45;
    pointer-events: none;
}
.flap-soon {
    font-family: var(--font-mono);
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: #ff6600;
    border: 1px solid #ff660044;
    padding: 2px 8px;
    margin-top: 4px;
}

/* --- ADMIN LAYOUT FIX --- */
.admin-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 60px; /* Increased gap massively to separate the admin containers */
    padding: 60px 20px; 
    max-width: 1400px; 
    margin: 0 auto;
}

.panel { 
    border: 2px solid var(--ink-color); 
    padding: 40px; /* More padding inside the admin boxes */
    background: var(--card-bg); 
    box-shadow: 6px 6px 0 var(--ink-color); /* Deeper shadow */
    display: flex;
    flex-direction: column;
    gap: 15px; 
}

/* Fix Inputs inside panels */
input, textarea, select {
    width: 100%; 
    padding: 12px; 
    margin: 5px 0 20px 0; /* Breathing room */
    background: var(--bg-color);
    border: 1px solid var(--ink-color);
    color: var(--ink-color);
    font-family: 'JetBrains Mono';
}

/* --- UTILS & SECTION DIVIDERS --- */
.label-strip { 
    grid-column: span 12; 
    background: var(--accent); 
    color: white; 
    padding: 15px 40px; 
    text-transform: uppercase; 
    font-weight: bold; 
    letter-spacing: 2px; 
    border: var(--grid-line); /* FIX: Full border */
    box-shadow: 4px 4px 0px var(--ink-color);
    margin-top: 40px; 
}

#cyber-map {
    grid-column: span 12;
    border: var(--grid-line); /* FIX: Full border */
    box-shadow: var(--shadow-depth) var(--shadow-depth) 0px var(--ink-color);
    height: 300px; 
    background: #001100; 
    position: relative; 
    overflow: hidden; 
}

/* --- LOGS READABILITY FIX --- */
.container article {
    background: var(--card-bg); /* Block the dots */
    border: var(--grid-line);
    padding: 40px; /* Increased padding for breathing room */
    box-shadow: var(--shadow-depth) var(--shadow-depth) 0px var(--ink-color);
    margin-bottom: 40px;
    position: relative;
    max-width: 800px; /* Optimal reading width (approx 75 characters) */
    margin-left: auto; /* Center the article block horizontally */
    margin-right: auto;
}
/* Ensure the text inside has good line height */
.markdown-body {
    font-size: 1.1rem;
    line-height: 1.8;
}

/* --- NAVIGATION: DESKTOP TASKBAR --- */
.system-bar { 
    background: var(--ink-color); 
    color: var(--bg-color); 
    padding: 12px 20px; 
    font-family: var(--font-mono); 
    font-size: 0.85rem; 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    border-bottom: 2px solid var(--pop-color);
}
.nav-links { display: flex; gap: 20px; }
.nav-btn { color: var(--bg-color); text-decoration: none; font-weight: bold; transition: color 0.2s; }
.nav-btn:hover { color: var(--pop-color);}


/* --- NAVIGATION: MOBILE COMIC PANEL BAR --- */
.mobile-dock {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    width: 100%;
    background: var(--ink-color);
    border-top: 4px solid var(--accent);
    padding: 0;
    border-radius: 0;
    z-index: 9999;
    gap: 0;
    transform: none;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.7);
}

.dock-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 4px 20px; /* bottom pad for home-bar safe area */
    border-right: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    transition: background 0.15s;
    gap: 3px;
}
.dock-btn:last-child { border-right: none; }
.dock-btn:active { background: var(--pop-color); color: var(--ink-color); }


.theme-btn { background: transparent; color: inherit; border: 1px solid currentColor; cursor: pointer; padding: 2px 8px; }
.btn-retro { display: inline-block; border: 2px solid var(--ink-color); padding: 10px 20px; text-decoration: none; color: var(--ink-color); font-weight: bold; text-transform: uppercase; background: var(--bg-color); box-shadow: 4px 4px 0 var(--accent); transition: all 0.2s; }
.btn-retro:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--accent); }
/* --- GALLERY MASONRY --- */
.gallery-masonry {
    columns: 2;
    column-gap: 24px;
    padding: 40px;
    background: var(--bg-color);
}
.gallery-card {
    break-inside: avoid;
    margin-bottom: 24px;
    border: 4px solid var(--ink-color);
    background: var(--card-bg);
    box-shadow: 8px 8px 0 var(--ink-color);
}
.gallery-img-wrap {
    overflow: hidden;
    border-bottom: 2px solid var(--ink-color);
    line-height: 0;
}
.gallery-img-wrap img {
    width: 100%;
    height: auto;
    display: block;
    filter: grayscale(100%) contrast(120%);
    transition: filter 0.3s;
}
.gallery-img-wrap:hover img { filter: none; }
.gallery-caption {
    padding: 12px 15px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    background: var(--accent);
    color: white;
}
.gallery-caption--empty {
    background: transparent;
    color: var(--ink-color);
    font-size: 0.8rem;
}
@media (max-width: 700px) {
    .gallery-masonry { columns: 1; padding: 16px; }
    .gallery-card { margin-bottom: 16px; }
}

footer { padding: 40px; grid-column: span 12; background: var(--ink-color); color: var(--bg-color); font-family: var(--font-mono); }
.mobile-hide { display: inline; }

/* --- MODAL (CENTER LOCK & BLUR) --- */
.modal-overlay { 
    position: fixed; /* Locks to the viewport, not the document */
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh; 
    background: rgba(0,0,0,0.6); 
    backdrop-filter: blur(5px); /* Adds the modern glass blur effect */
    display: flex; 
    justify-content: center; 
    align-items: center; 
    z-index: 9999; /* Ensures it is above everything else */
}

.modal-box { 
    background: var(--card-bg); /* Use the opaque card background */
    border: 4px solid var(--alert); /* Thicker danger border */
    padding: 40px; 
    max-width: 500px; 
    text-align: center; 
    font-family: var(--font-mono); 
    box-shadow: 10px 10px 0px rgba(0,0,0,0.8); /* Heavy pop-art shadow */
    transform: translateY(-10%); /* Slight offset for better visual centering */
}

/* --- PDF VIEWER MODAL --- */
.pdf-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.85);
    align-items: flex-start;
    justify-content: center;
    padding: 16px 20px;
}
.pdf-modal.active { display: flex; }

.pdf-viewer {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: calc(100vh - 32px);
    background: #111;
    border: 3px solid var(--ink-color);
    box-shadow: 6px 6px 0 var(--ink-color);
}
.pdf-viewer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: #0a0a0a;
    border-bottom: 2px solid var(--ink-color);
    font-family: 'JetBrains Mono';
    font-size: 0.75rem;
    color: var(--accent);
}
.pdf-viewer-bar a {
    color: var(--accent);
    text-decoration: none;
    font-family: 'JetBrains Mono';
    font-size: 0.7rem;
}
.pdf-viewer-bar button {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    font-family: 'JetBrains Mono';
}
.pdf-viewer iframe {
    width: 100%;
    height: calc(100% - 40px);
    border: none;
}

@media (max-width: 600px) {
    .pdf-modal { padding: 0; }
    .pdf-viewer {
        max-width: 100%;
        height: 100vh;
        height: 100dvh;
        border: none;
        box-shadow: none;
    }
    .pdf-viewer-bar {
        padding: 10px 12px;
        font-size: 0.65rem;
    }
    .pdf-viewer-bar button { font-size: 1.4rem; }
}

/* --- TECH STACK MARQUEE --- */
.marquee-wrapper {
    grid-column: span 12;
    overflow: hidden;
    background: var(--card-bg);
    border-top: var(--grid-line);
    border-bottom: var(--grid-line);
    padding: 40px 0;
    margin-top: 40px;
    position: relative;
    box-shadow: 0px 4px 15px rgba(0,0,0,0.1);
}

.marquee-track {
    display: flex;
    gap: 80px; /* Space between logos */
    width: max-content;
    animation: scroll-marquee 40s linear infinite; /* CSS fallback if JS disabled */
    will-change: transform;
}

/* Pause the animation so recruiters can look at a specific tech */
.marquee-wrapper:hover .marquee-track {
    animation-play-state: paused; 
}

.tech-logo {
    height: 55px;
    width: auto;
    /* Mute the colors to fit your theme */
    filter: grayscale(100%) opacity(0.6); 
    transition: all 0.3s ease;
    cursor: crosshair;
}

/* Light up in full brand color on hover */
.tech-logo:hover {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.15) translateY(-5px);
}

@keyframes scroll-marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); } /* Scrolls exactly half the width (Set 1) to loop perfectly */
}





/* --- MOBILE OPTIMIZATION (MERGED & CLEANED) --- */
@media (max-width: 900px) {
    /* 1. Reset Grid */
    .grid-container { 
        display: flex; 
        flex-direction: column; 
        border: none; 
        box-shadow: none; 
        width: 100%; 
        gap: 20px; /* Smaller gap on mobile */
    }
    
    /* 2. Hero Section */
    .hero-grid { 
        grid-template-columns: 1fr; 
        gap: 30px;
        margin-top: 20px;
    }
    
    /* 3. Typography */
    h1 { 
        font-size: 2.2rem; 
        text-shadow: 2px 2px 0 var(--bg-color), 4px 4px 0 var(--ink-color); 
    }
    
    /* 4. Card Spacing (The "Islands" on mobile) */
    .project-card { 
        border: var(--grid-line); 
        padding: 30px 20px; 
        margin-bottom: 20px; /* Keep islands separated on mobile */
        box-shadow: 4px 4px 0 var(--ink-color); 
    }
    
    .profile-container {
        margin-bottom: 15px;
    }
    
    /* 5. Admin Panel Adjustments */
    .admin-grid { 
        grid-template-columns: 1fr; /* Stack panels vertically */
        padding: 10px; 
    }
    .panel { 
        overflow-x: auto; 
    }
    
    /* 6. Hides */
    .mobile-hide { display: none; }

    /* Toggle Navigation Modes */
    .desktop-only { display: none !important; }
    .mobile-dock { display: flex; } 
    
    body { padding-bottom: 20px; }
}

/* ============================================================
   PAGE TRANSITION BAR
   ============================================================ */
#page-transition-bar {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0%;
    background: var(--accent);
    z-index: 9999;
    transition: width 0.25s ease, opacity 0.3s ease;
    pointer-events: none;
}
#page-transition-bar.loading {
    width: 85%;
}
#page-transition-bar.done {
    width: 100%;
    opacity: 0;
}

/* ============================================================
   PHASE 2 ADDITIONS — COMIC BOOK SYSTEM + ANIMATIONS
   ============================================================ */

/* --- THEME FLASH OVERLAY --- */
#theme-flash {
    position: fixed;
    inset: 0;
    background: var(--ink-color);
    opacity: 0;
    pointer-events: none;
    z-index: 99998;
}

/* --- LABEL STRIP: ACTION STAMP --- */
.label-strip {
    position: relative;
    overflow: visible;
}
.label-strip[data-stamp]::after {
    content: attr(data-stamp);
    position: absolute;
    right: 40px;
    top: -14px;
    background: var(--pop-color);
    color: white;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 4px 10px;
    border: 2px solid var(--ink-color);
    transform: rotate(3deg);
    letter-spacing: 1px;
    box-shadow: 2px 2px 0 var(--ink-color);
}

/* --- PROJECT CARD: SPEED LINES ON HOVER --- */
.project-card {
    overflow: hidden;
}
.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 18px,
        rgba(0,0,0,0.035) 18px,
        rgba(0,0,0,0.035) 19px
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.project-card:hover::before { opacity: 1; }

/* --- PAGE LOAD ANIMATION --- */
@keyframes page-stamp {
    0%   { opacity: 0; transform: scale(0.97); }
    100% { opacity: 1; transform: scale(1); }
}
.grid-container { animation: page-stamp 0.45s ease-out both; }

/* --- FOOTER GRID --- */
.footer-grid {
    display: flex;
    gap: 40px;
    align-items: center;
    font-size: 0.8rem;
}

/* ============================================================
   ARCHITECTURE DIAGRAM
   ============================================================ */
.arch-diagram {
    grid-column: span 12;
    background: var(--card-bg);
    border: var(--grid-line);
    box-shadow: var(--shadow-depth) var(--shadow-depth) 0 var(--ink-color);
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.arch-tier {
    border: 2px dashed var(--ink-color);
    padding: 20px;
    background: var(--bg-color);
}

.arch-tier-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink-color);
}

.arch-tier-badge {
    background: var(--ink-color);
    color: var(--bg-color);
    padding: 2px 8px;
    font-size: 0.65rem;
}

.arch-tier-badge.gitops {
    background: var(--accent);
}

.arch-nodes-grid {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.arch-nodes-grid.compact .arch-node {
    flex: 1;
    min-width: 140px;
}

.arch-node {
    flex: 1;
    min-width: 160px;
    border: 2px solid var(--ink-color);
    padding: 16px;
    background: var(--card-bg);
    position: relative;
    box-shadow: 4px 4px 0 var(--ink-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.arch-node:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--ink-color);
}

.arch-node.identity { border-left: 4px solid #D62828; }
.arch-node.edge     { border-left: 4px solid #2B9348; }
.arch-node.compute  { border-left: 4px solid #F77F00; }
.arch-node.data     { border-left: 4px solid #0077B6; }
.arch-node.factory  { border-left: 4px solid #7209B7; }
.arch-node.vps      { border-left: 4px solid #555; }
.arch-node.cdn      { border-left: 4px solid #FF6600; }

.arch-node.full-width {
    flex: none;
    width: 100%;
    text-align: center;
}

.arch-node-icon  { font-size: 1.4rem; margin-bottom: 8px; }
.arch-node-title { font-family: var(--font-mono); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; margin-bottom: 6px; }
.arch-node-stack { font-family: var(--font-mono); font-size: 0.68rem; color: var(--accent); margin-bottom: 4px; }
.arch-node-desc  { font-size: 0.72rem; color: #666; line-height: 1.4; }

.arch-connector-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 4px 0;
}

.arch-connector-line {
    flex: 1;
    height: 2px;
    background: repeating-linear-gradient(
        90deg,
        var(--ink-color) 0, var(--ink-color) 8px,
        transparent 8px, transparent 14px
    );
}

.arch-connector-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: var(--ink-color);
    color: var(--bg-color);
    padding: 4px 12px;
    white-space: nowrap;
}

.cdn-tier {
    border: 3px solid var(--pop-color);
}

/* GitOps flow */
.arch-gitops-panel {
    border: 2px dashed var(--accent);
    padding: 20px;
    background: var(--bg-color);
    margin-top: 8px;
}

.arch-flow {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.arch-flow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: var(--card-bg);
    border: 2px solid var(--ink-color);
    padding: 12px 16px;
    box-shadow: 3px 3px 0 var(--ink-color);
    flex: 1;
    min-width: 120px;
}

.flow-num {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--accent);
    line-height: 1;
}

.flow-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 6px;
}

.flow-tool {
    font-size: 0.7rem;
    color: #666;
    margin-top: 4px;
}

.arch-flow-arrow {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--accent);
    flex-shrink: 0;
}

.arch-meta-note {
    margin-top: 16px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--accent);
    border-top: 1px dashed var(--accent);
    padding-top: 10px;
    text-align: center;
}

/* ============================================================
   RESEARCH LAB SECTION
   ============================================================ */
.research-grid {
    grid-column: span 12;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.research-card {
    border: var(--grid-line);
    padding: 35px;
    background: var(--card-bg);
    position: relative;
    box-shadow: var(--shadow-depth) var(--shadow-depth) 0 var(--ink-color);
}

.research-badge {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 2px;
    border: 2px solid var(--ink-color);
    display: inline-block;
    padding: 3px 10px;
    margin-bottom: 12px;
}

.research-card h3 {
    font-size: 1.6rem;
    margin: 0 0 4px 0;
    line-height: 1;
}

.research-subtitle {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 20px;
}

.research-body p {
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 20px;
}

.research-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.research-chip {
    background: var(--ink-color);
    color: var(--bg-color);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    padding: 4px 10px;
    border: 1px solid var(--bg-color);
}

.research-spec-row {
    border-top: 2px solid var(--ink-color);
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.spec-item {
    display: flex;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    align-items: flex-start;
}

.spec-key {
    font-weight: 700;
    min-width: 100px;
    color: #888;
    flex-shrink: 0;
}

.spec-val {
    color: var(--ink-color);
}

/* ============================================================
   CONTACT SECTION
   ============================================================ */
.contact-section {
    grid-column: span 12;
}

.contact-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.contact-form-panel {
    border: var(--grid-line);
    padding: 40px;
    background: var(--card-bg);
    box-shadow: var(--shadow-depth) var(--shadow-depth) 0 var(--ink-color);
}

.contact-info-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-stat-box {
    border: 2px solid var(--ink-color);
    padding: 16px 20px;
    background: var(--card-bg);
    box-shadow: 4px 4px 0 var(--ink-color);
}

.contact-stat-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #888;
    margin-bottom: 6px;
}

.contact-stat-val {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.85rem;
}

.contact-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
}
.contact-link:hover { text-decoration: underline; }

.contact-form .form-group {
    margin-bottom: 20px;
}

.contact-form .form-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 6px;
}

.contact-form input,
.contact-form textarea {
    margin: 0;
}

.contact-btn {
    width: 100%;
    text-align: center;
    display: block;
}

.flash-message {
    background: var(--accent);
    color: white;
    padding: 14px 24px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.85rem;
    border: 2px solid var(--ink-color);
    box-shadow: 4px 4px 0 var(--ink-color);
    margin-bottom: 20px;
}

/* ============================================================
   NAVIGATION IMPROVEMENTS
   ============================================================ */
.nav-section-link {
    color: var(--bg-color);
    text-decoration: none;
    font-weight: bold;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    transition: color 0.2s;
    opacity: 0.7;
}
.nav-section-link:hover { opacity: 1; color: var(--pop-color); }

.nav-github-link {
    color: var(--pop-color);
    text-decoration: none;
    font-weight: 900;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    border: 1px solid var(--pop-color);
    padding: 2px 10px;
    transition: all 0.2s;
}
.nav-github-link:hover {
    background: var(--pop-color);
    color: var(--ink-color);
}

/* ============================================================
   MOBILE RESPONSIVE — NEW SECTIONS
   ============================================================ */
@media (max-width: 900px) {
    .hero-intro { flex-direction: column; text-align: center; gap: 16px; }
    .arch-nodes-grid { flex-direction: column; }
    .arch-flow { flex-direction: column; }
    .arch-flow-arrow { transform: rotate(90deg); }
    .research-grid { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
    .research-card { padding: 24px; }
    .contact-form-panel { padding: 24px; }
    /* collapse all arch nodes and flow steps in column mode */
    .arch-node { min-width: 0; width: 100%; }
    .arch-nodes-grid.compact .arch-node { min-width: 0; }
    .arch-flow-step { min-width: 0; width: 100%; }
    .footer-grid { flex-direction: column; gap: 8px; }
    /* tighten horizontal padding so content isn't cramped */
    .hero-section { padding: 40px 20px; }
    .flap-tile { min-width: 50%; }
    .label-strip { padding: 10px 20px; }
    .arch-diagram { padding: 16px; }
    .arch-tier { padding: 14px; }
    /* marquee smaller logos on mobile */
    .marquee-wrapper { padding: 24px 0; margin-top: 20px; }
    .tech-logo { height: 40px; }
    /* skill deck tighter on mobile */
    .skill-deck-outer { padding: 32px 0; }
}

/* ============================================================
   PHASE 5 — SECTION SPY + SCROLL PROGRESS + DOCK LABELS
   ============================================================ */

/* Scroll progress bar at very top of page */
#scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    background: var(--accent);
    width: 0%;
    z-index: 1002;
    transition: width 0.08s linear;
    pointer-events: none;
}

/* Section indicator in nav */
#nav-section-display {
    color: var(--pop-color);
    opacity: 0.9;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    transition: opacity 0.2s;
}

/* Active state for section nav links */
.nav-section-link.nav-link-active {
    opacity: 1;
    color: var(--pop-color);
    text-shadow: 0 0 8px var(--pop-color);
}

/* Mobile dock: flex-column layout for icon + label */
.dock-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s, transform 0.1s;
}
.dock-icon { font-size: 1.3rem; line-height: 1; }
.dock-label {
    font-size: 0.42rem;
    font-family: var(--font-mono);
    letter-spacing: 0.08em;
    color: var(--bg-color);
    opacity: 0.55;
    text-transform: uppercase;
}

/* Active dock button: filled panel */
.dock-btn.dock-active {
    background: var(--accent);
    border-right-color: rgba(0,0,0,0.15);
    color: white;
}
.dock-btn.dock-active .dock-icon { filter: brightness(1.2); }
.dock-btn.dock-active .dock-label { opacity: 1; color: white; }

/* ============================================================
   MOBILE NAV — HAMBURGER + FULL-SCREEN COMIC OVERLAY
   ============================================================ */
.hamburger-btn {
    display: none;
    background: none;
    color: var(--bg-color);
    border: 2px solid var(--pop-color);
    padding: 3px 10px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 900;
    cursor: pointer;
    letter-spacing: 0.05em;
    margin-left: 8px;
}
@media (max-width: 900px) { .hamburger-btn { display: block; } }

/* Compact system-bar on very narrow phones */
@media (max-width: 480px) {
    .system-bar { padding: 8px 12px; font-size: 0.75rem; }
    .theme-btn { padding: 2px 6px; font-size: 0.7rem; }
    .hamburger-btn { padding: 3px 8px; font-size: 0.8rem; }
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--ink-color);
    z-index: 10000;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    overflow: hidden;
    /* iOS notch / Android safe area */
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 20px);
}
.mobile-menu-overlay.open { display: flex; }

.mobile-menu-close {
    position: absolute;
    /* push below notch on iPhones */
    top: calc(20px + env(safe-area-inset-top, 0px));
    right: 20px;
    background: none;
    border: 2px solid var(--accent);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 900;
    padding: 8px 16px;   /* bigger tap target */
    cursor: pointer;
    letter-spacing: 0.1em;
    min-height: 44px;    /* iOS minimum tap target */
    display: flex;
    align-items: center;
}
.mobile-menu-item {
    display: flex;
    align-items: center;
    padding: 20px 40px;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 1.8rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 2px solid rgba(255,255,255,0.07);
    transition: background 0.1s, padding-left 0.1s;
    min-height: 64px;    /* comfortable tap height */
    position: relative;
}
.mobile-menu-item::before { content: '// '; color: var(--accent); font-size: 1rem; margin-right: 8px; flex-shrink: 0; }
.mobile-menu-item:active  { background: var(--accent); color: white; }

/* Smaller text on narrow phones */
@media (max-width: 480px) {
    .mobile-menu-item { font-size: 1.4rem; padding: 16px 24px; }
    .mobile-menu-close { font-size: 0.75rem; padding: 8px 12px; }
}

.mobile-menu-github {
    font-size: 1rem;
    color: var(--pop-color);
    padding-top: 28px;
    border-bottom: none;
    letter-spacing: 0.12em;
}
.mobile-menu-github::before { color: var(--pop-color); }

/* ============================================================
   SKILL CAROUSEL — INFINITE MARQUEE + EDGE FADE
   ============================================================ */
.skill-deck-outer {
    grid-column: span 12;
    position: relative;
    background: var(--ink-color);
    border-bottom: var(--grid-line);
    overflow: hidden;
    padding: 50px 0; /* top/bottom only; left/right handled by mask gradient */

    /* Fade edges into the page background — no hard cut */
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0,
        black 80px,
        black calc(100% - 80px),
        transparent 100%
    );
    mask-image: linear-gradient(
        to right,
        transparent 0,
        black 80px,
        black calc(100% - 80px),
        transparent 100%
    );
}

@media (max-width: 600px) {
    .skill-deck-outer {
        -webkit-mask-image: linear-gradient(
            to right,
            transparent 0,
            black 40px,
            black calc(100% - 40px),
            transparent 100%
        );
        mask-image: linear-gradient(
            to right,
            transparent 0,
            black 40px,
            black calc(100% - 40px),
            transparent 100%
        );
    }
}

/* Override original .skill-deck for infinite GSAP ticker */
.skill-deck {
    grid-column: unset;
    display: flex;
    width: max-content;   /* grows to contain all cards */
    overflow: visible;
    scroll-snap-type: none;
    flex-wrap: nowrap;
    gap: 20px;
    will-change: transform;
    padding: 0;
    background: transparent;
    border-bottom: none;
}

/* ============================================================
   CERTIFICATIONS GRID
   ============================================================ */
.cert-grid {
    grid-column: span 12;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.cert-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 22px 14px 18px;
    background: var(--card-bg);
    border: var(--grid-line);
    box-shadow: var(--shadow-depth) var(--shadow-depth) 0 var(--ink-color);
    text-decoration: none;
    color: var(--ink-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.cert-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: calc(var(--shadow-depth) + 2px) calc(var(--shadow-depth) + 2px) 0 var(--ink-color);
}

.cert-icon {
    height: 32px;
    width: auto;
    opacity: 0.85;
}

.cert-name {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.3;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.cert-issuer {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--accent);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.cert-date {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    opacity: 0.5;
}

.cert-credly-link {
    grid-column: span 12;
    text-align: right;
    padding: 8px 0;
}

.cert-credly-link a {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 0.08em;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.cert-credly-link a:hover { opacity: 1; }

@media (max-width: 900px) {
    .cert-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .cert-card { padding: 16px 10px 14px; }
    .cert-name { font-size: 0.65rem; }
}

@media (max-width: 480px) {
    .cert-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}

/* ============================================================
   NETWORK RADAR — FULL REDESIGN
   ============================================================ */
.radar-section {
    grid-column: span 12;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    background: #020d02;
    border: 3px solid var(--ink-color);
    box-shadow: 6px 6px 0 var(--ink-color);
    padding: 30px;
    align-items: center;
}

/* The circular radar display */
.radar-display {
    position: relative;
    width: 260px; height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, #001a00 0%, #000800 60%, #000400 100%);
    border: 2px solid rgba(0,255,0,0.5);
    overflow: hidden;
    flex-shrink: 0;
}

/* Concentric rings */
.radar-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(0,255,0,0.15);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}
.radar-ring.r1 { width: 26%; height: 26%; }
.radar-ring.r2 { width: 52%; height: 52%; }
.radar-ring.r3 { width: 78%; height: 78%; }
.radar-ring.r4 { width: 100%; height: 100%; border-color: rgba(0,255,0,0.35); }

/* Rotating sweep */
.radar-sweep {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        transparent 295deg,
        rgba(0,255,0,0.04) 315deg,
        rgba(0,255,0,0.25) 355deg,
        rgba(0,255,0,0.35) 360deg
    );
    animation: radar-rotate 3s linear infinite;
    transform-origin: center;
}
@keyframes radar-rotate {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Crosshairs */
.radar-crosshair-h { position: absolute; width: 100%; height: 1px; top: 50%; background: rgba(0,255,0,0.1); }
.radar-crosshair-v { position: absolute; height: 100%; width: 1px; left: 50%; background: rgba(0,255,0,0.1); }

/* Radar label */
.radar-center-label {
    position: absolute; bottom: 14px; left: 50%;
    transform: translateX(-50%);
    color: rgba(0,255,0,0.35);
    font-family: var(--font-mono);
    font-size: 0.5rem;
    letter-spacing: 0.15em;
    white-space: nowrap;
}

/* Blip dots */
.radar-blip {
    position: absolute;
    width: 7px; height: 7px;
    background: #00ff41;
    border-radius: 50%;
    box-shadow: 0 0 10px #00ff41, 0 0 4px #00ff41;
    transform: translate(-50%, -50%);
    animation: blip-fade 2.8s ease-out forwards;
    pointer-events: none;
}
@keyframes blip-fade {
    0%   { opacity: 1; transform: translate(-50%,-50%) scale(1.4); }
    20%  { opacity: 0.9; }
    100% { opacity: 0; transform: translate(-50%,-50%) scale(0.6); }
}

/* Stats panel */
.radar-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.radar-stat-card {
    border: 2px solid rgba(0,255,0,0.25);
    padding: 14px 16px;
    background: rgba(0,30,0,0.6);
    box-shadow: inset 0 0 20px rgba(0,255,0,0.03);
}

.radar-stat-label {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: rgba(0,255,0,0.45);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.radar-stat-val {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 900;
    color: #00ff41;
    letter-spacing: 0.04em;
    line-height: 1;
}

.radar-status-online  { color: #00ff41; }
.radar-status-offline { color: var(--accent); }

.radar-level-low      { color: #00ff41; }
.radar-level-medium   { color: var(--pop-color); }
.radar-level-high     { color: #ff6600; }
.radar-level-critical { color: var(--accent); animation: blink 0.6s step-start infinite; }
@keyframes blink { 50% { opacity: 0.2; } }

.radar-counter { font-size: 2rem; }

@media (max-width: 900px) {
    .radar-section { grid-template-columns: 1fr; justify-items: center; }
    .radar-stats { width: 100%; }
}

/* ============================================================
   PACKET FLOW CITYSCAPE
   ============================================================ */
.packet-section {
    grid-column: span 12;
    position: relative;
    background: #0a0a1a;
    border: 3px solid var(--ink-color);
    box-shadow: var(--shadow-depth) var(--shadow-depth) 0 var(--ink-color);
    padding: 60px 40px 30px;
    min-height: 380px;
    overflow: hidden;
}

/* Stars */
.packet-sky { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.packet-star {
    position: absolute;
    width: 2px; height: 2px;
    background: #fff;
    border-radius: 50%;
    opacity: 0.4;
    animation: star-twinkle 3s ease-in-out infinite alternate;
}
@keyframes star-twinkle { 0% { opacity: 0.2; } 100% { opacity: 0.7; } }

/* Buildings row */
.packet-buildings {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    padding: 0 20px;
}

/* Individual building */
.packet-building {
    position: relative;
    flex: 1;
    min-width: 80px;
    max-width: 160px;
    height: var(--bld-height, 120px);
    background: #12122a;
    border: 2px solid rgba(100, 140, 255, 0.25);
    border-bottom: none;
    cursor: pointer;
    transition: border-color 0.3s, filter 0.3s;
    z-index: 2;
}

/* Lit windows — intersecting gradients = grid of squares */
.bld-windows {
    position: absolute;
    inset: 8px 6px 12px 6px;
    background:
        repeating-linear-gradient(to bottom, transparent 0, transparent 6px, rgba(255,220,100,0.6) 6px, rgba(255,220,100,0.6) 10px, transparent 10px, transparent 16px),
        repeating-linear-gradient(to right, transparent 0, transparent 6px, rgba(255,220,100,0.6) 6px, rgba(255,220,100,0.6) 10px, transparent 10px, transparent 16px);
    background-blend-mode: multiply;
    opacity: 0.7;
    pointer-events: none;
}

/* Building label */
.bld-label {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 0.55rem;
    font-weight: 700;
    color: rgba(100, 180, 255, 0.7);
    letter-spacing: 0.1em;
    white-space: nowrap;
    text-transform: uppercase;
}

/* Hover: dim siblings, highlight active */
.packet-buildings:hover .packet-building {
    filter: brightness(0.4);
    border-color: rgba(100, 140, 255, 0.1);
}
.packet-buildings:hover .packet-building:hover {
    filter: brightness(1.2);
    border-color: rgba(100, 180, 255, 0.8);
    box-shadow: 0 0 20px rgba(100, 180, 255, 0.2), inset 0 0 15px rgba(100, 180, 255, 0.05);
}

/* Tooltip */
.packet-tooltip {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 10, 30, 0.95);
    border: 2px solid rgba(100, 180, 255, 0.5);
    padding: 12px 16px;
    min-width: 200px;
    max-width: 260px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
    z-index: 10;
    box-shadow: 0 0 15px rgba(100, 180, 255, 0.15);
}
.packet-building:hover .packet-tooltip { opacity: 1; }
.tooltip-title {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(100, 200, 255, 0.9);
    letter-spacing: 0.08em;
    margin-bottom: 6px;
    text-transform: uppercase;
}
.tooltip-desc {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: rgba(200, 220, 255, 0.75);
    line-height: 1.5;
}

/* Edge tooltips — prevent overflow */
.packet-building:first-child .packet-tooltip { left: 0; transform: none; }
.packet-building:last-child .packet-tooltip { left: auto; right: 0; transform: none; }

/* Ground line */
.packet-ground {
    position: relative;
    z-index: 1;
    height: 2px;
    background: rgba(100, 180, 255, 0.35);
}

/* Cable + packet dot */
.packet-cable {
    position: absolute;
    bottom: 62px;
    left: 60px;
    right: 60px;
    height: 2px;
    background: repeating-linear-gradient(90deg, rgba(100,180,255,0.3) 0, rgba(100,180,255,0.3) 8px, transparent 8px, transparent 14px);
    z-index: 3;
}
.packet-dot {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 8px; height: 8px;
    background: #00ffcc;
    border-radius: 50%;
    box-shadow: 0 0 12px #00ffcc, 0 0 6px #00ffcc, 0 0 24px rgba(0,255,200,0.3);
    z-index: 4;
    animation: packet-travel 6s linear infinite;
}
@keyframes packet-travel { 0% { left: 0%; } 100% { left: 100%; } }

/* Caption */
.packet-meta {
    position: relative;
    z-index: 2;
    margin-top: 36px;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: rgba(100, 180, 255, 0.35);
    text-align: center;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* Mobile info area (hidden on desktop) */
.packet-info-mobile { display: none; }

@media (max-width: 900px) {
    .packet-section { padding: 40px 16px 24px; min-height: auto; }
    .packet-buildings {
        overflow-x: auto;
        justify-content: flex-start;
        gap: 16px;
        padding: 0 10px 10px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    .packet-building { min-width: 120px; max-width: 140px; scroll-snap-align: center; flex-shrink: 0; }
    .packet-building.tapped { border-color: rgba(100, 180, 255, 0.8); filter: brightness(1.2); }
    .packet-tooltip { display: none !important; }
    .packet-cable { left: 16px; right: 16px; bottom: 52px; }
    .bld-label { font-size: 0.6rem; }
    .packet-meta { font-size: 0.55rem; }
    .packet-buildings:hover .packet-building { filter: none; }
    .packet-info-mobile {
        display: block;
        position: relative;
        z-index: 5;
        min-height: 48px;
        margin: 12px 0 0;
        padding: 12px 14px;
        background: rgba(10, 10, 30, 0.95);
        border: 2px solid rgba(100, 180, 255, 0.4);
        font-family: var(--font-mono);
        text-align: center;
    }
    .packet-info-mobile:empty { border-color: transparent; background: transparent; }
    .packet-info-mobile:empty::after {
        content: 'TAP A BUILDING';
        font-size: 0.55rem;
        color: rgba(100, 180, 255, 0.3);
        letter-spacing: 0.1em;
    }
    .packet-info-mobile .info-title {
        font-size: 0.75rem;
        font-weight: 700;
        color: rgba(100, 200, 255, 0.9);
        margin-bottom: 4px;
    }
    .packet-info-mobile .info-desc {
        font-size: 0.7rem;
        color: rgba(200, 220, 255, 0.75);
        line-height: 1.5;
    }
}