/* Variables & Themes */
:root {
    /* Dark Mode (Default) */
    --primary: #60a5fa;
    --text: #f1f5f9;
    --bg: #0f172a;
    --card-bg: #1e293b;
    --input-bg: #334155;
    --input-border: #475569;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

body.light-mode {
    /* Light Mode Overrides (Industrial) */
    --primary: #d97706; /* Amber */
    --text: #171717;    /* Neutral Dark Gray */
    --bg: #e5e5e5;       /* Light Neutral Gray */
    --card-bg: #f5f5f5; /* Very Light Gray */
    --input-bg: #ffffff;
    --input-border: #d4d4d4;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* General Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background-color: var(--bg);
    line-height: 1.6;
    margin: 0;
    transition: background-color 0.3s, color 0.3s;
}

h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; }

/* Layout */
.wrap { max-width: 1000px; margin: 0 auto; padding: 4rem 2rem; }
section { padding: 0; } /* Reset default padding if needed */

/* Barra de progreso */
.progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: rgba(148, 163, 184, .12);
    z-index: 999;
}

.progress > span {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, rgba(56, 189, 248, .95), rgba(167, 139, 250, .95));
    transition: width .06s linear;
}

/* Parallax Hero */
.parallax {
    background-attachment: scroll; /* Changed from fixed for JS control */
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    will-change: background-position; /* Performance optimization */
}

.hero {
    /* background-image: url('https://picsum.photos/id/3/1920/1080'); */
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 120px;
    box-sizing: border-box;
    color: #fff;
    text-align: center;
    position: relative; /* Needed for absolute positioning of particles */
}

.hero h1 { font-size: 4rem; margin: 0; color: var(--text); text-shadow: 0 2px 10px rgba(0,0,0,0.3); }
.hero p { font-size: 1.8rem; opacity: 0.9; font-weight: 300; color: var(--text); text-shadow: 0 2px 10px rgba(0,0,0,0.3); }

body.dark-mode .hero h1 {
    color: #fff;
}

body.dark-mode .hero p {
    color: #fff;
}

/* Animaciones parallax */
@media (prefers-reduced-motion: reduce) {
    .parallax {
        transform: none !important;
    }
}

/* Cards */
.card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, background-color 0.3s;
    margin-bottom: 2rem;
    transform-style: preserve-3d;
    position: relative;
    overflow: hidden; /* Ensure spotlight doesn't spill */
}

/* Journey Map */
.map-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: 2rem;
    align-items: stretch;
}

.map-card {
    padding: 0;
}

.map-canvas {
    position: relative;
    min-height: 360px;
    border-radius: 16px;
    background:
        radial-gradient(circle at 20% 30%, rgba(0, 113, 227, 0.18), transparent 55%),
        radial-gradient(circle at 80% 70%, rgba(14, 165, 233, 0.2), transparent 60%);
    border: none;
    border: 1px solid rgba(148, 163, 184, 0.35);
    overflow: hidden;
    padding: 2rem;
}

.map-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.78;
    filter: saturate(1) contrast(1.15);
    pointer-events: none;
}

.map-blob {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: none;
}

.map-pin {
    position: absolute;
    left: var(--x);
    top: var(--y);
    transform: translate(-50%, -50%);
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.map-pin:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 6px;
    border-radius: 999px;
}

.pin-dot {
    width: 12px;
    height: 12px;
    background: var(--primary);
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 8px 14px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 2;
    transition: transform 0.2s ease;
}

.pin-pulse {
    position: absolute;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(0, 113, 227, 0.25);
    animation: pinPulse 2.6s infinite;
    z-index: 1;
}

.map-pin.active .pin-dot,
.map-pin:hover .pin-dot {
    transform: scale(1.2);
}

.pin-label {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translate(-50%, -6px);
    background: var(--card-bg);
    color: var(--text);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: var(--shadow);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.map-pin:hover .pin-label,
.map-pin:focus-visible .pin-label,
.map-pin.active .pin-label {
    opacity: 1;
    transform: translate(-50%, -10px);
}

.map-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.map-details-kicker {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.7rem;
    opacity: 0.7;
}

.map-detail-meta {
    font-size: 0.9rem;
    opacity: 0.8;
    margin: 0;
}

#map-detail-desc {
    white-space: pre-line;
}

.map-attribution {
    font-size: 0.75rem;
    opacity: 0.7;
    margin: 0.5rem 0 0;
}

@keyframes pinPulse {
    0% { transform: scale(0.6); opacity: 0.5; }
    60% { transform: scale(1.1); opacity: 0.2; }
    100% { transform: scale(1.5); opacity: 0; }
}

@media (max-width: 900px) {
    .map-grid {
        grid-template-columns: 1fr;
    }
    .map-canvas {
        min-height: 300px;
    }
}

/* Form & Buttons */
button {
    background-color: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}
button:hover { background-color: #1d4ed8; }

input, textarea {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    background-color: var(--input-bg);
    color: var(--text);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    box-sizing: border-box;
    font-family: inherit;
}

/* Links */
a { color: var(--primary); text-decoration: none; font-weight: 600; }
.social-links { margin-top: 1rem; }
.social-links a { margin-right: 1rem; font-size: 1.1rem; }

/* Navigation Bar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(15, 23, 42, 0.9); /* Dark mode default */
    backdrop-filter: saturate(180%) blur(20px);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-sizing: border-box;
    transition: all 0.4s ease;
}
body.light-mode .navbar {
    background-color: rgba(255, 255, 255, 0.8);
}

/* Scrolled State for Navbar */
.navbar.scrolled {
    padding: 0.8rem 2rem;
    box-shadow: 0 1px 0 rgba(0,0,0,0.1);
}

.nav-brand { font-size: 1.5rem; font-weight: 600; color: var(--text); transition: all 0.4s ease; }
.navbar.scrolled .nav-brand { font-size: 1.1rem; }

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    gap: 2rem;
}

.nav-menu a { color: var(--text); font-weight: 400; font-size: 0.95rem; }
.nav-menu a:hover { color: var(--primary); }

/* Nav Link Underline Animation */
.nav-menu a { position: relative; }
.nav-menu a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--primary);
    transition: width 0.3s ease;
}
.nav-menu a:hover::after { width: 100%; }

.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}
.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--text);
    transition: 0.3s;
}

/* Theme Toggle (Updated for Navbar) */
.theme-toggle {
    background: radial-gradient(circle at 30% 30%, #fff 0%, var(--card-bg) 45%, var(--bg) 100%);
    color: var(--text);
    border: 1px solid var(--input-border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    position: relative;
    overflow: hidden;
}
.theme-toggle:hover {
    background-color: var(--bg);
}
.theme-toggle::after {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(96, 165, 250, 0.35);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.theme-toggle:hover::after { opacity: 1; }
.theme-icon {
    transition: transform 0.3s ease, filter 0.3s ease;
}
body.dark-mode .theme-toggle {
    background: radial-gradient(circle at 70% 30%, #1f2937 0%, #0f172a 60%, #0b1220 100%);
}
body.dark-mode .theme-toggle::after {
    box-shadow: 0 0 12px rgba(167, 139, 250, 0.45);
    opacity: 0.8;
}
body.dark-mode .theme-icon {
    transform: rotate(-12deg) scale(1.05);
    filter: drop-shadow(0 0 6px rgba(167, 139, 250, 0.6));
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    font-size: 1.5rem;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 999;
    box-shadow: var(--shadow);
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
}
#back-to-top.visible { display: flex; opacity: 1; }
#back-to-top:hover { transform: translateY(-5px); }

/* Mobile Responsive */
@media (max-width: 768px) {
    .hamburger { display: flex; }
}

/* Footer */
footer {
    background-color: var(--card-bg);
    text-align: center;
    box-shadow: 0 -5px 15px -5px rgba(0,0,0,0.1);
}
footer p {
    margin: 1rem 0 0;
    opacity: 0.8;
    font-size: 0.9rem;
}
.social-icons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}
.social-icons a {
    color: var(--text);
    font-size: 1.5rem;
    transition: color 0.3s, transform 0.3s;
}
.social-icons a:hover {
    color: var(--primary);
    transform: translateY(-3px);
}

/* Typing Effect Cursor */
.typing-cursor::after {
    content: '|';
    display: inline-block;
    margin-left: 4px;
    color: var(--primary);
    animation: blink 0.8s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Custom Cursor */
@media (pointer: fine) {
    .cursor {
        position: fixed;
        width: 8px;
        height: 8px;
        background: white;
        mix-blend-mode: difference;
        border-radius: 50%;
        pointer-events: none;
        z-index: 9999;
        transform: translate(-50%, -50%);
        transition: transform 0.1s ease;
    }
    .cursor-follower {
        position: fixed;
        width: 24px;
        height: 24px;
        border: 1px solid white;
        mix-blend-mode: difference;
        border-radius: 50%;
        pointer-events: none;
        z-index: 9998;
        transform: translate(-50%, -50%);
        transition: transform 0.15s ease-out, width 0.3s, height 0.3s, background 0.3s, border-color 0.3s;
    }
    .cursor.active {
        transform: translate(-50%, -50%) scale(0.5);
    }
    .cursor-follower.active {
        width: 50px;
        height: 50px;
        background: rgba(255, 255, 255, 0.3);
        border-color: transparent;
    }
    body.dark-mode .cursor-follower.active {
        background: rgba(255, 255, 255, 0.3);
    }
}

/* Card Spotlight Effect */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        800px circle at var(--mouse-x) var(--mouse-y),
        rgba(255, 255, 255, 0.06),
        transparent 40%
    );
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s;
}
.card:hover::before { opacity: 1; }
body.dark-mode .card::before {
    background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y), rgba(255, 255, 255, 0.15), transparent 40%);
}

/* Glitch Text Effect */
.hero h1 {
    position: relative;
    display: inline-block;
}

.hero h1:hover::before,
.hero h1:hover::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    opacity: 0.5; /* Reduced opacity for subtler effect */
}

.hero h1:hover::before {
    left: 1px; /* Reduced offset */
    text-shadow: -2px 0 #ff00c1;
    clip-path: inset(44% 0 61% 0);
    animation: glitch-anim-1 2.5s infinite linear alternate-reverse;
}

.hero h1:hover::after {
    left: -1px; /* Reduced offset */
    text-shadow: -2px 0 #00fff9;
    clip-path: inset(50% 0 30% 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

/* Simplified and smoother keyframes */
@keyframes glitch-anim-1 {
  0% { clip-path: inset(40% 0 60% 0); }
  20% { clip-path: inset(90% 0 5% 0); }
  40% { clip-path: inset(10% 0 85% 0); }
  60% { clip-path: inset(60% 0 35% 0); }
  80% { clip-path: inset(25% 0 70% 0); }
  100% { clip-path: inset(5% 0 90% 0); }
}

@keyframes glitch-anim-2 {
  0% { clip-path: inset(15% 0 80% 0); }
  20% { clip-path: inset(80% 0 10% 0); }
  40% { clip-path: inset(40% 0 50% 0); }
  60% { clip-path: inset(10% 0 85% 0); }
  80% { clip-path: inset(55% 0 40% 0); }
  100% { clip-path: inset(85% 0 5% 0); }
}

/* Scroll Down Indicator */
.scroll-down {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 2rem;
    animation: bounce 2s infinite;
    cursor: pointer;
    z-index: 10;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

/* Resume Section Styles */
.resume-section {
    margin-bottom: 1.5rem;
}

.resume-header {
    cursor: pointer;
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.3s ease, background-color 0.3s;
}

.resume-header:hover {
    transform: translateY(-2px);
    background-color: var(--bg);
}

.resume-header h3 { margin: 0; color: var(--primary); }

.resume-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out, padding 0.5s ease;
    background: var(--card-bg);
    border-radius: 0 0 12px 12px;
    margin-top: -10px; /* Overlap slightly with header */
    padding: 0 1.5rem;
    opacity: 0;
}

.resume-content.active {
    max-height: 2000px; /* Allow enough height for content */
    padding: 2rem 1.5rem 1.5rem;
    opacity: 1;
    margin-top: 10px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

/* Timeline Styles */
.timeline {
    position: relative;
    border-left: 2px solid var(--input-border);
    margin-left: 1rem;
    padding-left: 2rem;
}

.timeline-item { 
    position: relative; 
    margin-bottom: 2.5rem; 
    opacity: 0; 
    transform: translateY(20px); 
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.timeline-item:last-child { margin-bottom: 0; }
.timeline-item.visible { opacity: 1; transform: translateY(0); }

.timeline-marker {
    position: absolute;
    left: -2.6rem;
    top: 5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--primary);
    transition: background 0.3s, transform 0.3s;
}
.timeline-item:hover .timeline-marker { background: var(--primary); transform: scale(1.2); }

/* Timeline Expandable Details */
.timeline-header {
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.timeline-header-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.timeline-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.timeline-header-logos {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    transform: translateX(-30px);
}

.timeline-toggle-icon {
    position: static;
    color: var(--primary);
    transition: transform 0.3s;
}
.timeline-item.expanded .timeline-toggle-icon { transform: rotate(180deg); }

.timeline-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, opacity 0.3s ease;
    opacity: 0;
}
.timeline-item.expanded .timeline-details { max-height: 500px; opacity: 1; margin-top: 0.5rem; }

.timeline-date { font-size: 0.85rem; color: var(--primary); font-weight: bold; margin-bottom: 0.25rem; display: block; }
.timeline-title { font-weight: bold; font-size: 1.1rem; margin: 0 0 0.25rem 0; }
.timeline-subtitle { font-style: italic; opacity: 0.8; margin-bottom: 0.5rem; font-size: 0.95rem; }
.timeline-company {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-style: normal;
    font-weight: 600;
    color: var(--text);
}
.company-logo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 64px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    border: none;
}
.company-logo {
    height: 100%;
    width: 150px;
    object-fit: contain;
    display: block;
}
body.dark-mode .company-logo-badge {
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 12px 16px;
    height: 80px;
    width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 700px) {
    .timeline-header {
        flex-wrap: wrap;
    }

    .timeline-header-right {
        width: 100%;
        justify-content: flex-end;
    }
}
.timeline-desc { font-size: 0.95rem; opacity: 0.9; margin: 0; }
.timeline-desc ul { margin: 0.5rem 0 0 1rem; padding: 0; }

.timeline-media {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.timeline-media a {
    display: inline-flex;
}

.timeline-media img {
    width: min(360px, 100%);
    max-height: 220px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

/* Skills Tags */
.skills-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.skill-tag {
    background: var(--bg);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid var(--input-border);
    transition: all 0.3s;
}
.skill-tag:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.activities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}
.activity-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0.9rem 1rem;
    background: var(--bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    transition: transform 0.3s, border-color 0.3s, background 0.3s;
}
.activity-card i {
    color: var(--primary);
    font-size: 1.1rem;
}
.activity-title { font-weight: 600; }
.activity-meta { font-size: 0.85rem; opacity: 0.8; }
.activity-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
}
.activity-link:hover { text-decoration: underline; }

.activity-media {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.activity-media img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: var(--shadow);
}
.activity-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    background: var(--card-bg);
}

.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 0.5rem;
}
.cert-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 0.9rem 1rem;
    background: var(--bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    transition: transform 0.3s, border-color 0.3s, background 0.3s;
}
.cert-card i {
    color: var(--primary);
    font-size: 1.1rem;
    margin-top: 2px;
}
.cert-title { font-weight: 600; }
.cert-meta { font-size: 0.85rem; opacity: 0.8; }
.cert-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    background: var(--card-bg);
}

/* Blog Posts */
.post {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.post-link {
    align-self: flex-start;
    background-color: var(--primary);
    color: #fff;
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-shadow: var(--shadow);
}

.post-link:hover {
    background-color: #1d4ed8;
    transform: translateY(-2px);
}

/* Project Media */
.project-extra {
    margin-top: 0.5rem;
    opacity: 0.85;
}

.project-media {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin: 1rem 0 0.5rem;
}

.project-media img {
    width: 100%;
    height: auto;
    max-height: 260px;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.75rem;
    align-items: center;
}

.project-links a,
.project-links summary {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, background 0.2s ease;
}

.project-links a:hover,
.project-links summary:hover {
    background-color: #1d4ed8;
    transform: translateY(-2px);
}

.project-links .project-download {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    box-shadow: none;
}

.project-links .project-download:hover {
    background: rgba(0, 113, 227, 0.08);
}

.project-links details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.project-dropdown {
    margin: 0;
    flex: 0 0 auto;
}

.project-dropdown summary {
    cursor: pointer;
    list-style: none;
    gap: 0.5rem;
    width: fit-content;
}

.project-dropdown summary::-webkit-details-marker {
    display: none;
}

.project-dropdown summary::after {
    content: '▾';
    font-size: 0.85rem;
    transition: transform 0.2s ease;
}

.project-dropdown[open] {
    flex-basis: 100%;
}

.project-dropdown[open] summary {
    margin-bottom: 0.6rem;
}

.project-dropdown[open] summary::after {
    transform: rotate(180deg);
}

.project-long {
    margin-top: 0.75rem;
    opacity: 0.9;
    line-height: 1.6;
}

.project.card {
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.320, 1), box-shadow 0.3s cubic-bezier(0.23, 1, 0.320, 1);
}

.project.card:hover {
    transform: perspective(1200px) rotateX(5deg) rotateY(-5deg) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

body.projects-page .project.card {
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

body.projects-page .project.card::after {
    content: '';
    position: absolute;
    inset: -40% -20%;
    background: radial-gradient(circle at 20% 20%, rgba(0, 113, 227, 0.18), transparent 55%);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

body.projects-page .project.card:hover {
    transform: perspective(1200px) rotateX(5deg) rotateY(-5deg) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

body.projects-page .project.card:hover::after {
    opacity: 1;
    transform: translateY(0);
}

/* Party Mode (Konami Code) */
body.party-mode {
    animation: rainbow-bg 0.2s linear infinite; /* Super fast strobe */
    overflow-x: hidden;
}

body.party-mode .card, 
body.party-mode button {
    animation: shake 0.2s cubic-bezier(.36,.07,.19,.97) infinite;
    border: 3px solid #ff00ff;
}

body.party-mode img,
body.party-mode i,
body.party-mode .skill-tag,
body.party-mode canvas {
    animation: spin 1s linear infinite;
}

body.party-mode h1, 
body.party-mode h2, 
body.party-mode h3 {
    animation: bounce-party 0.3s infinite alternate;
    color: yellow !important;
    text-shadow: 4px 4px 0px #ff0000;
    font-family: 'Comic Sans MS', 'Chalkboard SE', sans-serif !important;
}

.party-meme {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    animation: fly 3s linear infinite;
    font-weight: bold;
    text-shadow: 2px 2px 0 #000;
}

@keyframes spin { 
    100% { transform: rotate(360deg) scale(1.2); } 
}

@keyframes fly {
    0% { transform: translate(-10vw, 110vh) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translate(110vw, -10vh) rotate(720deg); opacity: 0; }
}

@keyframes rainbow-bg {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

@keyframes bounce-party {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

/* Stop Party Button */
#stop-party-btn {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    background: red;
    color: white;
    border: 3px solid white;
    font-size: 1.5rem;
    padding: 1rem 2rem;
    display: none;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    font-family: 'Comic Sans MS', sans-serif;
    text-transform: uppercase;
    transition: top 0.4s ease-out, left 0.4s ease-out;
}
body.party-mode #stop-party-btn {
    display: block;
    animation: bounce 0.5s infinite;
}

/* Party Mode Backgrounds */
body.party-mode .hero {
    background-image: url('https://i.kym-cdn.com/entries/icons/original/000/028/497/sal.jpg') !important;
    background-size: 200px;
    background-repeat: repeat;
    animation: bg-glitch 0.3s infinite steps(3) !important;
}

body.party-mode .parallax:not(.hero) {
    background-image: url('https://i.kym-cdn.com/photos/images/newsfeed/001/482/328/c34.jpg') !important;
    background-size: 200px;
    background-repeat: repeat;
    animation: bg-glitch 0.3s infinite steps(3) !important;
}

/* Easter Egg Trigger */
.brand-container {
    display: flex;
    align-items: center;
}

#party-trigger {
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    background: transparent;
    border: none;
    font-size: 0; /* Hide original text */
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
    width: 30px;
    height: 30px;
    box-shadow: none;
    position: relative;
}

.brand-container:hover #party-trigger {
    opacity: 1;
}

#party-trigger:hover {
    background: transparent;
    transform: scale(1.2);
}

#party-trigger::before,
#party-trigger::after {
    content: '🍺';
    font-size: 1.5rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* Empty Glass (Base) */
#party-trigger::before {
    filter: grayscale(100%) opacity(0.3);
}

/* Full Glass (Animated) */
#party-trigger::after {
    clip-path: inset(100% 0 0 0);
    transition: clip-path 4s cubic-bezier(0.4, 0, 0.2, 1);
}

#party-trigger:hover::after {
    clip-path: inset(0 0 0 0);
    animation: foam 1.5s infinite 4s;
}

@keyframes foam {
    0% { text-shadow: 0 0 0 rgba(255, 255, 255, 0); }
    50% { text-shadow: -2px -15px 0 rgba(255, 255, 255, 0.8), 2px -10px 0 rgba(255, 255, 255, 0.8); }
    100% { text-shadow: -4px -25px 0 rgba(255, 255, 255, 0), 4px -20px 0 rgba(255, 255, 255, 0); }
}

@keyframes bg-glitch {
    0% { background-position: 0 0; filter: hue-rotate(0deg) invert(0); }
    25% { background-position: 5px -5px; filter: hue-rotate(90deg) invert(0.2); }
    50% { background-position: -5px 5px; filter: hue-rotate(180deg) invert(0.5); }
    75% { background-position: 5px 5px; filter: hue-rotate(270deg) invert(0.8); }
    100% { background-position: 0 0; filter: hue-rotate(360deg) invert(1); }
}

/* Confirmation Modal */
.confirmation-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 10002;
    backdrop-filter: blur(5px);
}

.confirmation-modal {
    background: var(--card-bg);
    padding: 2rem 3rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow);
}
.confirmation-modal .modal-buttons {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* --- RESTORED STYLES --- */

/* Terminal */
.terminal {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 400px;
    height: 300px;
    background: rgba(30, 30, 30, 0.95);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    font-family: 'Courier New', monospace;
    overflow: hidden;
    border: 1px solid #444;
    transition: transform 0.3s ease;
}
.terminal.minimized { transform: translateY(120%); }
.terminal-header {
    background: #333;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: grab;
    color: #ccc;
    font-size: 0.8rem;
}
.terminal-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}
.terminal-body {
    padding: 10px;
    color: #0f0;
    flex: 1;
    overflow-y: auto;
    font-size: 0.9rem;
}
.term-input-line {
    display: flex;
    gap: 8px;
    align-items: baseline;
}
.term-input-line .prompt {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}
#term-input {
    line-height: 1;
}
#term-input {
    background: transparent;
    border: none;
    color: #fff;
    font-family: inherit;
    flex: 1;
    outline: none;
}
.term-btn.close {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: #ff5f56;
    border-radius: 50%;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

/* Mascot */
.mascot {
    position: fixed;
    bottom: 0;
    left: 0;
    font-size: 30px;
    z-index: 9998;
    transition: left 0.1s linear, transform 0.2s;
    pointer-events: none;
    transform: scaleX(var(--mascot-dir, 1));
}
.mascot.running { animation: bounceMascot 0.3s infinite alternate; }
.mascot.hiding {
    transform: scaleX(var(--mascot-dir, 1)) scale(0.8);
    opacity: 0.7;
}

.footprint {
    position: fixed;
    bottom: 5px;
    font-size: 10px;
    opacity: 0.5;
    pointer-events: none;
    z-index: 9997;
    animation: fadeOut 2s forwards;
}
@keyframes fadeOut { to { opacity: 0; transform: translateY(-10px); } }

/* Physics */
.physics-element {
    user-select: none;
    z-index: 100;
}

/* =====================================================
   SMOOTH & MOBILE IMPROVEMENTS — v2
   ===================================================== */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Page fade-in on load */
body {
    animation: pageFadeIn 0.5s ease both;
}
@keyframes pageFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ---- Hero: responsive font scaling ---- */
.hero h1 {
    font-size: clamp(2rem, 6vw, 4rem) !important;
}
.hero p {
    font-size: clamp(1rem, 2.5vw, 1.8rem) !important;
}

/* ---- Hero: entrance animations ---- */
@keyframes heroFadeUp {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}
.hero-content-title {
    animation: heroFadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: 0.25s;
}
.hero-content-sub {
    animation: heroFadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: 0.5s;
}

/* ---- Hero: ambient gradient orbs ---- */
.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.18;
    pointer-events: none;
    animation: orbFloat 10s ease-in-out infinite;
}
.hero-orb-1 {
    width: 520px; height: 520px;
    background: var(--primary);
    top: -15%; right: -8%;
    animation-delay: 0s;
}
.hero-orb-2 {
    width: 380px; height: 380px;
    background: #a78bfa;
    bottom: 5%; left: -8%;
    animation-delay: -5s;
}
@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%       { transform: translate(24px, -24px) scale(1.06); }
    66%       { transform: translate(-18px, 18px) scale(0.94); }
}

/* ---- Hero: animated background paths ---- */
.hero-paths {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}
.hero-paths-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    color: rgba(255, 255, 255, 0.25);
}
body.light-mode .hero-paths-svg {
    color: rgba(15, 23, 42, 0.18);
}
@keyframes hero-path-flow {
    0%   { stroke-dashoffset: 2000; opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { stroke-dashoffset: -2000; opacity: 0; }
}
@keyframes hero-path-flow-reverse {
    0%   { stroke-dashoffset: -2000; opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { stroke-dashoffset: 2000; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .hero-paths { display: none; }
}

/* ---- Hero: animated gradient overlay ---- */
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        -45deg,
        rgba(96, 165, 250, 0.08),
        rgba(167, 139, 250, 0.08),
        rgba(56, 189, 248, 0.08),
        rgba(192, 132, 252, 0.08)
    );
    background-size: 400% 400%;
    animation: heroGradient 14s ease infinite;
    pointer-events: none;
    z-index: 0;
}
@keyframes heroGradient {
    0%, 100% { background-position: 0% 50%; }
    50%       { background-position: 100% 50%; }
}

/* ---- Navbar: glass polish ---- */
.navbar {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
body.light-mode .navbar {
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

/* ---- Hamburger → X animation ---- */
.hamburger span {
    transform-origin: center;
    transition: transform 0.35s cubic-bezier(0.23, 1, 0.32, 1),
                opacity   0.25s ease,
                background-color 0.3s;
}
.hamburger.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---- Toggle row: always inline ---- */
.nav-toggles {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}

/* ---- Desktop: nav-menu floats right of navbar (now a sibling element) ---- */
@media (min-width: 769px) {
    .nav-menu {
        position: fixed;
        top: 0;
        right: 2rem;
        height: var(--navbar-h, 78px);
        display: flex;
        align-items: center;
        gap: 2rem;
        z-index: 1001; /* above navbar (1000) so the navbar background doesn't hide links */
        background: transparent;
        list-style: none;
        margin: 0;
        padding: 0;
        opacity: 1;
        pointer-events: auto;
        transform: none;
    }
}

/* ---- Mobile nav: fullscreen overlay below the navbar ---- */
@media (max-width: 768px) {
    /* Overlay sits in root stacking context — navbar (z-index:1000) always paints on top */
    .nav-menu {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.25rem;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 500;                     /* well below navbar z-index: 1000 */
        background-color: var(--bg);
        padding-top: var(--navbar-h, 70px);
        box-sizing: border-box;
        margin: 0;
        list-style: none;
        /* Hidden state */
        opacity: 0;
        pointer-events: none;
        transform: translateY(-8px);
        transition: opacity 0.25s ease, transform 0.25s ease;
    }
    .nav-menu.active {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    /* Staggered item slide-in */
    .nav-menu li {
        opacity: 0;
        transform: translateY(14px);
        transition: opacity 0.3s ease, transform 0.3s ease;
        width: auto;
        text-align: center;
    }
    .nav-menu.active li { opacity: 1; transform: translateY(0); }
    .nav-menu.active li:nth-child(1) { transition-delay: 0.06s; }
    .nav-menu.active li:nth-child(2) { transition-delay: 0.11s; }
    .nav-menu.active li:nth-child(3) { transition-delay: 0.16s; }
    .nav-menu.active li:nth-child(4) { transition-delay: 0.21s; }
    .nav-menu.active li:nth-child(5) { transition-delay: 0.26s; }

    /* Large centered links */
    .nav-menu a {
        font-size: 1.6rem;
        font-weight: 600;
        letter-spacing: -0.01em;
        padding: 0.55rem 2rem;
        display: block;
        text-align: center;
        width: auto;
        min-height: unset;
    }

    /* Toggle row */
    .nav-toggles {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 1.25rem;
        margin-top: 1.75rem;
        width: auto;
    }

    /* Keep toggle buttons circular */
    .nav-menu .theme-toggle {
        width: 40px;
        height: 40px;
        min-height: unset;
        padding: 0;
        flex-shrink: 0;
    }

    /* Lang link in EN page */
    .nav-toggles .lang-link {
        font-size: 0.9rem;
        font-weight: bold;
        width: auto;
        min-height: unset;
        padding: 0;
    }

    /* Hero padding & text */
    .hero {
        padding-top: 76px;
    }
    .hero h1 {
        font-size: clamp(1.9rem, 7vw, 2.8rem) !important;
    }
    .hero p {
        font-size: clamp(0.95rem, 3.5vw, 1.3rem) !important;
    }

    /* Section padding */
    .wrap {
        padding: 3rem 1.25rem;
    }

    /* Timeline logos: remove negative translate that overflows */
    .timeline-header-logos {
        transform: none;
    }

    /* Cards: no heavy 3D on touch */
    .card {
        transition: box-shadow 0.3s ease, background-color 0.3s !important;
    }

    /* Mascot & terminal hidden on mobile */
    .mascot, #terminal {
        display: none !important;
    }

    /* Hamburger hit area */
    .hamburger {
        padding: 8px;
        margin: -8px;
    }

    /* Back to top: smaller on mobile */
    #back-to-top {
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
        bottom: 20px;
        right: 18px;
    }
}

/* ---- Extra-small screens ---- */
@media (max-width: 480px) {
    .hero h1 {
        font-size: clamp(1.65rem, 8.5vw, 2.2rem) !important;
    }
    .hero p {
        font-size: clamp(0.9rem, 4vw, 1.1rem) !important;
    }
    .hero-orb {
        opacity: 0.10;
    }
    .wrap {
        padding: 2.5rem 1rem;
    }
    .map-canvas {
        min-height: 220px;
    }
    .activity-media img {
        height: 70px;
    }
}

/* ---- Tablet ---- */
@media (min-width: 769px) and (max-width: 1024px) {
    .wrap {
        padding: 3.5rem 1.75rem;
    }
}

/* ---- Disable 3D hover on non-pointer / touch ---- */
@media (hover: none) {
    .project.card:hover,
    .card:hover {
        transform: none !important;
        box-shadow: var(--shadow) !important;
    }
    .skill-tag:hover {
        transform: none;
    }
    .resume-header:hover {
        transform: none;
    }
    .social-icons a:hover {
        transform: none;
    }
}

/* ---- Scroll-down indicator: smoother bounce ---- */
.scroll-down {
    animation: scrollBounce 2s ease infinite;
}
@keyframes scrollBounce {
    0%, 100% { transform: translateX(-50%) translateY(0);  opacity: 1; }
    50%       { transform: translateX(-50%) translateY(9px); opacity: 0.7; }
}

/* ---- Button: unified hover lift ---- */
button:not(.theme-toggle):not(#party-trigger):not(.map-pin) {
    transition: all 0.25s cubic-bezier(0.23, 1, 0.32, 1);
}
button:not(.theme-toggle):not(#party-trigger):not(.map-pin):hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}
button:not(.theme-toggle):not(#party-trigger):not(.map-pin):active {
    transform: translateY(0);
}

/* ---- Card: subtle entrance via AOS + smoother base ---- */
.card {
    transition: transform 0.35s cubic-bezier(0.23, 1, 0.32, 1),
                box-shadow 0.35s cubic-bezier(0.23, 1, 0.32, 1),
                background-color 0.3s ease !important;
}

/* ---- Skill tags: subtle stagger via nth-child ---- */
.skills-grid .skill-tag {
    animation: tagFadeIn 0.4s ease both;
}
@keyframes tagFadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1); }
}

/* ---- Timeline item transitions ---- */
.timeline-item {
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* ---- Social icons: smooth lift ---- */
.social-icons a {
    transition: color 0.25s ease, transform 0.25s cubic-bezier(0.23, 1, 0.32, 1);
}
.social-icons a:hover {
    transform: translateY(-4px) scale(1.1);
}

/* ---- Progress bar: gradient glow ---- */
.progress > span {
    box-shadow: 0 0 8px rgba(96, 165, 250, 0.5);
}

/* ---- Back to top: smoother ---- */
#back-to-top {
    transition: opacity 0.4s ease, transform 0.3s cubic-bezier(0.23, 1, 0.32, 1), background-color 0.3s;
}
#back-to-top:hover {
    transform: translateY(-5px) scale(1.05);
}

/* ---- Footer padding ---- */
footer {
    padding: 2rem 0;
}

/* ---- Map: mobile stack fix ---- */
@media (max-width: 600px) {
    .map-grid {
        grid-template-columns: 1fr;
    }
    .map-canvas {
        min-height: 240px;
        padding: 1rem;
    }
}

/* ---- Cert / activity cards: hover lift on pointer ---- */
@media (hover: hover) {
    .cert-card:hover,
    .activity-card:hover {
        transform: translateY(-3px);
        border-color: var(--primary);
    }
}

/* ---- Timeline company logos: lighter fix for dark mode ---- */
body.dark-mode .company-logo-badge {
    padding: 8px 12px;
    height: 64px;
    width: 120px;
}

/* ---- Resume download button: outline variant ---- */
.resume-download-btn {
    background: transparent !important;
    color: var(--primary) !important;
    border: 1.5px solid var(--primary) !important;
    box-shadow: none !important;
}
.resume-download-btn:hover {
    background: rgba(96, 165, 250, 0.1) !important;
    transform: translateY(-2px);
}

/* ---- Improved AOS timings on mobile ---- */
@media (max-width: 768px) {
    [data-aos] {
        transition-duration: 500ms !important;
    }
}

/* ---- Nav link active state (current page) ---- */
.nav-menu a.active-link {
    color: var(--primary);
}
.nav-menu a.active-link::after {
    width: 100%;
}

/* ---- Section h2 responsive ---- */
h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
}

/* ==============================================
   NEW FEATURES
   ============================================== */

/* Currently-at badge */
.currently-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #10b981;
    padding: 0.4rem 1.1rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 1rem;
    backdrop-filter: blur(4px);
    animation: heroFadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: 0.75s;
}
.currently-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #10b981;
    flex-shrink: 0;
    animation: pulse-dot 2s ease infinite;
}
@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55); }
    50%       { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
}

/* Stat counters */
.stats-row {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}
.stat-item { text-align: center; }
.stat-value {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.stat-suffix {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--primary);
}
.stat-label {
    font-size: 0.85rem;
    opacity: 0.65;
    margin-top: 0.3rem;
    letter-spacing: 0.02em;
}

/* Tech stack badges */
.tech-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0.6rem 0 0.5rem;
}
.tech-badge {
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.tech-badge.python         { background: rgba(59,130,246,0.15);  color: #3b82f6; border: 1px solid rgba(59,130,246,0.3);  }
.tech-badge.ros            { background: rgba(239,68,68,0.15);   color: #ef4444; border: 1px solid rgba(239,68,68,0.3);   }
.tech-badge.ml             { background: rgba(168,85,247,0.15);  color: #a855f7; border: 1px solid rgba(168,85,247,0.3);  }
.tech-badge.gazebo         { background: rgba(236,72,153,0.15);  color: #ec4899; border: 1px solid rgba(236,72,153,0.3);  }
.tech-badge.mbse           { background: rgba(20,184,166,0.15);  color: #0d9488; border: 1px solid rgba(20,184,166,0.3);  }
.tech-badge.power-platform { background: rgba(234,179,8,0.15);   color: #ca8a04; border: 1px solid rgba(234,179,8,0.3);   }
.tech-badge.optimization   { background: rgba(16,185,129,0.15);  color: #059669; border: 1px solid rgba(16,185,129,0.3);  }
.tech-badge.hardware       { background: rgba(249,115,22,0.15);  color: #ea580c; border: 1px solid rgba(249,115,22,0.3);  }
.tech-badge.nasa           { background: rgba(99,102,241,0.15);  color: #6366f1; border: 1px solid rgba(99,102,241,0.3);  }

/* Scroll progress dots */
.scroll-dots {
    position: fixed;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 500;
}
.scroll-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--input-border);
    display: block;
    transition: all 0.3s ease;
}
.scroll-dot.active {
    background: var(--primary);
    transform: scale(1.3);
}
.scroll-dot:hover { background: var(--primary); opacity: 0.8; }
@media (max-width: 768px) { .scroll-dots { display: none; } }

/* Skill rings */
.skills-rings-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.4rem 1.8rem;
    margin-top: 0.5rem;
}
.skill-ring-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    width: 70px;
}
.skill-ring-svg {
    width: 64px;
    height: 64px;
    overflow: visible;
}
.ring-bg {
    fill: none;
    stroke: var(--input-border);
    stroke-width: 4;
}
.ring-fill {
    fill: none;
    stroke: var(--primary);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 150.796;
    stroke-dashoffset: 150.796;
    transform-origin: 30px 30px;
    transform: rotate(-90deg);
    transition: stroke-dashoffset 1.3s cubic-bezier(0.23, 1, 0.32, 1);
}
.skill-ring-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-align: center;
    opacity: 0.85;
    line-height: 1.2;
}
.skill-ring-pct {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: -2px;
}

/* Contact quick widget */
.contact-widget {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}
.contact-widget-info { flex: 1 1 260px; }
.contact-widget-info h3 { margin: 0 0 0.3rem; }
.contact-widget-info p  { margin: 0; opacity: 0.75; font-size: 0.95rem; }
.contact-widget-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}
.contact-widget-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--input-border);
    transition: all 0.2s ease;
}
.contact-widget-link:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}
.contact-widget-cta {
    background: var(--primary);
    color: #fff !important;
    border-color: transparent;
}
.contact-widget-cta:hover { background: #1d4ed8; color: #fff !important; }

/* Noise texture on hero */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.88' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    opacity: 0.025;
    pointer-events: none;
    z-index: 3;
}

/* Hero particle canvas (inserted by JS) */
#hero > canvas {
    z-index: 0 !important;
}

/* Map zoom & pan — dimensions approach (keeps SVG vector-sharp at any scale) */
.map-transform-layer {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    user-select: none;
}
.map-canvas {
    cursor: grab;
    touch-action: none;
}
.map-canvas:active { cursor: grabbing; }
.map-zoom-controls {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 10;
}
.map-zoom-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid var(--input-border);
    background: var(--card-bg);
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 700;
    padding: 0;
    min-height: unset;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
    transition: background 0.2s ease, color 0.2s ease;
    transform: none !important;
}
.map-zoom-btn:hover {
    background: var(--primary);
    color: #fff;
    transform: none !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Animated travel route overlay */
.map-route-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: visible;
}
.map-route-path {
    fill: none;
    stroke: var(--primary);
    stroke-width: 0.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.55;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    transition: stroke-dashoffset 2.8s cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
}
#journey-map.journey-map-animated .map-route-path {
    stroke-dashoffset: 0;
}
.map-route-traveler {
    fill: var(--primary);
    opacity: 0;
    transition: opacity 0.3s;
    filter: drop-shadow(0 0 3px var(--primary));
}

@keyframes bounceMascot {
    from { transform: scaleX(var(--mascot-dir, 1)) translateY(0); }
    to   { transform: scaleX(var(--mascot-dir, 1)) translateY(-4px); }
}

/* Print stylesheet */
@media print {
    .navbar, .progress, .scroll-down, #back-to-top,
    #party-trigger, .mascot, .terminal, #stop-party-btn,
    .scroll-dots, .confirmation-modal-overlay,
    #hero, #about, #journey-map, #contact-widget,
    footer { display: none !important; }

    body { color: #000 !important; background: #fff !important; font-size: 11pt; }
    #resume { page-break-inside: avoid; }
    .wrap { padding: 0.5cm 0; max-width: 100% !important; }
    .resume-section { break-inside: avoid; margin-bottom: 1.2em; }
    .resume-content {
        max-height: none !important;
        opacity: 1 !important;
        padding: 0.5rem !important;
        display: block;
    }
    .resume-header { box-shadow: none; background: transparent; padding: 0.25rem 0; }
    .timeline-details { max-height: none !important; opacity: 1 !important; }
    .card, .resume-header, .activity-card, .cert-card { box-shadow: none !important; border: 1px solid #ccc; }
    a { color: #000 !important; text-decoration: none; }
    .skill-ring-svg, .skills-rings-grid { display: none; }
    @page { margin: 1.5cm 2cm; size: A4; }
}

/* ============================================================
   APPLE-STYLE UPGRADE PACK
   ============================================================ */

/* 1. STICKY HERO — subsequent sections scroll over it */
#hero {
    position: sticky;
    top: 0;
    z-index: 1;
    overflow: hidden;
}

/* Sections after hero sit above it and cover it as you scroll */
body > section:not(#hero),
body > footer {
    position: relative;
    z-index: 2;
    background-color: var(--bg);
}

/* 2. HERO WORD-BY-WORD REVEAL */
.hero-content-title {
    animation: none !important; /* word spans handle their own entrance */
    opacity: 1 !important;
    transform: none !important;
}
.hero-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(36px) skewY(3deg);
    animation: wordReveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    will-change: transform, opacity;
}
@keyframes wordReveal {
    to {
        opacity: 1;
        transform: translateY(0) skewY(0deg);
    }
}

/* 3. GLASSMORPHISM CARDS */
body.dark-mode .card {
    background: rgba(15, 23, 42, 0.45) !important;
    backdrop-filter: blur(28px) saturate(200%) brightness(1.08);
    -webkit-backdrop-filter: blur(28px) saturate(200%) brightness(1.08);
    border: 1px solid rgba(148, 163, 184, 0.1) !important;
    box-shadow:
        0 8px 40px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2) !important;
}
body.light-mode .card {
    background: rgba(255, 255, 255, 0.68) !important;
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(0, 0, 0, 0.07) !important;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.09),
        inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
}

/* 4. CURSOR TRAIL DOTS */
.cursor-trail-dot {
    position: fixed;
    border-radius: 50%;
    background: var(--primary);
    pointer-events: none;
    z-index: 9996;
    transform: translate(-50%, -50%);
    mix-blend-mode: screen;
    transition: background 0.3s ease;
}
body.light-mode .cursor-trail-dot {
    mix-blend-mode: normal;
}

/* 5. SKILLS RADAR CHART CONTAINER */
.skills-chart-wrap {
    max-width: 380px;
    margin: 1.5rem auto 0.5rem;
    padding: 0.75rem;
    border-radius: 16px;
    background: rgba(30, 41, 59, 0.25);
    border: 1px solid rgba(148, 163, 184, 0.1);
}
body.light-mode .skills-chart-wrap {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(0, 0, 0, 0.06);
}

/* 6. SECTION REVEAL: h2 slide-up on scroll */
.section-h2-clip {
    overflow: hidden;
    display: block;
}
.section-h2-clip .h2-inner {
    display: block;
    transform: translateY(110%);
    opacity: 0;
    transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.7s ease;
}
.section-h2-clip.h2-visible .h2-inner {
    transform: translateY(0);
    opacity: 1;
}

/* 7. AURORA CANVAS */
#hero > canvas {
    z-index: 1 !important;
    opacity: 1;
}

/* 8. SCROLL-DOWN INDICATOR: fade on scroll */
.scroll-down {
    transition: opacity 0.4s ease;
}

/* =====================================================
   EURODRON PAGE
   ===================================================== */

.eurodron-intro {
    padding-bottom: 0.5rem;
}

.eurodron-title-row {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1rem;
}

.eurodron-icon {
    width: 54px;
    height: 54px;
    color: var(--primary);
    flex-shrink: 0;
}

.eurodron-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0 0 0.2rem 0;
}

.eurodron-title span {
    color: var(--primary);
}

.eurodron-subtitle-text {
    font-size: 1rem;
    opacity: 0.6;
    margin: 0;
}

.eurodron-desc {
    max-width: 740px;
    opacity: 0.8;
    margin-bottom: 1.5rem;
    line-height: 1.75;
}

.eurodron-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
}

.eurodron-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--card-bg);
    border: 1px solid rgba(96, 165, 250, 0.2);
    color: var(--text);
    font-size: 0.8rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-weight: 500;
}

.eurodron-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.eurodron-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary);
    color: #0f172a;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.6rem 1.3rem;
    border-radius: 8px;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.15s;
}

.eurodron-btn-primary:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.eurodron-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--card-bg);
    color: var(--text);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.6rem 1.3rem;
    border-radius: 8px;
    text-decoration: none;
    border: 1px solid var(--input-border);
    transition: opacity 0.2s, transform 0.15s;
}

.eurodron-btn-ghost:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

/* Embed section */
.eurodron-embed-section {
    padding: 0 2rem 0.5rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.eurodron-iframe-wrap {
    position: relative;
    width: 100%;
    height: clamp(480px, 80vh, 900px);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(96, 165, 250, 0.15);
    background: #0f172a;
    box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.6);
}

.eurodron-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.eurodron-loader {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: rgba(15, 23, 42, 0.92);
    z-index: 10;
    color: rgba(241, 245, 249, 0.55);
    font-size: 0.85rem;
    pointer-events: none;
    transition: opacity 0.4s;
}

.eurodron-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(96, 165, 250, 0.2);
    border-top-color: rgba(96, 165, 250, 0.85);
    border-radius: 50%;
    animation: eurodronSpin 0.9s linear infinite;
}

@keyframes eurodronSpin {
    to { transform: rotate(360deg); }
}

.eurodron-loader.timed-out {
    opacity: 0.4;
}

.eurodron-not-running {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: rgba(15, 23, 42, 0.97);
    z-index: 11;
    text-align: center;
    padding: 2rem;
}

.eurodron-not-running.visible {
    display: flex;
}

.eurodron-not-running h3 {
    margin: 0;
    color: var(--primary);
    font-size: 1.1rem;
}

.eurodron-not-running p {
    margin: 0;
    opacity: 0.65;
    font-size: 0.85rem;
    max-width: 400px;
}

.eurodron-not-running code {
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid rgba(96, 165, 250, 0.2);
    color: #93c5fd;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.eurodron-hint {
    text-align: center;
    font-size: 0.78rem;
    opacity: 0.45;
    margin-top: 0.7rem;
    line-height: 1.6;
}

.eurodron-hint code {
    background: var(--card-bg);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.73rem;
}

.eurodron-hint a {
    color: var(--primary);
    text-decoration: none;
}

.eurodron-hint a:hover {
    text-decoration: underline;
}

/* Tech stack section */
.eurodron-tech-section {
    border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.eurodron-tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.eurodron-tech-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1.25rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.08);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.eurodron-tech-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.eurodron-tech-icon {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    display: block;
}

.eurodron-tech-name {
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 0.2rem;
    color: var(--primary);
}

.eurodron-tech-desc {
    font-size: 0.73rem;
    opacity: 0.55;
    line-height: 1.4;
}

/* Project card accent for EuroDron in projects page */
.project-featured {
    border-left: 3px solid var(--primary);
    position: relative;
}

.project-live-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary);
    color: #0f172a;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

@media (max-width: 600px) {
    .eurodron-embed-section {
        padding: 0 1rem 0.5rem 1rem;
    }
    .eurodron-tech-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .eurodron-title-row {
        gap: 0.75rem;
    }
}
