/* ═══════════════════════════════════════════════════════
   FOUNDATION
   ═══════════════════════════════════════════════════════ */

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

:root {
    --bg: #08090a;
    --bg-elevated: #0e1012;
    --bg-card: #111316;
    --bg-card-hover: #161a1d;
    --surface: #1c2025;
    --border: rgba(255,255,255,0.06);
    --border-hover: rgba(255,255,255,0.12);
    --text: #eaedf0;
    --text-secondary: #8b929e;
    --text-muted: #4d5565;
    --accent: #6ee7b7;
    --accent-dim: #34d399;
    --accent-bright: #a7f3d0;
    --accent-gradient: linear-gradient(135deg, #6ee7b7 0%, #3b82f6 100%);
    --accent-gradient-subtle: linear-gradient(135deg, rgba(110,231,183,0.12) 0%, rgba(59,130,246,0.08) 100%);
    --accent-glow: rgba(110, 231, 183, 0.08);
    --blue: #3b82f6;
    --blue-dim: #2563eb;
    --heading: 'Sora', sans-serif;
    --body: 'Outfit', sans-serif;
    --mono: 'Fira Code', monospace;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --max-w: 1200px;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scrollbar-width: thin;
    scrollbar-color: var(--surface) var(--bg);
}

body {
    font-family: var(--body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
    font-size: 15px;
    font-weight: 400;
}

::selection { background: rgba(110,231,183,0.2); color: #fff; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface); border-radius: 3px; }

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

/* ═══════════════════════════════════════════════════════
   NOISE OVERLAY
   ═══════════════════════════════════════════════════════ */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 256px;
}

/* ═══════════════════════════════════════════════════════
   SCROLL REVEAL
   ═══════════════════════════════════════════════════════ */
.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ═══════════════════════════════════════════════════════
   NAVBAR
   ═══════════════════════════════════════════════════════ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0 40px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(8,9,10,0.7);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border-bottom: 1px solid var(--border);
    transition: background 0.3s;
}
.nav-logo {
    font-family: var(--heading);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: var(--text);
}
.nav-logo span { color: var(--accent); }
.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}
.nav-links a {
    font-family: var(--heading);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
    transition: color 0.3s;
    position: relative;
}
.nav-links a:hover { color: var(--text); }
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--accent);
    transition: width 0.3s var(--ease-out-expo);
}
.nav-links a:hover::after { width: 100%; }

.lang-toggle {
    display: flex;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow: hidden;
}
.lang-btn {
    padding: 6px 14px;
    font-family: var(--heading);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 0.5px;
}
.lang-btn.active {
    background: var(--accent);
    color: var(--bg);
}

/* Mobile nav */
.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px;
}
.nav-hamburger span {
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s;
}
.nav-mobile {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(8,9,10,0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 24px 40px;
    z-index: 999;
}
.nav-mobile.open { display: flex; flex-direction: column; gap: 20px; }
.nav-mobile a {
    font-family: var(--heading);
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
}

@media (max-width: 900px) {
    .nav-links { display: none; }
    .nav-hamburger { display: flex; }
    .nav { padding: 0 24px; }
}

/* ═══════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 40px 80px;
    position: relative;
    overflow: hidden;
}
.hero-grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(110,231,183,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(110,231,183,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 70%);
}
.hero-glow {
    position: absolute;
    top: -200px;
    right: -100px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(110,231,183,0.06) 0%, transparent 70%);
    pointer-events: none;
}
.hero-glow-2 {
    position: absolute;
    bottom: -150px;
    left: -100px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(59,130,246,0.04) 0%, transparent 70%);
    pointer-events: none;
}
.hero-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 80px;
    position: relative;
    z-index: 1;
}
.hero-content { flex: 1; }
.hero-photo-area {
    flex-shrink: 0;
    width: 480px;
    height: 420px;
    border-radius: var(--radius-xl);
    border: 2px solid var(--border);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    margin-top: -80px;
    cursor: none;
}
.hero-photo-area img.hero-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* Dark overlay that hides the photo */
.hero-photo-overlay {
    position: absolute;
    inset: 0;
    background: var(--bg-card);
    z-index: 2;
    pointer-events: none;
    -webkit-mask-image: radial-gradient(circle 0px at -100px -100px, transparent 0%, transparent 100%, black 100%);
    mask-image: radial-gradient(circle 0px at -100px -100px, transparent 0%, transparent 100%, black 100%);
}
/* Grid pattern on the overlay */
.hero-photo-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(110,231,183,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(110,231,183,0.04) 1px, transparent 1px);
    background-size: 30px 30px;
}
/* Noise texture on overlay */
.hero-photo-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 256px;
}
/* Logo shown when not revealed */
.hero-photo-logo {
    position: absolute;
    z-index: 3;
    font-family: var(--heading);
    font-size: 52px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -2px;
    user-select: none;
    pointer-events: none;
    transition: opacity 0.6s ease;
}
.hero-photo-logo .dot {
    color: var(--accent);
}
.hero-photo-area:hover .hero-photo-logo,
.hero-photo-area.revealed .hero-photo-logo {
    opacity: 0;
}
/* Hint label */
.hero-photo-hint {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--mono);
    background: rgba(0,0,0,0.6);
    padding: 4px 12px;
    border-radius: 20px;
    white-space: nowrap;
    z-index: 4;
    pointer-events: none;
    transition: opacity 0.6s ease;
}
.hero-photo-area:hover .hero-photo-hint,
.hero-photo-area.revealed .hero-photo-hint {
    opacity: 0;
}
/* Custom cursor glow that follows mouse */
.hero-photo-cursor {
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 1px solid rgba(110,231,183,0.12);
    pointer-events: none;
    z-index: 5;
    transform: translate(-50%, -50%);
    opacity: 0;
    box-shadow: 0 0 40px rgba(110,231,183,0.05);
}
.hero-photo-area:hover .hero-photo-cursor {
    opacity: 1;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--accent-gradient-subtle);
    border: 1px solid rgba(110,231,183,0.15);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 28px;
    font-family: var(--heading);
}
.hero-badge i { width: 16px; height: 16px; }
.hero-title {
    font-family: var(--heading);
    font-size: clamp(40px, 5.5vw, 68px);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -2px;
    margin-bottom: 24px;
    color: var(--text);
}
.hero-title .gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-subtitle {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 520px;
    margin-bottom: 36px;
    font-weight: 400;
}
.hero-ctas {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--accent);
    color: var(--bg);
    font-family: var(--heading);
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 0.2px;
}
.btn-primary:hover { background: var(--accent-bright); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(110,231,183,0.2); }
.btn-primary i { width: 16px; height: 16px; }
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: transparent;
    color: var(--text);
    font-family: var(--heading);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-hover);
    cursor: pointer;
    transition: all 0.3s;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn-secondary i { width: 16px; height: 16px; }
.hero-stats {
    display: flex;
    gap: 48px;
    margin-top: 56px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}
.hero-stat-value {
    font-family: var(--heading);
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -1px;
}
.hero-stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Mobile photo reveal button */
.hero-photo-mobile-btn {
    display: none;
}
@media (max-width: 900px) {
    .hero { padding: 100px 24px 60px; }
    .hero-inner { flex-direction: column-reverse; gap: 32px; text-align: center; }
    .hero-photo-area {
        display: none;
        width: 220px;
        height: 280px;
        margin: 0 auto;
        border-radius: var(--radius-xl);
    }
    .hero-photo-area.mobile-visible {
        display: flex;
    }
    .hero-photo-logo { font-size: 32px; letter-spacing: -1px; }
    .hero-photo-cursor { display: none; }
    .hero-photo-hint span[data-en],
    .hero-photo-hint span[data-es] { display: none; }
    .hero-photo-hint::after { content: '// tap to reveal'; }
    [data-lang="es"] .hero-photo-hint::after { content: '// toca para ver'; }
    .hero-photo-mobile-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 10px 20px;
        background: transparent;
        border: 1px solid var(--border);
        border-radius: 100px;
        color: var(--text-secondary);
        font-family: var(--mono);
        font-size: 12px;
        cursor: pointer;
        transition: all 0.3s ease;
        margin: 0 auto;
    }
    .hero-photo-mobile-btn:hover {
        border-color: var(--accent);
        color: var(--accent);
    }
    .hero-photo-mobile-btn i {
        width: 16px;
        height: 16px;
    }
    .hero-photo-mobile-btn.active {
        border-color: var(--accent);
        color: var(--accent);
    }
    .hero-subtitle { margin-left: auto; margin-right: auto; }
    .hero-ctas { justify-content: center; }
    .hero-stats { justify-content: center; gap: 32px; }
}

/* ═══════════════════════════════════════════════════════
   SECTION COMMONS
   ═══════════════════════════════════════════════════════ */
.section {
    padding: 100px 40px;
    max-width: var(--max-w);
    margin: 0 auto;
}
.section-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 16px;
}
.section-label i { width: 16px; height: 16px; }
.section-title {
    font-family: var(--heading);
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 700;
    letter-spacing: -1.5px;
    margin-bottom: 20px;
    color: var(--text);
}
.section-desc {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 600px;
    line-height: 1.7;
    margin-bottom: 48px;
}
.section-divider {
    border: none;
    height: 1px;
    background: var(--border);
    max-width: var(--max-w);
    margin: 0 auto;
}

@media (max-width: 768px) {
    .section { padding: 60px 24px; }
}

/* ═══════════════════════════════════════════════════════
   ABOUT
   ═══════════════════════════════════════════════════════ */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}
.about-text {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.8;
}
.about-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.about-card {
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all 0.3s;
}
.about-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}
.about-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    background: var(--accent-gradient-subtle);
    border: 1px solid rgba(110,231,183,0.1);
}
.about-card-icon i { width: 20px; height: 20px; color: var(--accent); }
.about-card h4 {
    font-family: var(--heading);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}
.about-card p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

@media (max-width: 768px) {
    .about-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* ═══════════════════════════════════════════════════════
   AI & ARCHITECTURE
   ═══════════════════════════════════════════════════════ */
.ai-section-bg {
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.ai-header {
    display: flex;
    align-items: flex-start;
    gap: 48px;
    margin-bottom: 48px;
}
.ai-header-text { flex: 1; }
.ai-diagram {
    flex-shrink: 0;
    width: 340px;
    padding: 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.8;
    white-space: pre;
    overflow-x: auto;
}
.ai-diagram .hl { color: var(--accent); }
.ai-diagram .bl { color: var(--blue); }
.ai-pillars {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 48px;
}
.ai-pillar {
    padding: 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all 0.3s;
}
.ai-pillar:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.ai-pillar-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    background: var(--accent-gradient-subtle);
    border: 1px solid rgba(110,231,183,0.1);
}
.ai-pillar-icon i { width: 22px; height: 22px; color: var(--accent); }
.ai-pillar h4 {
    font-family: var(--heading);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text);
}
.ai-pillar p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}
.ai-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.ai-tool-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-family: var(--heading);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s;
}
.ai-tool-chip:hover { border-color: var(--accent); color: var(--accent); }
.ai-tool-chip i { width: 16px; height: 16px; }

@media (max-width: 900px) {
    .ai-header { flex-direction: column; gap: 24px; }
    .ai-diagram { width: 100%; }
    .ai-pillars { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════
   EXPERIENCE TIMELINE
   ═══════════════════════════════════════════════════════ */
.timeline { position: relative; }
.timeline::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border);
}
.timeline-item {
    position: relative;
    padding-left: 68px;
    padding-bottom: 48px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
    position: absolute;
    left: 16px;
    top: 6px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--accent);
    z-index: 1;
}
.timeline-dot::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--accent);
}
.timeline-date {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--accent);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}
.timeline-role {
    font-family: var(--heading);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text);
    letter-spacing: -0.5px;
}
.timeline-company {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 14px;
    font-weight: 500;
}
.timeline-company a {
    color: var(--accent-dim);
    transition: color 0.3s;
}
.timeline-company a:hover { color: var(--accent); }
.timeline-details {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.timeline-details li {
    font-size: 14px;
    color: var(--text-secondary);
    padding-left: 20px;
    position: relative;
    line-height: 1.6;
}
.timeline-details li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 1px;
    background: var(--text-muted);
}
.timeline-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 14px;
}
.timeline-tech span {
    font-family: var(--mono);
    font-size: 11px;
    padding: 4px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .timeline::before { left: 12px; }
    .timeline-item { padding-left: 44px; }
    .timeline-dot { left: 4px; }
}

/* ═══════════════════════════════════════════════════════
   PROJECTS
   ═══════════════════════════════════════════════════════ */
.project-featured {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}
.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all 0.4s var(--ease-out-expo);
}
.project-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
.project-card-image {
    width: 100%;
    height: 220px;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}
.project-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.project-card-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
}
.project-card-image-placeholder i { width: 48px; height: 48px; opacity: 0.3; }
.project-card-image-placeholder span { font-size: 12px; font-family: var(--mono); }
.project-card-body { padding: 28px; }
.project-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.project-card-title {
    font-family: var(--heading);
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.5px;
}
.project-card-links {
    display: flex;
    gap: 8px;
}
.project-card-links a {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: all 0.3s;
}
.project-card-links a:hover { border-color: var(--accent); color: var(--accent); }
.project-card-links a i { width: 16px; height: 16px; }
.project-card-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
}
.project-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.project-tag {
    font-family: var(--mono);
    font-size: 11px;
    padding: 4px 10px;
    background: var(--accent-gradient-subtle);
    border: 1px solid rgba(110,231,183,0.1);
    border-radius: 6px;
    color: var(--accent);
}
.project-card.featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
}
.project-card.featured .project-card-image {
    height: 100%;
    min-height: 320px;
    border-bottom: none;
    border-right: 1px solid var(--border);
}
.project-card.featured .project-card-body {
    padding: 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.project-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(110,231,183,0.08);
    border: 1px solid rgba(110,231,183,0.15);
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 16px;
    font-family: var(--heading);
    width: fit-content;
}
.project-badge i { width: 14px; height: 14px; }
.project-stores {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}
.store-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s;
    font-family: var(--heading);
}
.store-badge:hover { border-color: var(--accent); color: var(--accent); }
.store-badge i { width: 18px; height: 18px; }

@media (max-width: 768px) {
    .project-featured { grid-template-columns: 1fr; }
    .project-card.featured { grid-template-columns: 1fr; }
    .project-card.featured .project-card-image {
        min-height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
}

/* ═══════════════════════════════════════════════════════
   TECH STACK
   ═══════════════════════════════════════════════════════ */
.tech-section-bg {
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.tech-categories {
    display: flex;
    flex-direction: column;
    gap: 36px;
}
.tech-category-label {
    font-family: var(--heading);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 16px;
}
.tech-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.tech-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all 0.3s;
    cursor: default;
}
.tech-item:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}
.tech-item i {
    font-size: 22px;
    color: var(--accent);
}
.tech-item span {
    font-family: var(--heading);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════
   TESTIMONIALS
   ═══════════════════════════════════════════════════════ */
.testimonials-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.testimonial-card {
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}
.testimonial-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.testimonial-quote-icon {
    color: var(--accent);
    margin-bottom: 16px;
    opacity: 0.4;
}
.testimonial-quote-icon i { width: 28px; height: 28px; }
.testimonial-text {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 24px;
    font-style: italic;
    flex: 1;
}
.testimonial-author {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    margin-top: auto;
}
.testimonial-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent-gradient-subtle);
    border: 1px solid rgba(110,231,183,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--heading);
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
}
.testimonial-name {
    font-family: var(--heading);
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}
.testimonial-role {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

@media (max-width: 768px) {
    .testimonials-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════
   EDUCATION
   ═══════════════════════════════════════════════════════ */
.education-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.education-card {
    padding: 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.education-card-date {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--accent);
    margin-bottom: 10px;
}
.education-card h4 {
    font-family: var(--heading);
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.education-card p {
    font-size: 14px;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .education-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════
   CONTACT
   ═══════════════════════════════════════════════════════ */
.contact-section-bg {
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
}
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}
.contact-info-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.contact-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all 0.3s;
}
.contact-item:hover { border-color: var(--border-hover); transform: translateX(4px); }
.contact-item-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient-subtle);
    border: 1px solid rgba(110,231,183,0.1);
    flex-shrink: 0;
}
.contact-item-icon i { width: 18px; height: 18px; color: var(--accent); }
.contact-item-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 2px;
}
.contact-item-value {
    font-family: var(--heading);
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}
.contact-socials {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.contact-social-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all 0.3s;
}
.contact-social-link:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.contact-social-link i { width: 22px; height: 22px; color: var(--accent); }
.contact-social-link span {
    font-family: var(--heading);
    font-size: 15px;
    font-weight: 500;
}
.contact-social-link .arrow {
    margin-left: auto;
    color: var(--text-muted);
    transition: transform 0.3s;
}
.contact-social-link:hover .arrow { transform: translateX(4px); color: var(--accent); }

@media (max-width: 768px) {
    .contact-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════ */
.footer {
    padding: 32px 40px;
    text-align: center;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
}
.footer a { color: var(--accent-dim); transition: color 0.3s; }
.footer a:hover { color: var(--accent); }

/* ═══════════════════════════════════════════════════════
   BILINGUAL SUPPORT
   ═══════════════════════════════════════════════════════ */
[data-lang="en"] [data-es] { display: none; }
[data-lang="es"] [data-en] { display: none; }

/* ═══════════════════════════════════════════════════════
   THEME TOGGLE
   ═══════════════════════════════════════════════════════ */
.theme-toggle {
    height: 30px;
    width: 30px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-muted);
    flex-shrink: 0;
    padding: 6px;
}
.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.theme-toggle i { width: 8px; height: 8px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

/* ═══════════════════════════════════════════════════════
   LIGHT MODE
   ═══════════════════════════════════════════════════════ */
[data-theme="light"] {
    --bg: #faf9f7;
    --bg-elevated: #f3f1ee;
    --bg-card: #ffffff;
    --bg-card-hover: #f7f6f3;
    --surface: #ebe8e4;
    --border: rgba(0,0,0,0.07);
    --border-hover: rgba(0,0,0,0.14);
    --text: #1c1917;
    --text-secondary: #57534e;
    --text-muted: #a8a29e;
    --accent: #0d7c5f;
    --accent-dim: #0a6b52;
    --accent-bright: #10b981;
    --accent-gradient: linear-gradient(135deg, #0d7c5f 0%, #1d4ed8 100%);
    --accent-gradient-subtle: linear-gradient(135deg, rgba(13,124,95,0.06) 0%, rgba(29,78,216,0.04) 100%);
    --accent-glow: rgba(13, 124, 95, 0.05);
}
[data-theme="light"] body::before { opacity: 0; }
[data-theme="light"] .nav {
    background: rgba(250,249,247,0.85);
    border-bottom-color: rgba(0,0,0,0.06);
}
[data-theme="light"] .nav-mobile {
    background: rgba(250,249,247,0.97);
}
[data-theme="light"] .hero-grid-bg {
    background-image:
        linear-gradient(rgba(13,124,95,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(13,124,95,0.04) 1px, transparent 1px);
}
[data-theme="light"] .hero-glow {
    background: radial-gradient(circle, rgba(13,124,95,0.05) 0%, transparent 70%);
}
[data-theme="light"] .hero-glow-2 {
    background: radial-gradient(circle, rgba(29,78,216,0.03) 0%, transparent 70%);
}
[data-theme="light"] ::selection {
    background: rgba(13,124,95,0.15);
    color: #1c1917;
}
[data-theme="light"] ::-webkit-scrollbar-thumb { background: #d6d3d1; }
[data-theme="light"] .hero-photo-area {
    border-color: rgba(0,0,0,0.08);
    box-shadow: 0 8px 32px rgba(0,0,0,0.06);
}
[data-theme="light"] .hero-photo-overlay {
    background: var(--bg-card);
}
[data-theme="light"] .hero-photo-overlay::before {
    background-image:
        linear-gradient(rgba(13,124,95,0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(13,124,95,0.06) 1px, transparent 1px);
}
[data-theme="light"] .hero-photo-logo .dot {
    color: #0d7c5f;
}
[data-theme="light"] .hero-photo-cursor {
    border-color: rgba(13,124,95,0.2);
    box-shadow: 0 0 30px rgba(13,124,95,0.08);
}
[data-theme="light"] .gradient-text {
    background: linear-gradient(135deg, #0d7c5f 0%, #1d4ed8 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
}
[data-theme="light"] .hero-badge {
    background: rgba(13,124,95,0.06);
    border-color: rgba(13,124,95,0.12);
}
[data-theme="light"] .btn-primary {
    background: #0d7c5f;
    color: #fff;
}
[data-theme="light"] .btn-primary:hover {
    background: #0a6b52;
    box-shadow: 0 8px 24px rgba(13,124,95,0.2);
}
[data-theme="light"] .about-card {
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
[data-theme="light"] .about-card-icon,
[data-theme="light"] .ai-pillar-icon,
[data-theme="light"] .contact-item-icon {
    background: rgba(13,124,95,0.06);
    border-color: rgba(13,124,95,0.1);
}
[data-theme="light"] .ai-diagram {
    background: #f3f1ee;
    border-color: rgba(0,0,0,0.06);
}
[data-theme="light"] .ai-diagram .hl { color: #0d7c5f; }
[data-theme="light"] .ai-diagram .bl { color: #1d4ed8; }
[data-theme="light"] .ai-pillar,
[data-theme="light"] .ai-tool-chip {
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}
[data-theme="light"] .project-tag {
    background: rgba(13,124,95,0.06);
    border-color: rgba(13,124,95,0.12);
    color: #0d7c5f;
}
[data-theme="light"] .project-card {
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
[data-theme="light"] .project-card:hover {
    box-shadow: 0 12px 32px rgba(0,0,0,0.08);
}
[data-theme="light"] .timeline-dot {
    background: var(--bg);
    border-color: #0d7c5f;
}
[data-theme="light"] .timeline-dot::after { background: #0d7c5f; }
[data-theme="light"] .timeline-tech span {
    background: #f3f1ee;
    border-color: rgba(0,0,0,0.06);
    color: var(--text-secondary);
}
[data-theme="light"] .tech-item {
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}
[data-theme="light"] .tech-item i { color: #0d7c5f; }
[data-theme="light"] .testimonial-card {
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
[data-theme="light"] .testimonial-avatar {
    background: rgba(13,124,95,0.06);
    border-color: rgba(13,124,95,0.15);
    color: #0d7c5f;
}
[data-theme="light"] .education-card {
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}
[data-theme="light"] .contact-item,
[data-theme="light"] .contact-social-link {
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}
[data-theme="light"] .section-divider {
    background: rgba(0,0,0,0.06);
}
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .store-badge { background: #f3f1ee; }
[data-theme="light"] .lang-btn.active { color: #fff; background: #0d7c5f; }

/* ═══════════════════════════════════════════════════════
   ADMIN PANEL
   ═══════════════════════════════════════════════════════ */
#portfolio-app { display: block; }
#admin-app { display: none; }
body.admin-mode #portfolio-app { display: none; }
body.admin-mode #admin-app { display: block; }
body.admin-mode .nav { display: none; }
body.admin-mode .nav-mobile { display: none; }

.admin-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg);
}
.admin-login-card {
    width: 100%;
    max-width: 400px;
    padding: 40px 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
}
.admin-login-card h2 {
    font-family: var(--heading);
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}
.admin-login-card p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 28px;
}
.admin-field {
    margin-bottom: 16px;
}
.admin-field label {
    display: block;
    font-family: var(--heading);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.admin-field input,
.admin-field textarea,
.admin-field select {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--body);
    font-size: 14px;
    transition: border-color 0.3s;
    outline: none;
}
.admin-field input:focus,
.admin-field textarea:focus,
.admin-field select:focus {
    border-color: var(--accent);
}
.admin-field textarea {
    min-height: 80px;
    resize: vertical;
}
.admin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: var(--heading);
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s;
}
.admin-btn-primary {
    background: var(--accent);
    color: var(--bg);
    width: 100%;
}
.admin-btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}
.admin-btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}
.admin-btn-secondary:hover {
    border-color: var(--accent);
}
.admin-btn-danger {
    background: transparent;
    color: #ef4444;
    border: 1px solid rgba(239,68,68,0.3);
    padding: 8px 14px;
    font-size: 12px;
}
.admin-btn-danger:hover {
    background: rgba(239,68,68,0.1);
}
.admin-btn-sm {
    padding: 8px 14px;
    font-size: 12px;
}
.admin-error {
    color: #ef4444;
    font-size: 13px;
    margin-top: 12px;
    display: none;
}

/* Admin Dashboard */
.admin-dashboard {
    min-height: 100vh;
    background: var(--bg);
}
.admin-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(20px);
}
.admin-header h3 {
    font-family: var(--heading);
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}
.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Tabs */
.admin-tabs {
    display: flex;
    gap: 4px;
    padding: 12px 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tab {
    flex-shrink: 0;
    padding: 8px 16px;
    font-family: var(--heading);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}
.admin-tab:hover { color: var(--text-secondary); }
.admin-tab.active {
    color: var(--accent);
    background: var(--accent-gradient-subtle);
    border-color: rgba(110,231,183,0.15);
}

/* Content area */
.admin-content {
    padding: 24px;
    max-width: 900px;
    margin: 0 auto;
}
.admin-section { display: none; }
.admin-section.active { display: block; }

/* Card list */
.admin-card-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 80px;
}
.admin-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    gap: 12px;
}
.admin-card-info { flex: 1; min-width: 0; }
.admin-card-title {
    font-family: var(--heading);
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.admin-card-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}
.admin-card-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.admin-card-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
}
.admin-card-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.admin-card-btn.delete:hover {
    border-color: #ef4444;
    color: #ef4444;
}
.admin-sort-handle {
    cursor: grab;
    color: var(--text-muted);
    font-size: 18px;
    padding: 0 4px;
}

/* Floating action button */
.admin-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--bg);
    border: none;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(110,231,183,0.3);
    transition: all 0.3s;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}
.admin-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(110,231,183,0.4);
}

/* Modal */
.admin-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 200;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.admin-modal-overlay.open {
    display: flex;
}
.admin-modal {
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    overflow-y: auto;
    animation: slideUp 0.3s var(--ease-out-expo);
}
@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.admin-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
}
.admin-modal-header h3 {
    font-family: var(--heading);
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}
.admin-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
}
.admin-modal-close:hover { border-color: var(--accent); color: var(--accent); }
.admin-modal-body {
    padding: 24px;
}
.admin-modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    position: sticky;
    bottom: 0;
    background: var(--bg-card);
}
.admin-modal-footer .admin-btn { flex: 1; }

/* Toast */
.admin-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    background: var(--accent);
    color: var(--bg);
    font-family: var(--heading);
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    z-index: 300;
    transition: transform 0.3s var(--ease-out-expo);
    pointer-events: none;
}
.admin-toast.show {
    transform: translateX(-50%) translateY(0);
}
.admin-toast.error {
    background: #ef4444;
    color: #fff;
}

/* Empty state */
.admin-empty {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
    font-size: 14px;
}
.admin-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

/* Image upload */
.admin-img-upload {
    display: flex;
    align-items: center;
    gap: 16px;
}
.admin-img-preview {
    width: 80px;
    height: 60px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    object-fit: cover;
}
.admin-img-upload input[type="file"] { display: none; }
.admin-img-upload-btn {
    padding: 8px 16px;
    font-family: var(--heading);
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-gradient-subtle);
    border: 1px solid rgba(110,231,183,0.15);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s;
}
.admin-img-upload-btn:hover { border-color: var(--accent); }

/* Config key-value */
.admin-kv-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: flex-start;
}
.admin-kv-row .admin-field { flex: 1; margin-bottom: 0; }
.admin-kv-row .admin-field:first-child { flex: 0 0 180px; }

/* Responsive: desktop modal centering */
@media (min-width: 601px) {
    .admin-modal-overlay {
        align-items: center;
    }
    .admin-modal {
        border-radius: var(--radius-xl);
        max-height: 85vh;
    }
    .admin-content {
        padding: 32px;
    }
    .admin-card-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
}

/* Light mode adjustments */
[data-theme="light"] .admin-login-card,
[data-theme="light"] .admin-card,
[data-theme="light"] .admin-modal {
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
[data-theme="light"] .admin-fab {
    background: #0d7c5f;
    box-shadow: 0 8px 24px rgba(13,124,95,0.25);
}
[data-theme="light"] .admin-toast {
    background: #0d7c5f;
    color: #fff;
}
[data-theme="light"] .admin-tab.active {
    background: rgba(13,124,95,0.06);
    border-color: rgba(13,124,95,0.12);
    color: #0d7c5f;
}

/* ═══════════════════════════════════════════════════════
   UTILITY CLASSES (extracted from inline styles)
   ═══════════════════════════════════════════════════════ */
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-mobile-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.section-pb-lg { padding-bottom: 80px; }
.section-desc-mb { margin-bottom: 24px; }
.section-label-mt { margin-top: 12px; }
.ai-tools-mt { margin-top: 20px; }
.admin-hidden { display: none; }
.admin-back-container { text-align: center; margin-top: 20px; }
.admin-back-link { color: var(--text-muted); font-size: 13px; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }
.icon-xs { width: 14px; height: 14px; }
.icon-admin { font-size: 18px; margin-right: 8px; }
.admin-img-placeholder { display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 11px; }
.admin-config-hint { margin-bottom: 16px; font-size: 13px; color: var(--text-muted); }
.admin-card-config { flex-direction: column; align-items: stretch; gap: 10px; }
.admin-card-config-header { display: flex; align-items: center; justify-content: space-between; }
.admin-card-key { font-size: 12px; font-family: var(--mono); color: var(--accent); }
.admin-tag-suggested { font-size: 10px; color: var(--text-muted); background: var(--surface); padding: 2px 8px; border-radius: 4px; }
.admin-field-compact { margin: 0; }

/* ═══════════════════════════════════════════════════════
   CLAUDE CODE LAB
   ═══════════════════════════════════════════════════════ */

/* Trigger button inside AI section */
.lab-trigger-wrap { margin-top: 32px; }
.lab-trigger-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(110,231,183,0.06) 0%, rgba(59,130,246,0.04) 100%);
    border: 1px solid rgba(110,231,183,0.15);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.4s var(--ease-out-expo);
    text-align: left;
}
.lab-trigger-btn:hover {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(110,231,183,0.1) 0%, rgba(59,130,246,0.06) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(110,231,183,0.1);
}
.lab-trigger-icon {
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(110,231,183,0.1);
    border-radius: var(--radius-md);
    color: var(--accent);
    flex-shrink: 0;
}
.lab-trigger-icon svg { width: 22px; height: 22px; }
.lab-trigger-text { flex: 1; }
.lab-trigger-title {
    font-family: var(--heading);
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    display: block;
    margin-bottom: 4px;
}
.lab-trigger-sub {
    font-size: 13px;
    color: var(--text-secondary);
    display: block;
}
.lab-trigger-arrow {
    color: var(--accent);
    opacity: 0.6;
    transition: all 0.3s;
    margin-right: 10px;
}
.lab-trigger-btn:hover .lab-trigger-arrow { opacity: 1; transform: translateX(4px); }
.lab-trigger-arrow svg { width: 20px; height: 20px; }

/* Fullscreen overlay */
.lab-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(12px);
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: labFadeIn 0.3s ease;
}
.lab-overlay.open { display: flex; }
@keyframes labFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lab-modal {
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    animation: labSlideUp 0.4s var(--ease-out-expo);
    box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}
@keyframes labSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.lab-modal-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
    background: var(--bg-elevated);
}
.lab-modal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--heading);
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    flex: 1;
}
.lab-modal-title svg { width: 18px; height: 18px; color: var(--accent); }

.lab-modal-score {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text-muted);
}
.lab-score-val {
    color: var(--accent);
    font-weight: 700;
    font-size: 16px;
    min-width: 24px;
    text-align: right;
}

.lab-modal-close {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}
.lab-modal-close:hover { color: var(--text); border-color: var(--border-hover); }
.lab-modal-close svg { width: 16px; height: 16px; }

/* Mission selector */
.lab-mission-select {
    padding: 32px 24px;
    overflow-y: auto;
}
.lab-mission-select h3 {
    font-family: var(--heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}
.lab-mission-select-sub {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}
.lab-mission-cards { display: flex; flex-direction: column; gap: 12px; }
.lab-mission-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
    text-align: left;
}
.lab-mission-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateX(4px);
}
.lab-mc-icon {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface);
    border-radius: var(--radius-md);
    color: var(--accent);
    flex-shrink: 0;
}
.lab-mc-icon svg { width: 18px; height: 18px; }
.lab-mc-body { flex: 1; }
.lab-mc-title {
    font-family: var(--heading);
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}
.lab-mc-desc { font-size: 13px; color: var(--text-secondary); }
.lab-mc-diff {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 4px 10px;
    background: var(--surface);
    border-radius: 20px;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Terminal inside modal */
.lab-terminal-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}
.lab-terminal {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}
.lab-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #111418;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.lab-dots { display: flex; gap: 8px; }
.lab-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--surface); }
.lab-dot-red { background: #ff5f57; }
.lab-dot-yellow { background: #febc2e; }
.lab-dot-green { background: #28c840; }
.lab-title {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}
.lab-output {
    flex: 1;
    padding: 16px 20px;
    overflow-y: auto;
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-secondary);
    scroll-behavior: smooth;
    min-height: 200px;
    max-height: 50vh;
}
.lab-output .lab-line {
    opacity: 0;
    transform: translateY(4px);
    animation: labLineIn 0.3s ease forwards;
    white-space: pre-wrap;
    word-break: break-word;
}
@keyframes labLineIn {
    to { opacity: 1; transform: translateY(0); }
}
.lab-output .t-green { color: var(--accent); }
.lab-output .t-blue { color: var(--blue); }
.lab-output .t-dim { color: var(--text-muted); }
.lab-output .t-bold { color: var(--text); font-weight: 600; }
.lab-output .t-red { color: #ef4444; }
.lab-output .t-yellow { color: #febc2e; }
.lab-output .t-cmd { color: var(--accent-bright); font-weight: 600; }

/* Choice buttons */
.lab-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 20px 16px;
    flex-shrink: 0;
}
.lab-choices:empty { display: none; padding: 0; }
.lab-choice-btn {
    padding: 10px 18px;
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.25s var(--ease-out-expo);
    text-align: left;
    flex: 1;
    min-width: 180px;
}
.lab-choice-btn:hover {
    border-color: var(--accent);
    background: rgba(110,231,183,0.06);
    color: var(--accent);
}
.lab-choice-btn.correct {
    border-color: var(--accent);
    background: rgba(110,231,183,0.1);
    color: var(--accent);
    pointer-events: none;
}
.lab-choice-btn.wrong {
    border-color: #ef4444;
    background: rgba(239,68,68,0.08);
    color: #ef4444;
    pointer-events: none;
}
.lab-choice-btn.disabled {
    opacity: 0.4;
    pointer-events: none;
}
.lab-choice-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 4px;
    font-family: var(--body);
}

/* Input line */
.lab-input-line {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    background: #0d0f12;
    gap: 8px;
    flex-shrink: 0;
}
.lab-prompt {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
    user-select: none;
}
.lab-input {
    flex: 1;
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text);
    background: transparent;
    border: none;
    outline: none;
    caret-color: var(--accent);
}
.lab-input::placeholder { color: var(--text-muted); opacity: 0.5; }
.lab-cursor {
    width: 8px; height: 16px;
    background: var(--accent);
    opacity: 0.7;
    animation: labBlink 1s step-end infinite;
    border-radius: 1px;
    flex-shrink: 0;
}
@keyframes labBlink { 50% { opacity: 0; } }

/* Mission complete */
.lab-complete {
    padding: 48px 32px;
    text-align: center;
}
.lab-complete-icon {
    width: 64px; height: 64px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
    font-size: 28px;
    background: rgba(110,231,183,0.1);
    border: 2px solid var(--accent);
    border-radius: 50%;
    color: var(--accent);
}
.lab-complete h3 {
    font-family: var(--heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}
.lab-complete p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}
.lab-complete-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--heading);
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 28px;
}
.lab-complete-score strong {
    font-size: 32px;
    color: var(--accent);
    font-weight: 700;
}
.lab-complete-max { color: var(--text-muted); font-size: 18px; }
.lab-complete-actions { display: flex; gap: 12px; justify-content: center; }
.lab-btn-secondary {
    padding: 12px 24px;
    font-family: var(--heading);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s;
}
.lab-btn-secondary:hover { color: var(--text); border-color: var(--border-hover); }
.lab-btn-primary {
    padding: 12px 24px;
    font-family: var(--heading);
    font-size: 14px;
    font-weight: 600;
    color: #000;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-md);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
}
.lab-btn-primary:hover { background: var(--accent-bright); transform: translateY(-1px); }

/* Responsive */
@media (max-width: 600px) {
    .lab-modal { max-height: 95vh; border-radius: var(--radius-lg); }
    .lab-mission-select { padding: 24px 16px; }
    .lab-output { padding: 12px 14px; font-size: 12px; max-height: 40vh; }
    .lab-choices { padding: 0 14px 12px; }
    .lab-choice-btn { min-width: 100%; font-size: 12px; padding: 10px 14px; }
    .lab-input-line { padding: 10px 14px; }
    .lab-trigger-btn { padding: 16px; gap: 12px; }
    .lab-trigger-title { font-size: 14px; }
    .lab-complete { padding: 32px 20px; }
}

/* ── Lab: Progress bar ── */
.lab-progress-wrap {
    padding: 0 20px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
    padding-top: 8px;
}
.lab-progress-bar {
    height: 4px;
    background: var(--surface);
    border-radius: 2px;
    overflow: hidden;
}
.lab-progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 2px;
    transition: width 0.6s var(--ease-out-expo);
    box-shadow: 0 0 8px rgba(110,231,183,0.3);
}
.lab-progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-muted);
}

/* ── Lab: Header right group ── */
.lab-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ── Lab: Streak counter ── */
.lab-streak {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--mono);
    font-size: 14px;
    font-weight: 700;
    color: #febc2e;
    padding: 4px 10px;
    background: rgba(254,188,46,0.08);
    border: 1px solid rgba(254,188,46,0.2);
    border-radius: 20px;
    animation: labStreakPulse 2s ease infinite;
}
.lab-streak-icon { font-size: 14px; }
@keyframes labStreakPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(254,188,46,0); }
    50% { box-shadow: 0 0 12px 2px rgba(254,188,46,0.15); }
}

/* ── Lab: Developer insight panel ── */
.lab-insight {
    margin: 0 16px 12px;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(110,231,183,0.04) 0%, rgba(59,130,246,0.03) 100%);
    border: 1px solid rgba(110,231,183,0.12);
    border-radius: var(--radius-md);
    max-height: 60vh;
    overflow-y: auto;
    overflow-x: hidden;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s var(--ease-out-expo), transform 0.4s var(--ease-out-expo);
}
.lab-insight.visible {
    opacity: 1;
    transform: translateY(0);
}
.lab-insight.hiding {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.lab-insight-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-shrink: 0;
}
.lab-insight-badge {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    color: var(--accent);
    background: rgba(110,231,183,0.1);
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.lab-insight-name {
    font-family: var(--heading);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.lab-insight-body {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.lab-insight-body p { margin: 0 0 10px; }
.lab-insight-body p:last-child { margin-bottom: 0; }

/* Insight: inline code */
.lab-insight-body code {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--accent);
    background: rgba(110,231,183,0.08);
    padding: 2px 5px;
    border-radius: 3px;
    word-break: break-all;
}

/* Insight: code block */
.lab-insight-code {
    font-family: var(--mono);
    font-size: 11px;
    line-height: 1.5;
    color: var(--text);
    background: #0a0c0e;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin: 10px 0;
    overflow-x: auto;
    white-space: pre;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

/* Insight: comparison bars */
.lab-insight-compare {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 10px 0;
}
.lab-insight-bar {
    display: grid;
    grid-template-columns: minmax(90px, 130px) minmax(60px, 120px) auto;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}
.lab-insight-bar-label {
    font-family: var(--mono);
    color: var(--text-secondary);
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.lab-insight-bar-track {
    height: 10px;
    background: var(--surface);
    border-radius: 5px;
    overflow: hidden;
    min-width: 50px;
}
.lab-insight-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s var(--ease-out-expo);
}
.lab-insight-bar-fill.bar-green { background: var(--accent); }
.lab-insight-bar-fill.bar-red { background: #ef4444; }
.lab-insight-bar-fill.bar-yellow { background: #febc2e; }
.lab-insight-bar-fill.bar-blue { background: var(--blue); }
.lab-insight-bar-fill.bar-dim { background: var(--text-muted); }
.lab-insight-bar-val {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-muted);
    text-align: right;
}

/* Insight: continue button */
.lab-continue-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
    padding: 10px 20px;
    font-family: var(--heading);
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    background: rgba(110,231,183,0.06);
    border: 1px solid rgba(110,231,183,0.15);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
}
.lab-continue-btn:hover {
    background: rgba(110,231,183,0.12);
    border-color: var(--accent);
    transform: translateY(-1px);
}
.lab-continue-key {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-muted);
    background: var(--surface);
    padding: 2px 8px;
    border-radius: 4px;
}

/* Insight badge color variants */
.lab-insight-badge.badge-correct {
    color: var(--accent);
    background: rgba(110,231,183,0.1);
}
.lab-insight-badge.badge-wrong {
    color: #ef4444;
    background: rgba(239,68,68,0.1);
}

/* ── Lab: Mission card meta ── */
.lab-mc-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}
.lab-mc-questions {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-muted);
}
.lab-mc-diff {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.lab-mc-diff-easy {
    color: var(--accent);
    background: rgba(110,231,183,0.08);
    border: 1px solid rgba(110,231,183,0.15);
}
.lab-mc-diff-medium {
    color: #febc2e;
    background: rgba(254,188,46,0.08);
    border: 1px solid rgba(254,188,46,0.15);
}
.lab-mc-diff-hard {
    color: #ef4444;
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.15);
}

/* ── Lab: Enhanced choice buttons ── */
.lab-choice-btn {
    position: relative;
    overflow: hidden;
}
.lab-choice-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(110,231,183,0.08) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.lab-choice-btn:hover::before { opacity: 1; }
.lab-choice-btn.correct {
    animation: labCorrectPop 0.4s var(--ease-out-expo);
}
@keyframes labCorrectPop {
    0% { transform: scale(1); }
    40% { transform: scale(1.03); }
    100% { transform: scale(1); }
}
.lab-choice-btn.wrong {
    animation: labWrongShake 0.4s ease;
}
@keyframes labWrongShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* ── Lab: Score ring (completion screen) ── */
.lab-complete-ring {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
}
.lab-ring-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.lab-ring-bg {
    fill: none;
    stroke: var(--surface);
    stroke-width: 6;
}
.lab-ring-fill {
    fill: none;
    stroke: url(#labGradient);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 326.73;
    stroke-dashoffset: 326.73;
    transition: stroke-dashoffset 1.2s var(--ease-out-expo);
    filter: drop-shadow(0 0 6px rgba(110,231,183,0.3));
}
.lab-ring-score {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--heading);
    font-size: 32px;
    font-weight: 700;
    color: var(--accent);
}

/* ── Lab: Stats bars ── */
.lab-complete-stats {
    max-width: 320px;
    margin: 0 auto 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.lab-stat-bar {
    display: grid;
    grid-template-columns: 80px 1fr 40px;
    align-items: center;
    gap: 10px;
}
.lab-stat-label {
    font-family: var(--heading);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}
.lab-stat-track {
    height: 6px;
    background: var(--surface);
    border-radius: 3px;
    overflow: hidden;
}
.lab-stat-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 1s var(--ease-out-expo) 0.3s;
}
.lab-stat-fill-blue { background: var(--blue); }
.lab-stat-fill-yellow { background: #febc2e; }
.lab-stat-pct {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    text-align: right;
}

/* ── Lab: Score val bounce ── */
.lab-score-val {
    transition: transform 0.2s var(--ease-out-expo);
}

/* ── Lab: Enhanced responsive ── */
@media (max-width: 600px) {
    .lab-insight { margin: 0 10px 10px; padding: 12px 14px; max-height: 50vh; }
    .lab-insight-body { font-size: 12px; }
    .lab-insight-bar { grid-template-columns: minmax(80px, 120px) minmax(50px, 100px) auto; gap: 8px; }
    .lab-insight-bar-label { font-size: 10px; }
    .lab-insight-code { font-size: 10px; padding: 8px 10px; }
    .lab-continue-btn { padding: 8px 16px; font-size: 12px; }
    .lab-progress-wrap { padding: 8px 14px; }
    .lab-stat-bar { grid-template-columns: 70px 1fr 36px; }
    .lab-complete-ring { width: 100px; height: 100px; }
    .lab-ring-score { font-size: 26px; }
    .lab-mc-meta { flex-direction: row; gap: 8px; }
    .lab-header-right { gap: 8px; }
    .lab-streak { padding: 3px 8px; font-size: 12px; }
}
