/* style.css */
:root {
    --bg-color: #070708;
    --bg-surface: #101012;
    --bg-surface-hover: #18181b;
    --bg-card: rgba(16, 16, 18, 0.7);
    
    --text-main: #fafafa;
    --text-muted: #a1a1aa;
    
    --accent-1: #3b82f6; /* Slate Blue */
    --accent-2: #8b5cf6; /* Tech Indigo */
    --accent-3: #10b981; /* Bio Mint */
    --accent-glow: rgba(59, 130, 246, 0.15);
    
    --border-color: rgba(255, 255, 255, 0.06);
    
    --glass-bg: rgba(7, 7, 8, 0.7);
    --glass-border: rgba(255, 255, 255, 0.05);
    
    --shadow-sm: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
    
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --trans-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    --trans-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);

    --nav-bg-rest: rgba(8, 10, 14, 0.84);
    --nav-bg-scrolled: rgba(8, 10, 14, 0.92);
    --nav-shadow-rest: 0 8px 24px rgba(0, 0, 0, 0.22);
    --nav-shadow-scrolled: 0 10px 28px rgba(0, 0, 0, 0.34);

    --hero-shell-bg:
        linear-gradient(140deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01) 30%, rgba(255, 255, 255, 0) 68%),
        rgba(8, 10, 16, 0.72);
    --hero-shell-border: rgba(255, 255, 255, 0.08);
    --hero-shell-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 36px 80px rgba(0, 0, 0, 0.32);

    --glass-card-bg:
        linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03) 30%, rgba(255, 255, 255, 0.01) 65%),
        rgba(10, 14, 23, 0.72);
    --glass-card-border: rgba(255, 255, 255, 0.11);
    --glass-card-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 22px 50px rgba(3, 7, 18, 0.35);

    --soft-surface: rgba(255, 255, 255, 0.04);
    --soft-surface-strong: rgba(255, 255, 255, 0.06);
    --soft-border: rgba(255, 255, 255, 0.08);
    --soft-border-strong: rgba(255, 255, 255, 0.15);

    --project-card-bg:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)),
        rgba(10, 12, 16, 0.88);
    --project-card-border: rgba(255, 255, 255, 0.1);
    --project-card-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
    --project-card-hover-border: rgba(148, 163, 184, 0.4);
    --project-card-hover-shadow: 0 24px 48px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(59, 130, 246, 0.18);

    --surface-lifted:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0)),
        rgba(10, 12, 18, 0.86);
    --surface-lifted-border: rgba(148, 163, 184, 0.2);
    --surface-lifted-shadow: 0 16px 34px rgba(2, 6, 23, 0.25);
    --surface-lifted-hover-shadow: 0 22px 42px rgba(2, 6, 23, 0.35);

    --project-stage-bg:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.14), transparent 42%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)),
        rgba(9, 11, 16, 0.9);
    --project-stage-border: rgba(148, 163, 184, 0.22);
    --project-stage-shadow: 0 28px 65px rgba(0, 0, 0, 0.38);
    --project-stage-bar-bg:
        linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0)),
        rgba(2, 6, 23, 0.42);
    --project-stage-note-bg: rgba(15, 23, 42, 0.35);

    --footer-bg:
        linear-gradient(180deg, rgba(7, 7, 8, 0), rgba(6, 10, 18, 0.94) 18%, rgba(5, 8, 14, 1) 100%);
    --footer-border: rgba(255, 255, 255, 0.06);
    --footer-card-bg:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015)),
        rgba(8, 13, 23, 0.66);
    --footer-card-border: rgba(148, 163, 184, 0.16);
    --footer-link-bg: rgba(15, 23, 42, 0.42);
    --footer-link-border: rgba(148, 163, 184, 0.18);
    --footer-link-hover-bg: rgba(37, 99, 235, 0.1);
    --footer-link-hover-border: rgba(96, 165, 250, 0.36);

    --theme-panel-bg:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)),
        rgba(7, 10, 16, 0.94);
    --theme-panel-border: rgba(148, 163, 184, 0.22);
    --theme-panel-shadow: 0 24px 70px rgba(2, 6, 23, 0.42);
    --theme-chip-bg: rgba(255, 255, 255, 0.04);
    --theme-chip-border: rgba(148, 163, 184, 0.16);
    --theme-chip-active-bg: rgba(59, 130, 246, 0.14);
    --theme-chip-active-border: rgba(96, 165, 250, 0.36);
    --theme-chip-text: var(--text-main);

    --accent-label-color: #93c5fd;
    --accent-chip-bg: rgba(59, 130, 246, 0.12);
    --accent-chip-border: rgba(96, 165, 250, 0.25);
    --accent-chip-text: #dbeafe;
    --eyebrow-color: #a7f3d0;
    --eyebrow-dot: #34d399;
    --status-pill-bg: rgba(20, 184, 166, 0.12);
    --status-pill-border: rgba(45, 212, 191, 0.24);
    --status-pill-text: #99f6e4;
    --focus-ring: rgba(59, 130, 246, 0.42);
    --navbar-clearance: 88px;
}

body[data-theme-palette="ocean"] {
    --accent-1: #2563eb;
    --accent-2: #7c3aed;
    --accent-3: #059669;
    --accent-glow: rgba(37, 99, 235, 0.18);
    --accent-label-color: #93c5fd;
    --accent-chip-bg: rgba(59, 130, 246, 0.12);
    --accent-chip-border: rgba(96, 165, 250, 0.25);
    --accent-chip-text: #dbeafe;
    --eyebrow-color: #a7f3d0;
    --eyebrow-dot: #34d399;
    --status-pill-bg: rgba(20, 184, 166, 0.12);
    --status-pill-border: rgba(45, 212, 191, 0.24);
    --status-pill-text: #99f6e4;
    --focus-ring: rgba(59, 130, 246, 0.42);
}

body[data-theme-palette="forest"] {
    --accent-1: #0f766e;
    --accent-2: #15803d;
    --accent-3: #ca8a04;
    --accent-glow: rgba(21, 128, 61, 0.18);
    --accent-label-color: #86efac;
    --accent-chip-bg: rgba(21, 128, 61, 0.14);
    --accent-chip-border: rgba(74, 222, 128, 0.25);
    --accent-chip-text: #dcfce7;
    --eyebrow-color: #bbf7d0;
    --eyebrow-dot: #22c55e;
    --status-pill-bg: rgba(21, 128, 61, 0.14);
    --status-pill-border: rgba(74, 222, 128, 0.26);
    --status-pill-text: #dcfce7;
    --focus-ring: rgba(21, 128, 61, 0.42);
}

body[data-theme-palette="sunrise"] {
    --accent-1: #b45309;
    --accent-2: #be123c;
    --accent-3: #6d28d9;
    --accent-glow: rgba(180, 83, 9, 0.18);
    --accent-label-color: #fdba74;
    --accent-chip-bg: rgba(180, 83, 9, 0.14);
    --accent-chip-border: rgba(251, 191, 36, 0.28);
    --accent-chip-text: #ffedd5;
    --eyebrow-color: #fdba74;
    --eyebrow-dot: #f59e0b;
    --status-pill-bg: rgba(190, 24, 93, 0.14);
    --status-pill-border: rgba(251, 113, 133, 0.26);
    --status-pill-text: #ffe4e6;
    --focus-ring: rgba(180, 83, 9, 0.42);
}

body[data-theme-mode="light"] {
    --bg-color: #edf4ff;
    --bg-surface: rgba(255, 255, 255, 0.9);
    --bg-surface-hover: rgba(248, 250, 252, 0.96);
    --bg-card: rgba(255, 255, 255, 0.86);

    --text-main: #0f172a;
    --text-muted: #334155;

    --border-color: rgba(15, 23, 42, 0.12);
    --glass-bg: rgba(255, 255, 255, 0.76);
    --glass-border: rgba(148, 163, 184, 0.24);

    --shadow-sm: 0 6px 14px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.12);

    --nav-bg-rest: rgba(255, 255, 255, 0.9);
    --nav-bg-scrolled: rgba(255, 255, 255, 0.97);
    --nav-shadow-rest: 0 8px 22px rgba(15, 23, 42, 0.08);
    --nav-shadow-scrolled: 0 14px 34px rgba(15, 23, 42, 0.14);

    --hero-shell-bg:
        linear-gradient(140deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.98)),
        rgba(255, 255, 255, 0.98);
    --hero-shell-border: rgba(148, 163, 184, 0.16);
    --hero-shell-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 28px 64px rgba(15, 23, 42, 0.09);

    --glass-card-bg:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.88)),
        rgba(255, 255, 255, 0.92);
    --glass-card-border: rgba(148, 163, 184, 0.18);
    --glass-card-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.88),
        0 18px 40px rgba(15, 23, 42, 0.08);

    --soft-surface: rgba(255, 255, 255, 0.72);
    --soft-surface-strong: rgba(255, 255, 255, 0.9);
    --soft-border: rgba(148, 163, 184, 0.18);
    --soft-border-strong: rgba(148, 163, 184, 0.28);

    --project-card-bg:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.94)),
        rgba(255, 255, 255, 0.98);
    --project-card-border: rgba(148, 163, 184, 0.2);
    --project-card-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    --project-card-hover-border: rgba(37, 99, 235, 0.3);
    --project-card-hover-shadow: 0 24px 44px rgba(15, 23, 42, 0.1), 0 0 0 1px rgba(37, 99, 235, 0.08);

    --surface-lifted:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.92)),
        rgba(255, 255, 255, 0.98);
    --surface-lifted-border: rgba(148, 163, 184, 0.18);
    --surface-lifted-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
    --surface-lifted-hover-shadow: 0 18px 36px rgba(15, 23, 42, 0.1);

    --project-stage-bg:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.12), transparent 42%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96)),
        rgba(255, 255, 255, 0.98);
    --project-stage-border: rgba(148, 163, 184, 0.18);
    --project-stage-shadow: 0 22px 54px rgba(15, 23, 42, 0.09);
    --project-stage-bar-bg:
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.88)),
        rgba(255, 255, 255, 0.86);
    --project-stage-note-bg: rgba(248, 250, 252, 0.9);

    --footer-bg:
        linear-gradient(180deg, rgba(237, 244, 255, 0), rgba(244, 247, 252, 0.92) 18%, rgba(255, 255, 255, 1) 100%);
    --footer-border: rgba(148, 163, 184, 0.14);
    --footer-card-bg:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.92)),
        rgba(255, 255, 255, 0.98);
    --footer-card-border: rgba(148, 163, 184, 0.16);
    --footer-link-bg: rgba(255, 255, 255, 0.92);
    --footer-link-border: rgba(148, 163, 184, 0.18);
    --footer-link-hover-bg: rgba(37, 99, 235, 0.08);
    --footer-link-hover-border: rgba(37, 99, 235, 0.3);

    --theme-panel-bg:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94)),
        rgba(255, 255, 255, 0.98);
    --theme-panel-border: rgba(148, 163, 184, 0.18);
    --theme-panel-shadow: 0 24px 56px rgba(15, 23, 42, 0.12);
    --theme-chip-bg: rgba(255, 255, 255, 0.92);
    --theme-chip-border: rgba(148, 163, 184, 0.18);
    --theme-chip-active-bg: rgba(37, 99, 235, 0.08);
    --theme-chip-active-border: rgba(37, 99, 235, 0.28);
    --theme-chip-text: #0f172a;
    --focus-ring: rgba(37, 99, 235, 0.34);

    color-scheme: light;
}

body[data-theme-mode="light"][data-theme-palette="ocean"] {
    --accent-label-color: #1d4ed8;
    --accent-chip-bg: rgba(37, 99, 235, 0.08);
    --accent-chip-border: rgba(37, 99, 235, 0.2);
    --accent-chip-text: #1e3a8a;
    --eyebrow-color: #0f766e;
    --eyebrow-dot: #059669;
    --status-pill-bg: rgba(15, 118, 110, 0.08);
    --status-pill-border: rgba(15, 118, 110, 0.2);
    --status-pill-text: #115e59;
}

body[data-theme-mode="light"][data-theme-palette="forest"] {
    --accent-label-color: #166534;
    --accent-chip-bg: rgba(22, 101, 52, 0.08);
    --accent-chip-border: rgba(22, 101, 52, 0.2);
    --accent-chip-text: #14532d;
    --eyebrow-color: #166534;
    --eyebrow-dot: #15803d;
    --status-pill-bg: rgba(21, 128, 61, 0.08);
    --status-pill-border: rgba(21, 128, 61, 0.2);
    --status-pill-text: #166534;
}

body[data-theme-mode="light"][data-theme-palette="sunrise"] {
    --accent-label-color: #9a3412;
    --accent-chip-bg: rgba(154, 52, 18, 0.08);
    --accent-chip-border: rgba(154, 52, 18, 0.2);
    --accent-chip-text: #7c2d12;
    --eyebrow-color: #9a3412;
    --eyebrow-dot: #b45309;
    --status-pill-bg: rgba(190, 24, 93, 0.08);
    --status-pill-border: rgba(190, 24, 93, 0.2);
    --status-pill-text: #9f1239;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.25s ease, color 0.25s ease;
}

body.nav-open {
    overflow: hidden;
}

/* Custom cursor elements hidden */
.cursor-dot,
.cursor-outline {
    display: none;
}

h1, h2, h3, h4, .nav-links, .logo {
    font-family: 'Outfit', sans-serif;
}

/* Background Effects */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    filter: blur(140px);
    opacity: 0.15;
    pointer-events: none;
    transition: opacity 0.25s ease, filter 0.25s ease;
}

.bg-gradient-1 {
    background: radial-gradient(circle at 10% 20%, var(--accent-1), transparent 40%);
    animation: drift 20s ease-in-out infinite alternate;
}

.bg-gradient-2 {
    background: radial-gradient(circle at 90% 80%, var(--accent-2), transparent 40%);
    animation: drift 25s ease-in-out infinite alternate-reverse;
}

.bg-noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    pointer-events: none;
    transition: opacity 0.25s ease;
}

body[data-theme-mode="light"] .bg-gradient {
    opacity: 0.24;
    filter: blur(160px);
}

body[data-theme-mode="light"] .bg-noise {
    opacity: 0.015;
}

@keyframes drift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(20px, 40px); }
}

/* Navigation */
.navbar {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 48px);
    max-width: 800px;
    z-index: 100;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}

.nav-content {
    padding: 0.8rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--text-main), var(--accent-1));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    cursor: pointer;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--trans-fast);
    position: relative;
}

.nav-links a:hover {
    color: var(--text-main);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background: linear-gradient(to right, var(--accent-1), var(--accent-2));
    transition: var(--trans-fast);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 44px;
    min-width: 44px;
    padding: 0.72rem 0.95rem;
    border: 1px solid var(--soft-border);
    border-radius: 999px;
    background: var(--soft-surface);
    color: var(--text-main);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.nav-menu-toggle:hover,
.nav-menu-toggle:focus-visible {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--accent-1) 28%, transparent);
    background: var(--soft-surface-strong);
}

.nav-menu-toggle:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

.nav-menu-toggle__icon {
    width: 1rem;
    height: 1rem;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
}

.nav-menu-toggle__icon svg {
    width: 100%;
    height: 100%;
    display: block;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.theme-toggle-btn {
    position: fixed;
    right: 1.2rem;
    bottom: 1.2rem;
    z-index: 140;
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 50%;
    border: 1px solid var(--theme-chip-border);
    background: color-mix(in srgb, var(--theme-chip-bg) 86%, transparent);
    color: var(--theme-chip-text);
    box-shadow:
        0 14px 30px rgba(2, 6, 23, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    padding: 0;
    margin: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.theme-toggle-btn:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--accent-1) 44%, transparent);
    box-shadow:
        0 18px 36px rgba(2, 6, 23, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.theme-toggle-btn:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

.theme-toggle-icon {
    width: 1.5rem;
    height: 1.5rem;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -0.75rem;
    margin-left: -0.75rem;

    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}


.theme-toggle-icon svg {
    width: 100%;
    height: 100%;
    display: block;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.theme-toggle-icon--light {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

.theme-toggle-icon--dark {
    opacity: 1;
    transform: rotate(0) scale(1);
}

.theme-toggle-btn.is-light .theme-toggle-icon--light {
    opacity: 1;
    transform: rotate(0) scale(1);
}

.theme-toggle-btn.is-light .theme-toggle-icon--dark {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}
/* Layout Container */
.container {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 2.25rem;
}

/* Typography & Utilities */
.section-title {
    font-size: 2rem;
    margin-bottom: 2.5rem;
    position: relative;
    display: inline-block;
    letter-spacing: -0.02em;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 60px;
    height: 4px;
    background: linear-gradient(to right, var(--accent-1), var(--accent-3));
    border-radius: 2px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.85rem 1.9rem;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--trans-fast);
    cursor: pointer;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.02em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: white;
    border: none;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: clamp(6.7rem, 8.5vw, 8.4rem);
    padding-bottom: clamp(1.8rem, 4vw, 3.2rem);
    position: relative;
    isolation: isolate;
    --hero-spotlight-x: 50%;
    --hero-spotlight-y: 34%;
    overflow: clip;
}

.hero::before {
    content: '';
    position: absolute;
    inset: calc(var(--navbar-clearance) + 0.35rem) 0 3rem;
    border-radius: 38px;
    background: var(--hero-shell-bg);
    border: 1px solid var(--hero-shell-border);
    box-shadow: var(--hero-shell-shadow);
    z-index: 0;
}

.hero-layout {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1.04fr) minmax(360px, 0.9fr);
    align-items: center;
    gap: clamp(2rem, 3.4vw, 3.2rem);
    width: 100%;
    padding: clamp(2rem, 3.5vw, 3.15rem);
}

.hero-backdrop-grid,
.hero-ambient,
.hero-spotlight {
    pointer-events: none;
    position: absolute;
    z-index: 1;
}

.hero-backdrop-grid {
    inset: calc(var(--navbar-clearance) + 1.6rem) 1.25rem 3.5rem;
    border-radius: 32px;
    opacity: 0.16;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.58), transparent 100%);
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.58), transparent 100%);
}

.hero-ambient {
    filter: blur(90px);
    opacity: 0.34;
}

.hero-ambient-1 {
    top: 6%;
    left: -6%;
    width: 24rem;
    height: 24rem;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.18), transparent 72%);
}

.hero-ambient-2 {
    right: -8%;
    bottom: 4%;
    width: 28rem;
    height: 28rem;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.14), transparent 70%);
}

.hero-spotlight {
    inset: 0;
    background:
        radial-gradient(circle at var(--hero-spotlight-x) var(--hero-spotlight-y), rgba(96, 165, 250, 0.1), transparent 18rem),
        radial-gradient(circle at calc(var(--hero-spotlight-x) + 12%) calc(var(--hero-spotlight-y) + 26%), rgba(16, 185, 129, 0.08), transparent 16rem);
    mix-blend-mode: screen;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 40rem;
    width: 100%;
}

.hero-glass-card {
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    background: var(--glass-card-bg);
    border: 1px solid var(--glass-card-border);
    box-shadow: var(--glass-card-shadow);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.hero-glass-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(115deg, transparent 18%, rgba(255, 255, 255, 0.18) 34%, transparent 48%),
        radial-gradient(circle at var(--card-glow-x, 30%) var(--card-glow-y, 20%), rgba(96, 165, 250, 0.12), transparent 36%);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.hero-glass-card:hover::before,
.hero-glass-card:focus-within::before {
    opacity: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    background: var(--status-pill-bg);
    border: 1px solid var(--status-pill-border);
    color: var(--status-pill-text);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    letter-spacing: 0.5px;
    animation: badgeFadeIn 0.8s ease both;
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px #10b981; }
    50% { opacity: 0.4; box-shadow: 0 0 2px #10b981; }
}

@keyframes badgeFadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Typed roles subtitle */
.hero-roles {
    display: flex;
    align-items: center;
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 1.2rem;
    font-weight: 400;
    min-height: 1.8em;
}

.hero-role-static {
    color: var(--text-muted);
}

.hero-role-typed {
    color: var(--accent-1);
    font-weight: 600;
}

.typed-cursor {
    color: var(--accent-1);
    font-weight: 200;
    animation: cursorBlink 0.75s step-end infinite;
}

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

/* Specialty chips */
.hero-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.7rem;
}

.hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    background: var(--soft-surface);
    border: 1px solid var(--soft-border);
    border-radius: 100px;
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: var(--trans-fast);
    cursor: default;
}

.hero-chip:hover {
    background: color-mix(in srgb, var(--accent-1) 12%, transparent);
    border-color: color-mix(in srgb, var(--accent-1) 34%, transparent);
    color: var(--text-main);
    transform: translateY(-2px);
}

.hero-chip .chip-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--dot-color, var(--accent-1));
    box-shadow: 0 0 6px var(--dot-color, var(--accent-1));
    flex-shrink: 0;
}

/* Orbit rings behind portrait */
.hero-orbit-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px dashed rgba(59, 130, 246, 0.1);
    pointer-events: none;
    transform-style: preserve-3d;
    box-shadow: inset 0 0 10px rgba(59, 130, 246, 0.02);
}

.hero-orbit-ring.ring-1 {
    width: 312px;
    height: 312px;
    top: 50%;
    left: 50%;
    border: 1px dashed rgba(59, 130, 246, 0.1);
    animation: orbitSpin1 24s linear infinite;
}

.hero-orbit-ring.ring-2 {
    width: 364px;
    height: 364px;
    top: 50%;
    left: 50%;
    border: 1px dotted rgba(139, 92, 246, 0.08);
    box-shadow: inset 0 0 12px rgba(139, 92, 246, 0.02);
    animation: orbitSpin2 34s linear infinite reverse;
}

/* Ring orbital dots */
.hero-orbit-ring::after,
.hero-orbit-ring::before {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    left: 50%;
    transform: translateX(-50%);
}

.hero-orbit-ring::after {
    top: -4px;
}

.hero-orbit-ring::before {
    bottom: -4px;
}

.hero-orbit-ring.ring-1::after,
.hero-orbit-ring.ring-1::before {
    background: rgba(59, 130, 246, 0.8);
    box-shadow: 0 0 15px 3px rgba(59, 130, 246, 0.6);
}

.hero-orbit-ring.ring-2::after,
.hero-orbit-ring.ring-2::before {
    background: rgba(139, 92, 246, 0.58);
    box-shadow: 0 0 10px 2px rgba(139, 92, 246, 0.36);
}

@keyframes orbitSpin1 {
    from { transform: translate(-50%, -50%) rotateX(65deg) rotateY(25deg) rotateZ(0deg); }
    to { transform: translate(-50%, -50%) rotateX(65deg) rotateY(25deg) rotateZ(360deg); }
}

@keyframes orbitSpin2 {
    from { transform: translate(-50%, -50%) rotateX(70deg) rotateY(-40deg) rotateZ(0deg); }
    to { transform: translate(-50%, -50%) rotateX(70deg) rotateY(-40deg) rotateZ(360deg); }
}

/* Floating particle canvas behind portrait */
.hero-particles-canvas {
    position: absolute;
    inset: -60px;
    width: calc(100% + 120px);
    height: calc(100% + 120px);
    z-index: 0;
    pointer-events: none;
    opacity: 0.26;
}

.hero-title {
    font-size: clamp(3rem, 5.5vw, 4.5rem);
    line-height: 1.05;
    margin-bottom: 1.5rem;
    letter-spacing: -0.04em;
    font-weight: 700;
}

.hero-title span {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    font-size: 1.08rem;
    color: var(--text-muted);
    margin-bottom: 1.7rem;
    max-width: 34rem;
    line-height: 1.72;
    letter-spacing: 0.01em;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-bottom: 1.2rem;
}

.hero-actions .btn {
    position: relative;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    min-width: clamp(13rem, 28vw, 15.5rem);
    border-radius: 16px;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.78rem 0.88rem 0.78rem 1rem;
    text-align: left;
    overflow: hidden;
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease, background 0.24s ease, color 0.24s ease;
}

.hero-actions .btn::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.28s ease;
}

.hero-cta-copy {
    display: grid;
    gap: 0.16rem;
    line-height: 1.05;
}

.hero-cta-kicker {
    color: color-mix(in srgb, var(--text-muted) 82%, white 18%);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero-cta-label {
    color: inherit;
    font-size: 1.02rem;
    font-weight: 600;
}

.hero-cta-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 0.96rem;
    font-weight: 700;
    transition: transform 0.24s ease, background 0.24s ease, color 0.24s ease, box-shadow 0.24s ease;
}

.hero-actions .btn-primary {
    border: 1px solid color-mix(in srgb, var(--accent-1) 42%, white 8%);
    background:
        linear-gradient(134deg, color-mix(in srgb, var(--accent-1) 88%, white 12%), color-mix(in srgb, var(--accent-2) 88%, black 12%));
    color: #ffffff;
    box-shadow:
        0 14px 34px color-mix(in srgb, var(--accent-1) 26%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.hero-actions .btn-primary .hero-cta-kicker {
    color: rgba(255, 255, 255, 0.78);
}

.hero-actions .btn-primary::after {
    background:
        linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.32) 45%, transparent 78%);
}

.hero-actions .btn-primary:hover,
.hero-actions .btn-primary:focus-visible {
    transform: translateY(-3px);
    box-shadow:
        0 20px 42px color-mix(in srgb, var(--accent-1) 32%, transparent),
        0 0 0 1px color-mix(in srgb, var(--accent-1) 44%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.hero-actions .btn-primary:hover::after,
.hero-actions .btn-primary:focus-visible::after {
    opacity: 1;
}

.hero-actions .btn-primary .hero-cta-icon {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.hero-actions .btn-primary:hover .hero-cta-icon,
.hero-actions .btn-primary:focus-visible .hero-cta-icon {
    transform: translateX(2px) translateY(-1px);
    background: rgba(255, 255, 255, 0.3);
}

.hero-actions .btn-secondary {
    border: 1px solid var(--soft-border-strong);
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--soft-surface-strong) 86%, transparent), color-mix(in srgb, var(--soft-surface) 90%, transparent));
    box-shadow:
        0 6px 18px rgba(2, 6, 23, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.hero-actions .btn-secondary::after {
    background: linear-gradient(120deg, color-mix(in srgb, var(--accent-1) 14%, transparent), transparent 60%);
}

.hero-actions .btn-secondary:hover,
.hero-actions .btn-secondary:focus-visible {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--accent-1) 34%, var(--soft-border-strong));
    box-shadow:
        0 16px 30px rgba(2, 6, 23, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.hero-actions .btn-secondary:hover::after,
.hero-actions .btn-secondary:focus-visible::after {
    opacity: 1;
}

.hero-actions .btn-secondary .hero-cta-icon {
    background: color-mix(in srgb, var(--accent-1) 16%, transparent);
    color: color-mix(in srgb, var(--accent-1) 86%, var(--text-main) 14%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.hero-actions .btn-secondary:hover .hero-cta-icon,
.hero-actions .btn-secondary:focus-visible .hero-cta-icon {
    transform: translateX(2px);
    background: color-mix(in srgb, var(--accent-1) 22%, transparent);
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    padding: 1rem 1.05rem;
    border-radius: 22px;
    margin-bottom: 0;
}

.hero-metric {
    display: grid;
    gap: 0.35rem;
}

.hero-metric span {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero-metric strong {
    color: var(--text-main);
    font-size: 0.93rem;
    line-height: 1.42;
    font-weight: 600;
}

.hero-scroll-link {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: min(100%, 28rem);
    padding: 1rem 1.1rem;
    border-radius: 22px;
    text-decoration: none;
    color: var(--text-main);
    border: 1px solid var(--soft-border);
    background: var(--soft-surface);
    transition: var(--trans-fast);
}

.hero-scroll-link:hover {
    border-color: color-mix(in srgb, var(--accent-1) 32%, transparent);
    background: color-mix(in srgb, var(--accent-1) 10%, transparent);
    transform: translateY(-2px);
}

.hero-scroll-copy {
    display: grid;
    gap: 0.15rem;
}

.hero-scroll-label {
    color: color-mix(in srgb, var(--text-muted) 88%, white 0%);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero-scroll-copy strong {
    font-size: 0.98rem;
    font-weight: 600;
}

.hero-scroll-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    flex-shrink: 0;
    border: 1px solid rgba(96, 165, 250, 0.3);
    background:
        radial-gradient(circle at 50% 32%, rgba(96, 165, 250, 0.34), transparent 48%),
        rgba(7, 10, 16, 0.9);
    position: relative;
}

.hero-scroll-icon::before,
.hero-scroll-icon::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.hero-scroll-icon::before {
    top: 0.82rem;
    width: 2px;
    height: 1rem;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(96, 165, 250, 0.88));
    animation: heroScrollPulse 1.6s ease-in-out infinite;
}

.hero-scroll-icon::after {
    top: 1.45rem;
    width: 0.6rem;
    height: 0.6rem;
    border-right: 2px solid rgba(191, 219, 254, 0.92);
    border-bottom: 2px solid rgba(191, 219, 254, 0.92);
    transform: translateX(-50%) rotate(45deg);
}

@keyframes heroScrollPulse {
    0%, 100% { opacity: 0.45; transform: translate(-50%, -2px); }
    50% { opacity: 1; transform: translate(-50%, 4px); }
}

.hero-visual {
    min-height: 35rem;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 1rem 0 0.8rem;
}

.hero-visual-shell {
    position: relative;
    width: min(100%, 27.5rem);
    margin-left: 0;
    padding: 1rem;
    border-radius: 30px;
    z-index: 3;
}

.hero-visual > * {
    max-width: 100%;
}

.hero-image-wrapper {
    position: relative;
    width: 100%;
    height: 33rem;
    border-radius: 26px;
    overflow: hidden;
    z-index: 2;
    background:
        radial-gradient(circle at 50% 8%, rgba(255, 255, 255, 0.1), transparent 38%),
        linear-gradient(180deg, rgba(10, 14, 23, 0.55), rgba(7, 10, 16, 0.1));
}

.hero-image-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(7, 10, 16, 0.04), rgba(7, 10, 16, 0.3) 58%, rgba(7, 10, 16, 0.5) 100%),
        radial-gradient(circle at 50% 14%, rgba(255, 255, 255, 0.14), transparent 34%);
    z-index: 2;
    pointer-events: none;
}

.hero-image-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    z-index: 3;
    pointer-events: none;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    position: relative;
    z-index: 1;
    border: none;
    border-radius: 0;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), filter 0.8s ease;
    filter: saturate(1.02) contrast(1.05) brightness(0.97);
}

.hero-image-wrapper:hover .hero-img {
    transform: scale(1.03);
    filter: saturate(1.08) contrast(1.06) brightness(1);
}

.image-glow {
    position: absolute;
    inset: -50px;
    z-index: 1;
    border-radius: 50%;
    background: radial-gradient(ellipse at 50% 45%,
        rgba(59, 130, 246, 0.12) 0%,
        rgba(139, 92, 246, 0.06) 35%,
        transparent 65%);
    filter: blur(40px);
    transition: var(--trans-slow);
    animation: glowPulse 5s ease-in-out infinite alternate;
}

@keyframes glowPulse {
    0% { opacity: 0.5; transform: scale(1); }
    100% { opacity: 0.9; transform: scale(1.08); }
}

.hero-image-wrapper:hover .image-glow {
    opacity: 1;
    background: radial-gradient(ellipse at 50% 45%,
        rgba(59, 130, 246, 0.18) 0%,
        rgba(139, 92, 246, 0.1) 35%,
        transparent 65%);
}

.hero-visual-footer {
    display: grid;
    gap: 0.75rem;
    padding: 1rem 0.15rem 0.1rem;
}

.hero-visual-eyebrow {
    color: var(--eyebrow-color);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero-visual-footer p {
    color: var(--text-muted);
    font-size: 0.94rem;
    line-height: 1.65;
    max-width: 26rem;
}

.hero-visual-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.hero-visual-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    background: var(--soft-surface);
    border: 1px solid var(--soft-border);
    color: var(--text-main);
    font-size: 0.76rem;
    font-weight: 600;
}

@media (max-width: 1200px) {
    .hero {
        padding-top: clamp(6.9rem, 10vw, 8.2rem);
    }

    .hero-layout {
        grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
        gap: clamp(1.4rem, 2.6vw, 2.6rem);
        padding: clamp(1.75rem, 3vw, 2.6rem);
    }

    .hero-title {
        font-size: clamp(2.55rem, 4.4vw, 3.7rem);
    }

    .hero-desc {
        font-size: 1.04rem;
        line-height: 1.62;
        margin-bottom: 1.9rem;
    }

    .hero-visual {
        min-height: 32rem;
    }
}

.hero-stack-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.hero-stack-list span {
    padding: 0.28rem 0.58rem;
    border-radius: 999px;
    background: var(--soft-surface);
    color: var(--text-main);
    font-size: 0.76rem;
    border: 1px solid var(--soft-border);
}

.hero-signal {
    display: flex;
    align-items: flex-end;
    gap: 0.28rem;
    min-height: 1.8rem;
}

.hero-signal__bar {
    width: 0.4rem;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(96, 165, 250, 0.9), rgba(16, 185, 129, 0.52));
    animation: heroSignal 1.8s ease-in-out infinite;
    transform-origin: bottom;
}

.hero-signal__bar--one {
    height: 0.9rem;
    animation-delay: 0s;
}

.hero-signal__bar--two {
    height: 1.5rem;
    animation-delay: 0.2s;
}

.hero-signal__bar--three {
    height: 1.15rem;
    animation-delay: 0.4s;
}

.hero-signal__bar--four {
    height: 1.85rem;
    animation-delay: 0.6s;
}

@keyframes heroSignal {
    0%, 100% { transform: scaleY(0.72); opacity: 0.62; }
    50% { transform: scaleY(1); opacity: 1; }
}

.tilt-elem {
    transform-style: preserve-3d;
    transform: perspective(1000px);
}

.magnetic {
    display: inline-block;
}

/* Skills Section */
.skills-section {
    padding: 6rem 0;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skills-grid:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 6px;
    border-radius: calc(var(--radius-lg) + 4px);
}

.skill-category {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: var(--trans-fast), background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.skill-category:hover {
    transform: translateY(-5px);
    border-color: var(--soft-border-strong);
    background: var(--bg-surface-hover);
}

.skill-category h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.tag {
    background: var(--soft-surface);
    border: 1px solid var(--soft-border);
    padding: 0.45rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: var(--trans-fast);
    cursor: default;
    font-family: 'Inter', sans-serif;
}

.tag:hover {
    background: var(--soft-surface-strong);
    border-color: var(--soft-border-strong);
    color: var(--text-main);
}

.tag-small {
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
}

/* Projects Section */
.projects-section {
    padding: 6rem 0;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    align-items: stretch;
}

.project-card {
    background: var(--project-card-bg);
    border: 1px solid var(--project-card-border);
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.35s ease, box-shadow 0.35s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    box-shadow: var(--project-card-shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.project-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(300px circle at var(--glow-x, 50%) var(--glow-y, 50%), rgba(59, 130, 246, 0.08), transparent 60%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover::after {
    opacity: 1;
}

.project-card:hover {
    transform: translateY(-9px);
    border-color: var(--project-card-hover-border);
    box-shadow: var(--project-card-hover-shadow);
}

.project-image-placeholder {
    height: 210px;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(40,40,40,0.8), rgba(20,20,20,0.9));
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

body[data-theme-mode="light"] .project-image-placeholder {
    border-bottom-color: rgba(148, 163, 184, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

body[data-theme-mode="light"] .project-image-placeholder > * {
    filter: saturate(0.96) brightness(1.04);
}



.project-info {
    padding: 1.2rem 1.2rem 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    flex-grow: 1;
    gap: 0.35rem;
    min-height: 0;
}

/* Ideas Section */
.ideas-section {
    position: relative;
    padding: 6.2rem 0 7rem;
    overflow: clip;
}

.ideas-section::before {
    content: '';
    position: absolute;
    inset: -2rem 0 auto;
    height: 32rem;
    pointer-events: none;
    background:
        radial-gradient(circle at 14% 16%, rgba(59, 130, 246, 0.16), transparent 28%),
        radial-gradient(circle at 82% 14%, rgba(139, 92, 246, 0.12), transparent 26%),
        radial-gradient(circle at 52% 38%, rgba(16, 185, 129, 0.08), transparent 26%);
    opacity: 0.9;
}

.ideas-section::after {
    content: '';
    position: absolute;
    inset: 4rem 8% 3rem;
    border-radius: 48px;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0)),
        radial-gradient(circle at top, rgba(255, 255, 255, 0.04), transparent 58%);
    border: 1px solid rgba(255, 255, 255, 0.03);
    opacity: 0.56;
}

.ideas-shell {
    position: relative;
    z-index: 1;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

.ideas-header {
    display: grid;
    grid-template-columns: minmax(0, 1.16fr) minmax(320px, 0.84fr);
    gap: 3.4rem;
    align-items: start;
    margin-bottom: 2.7rem;
}

.ideas-copy {
    max-width: 40rem;
}

.ideas-eyebrow,
.ideas-summary__label,
.ideas-feed__eyebrow,
.ideas-step__eyebrow,
.ideas-feed__kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.ideas-eyebrow {
    margin-bottom: 1rem;
    color: var(--eyebrow-color);
}

.ideas-eyebrow::before,
.ideas-summary__label::before,
.ideas-feed__eyebrow::before,
.ideas-step__eyebrow::before,
.ideas-feed__kicker::before {
    content: '';
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 14px color-mix(in srgb, currentColor 35%, transparent);
}

.ideas-section .section-title {
    margin-bottom: 1.15rem;
    font-size: clamp(2.8rem, 4.8vw, 5rem);
    line-height: 0.94;
    letter-spacing: -0.055em;
}

.ideas-intro {
    max-width: 34rem;
    color: var(--text-muted);
    font-size: 1.02rem;
    line-height: 1.86;
}

.ideas-summary {
    align-self: end;
    padding: 0.3rem 0 0 1.4rem;
    border-left: 1px solid var(--soft-border-strong);
}

.ideas-summary__label {
    margin-bottom: 1.15rem;
    color: var(--eyebrow-color);
}

.ideas-summary__list {
    display: grid;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ideas-summary__list li {
    position: relative;
    padding-left: 1.1rem;
    color: var(--text-muted);
    line-height: 1.72;
}

.ideas-summary__list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.78rem;
    width: 0.38rem;
    height: 0.38rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
    box-shadow: 0 0 10px color-mix(in srgb, var(--accent-1) 34%, transparent);
    transform: translateY(-50%);
}

.ideas-role-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.ideas-role-pills span,
.ideas-step__tags span {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.42rem 0.78rem;
    border-radius: 999px;
    border: 1px solid var(--soft-border);
    background: color-mix(in srgb, var(--bg-surface) 82%, transparent);
    color: var(--text-main);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.ideas-lanes {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.2rem;
    margin-bottom: 3rem;
    padding: 1.45rem 0 1.6rem;
    border-top: 1px solid var(--soft-border);
    border-bottom: 1px solid var(--soft-border);
}

.ideas-lane {
    padding-right: 1rem;
    border-right: 1px solid var(--soft-border);
}

.ideas-lane:last-child {
    padding-right: 0;
    border-right: none;
}

.ideas-lane__index,
.ideas-step__index {
    display: inline-flex;
    align-items: center;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-subtle);
}

.ideas-lane h3 {
    margin: 0.85rem 0 0.55rem;
    font-size: 1.08rem;
    line-height: 1.18;
    letter-spacing: -0.02em;
}

.ideas-lane p {
    color: var(--text-muted);
    line-height: 1.68;
    font-size: 0.93rem;
}

.ideas-feed {
    position: relative;
}

.ideas-feed__intro {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.6rem;
}

.ideas-feed__eyebrow {
    color: var(--eyebrow-color);
}

.ideas-feed__intro p {
    max-width: 36rem;
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.75;
}

.ideas-feed__layout {
    display: grid;
    grid-template-columns: minmax(320px, 0.92fr) minmax(0, 1fr);
    gap: 2.7rem;
    align-items: start;
}

.ideas-feed__visual {
    position: sticky;
    top: calc(var(--navbar-clearance) + 1.25rem);
}

.ideas-feed__screen {
    --ideas-accent: #60a5fa;
    --ideas-accent-2: #34d399;
    position: relative;
    min-height: 32rem;
    overflow: hidden;
    padding: 1.35rem;
    border-radius: 28px;
    border: 1px solid rgba(96, 165, 250, 0.18);
    color: #f8fafc;
    background:
        radial-gradient(circle at 82% 16%, color-mix(in srgb, var(--ideas-accent) 18%, transparent), transparent 26%),
        radial-gradient(circle at 18% 18%, color-mix(in srgb, var(--ideas-accent-2) 12%, transparent), transparent 22%),
        linear-gradient(180deg, rgba(7, 12, 22, 0.98), rgba(4, 8, 14, 0.98));
    box-shadow:
        0 28px 56px rgba(2, 6, 23, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: border-color 0.32s ease, box-shadow 0.32s ease, transform 0.32s ease;
}

.ideas-feed__screen[data-ideas-theme="demo"] {
    --ideas-accent: #34d399;
    --ideas-accent-2: #60a5fa;
}

.ideas-feed__screen[data-ideas-theme="world"] {
    --ideas-accent: #f472b6;
    --ideas-accent-2: #a78bfa;
}

.ideas-feed__screen[data-ideas-theme="rollout"] {
    --ideas-accent: #f59e0b;
    --ideas-accent-2: #34d399;
}

.ideas-feed__screen::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 3.1rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

.ideas-feed__screen::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 6px);
    opacity: 0.12;
    mix-blend-mode: screen;
    pointer-events: none;
}

.ideas-feed__screen-noise {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 82%, color-mix(in srgb, var(--ideas-accent) 18%, transparent), transparent 28%),
        radial-gradient(circle at 82% 76%, color-mix(in srgb, var(--ideas-accent-2) 12%, transparent), transparent 30%);
    opacity: 0.7;
    pointer-events: none;
}

.ideas-byte-rain {
    position: absolute;
    inset: 3.25rem 0 0;
    overflow: hidden;
    pointer-events: none;
}

.ideas-byte-column {
    position: absolute;
    top: -70%;
    left: var(--ideas-column-left);
    width: var(--ideas-column-width, 4.2rem);
    color: color-mix(in srgb, var(--ideas-accent) 52%, white 14%);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.67rem;
    line-height: 1.2;
    letter-spacing: 0.06em;
    white-space: pre;
    opacity: var(--ideas-column-opacity, 0.26);
    text-shadow: 0 0 10px color-mix(in srgb, var(--ideas-accent) 44%, transparent);
    animation: ideasByteFall var(--ideas-column-duration, 18s) linear infinite;
    animation-delay: var(--ideas-column-delay, 0s);
}

.ideas-feed__hud {
    position: relative;
    z-index: 1;
    min-height: calc(32rem - 2.7rem);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.65rem;
}

.ideas-feed__hud-main {
    display: grid;
    gap: 0.9rem;
    max-width: 26rem;
    padding-top: 1.85rem;
}

.ideas-feed__kicker {
    color: color-mix(in srgb, var(--ideas-accent) 82%, white 6%);
}

.ideas-feed__title {
    font-size: clamp(1.55rem, 1.3rem + 0.9vw, 2.2rem);
    line-height: 1.02;
    letter-spacing: -0.045em;
    max-width: 12ch;
}

.ideas-feed__summary {
    color: rgba(226, 232, 240, 0.76);
    font-size: 0.96rem;
    line-height: 1.72;
    max-width: 30ch;
}

.ideas-feed__line-list {
    display: grid;
    gap: 0.65rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ideas-feed__line-list li {
    display: flex;
    align-items: center;
    min-height: 2.5rem;
    padding: 0.68rem 0.8rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(8, 14, 24, 0.68);
    color: rgba(226, 232, 240, 0.82);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ideas-feed__footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(226, 232, 240, 0.7);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.74rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.ideas-feed__steps {
    display: grid;
    gap: 0;
}

.ideas-step {
    position: relative;
    min-height: 76vh;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 1.3rem;
    padding: 1.6rem 0 1.6rem 1rem;
    opacity: 0.44;
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.ideas-step::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, transparent, var(--soft-border-strong) 14%, var(--soft-border-strong) 86%, transparent);
}

.ideas-step::after {
    content: '';
    position: absolute;
    left: -4px;
    top: 50%;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    opacity: 0.42;
    transform: translateY(-50%);
    transition: opacity 0.28s ease, box-shadow 0.28s ease, background 0.28s ease;
}

.ideas-step[data-ideas-theme="hook"]::after {
    background: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.16);
}

.ideas-step[data-ideas-theme="demo"]::after {
    background: #34d399;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.16);
}

.ideas-step[data-ideas-theme="world"]::after {
    background: #f472b6;
    box-shadow: 0 0 0 4px rgba(244, 114, 182, 0.14);
}

.ideas-step[data-ideas-theme="rollout"]::after {
    background: #f59e0b;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14);
}

.ideas-step.is-active {
    opacity: 1;
    transform: translateX(0.35rem);
}

.ideas-step.is-active::after {
    opacity: 1;
}

.ideas-step__copy {
    max-width: 30rem;
    display: grid;
    gap: 0.8rem;
}

.ideas-step__eyebrow {
    color: var(--text-subtle);
}

.ideas-step[data-ideas-theme="hook"] .ideas-step__eyebrow {
    color: #60a5fa;
}

.ideas-step[data-ideas-theme="demo"] .ideas-step__eyebrow {
    color: #34d399;
}

.ideas-step[data-ideas-theme="world"] .ideas-step__eyebrow {
    color: #f472b6;
}

.ideas-step[data-ideas-theme="rollout"] .ideas-step__eyebrow {
    color: #f59e0b;
}

.ideas-step h3 {
    font-size: clamp(1.4rem, 1.18rem + 0.55vw, 1.88rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
    max-width: 17ch;
}

.ideas-step p {
    color: var(--text-muted);
    font-size: 0.97rem;
    line-height: 1.72;
    max-width: 32ch;
}

.ideas-step__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

body[data-theme-mode="light"] .ideas-section::after {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0)),
        radial-gradient(circle at top, rgba(148, 163, 184, 0.14), transparent 62%);
    border-color: rgba(148, 163, 184, 0.12);
}

body[data-theme-mode="light"] .ideas-summary {
    border-color: rgba(148, 163, 184, 0.28);
}

body[data-theme-mode="light"] .ideas-lanes {
    border-color: rgba(148, 163, 184, 0.22);
}

body[data-theme-mode="light"] .ideas-lane {
    border-color: rgba(148, 163, 184, 0.18);
}

body[data-theme-mode="light"] .ideas-role-pills span,
body[data-theme-mode="light"] .ideas-step__tags span {
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(148, 163, 184, 0.24);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

body[data-theme-mode="light"] .ideas-step::before {
    background: linear-gradient(180deg, transparent, rgba(148, 163, 184, 0.34) 14%, rgba(148, 163, 184, 0.34) 86%, transparent);
}

body[data-theme-mode="light"] .ideas-feed__screen {
    box-shadow:
        0 28px 56px rgba(15, 23, 42, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

@media (max-width: 1120px) {
    .ideas-header {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .ideas-summary {
        padding-left: 0;
        padding-top: 1rem;
        border-left: none;
        border-top: 1px solid var(--soft-border-strong);
    }

    .ideas-lanes {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ideas-lane:nth-child(2n) {
        padding-right: 0;
        border-right: none;
    }

    .ideas-feed__layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .ideas-feed__visual {
        position: relative;
        top: auto;
    }

    .ideas-step {
        min-height: 56vh;
    }
}

@media (max-width: 820px) {
    .ideas-section {
        padding: 4.6rem 0 5rem;
    }

    .ideas-shell {
        padding: 0 1rem;
    }

    .ideas-header {
        gap: 1.35rem;
        margin-bottom: 2.1rem;
    }

    .ideas-intro,
    .ideas-feed__intro p {
        font-size: 0.94rem;
        line-height: 1.68;
    }

    .ideas-lanes {
        grid-template-columns: 1fr;
        gap: 0.85rem;
        margin-bottom: 2.4rem;
        padding: 1rem 0 1.15rem;
    }

    .ideas-lane {
        padding-right: 0;
        padding-bottom: 0.9rem;
        border-right: none;
        border-bottom: 1px solid var(--soft-border);
    }

    .ideas-lane:last-child {
        padding-bottom: 0;
        border-bottom: none;
    }

    .ideas-feed__intro {
        display: block;
        margin-bottom: 1.25rem;
    }

    .ideas-feed__screen {
        min-height: 25.5rem;
        padding: 1rem;
        border-radius: 22px;
    }

    .ideas-feed__hud {
        min-height: calc(25.5rem - 2rem);
    }

    .ideas-feed__hud-main {
        padding-top: 1.45rem;
        max-width: 100%;
    }

    .ideas-feed__title {
        max-width: 13ch;
        font-size: 1.7rem;
    }

    .ideas-feed__summary {
        max-width: 100%;
        font-size: 0.9rem;
    }

    .ideas-feed__footer {
        display: grid;
        gap: 0.45rem;
    }

    .ideas-feed__line-list li {
        font-size: 0.66rem;
        letter-spacing: 0.06em;
    }

    .ideas-step {
        min-height: auto;
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 1.3rem 0 1.3rem 1rem;
        opacity: 1;
        transform: none;
    }

    .ideas-step.is-active {
        transform: none;
    }

    .ideas-step h3,
    .ideas-step p {
        max-width: none;
    }

    .ideas-byte-column {
        width: 3.3rem;
        font-size: 0.6rem;
    }
}

@keyframes ideasByteFall {
    from {
        transform: translateY(-8%);
    }
    to {
        transform: translateY(66%);
    }
}

/* EKG Card Custom Animations */
.ekg-bg {
    background: linear-gradient(135deg, rgba(30,10,20,0.8), rgba(10,5,10,0.9));
}

.ekg-trace polyline {
    stroke-dasharray: 250;
    stroke-dashoffset: 250;
    animation: drawTrace 2.5s infinite ease-in-out;
    filter: drop-shadow(0 0 6px #10b981);
    stroke: #10b981;
}

@keyframes drawTrace {
    0% { stroke-dashoffset: 250; }
    40% { stroke-dashoffset: 0; }
    60% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -250; }
}

/* CarPlay Dashboard Styles */
.carplay-bg {
    background: radial-gradient(ellipse at 50% 60%, #0c1929 0%, #080e1a 100%);
    overflow: hidden;
}

/* Mini dashboard card cover */
.cp-mini-dash {
    width: 150px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cp-mini-top {
    display: flex;
    gap: 6px;
    align-items: stretch;
}

.cp-speed-box {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 6px 10px;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.cp-speed-num {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #e2e8f0;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    animation: cpSpeedCount 4s ease-in-out infinite;
}

.cp-speed-unit {
    font-size: 0.55rem;
    color: #64748b;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.cp-nav-pill {
    flex: 1;
    background: rgba(0, 122, 255, 0.15);
    border: 1px solid rgba(0, 122, 255, 0.25);
    border-radius: 10px;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.cp-turn-arrow {
    font-size: 1rem;
    color: #3b82f6;
    line-height: 1;
    animation: cpArrowTurn 1.5s ease-in-out infinite;
}
@keyframes cpArrowTurn {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.cp-nav-dist {
    font-size: 0.6rem;
    color: #93c5fd;
    font-weight: 600;
}

.cp-mini-map {
    position: relative;
    height: 48px;
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
    overflow: hidden;
}

.cp-map-road {
    position: absolute;
    background: rgba(0, 122, 255, 0.12);
}

.cp-mr-h {
    top: 50%;
    left: -20%;
    right: -20%;
    height: 2px;
    animation: cpPanMapH 4s ease-in-out infinite alternate;
}

.cp-mr-v {
    left: 55%;
    top: -20%;
    bottom: -20%;
    width: 2px;
    animation: cpPanMapV 5s ease-in-out infinite alternate;
}

@keyframes cpPanMapH { 0% { top: 40%; } 100% { top: 60%; } }
@keyframes cpPanMapV { 0% { left: 45%; } 100% { left: 65%; } }

.cp-map-route {
    position: absolute;
    top: 50%;
    left: 20%;
    width: 35%;
    height: 2px;
    background: #3b82f6;
    box-shadow: 0 0 8px rgba(59,130,246,0.5);
    transform-origin: right center;
    animation: cpRouteMove 3s linear infinite;
}

@keyframes cpRouteMove {
    0% { transform: translateY(-50%) scaleX(1); left: 20%; opacity: 0; }
    10% { opacity: 1; }
    90% { transform: translateY(-50%) scaleX(0.1); left: 51.5%; opacity: 1; }
    100% { transform: translateY(-50%) scaleX(0); left: 55%; opacity: 0; }
}

.cp-map-dot {
    position: absolute;
    top: calc(50% - 4px);
    left: calc(55% - 4px);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3b82f6;
    border: 2px solid #fff;
    box-shadow: 0 0 10px rgba(59,130,246,0.6);
    z-index: 1;
    animation: cpDotPulse 2s ease-in-out infinite, cpDotBounce 0.5s ease-in-out infinite alternate;
}

@keyframes cpDotPulse {
    0%, 100% { box-shadow: 0 0 6px rgba(59,130,246,0.4); }
    50% { box-shadow: 0 0 14px rgba(59,130,246,0.8); }
}

@keyframes cpDotBounce {
    0% { transform: scale(1); }
    100% { transform: scale(1.15); }
}

.cp-mini-media {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.04);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
    padding: 6px 8px;
}

.cp-media-art {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: linear-gradient(135deg, #bf5af2, #ff375f);
    flex-shrink: 0;
}

.cp-media-bar {
    flex: 1;
    height: 3px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
}

.cp-media-fill {
    width: 45%;
    height: 100%;
    background: linear-gradient(90deg, #bf5af2, #ff375f);
    border-radius: inherit;
    animation: cpMediaProgress 6s linear infinite;
}

@keyframes cpMediaProgress {
    0% { width: 15%; }
    100% { width: 85%; }
}

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

/* PianoViz Styles */
.pianoviz-bg { background: radial-gradient(circle at top, #4338ca, #1e1b4b); }
.keys-container { display: flex; position: relative; height: 80px; width: 140px; box-shadow: 0 10px 20px rgba(0,0,0,0.5); border-radius: 0 0 6px 6px; }
.k { border-radius: 0 0 6px 6px; box-shadow: 0 4px 6px rgba(0,0,0,0.3); animation: pressKey 2s infinite alternate; }
.key-w { flex: 1; background: linear-gradient(to bottom, #fff, #ddd); margin: 0 2px; z-index: 1; }
.key-b { position: absolute; width: 16px; height: 50px; background: linear-gradient(to bottom, #333, #000); z-index: 2; top: 0; box-shadow: 0 3px 5px rgba(0,0,0,0.6); }
.kb1 { left: 24px; animation-delay: 0.2s; }
.kb2 { left: 60px; animation-delay: 0.5s; }
.kb3 { left: 96px; animation-delay: 0.8s; }
@keyframes pressKey { 0%, 75% { transform: scaleY(1); } 90%, 100% { transform: scaleY(0.95); background: linear-gradient(to bottom, #e0e7ff, #c7d2fe); } }

/* FreewayFrenzy Styles — 2D top-down, faithful to actual game */
.freeway-bg {
    background: #0a0a0a;
    position: relative;
    overflow: hidden;
}

.fw-scene {
    position: absolute;
    inset: 0;
    display: flex;
}

/* Shoulders */
.fw-shoulder {
    flex: 1;
    background: #0a0a0a;
}
.fw-shoulder-l { border-right: 3px solid #333; }
.fw-shoulder-r { border-left: 3px solid #333; }

/* Road surface */
.fw-road-surface {
    position: relative;
    width: 60%;
    max-width: 200px;
    background: #181818;
    flex-shrink: 0;
}

/* Solid edge lines */
.fw-edge {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #333;
}
.fw-edge-l { left: 0; }
.fw-edge-r { right: 0; }

/* Dashed lane markings — scrolling */
.fw-lane-mark {
    position: absolute;
    top: -100%;
    bottom: 0;
    width: 3px;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 20px,
        #444 20px,
        #444 40px
    );
    animation: fwScrollLane 0.6s linear infinite;
}
.fm1 { left: 20%; }
.fm2 { left: 40%; }
.fm3 { left: 60%; }
.fm4 { left: 80%; }

@keyframes fwScrollLane {
    0%   { transform: translateY(0); }
    100% { transform: translateY(40px); }
}

/* Obstacle cars (top-down rectangles scrolling downward) */
.fw-obs {
    position: absolute;
    width: 22px;
    height: 36px;
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    animation: fwObsScroll 3s linear infinite;
}
.fw-obs::before {
    content: '';
    position: absolute;
    bottom: 1px;
    left: 2px;
    right: 2px;
    height: 6px;
    background: rgba(140,200,230,0.5);
    border-radius: 1px;
}
.fw-obs::after {
    content: '';
    position: absolute;
    top: 0;
    left: 1px;
    width: 4px;
    height: 3px;
    background: #f00;
    box-shadow: calc(22px - 6px) 0 0 0 #f00;
    border-radius: 1px;
}

/* Side traffic — safe lanes, scroll past cleanly */
.fw-obs-side1 {
    background: #1e90ff;
    left: 5%;
    animation: fwObsScroll 2.8s linear infinite;
    animation-delay: -0.5s;
}
.fw-obs-side2 {
    background: #32cd32;
    right: 5%;
    left: auto;
    animation: fwObsScroll 3.4s linear infinite;
    animation-delay: -2s;
}

@keyframes fwObsScroll {
    0%   { top: -40px; }
    100% { top: 110%; }
}

/* Crash obstacle — comes down center lane, stops at player */
.fw-obs-crash {
    background: #ffd700;
    left: 50%;
    transform: translateX(-50%);
    animation: fwCrashObs 5s ease-in infinite;
}

@keyframes fwCrashObs {
    0%   { top: -40px; opacity: 1; }
    55%  { top: calc(100% - 60px); opacity: 1; }
    60%  { top: calc(100% - 55px); opacity: 1; }
    65%, 100% { top: calc(100% - 55px); opacity: 1; }
}

/* Player car — stationary in center, shakes on crash */
.fw-player-car {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: 26px;
    height: 40px;
    background: #d90429;
    border-radius: 4px 4px 3px 3px;
    box-shadow: 2px 2px 0 #050505;
    z-index: 5;
    animation: fwPlayerShake 5s ease-in infinite;
}

@keyframes fwPlayerShake {
    0%, 54%  { transform: translateX(-50%); }
    56%  { transform: translateX(-50%) translateX(3px) translateY(-2px); }
    58%  { transform: translateX(-50%) translateX(-4px) translateY(1px); }
    60%  { transform: translateX(-50%) translateX(2px) translateY(-1px); }
    63%  { transform: translateX(-50%) translateX(-1px); }
    66%, 100% { transform: translateX(-50%); }
}

/* Roof */
.fw-pc-roof {
    position: absolute;
    top: 25%;
    left: 25%;
    width: 50%;
    height: 33%;
    background: #a3031f;
    border-radius: 1px;
}

/* Windshield */
.fw-pc-wind {
    position: absolute;
    top: 3px;
    left: 25%;
    width: 50%;
    height: 8px;
    background: #8ecae6;
    border-radius: 1px;
}

/* Headlights */
.fw-pc-hl {
    position: absolute;
    top: 1px;
    width: 4px;
    height: 2px;
    background: #ffff99;
    box-shadow: 0 0 4px rgba(255,255,150,0.6);
}
.fw-pc-hl-l { left: 2px; }
.fw-pc-hl-r { right: 2px; }

/* Taillights */
.fw-pc-tl {
    position: absolute;
    bottom: 1px;
    width: 5px;
    height: 3px;
    background: #ff0000;
    box-shadow: 0 0 6px rgba(255,0,0,0.6);
}
.fw-pc-tl-l { left: 2px; }
.fw-pc-tl-r { right: 2px; }

/* Crash flash */
.fw-crash-flash {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,170,0,0.9), rgba(255,68,0,0.5), transparent 70%);
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    animation: fwFlash 5s ease-in infinite;
}

@keyframes fwFlash {
    0%, 54%  { opacity: 0; transform: translateX(-50%) scale(0.3); }
    56%  { opacity: 1; transform: translateX(-50%) scale(1.2); }
    62%  { opacity: 0.6; transform: translateX(-50%) scale(1.5); }
    70%, 100% { opacity: 0; transform: translateX(-50%) scale(0.3); }
}

/* Debris particles */
.fw-debris {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 1px;
    z-index: 11;
    opacity: 0;
    pointer-events: none;
}

.fw-d1 { background: #ff4400; animation: fwDebris1 5s ease-out infinite; }
.fw-d2 { background: #ffaa00; animation: fwDebris2 5s ease-out infinite; }
.fw-d3 { background: #ff0000; animation: fwDebris3 5s ease-out infinite; }
.fw-d4 { background: #ccc;    animation: fwDebris4 5s ease-out infinite; }
.fw-d5 { background: #ffff44; animation: fwDebris5 5s ease-out infinite; }
.fw-d6 { background: #888;    animation: fwDebris6 5s ease-out infinite; }

@keyframes fwDebris1 {
    0%, 55% { bottom: 56px; left: 50%; opacity: 0; }
    56% { opacity: 1; }
    75% { bottom: 120px; left: 30%; opacity: 0; }
    100% { opacity: 0; }
}
@keyframes fwDebris2 {
    0%, 55% { bottom: 56px; left: 50%; opacity: 0; }
    56% { opacity: 1; }
    75% { bottom: 140px; left: 65%; opacity: 0; }
    100% { opacity: 0; }
}
@keyframes fwDebris3 {
    0%, 55% { bottom: 56px; left: 48%; opacity: 0; }
    56% { opacity: 1; }
    75% { bottom: 90px; left: 20%; opacity: 0; }
    100% { opacity: 0; }
}
@keyframes fwDebris4 {
    0%, 55% { bottom: 56px; left: 52%; opacity: 0; }
    56% { opacity: 1; }
    75% { bottom: 100px; left: 75%; opacity: 0; }
    100% { opacity: 0; }
}
@keyframes fwDebris5 {
    0%, 55% { bottom: 56px; left: 46%; opacity: 0; }
    56% { opacity: 1; }
    75% { bottom: 130px; left: 40%; opacity: 0; }
    100% { opacity: 0; }
}
@keyframes fwDebris6 {
    0%, 55% { bottom: 56px; left: 54%; opacity: 0; }
    56% { opacity: 1; }
    75% { bottom: 110px; left: 60%; opacity: 0; }
    100% { opacity: 0; }
}

/* Score HUD */
.fw-hud {
    position: absolute;
    top: 8px;
    left: 10px;
    font-family: monospace;
    font-size: 0.6rem;
    color: #ddd;
    font-weight: bold;
    letter-spacing: 0.05em;
    z-index: 10;
    pointer-events: none;
}

/* GAME OVER text */
.fw-hud-go {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: monospace;
    font-size: 0.7rem;
    font-weight: bold;
    color: #ff3333;
    z-index: 12;
    opacity: 0;
    pointer-events: none;
    text-shadow: 0 0 6px rgba(255,50,50,0.6);
    animation: fwGameOver 5s ease-in infinite;
}

@keyframes fwGameOver {
    0%, 58% { opacity: 0; }
    64% { opacity: 1; }
    85% { opacity: 1; }
    95%, 100% { opacity: 0; }
}

/* Orbital Styles */
.orbital-bg { background: radial-gradient(circle at center, #064e3b, #022c22); }
.molecule { position: relative; width: 100px; height: 100px; animation: rotateMol 12s infinite linear; }
.atom { position: absolute; width: 30px; height: 30px; border-radius: 50%; background: #10b981; box-shadow: 0 0 15px #10b981; border: 2px solid #fff; animation: pulseAtom 2s infinite alternate; }
.a1 { top: 0; left: 35px; } .a2 { bottom: 10px; left: 0; } .a3 { bottom: 10px; right: 0; }
.bond { position: absolute; background: rgba(16, 185, 129, 0.6); box-shadow: 0 0 8px rgba(16, 185, 129, 0.8); }
.b1 { width: 4px; height: 50px; top: 15px; left: 25px; transform: rotate(-35deg); }
.b2 { width: 4px; height: 50px; top: 15px; right: 25px; transform: rotate(35deg); }
@keyframes rotateMol { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes pulseAtom { 0% { box-shadow: 0 0 10px #10b981; } 100% { box-shadow: 0 0 25px #34d399; } }

/* Pocket Scholar Styles */
.ps-bg {
    background:
        radial-gradient(circle at 24% 18%, rgba(16, 185, 129, 0.2), transparent 34%),
        radial-gradient(circle at 78% 24%, rgba(250, 204, 21, 0.12), transparent 24%),
        linear-gradient(145deg, #08120f 0%, #0d1d17 48%, #091019 100%);
}

.ps-card-scene {
    --ps-ball-size: 18px;
    position: relative;
    width: min(214px, 84%);
    aspect-ratio: 16 / 10;
    border-radius: 24px;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 42%, rgba(33, 188, 118, 0.35), transparent 34%),
        radial-gradient(circle at 50% 44%, #0d8a61 0%, #0b6a4c 48%, #073a31 100%);
    border: 12px solid #5f3816;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.06),
        inset 0 0 40px rgba(0, 0, 0, 0.35),
        0 18px 40px rgba(0, 0, 0, 0.36);
    transform: rotate(-4deg);
}

.ps-card-scene::before {
    content: '';
    position: absolute;
    inset: 12px;
    border-radius: 16px;
    border: 3px solid rgba(8, 55, 42, 0.78);
    box-shadow:
        inset 0 0 24px rgba(0, 0, 0, 0.35),
        inset 0 0 0 1px rgba(255, 255, 255, 0.03);
    pointer-events: none;
}

.ps-card-scene::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(125deg, rgba(255, 255, 255, 0.12), transparent 24%),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 18px,
            rgba(255, 255, 255, 0.02) 18px,
            rgba(255, 255, 255, 0.02) 19px
        );
    mix-blend-mode: screen;
    pointer-events: none;
}

.ps-card-scene--hero {
    width: min(100%, 460px);
    --ps-ball-size: 28px;
    border-width: 16px;
    border-radius: 30px;
    transform: none;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.08),
        inset 0 0 56px rgba(0, 0, 0, 0.36),
        0 30px 70px rgba(0, 0, 0, 0.38);
}

.ps-card-scene--hero::before {
    inset: 16px;
    border-radius: 22px;
}

.ps-pocket {
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 42% 40%, #111827 0%, #020617 62%, rgba(0, 0, 0, 0.98) 100%);
    box-shadow:
        0 0 0 3px rgba(24, 14, 6, 0.9),
        0 0 18px rgba(0, 0, 0, 0.45);
    z-index: 2;
}

.ps-card-scene--hero .ps-pocket {
    width: 28px;
    height: 28px;
}

.ps-pocket-tl { top: 6px; left: 6px; }
.ps-pocket-tm { top: 4px; left: 50%; transform: translateX(-50%); }
.ps-pocket-tr { top: 6px; right: 6px; }
.ps-pocket-bl { bottom: 6px; left: 6px; }
.ps-pocket-bm { bottom: 4px; left: 50%; transform: translateX(-50%); }
.ps-pocket-br { bottom: 6px; right: 6px; }

.ps-diamond {
    position: absolute;
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, #fcd34d, #fde68a);
    transform: rotate(45deg);
    top: 50%;
    margin-top: -5px;
    box-shadow: 0 0 10px rgba(252, 211, 77, 0.3);
    opacity: 0.72;
}

.ps-card-scene--hero .ps-diamond {
    width: 12px;
    height: 12px;
    margin-top: -6px;
}

.ps-diamond-left { left: 14px; }
.ps-diamond-right { right: 14px; }

.ps-aim-trace {
    position: absolute;
    left: 22%;
    top: 66%;
    width: 42%;
    height: 4px;
    border-radius: 999px;
    background:
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0),
            rgba(255, 255, 255, 0.9) 18%,
            rgba(255, 255, 255, 0.22) 62%,
            rgba(255, 255, 255, 0)
        );
    transform-origin: left center;
    transform: rotate(-12deg);
    filter: blur(0.2px);
    animation: psAimTracePulse 5.8s ease-in-out infinite;
    z-index: 1;
}

.ps-card-scene--hero .ps-aim-trace {
    height: 5px;
}

.ps-cue-path,
.ps-object-path {
    position: absolute;
    border-radius: 999px;
    transform-origin: left center;
    pointer-events: none;
    z-index: 1;
}

.ps-cue-path {
    left: 26%;
    top: 49.5%;
    width: 18%;
    height: 3px;
    background:
        linear-gradient(90deg, rgba(191, 219, 254, 0), rgba(191, 219, 254, 0.78) 35%, rgba(191, 219, 254, 0.14));
    transform: rotate(-17deg);
    filter: blur(0.15px);
    animation: psCuePathPulse 5.8s ease-in-out infinite;
}

.ps-object-path {
    left: 60%;
    top: 45%;
    width: 20%;
    height: 3px;
    background:
        linear-gradient(90deg, rgba(254, 240, 138, 0), rgba(245, 158, 11, 0.88) 36%, rgba(124, 45, 18, 0.18));
    transform: rotate(-34deg);
    opacity: 0;
    filter: blur(0.15px);
    animation: psObjectPathBurst 5.8s ease-in-out infinite;
}

.ps-card-scene--hero .ps-cue-path,
.ps-card-scene--hero .ps-object-path {
    height: 4px;
}

.ps-ghost-ball,
.ps-power-ring,
.ps-impact-glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.ps-ghost-ball {
    left: 48%;
    top: 41%;
    width: var(--ps-ball-size);
    height: var(--ps-ball-size);
    background: rgba(251, 191, 36, 0.15);
    border: 1.4px dashed rgba(255, 255, 255, 0.52);
    box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.18);
    opacity: 0;
    z-index: 2;
    animation: psGhostBallBlink 5.8s ease-in-out infinite;
}

.ps-power-ring {
    left: calc(22% - 9px);
    top: calc(50% - 9px);
    width: calc(var(--ps-ball-size) + 18px);
    height: calc(var(--ps-ball-size) + 18px);
    border: 1.6px solid rgba(250, 204, 21, 0.34);
    box-shadow: 0 0 0 6px rgba(56, 189, 248, 0.08);
    opacity: 0;
    z-index: 2;
    animation: psPowerRingPulse 5.8s ease-in-out infinite;
}

.ps-cue-shadow,
.ps-cue-stick {
    position: absolute;
    left: -6%;
    top: 67%;
    width: 38%;
    height: 10px;
    border-radius: 999px;
    transform-origin: 92% 50%;
    z-index: 1;
}

.ps-card-scene--hero .ps-cue-shadow,
.ps-card-scene--hero .ps-cue-stick {
    height: 14px;
    width: 44%;
}

.ps-cue-shadow {
    background: rgba(0, 0, 0, 0.35);
    filter: blur(4px);
    transform: translateY(8px) rotate(-11deg);
    animation: psCueShadowDrift 5.8s ease-in-out infinite;
}

.ps-cue-stick {
    background:
        linear-gradient(
            90deg,
            #fdf1bf 0%,
            #eab308 10%,
            #d4a574 34%,
            #8b4513 68%,
            #2f1606 100%
        );
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        0 4px 12px rgba(0, 0, 0, 0.28);
    transform: rotate(-11deg);
    animation: psCueStroke 5.8s cubic-bezier(0.3, 0, 0.18, 1) infinite;
}

.ps-cue-stick::before {
    content: '';
    position: absolute;
    left: 0;
    top: 1px;
    width: 10px;
    height: calc(100% - 2px);
    border-radius: 999px;
    background: linear-gradient(180deg, #e0f2fe, #38bdf8);
}

.ps-cue-stick::after {
    content: '';
    position: absolute;
    right: 12%;
    top: 0;
    width: 26%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.92), rgba(30, 41, 59, 0.92));
}

.ps-ball {
    position: absolute;
    width: var(--ps-ball-size);
    height: var(--ps-ball-size);
    border-radius: 50%;
    box-shadow:
        0 8px 14px rgba(0, 0, 0, 0.32),
        inset -6px -7px 10px rgba(0, 0, 0, 0.38),
        inset 5px 6px 10px rgba(255, 255, 255, 0.18);
    z-index: 3;
}

.ps-ball::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.18) 20%, transparent 34%),
        radial-gradient(circle at 72% 78%, rgba(0, 0, 0, 0.25), transparent 42%);
    mix-blend-mode: screen;
}

.ps-ball-core {
    position: absolute;
    inset: 24%;
    border-radius: 50%;
    border: 1.5px solid rgba(15, 23, 42, 0.38);
    border-right-color: transparent;
    border-bottom-color: transparent;
    opacity: 0.78;
    animation: psSpinDial 0.9s linear infinite;
}

.ps-ball--cue .ps-ball-core {
    border-color: rgba(100, 116, 139, 0.5);
    border-right-color: transparent;
    border-bottom-color: transparent;
}

.ps-ball-mark {
    position: absolute;
    inset: 28%;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.95);
    color: #0f172a;
    font-size: calc(var(--ps-ball-size) * 0.33);
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    line-height: 1;
    box-shadow: inset 0 -1px 2px rgba(15, 23, 42, 0.16);
}

.ps-ball--stripe::before {
    content: '';
    position: absolute;
    left: 2px;
    right: 2px;
    top: 30%;
    height: 40%;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
}

.ps-ball--cue {
    left: 22%;
    top: 50%;
    transform: translateY(-50%);
    background: radial-gradient(circle at 30% 30%, #ffffff 0%, #edf2f7 58%, #94a3b8 100%);
    animation: psCueBallBreak 5.8s ease-in-out infinite;
}

/* Triangle rack — front ball */
.ps-ball--one {
    left: 58%;
    top: 50%;
    transform: translateY(-50%);
    background: radial-gradient(circle at 30% 30%, #fef08a 0%, #f59e0b 58%, #7c2d12 100%);
    animation: psObjectScatterOne 5.8s ease-in-out infinite;
}

.ps-ball--two {
    left: 63%;
    top: 61%;
    background: radial-gradient(circle at 30% 30%, #bfdbfe 0%, #3b82f6 58%, #1e3a8a 100%);
    animation: psObjectScatterTwo 5.8s ease-in-out 0.06s infinite;
}

/* Triangle rack — back left */
.ps-ball--eight {
    left: 67%;
    top: 37%;
    background: radial-gradient(circle at 30% 30%, #334155 0%, #111827 58%, #020617 100%);
    animation: psObjectScatterEight 5.8s ease-in-out 0.1s infinite;
}

/* Triangle rack — back right */
.ps-ball--three {
    left: 67%;
    top: 57%;
    background: radial-gradient(circle at 30% 30%, #fca5a5 0%, #ef4444 58%, #7f1d1d 100%);
    animation: psObjectScatterThree 5.8s ease-in-out 0.14s infinite;
}

.ps-impact-glow {
    left: 53.5%;
    top: 39%;
    width: calc(var(--ps-ball-size) * 1.9);
    height: calc(var(--ps-ball-size) * 1.9);
    background:
        radial-gradient(circle, rgba(250, 204, 21, 0.5) 0%, rgba(56, 189, 248, 0.18) 38%, rgba(16, 185, 129, 0) 72%);
    mix-blend-mode: screen;
    opacity: 0;
    z-index: 1;
    animation: psImpactBloom 5.8s ease-in-out infinite;
}

@keyframes psCueStroke {
    0%, 16%, 100% { transform: translate3d(0, 0, 0) rotate(-11deg); }
    24% { transform: translate3d(8px, -2px, 0) rotate(-11deg); }
    30% { transform: translate3d(42px, -10px, 0) rotate(-11deg); }
    42% { transform: translate3d(18px, -4px, 0) rotate(-11deg); }
}

@keyframes psCueShadowDrift {
    0%, 16%, 100% { transform: translateY(8px) rotate(-11deg); opacity: 0.32; }
    30% { transform: translate(32px, 4px) rotate(-11deg); opacity: 0.4; }
}

@keyframes psAimTracePulse {
    0%, 18%, 100% { opacity: 0.88; transform: rotate(-12deg) scaleX(1); }
    26% { opacity: 0.5; }
    32%, 62% { opacity: 0; transform: rotate(-12deg) scaleX(1.12); }
}

@keyframes psCuePathPulse {
    0%, 22%, 100% { opacity: 0.18; transform: rotate(-17deg) scaleX(0.9); }
    14% { opacity: 0.72; transform: rotate(-17deg) scaleX(1); }
    32%, 62% { opacity: 0; transform: rotate(-17deg) scaleX(1.06); }
}

@keyframes psObjectPathBurst {
    0%, 28%, 100% { opacity: 0; transform: rotate(-34deg) scaleX(0.84); }
    34% { opacity: 0.78; }
    44%, 64% { opacity: 0.42; transform: rotate(-34deg) scaleX(1.08); }
    76% { opacity: 0.12; }
}

@keyframes psGhostBallBlink {
    0%, 20%, 100% { opacity: 0.14; transform: scale(1); }
    30% { opacity: 0.44; transform: scale(1.02); }
    40%, 62% { opacity: 0; transform: scale(1.08); }
}

@keyframes psPowerRingPulse {
    0%, 12%, 100% { opacity: 0.12; transform: scale(0.86); }
    22% { opacity: 0.38; transform: scale(1.02); }
    30%, 52% { opacity: 0; transform: scale(1.18); }
}

@keyframes psCueBallBreak {
    0%, 18%, 100% { transform: translate3d(0, -50%, 0) scale(1); }
    26% { transform: translate3d(22px, -57%, 0) scale(1.02); }
    34%, 60% { transform: translate3d(76px, -72%, 0) scale(1.02); }
    76% { transform: translate3d(32px, -60%, 0) scale(0.98); }
}

@keyframes psObjectScatterOne {
    0%, 22%, 100% { transform: translate3d(0, -50%, 0) rotate(0deg); }
    34%, 62% { transform: translate3d(34px, -74%, 0) rotate(180deg); }
    76% { transform: translate3d(14px, -60%, 0) rotate(240deg); }
}

@keyframes psObjectScatterTwo {
    0%, 22%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
    34%, 62% { transform: translate3d(22px, 18px, 0) rotate(200deg); }
    76% { transform: translate3d(8px, 8px, 0) rotate(260deg); }
}

@keyframes psObjectScatterThree {
    0%, 22%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
    34%, 62% { transform: translate3d(38px, -4px, 0) rotate(160deg); }
    76% { transform: translate3d(14px, -2px, 0) rotate(240deg); }
}

@keyframes psObjectScatterEight {
    0%, 22%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
    34%, 62% { transform: translate3d(8px, -16px, 0) rotate(140deg); }
    76% { transform: translate3d(4px, -6px, 0) rotate(190deg); }
}

@keyframes psSpinDial {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes psImpactBloom {
    0%, 24%, 100% { opacity: 0; transform: scale(0.6); }
    33% { opacity: 0.55; transform: scale(1); }
    54% { opacity: 0.18; transform: scale(1.55); }
}

/* SupaSesh Styles */
.supasesh-bg { background: radial-gradient(ellipse at 30% 80%, #312e81, #1e1b4b 60%, #0f0d2e 100%); }
.supa-app-ui {
    width: 150px;
    background: rgba(255,255,255,0.06);
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    overflow: hidden;
    backdrop-filter: blur(6px);
}
.supa-header {
    display: flex;
    gap: 5px;
    padding: 10px 12px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.supa-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
}
.supa-dot:first-child { background: #f43f5e; }
.supa-dot:nth-child(2) { background: #f59e0b; }
.supa-dot:nth-child(3) { background: #10b981; }
.supa-card {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.supa-bar {
    height: 8px;
    border-radius: 4px;
    animation: supaSlide 2.5s infinite alternate ease-in-out;
}
.sb1 { width: 80%; background: linear-gradient(to right, #8b5cf6, #a78bfa); }
.sb2 { width: 100%; background: linear-gradient(to right, #3b82f6, #60a5fa); animation-delay: 0.3s; }
.sb3 { width: 60%; background: linear-gradient(to right, #10b981, #34d399); animation-delay: 0.6s; }
.supa-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 0 12px 10px;
}
.supa-stat {
    height: 28px;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
}

@keyframes supaSlide {
    0%, 20% { transform: scaleX(0.6); opacity: 0.5; }
    100% { transform: scaleX(1); opacity: 1; }
}

/* UCSD Radiology Styles */
.radiology-bg { background: radial-gradient(ellipse at 40% 60%, #1e3a5f, #0c1929 60%, #060d17 100%); }
.rad-ui { position: relative; width: 100px; height: 100px; }
.rad-cross { position: absolute; top: 50%; left: 50%; width: 60px; height: 60px; transform: translate(-50%, -50%); }
.rad-cross::before, .rad-cross::after { content: ''; position: absolute; background: rgba(59, 130, 246, 0.4); border-radius: 3px; }
.rad-cross::before { width: 8px; height: 60px; left: 50%; transform: translateX(-50%); }
.rad-cross::after { width: 60px; height: 8px; top: 50%; transform: translateY(-50%); }
.rad-scan-line { position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: linear-gradient(to right, transparent, rgba(59, 130, 246, 0.6), transparent); animation: radScan 2.5s ease-in-out infinite; box-shadow: 0 0 12px rgba(59, 130, 246, 0.4); }
@keyframes radScan { 0% { top: 0; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { top: 100%; opacity: 0; } }

/* ESP32-CAR Styles */
.esp32car-bg { background: radial-gradient(circle at 50% 60%, #1a1a2e, #0a0a15); overflow: hidden; }
.esp-pcb { position: relative; width: 110px; height: 100px; }
.esp-chip {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 48px; height: 48px;
    background: #1e293b;
    border: 1.5px solid rgba(245, 158, 11, 0.5);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.15), inset 0 0 8px rgba(0,0,0,0.4);
}
.esp-chip span {
    font-family: 'Inter', monospace;
    font-size: 0.55rem;
    font-weight: 700;
    color: #f59e0b;
    letter-spacing: 0.08em;
}
.esp-trace {
    position: absolute;
    background: rgba(245, 158, 11, 0.25);
    border-radius: 1px;
}
.esp-trace.t1 { width: 30px; height: 2px; top: 50%; right: 0; transform: translateY(-50%); animation: espPulseTrace 2s ease-in-out infinite; }
.esp-trace.t2 { height: 30px; width: 2px; left: 50%; top: 0; transform: translateX(-50%); animation: espPulseTrace 2s ease-in-out 0.5s infinite; }
.esp-trace.t3 { width: 25px; height: 2px; top: 50%; left: 0; transform: translateY(-50%); animation: espPulseTrace 2s ease-in-out 1s infinite; }
@keyframes espPulseTrace { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; box-shadow: 0 0 6px rgba(245,158,11,0.4); } }
.esp-pin-row {
    position: absolute; left: 50%; transform: translateX(-50%);
    display: flex; gap: 6px;
}
.esp-pin-row.top { top: 6px; }
.esp-pin-row.bottom { bottom: 6px; }
.esp-pin {
    width: 4px; height: 8px;
    background: rgba(148, 163, 184, 0.5);
    border-radius: 1px;
}
.esp-sensor {
    position: absolute;
    top: 50%; right: -2px;
    transform: translateY(-50%);
    display: flex; flex-direction: column; gap: 6px;
}
.esp-sensor-eye {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(16,185,129,0.6), rgba(16,185,129,0.15));
    border: 1px solid rgba(16,185,129,0.4);
    animation: espSensorPulse 1.5s ease-in-out infinite;
}
.esp-sensor-eye:last-child { animation-delay: 0.3s; }
@keyframes espSensorPulse { 0%, 100% { box-shadow: 0 0 4px rgba(16,185,129,0.2); } 50% { box-shadow: 0 0 12px rgba(16,185,129,0.6); } }
.esp-signal-wave {
    position: absolute;
    top: 8px; left: 8px;
    width: 16px; height: 16px;
    border: 2px solid rgba(239,68,68,0.4);
    border-radius: 50%;
    animation: espWave 2s ease-out infinite;
}
.esp-signal-wave::after {
    content: '';
    position: absolute;
    inset: 3px;
    border: 1.5px solid rgba(239,68,68,0.6);
    border-radius: 50%;
    animation: espWave 2s ease-out 0.4s infinite;
}
@keyframes espWave { 0% { transform: scale(0.5); opacity: 1; } 100% { transform: scale(1.8); opacity: 0; } }

/* Notchill Styles */
.notchill-bg { background: radial-gradient(ellipse at 50% 30%, #1c1c1e, #0a0a0a); }
.notch-shape { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.notch-pill { width: 120px; height: 28px; background: #000; border-radius: 14px; border: 1px solid rgba(255,255,255,0.1); position: relative; overflow: hidden; }
.notch-pill::after { content: ''; position: absolute; top: 8px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: #10b981; box-shadow: 0 0 8px #10b981; animation: notchPulse 2s infinite; }
.notch-media-bar { width: 140px; height: 36px; background: rgba(255,255,255,0.06); border-radius: 10px; border: 1px solid rgba(255,255,255,0.08); display: flex; align-items: center; justify-content: center; gap: 12px; animation: notchExpand 3s ease-in-out infinite; }
.notch-media-bar::before { content: ''; width: 0; height: 0; border-left: 10px solid rgba(255,255,255,0.5); border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.notch-media-bar::after { content: ''; width: 50px; height: 4px; background: linear-gradient(to right, #8b5cf6, rgba(139,92,246,0.2)); border-radius: 2px; animation: notchProgress 3s linear infinite; }
@keyframes notchPulse { 0%, 100% { box-shadow: 0 0 6px #10b981; } 50% { box-shadow: 0 0 14px #34d399; } }
@keyframes notchExpand { 0%, 100% { width: 140px; } 50% { width: 160px; } }
@keyframes notchProgress { 0% { width: 10px; } 100% { width: 50px; } }

/* Delivery Center Tycoon Styles */
.dct-bg { background: linear-gradient(135deg, #1a0f00, #2d1a00 40%, #0f0a00 100%); }
.dct-warehouse { position: relative; width: 120px; height: 80px; }
.dct-box { position: absolute; border-radius: 4px; border: 1.5px solid rgba(255,255,255,0.1); }
.dct-b1 { width: 28px; height: 28px; background: linear-gradient(135deg, #d97706, #b45309); bottom: 12px; left: 8px; animation: dctBob 2s ease-in-out infinite; }
.dct-b2 { width: 24px; height: 24px; background: linear-gradient(135deg, #dc2626, #b91c1c); bottom: 12px; left: 44px; animation: dctBob 2s ease-in-out 0.3s infinite; }
.dct-b3 { width: 26px; height: 26px; background: linear-gradient(135deg, #2563eb, #1d4ed8); bottom: 12px; right: 8px; animation: dctBob 2s ease-in-out 0.6s infinite; }
.dct-conveyor { position: absolute; bottom: 0; left: 0; width: 100%; height: 10px; background: repeating-linear-gradient(to right, #374151, #374151 8px, #1f2937 8px, #1f2937 16px); border-radius: 2px; animation: dctBelt 0.8s linear infinite; }
@keyframes dctBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes dctBelt { 0% { background-position: 0 0; } 100% { background-position: 16px 0; } }

/* miSO Styles */
.miso-bg { background: radial-gradient(circle at 60% 40%, #1e1b4b, #0f0d2e 60%, #08061a 100%); }
.miso-ui { display: flex; justify-content: center; align-items: center; }
.miso-window { width: 130px; background: rgba(255,255,255,0.06); border-radius: 10px; border: 1px solid rgba(255,255,255,0.1); overflow: hidden; }
.miso-dots { display: flex; gap: 5px; padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.miso-dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.15); }
.miso-dots span:first-child { background: #f43f5e; }
.miso-dots span:nth-child(2) { background: #f59e0b; }
.miso-dots span:nth-child(3) { background: #10b981; }
.miso-vm-icon { text-align: center; padding: 16px; font-size: 2rem; color: rgba(139, 92, 246, 0.8); animation: misoSpin 4s ease-in-out infinite; filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.4)); }
@keyframes misoSpin { 0%, 100% { transform: scale(1); opacity: 0.8; } 50% { transform: scale(1.15); opacity: 1; } }

/* Power Analysis Tool Styles */
.powertool-bg {
    background: radial-gradient(circle at 20% 0%, #1d4ed8, #0f172a 54%, #020617 100%);
}

.pat-mini {
    width: 170px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.7);
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.35);
    overflow: hidden;
}

.pat-head {
    display: flex;
    gap: 5px;
    padding: 9px 11px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.pat-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.5);
}

.pat-dot:nth-child(1) { background: #f87171; }
.pat-dot:nth-child(2) { background: #fbbf24; }
.pat-dot:nth-child(3) { background: #34d399; }

.pat-chart {
    position: relative;
    height: 48px;
    margin: 10px 10px 8px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.14);
    overflow: hidden;
}

.pat-axis {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 10px;
    height: 1px;
    background: rgba(148, 163, 184, 0.28);
}

.pat-line {
    position: absolute;
    left: 12px;
    right: 12px;
    top: 12px;
    height: 18px;
    border-bottom: 2px solid rgba(56, 189, 248, 0.9);
    border-left: 2px solid transparent;
    border-radius: 0 0 18px 8px;
    transform: skewX(-16deg);
    animation: patLinePulse 2.8s ease-in-out infinite;
}

@keyframes patLinePulse {
    0%, 100% { opacity: 0.8; transform: skewX(-16deg) translateY(0); }
    50% { opacity: 1; transform: skewX(-16deg) translateY(-2px); }
}

.pat-bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 32px;
    padding: 0 10px 10px;
}

.pat-bar {
    flex: 1;
    border-radius: 4px 4px 2px 2px;
    background: linear-gradient(180deg, #34d399, #0f766e);
    animation: patBarWave 2.6s ease-in-out infinite;
}

.pat-bar.b1 { height: 45%; animation-delay: 0s; }
.pat-bar.b2 { height: 70%; animation-delay: 0.2s; }
.pat-bar.b3 { height: 88%; animation-delay: 0.4s; }
.pat-bar.b4 { height: 56%; animation-delay: 0.6s; }

@keyframes patBarWave {
    0%, 100% { filter: brightness(0.95); transform: scaleY(1); }
    50% { filter: brightness(1.1); transform: scaleY(1.06); }
}

/* SignalScope Styles */
.signalscope-bg {
    background:
        radial-gradient(circle at 20% 18%, rgba(34, 211, 238, 0.24), transparent 30%),
        radial-gradient(circle at 82% 18%, rgba(16, 185, 129, 0.2), transparent 26%),
        linear-gradient(145deg, #07131b, #031018 56%, #01060c 100%);
}

.sig-mini {
    width: 176px;
    padding: 11px;
    border-radius: 22px;
    background: rgba(4, 12, 18, 0.72);
    border: 1px solid rgba(103, 232, 249, 0.16);
    box-shadow: 0 14px 34px rgba(2, 8, 14, 0.42);
}

.sig-mini-screen {
    padding: 10px;
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)),
        rgba(6, 18, 28, 0.9);
    border: 1px solid rgba(103, 232, 249, 0.12);
    display: grid;
    gap: 8px;
}

.sig-mini-head {
    display: flex;
    gap: 5px;
}

.sig-mini-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.45);
}

.sig-mini-dot:nth-child(1) { background: #fb7185; }
.sig-mini-dot:nth-child(2) { background: #fbbf24; }
.sig-mini-dot:nth-child(3) { background: #34d399; }

.sig-mini-chart {
    position: relative;
    height: 30px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(103, 232, 249, 0.12);
    background:
        linear-gradient(180deg, rgba(6, 18, 28, 0.9), rgba(6, 18, 28, 0.72)),
        rgba(7, 89, 133, 0.08);
}

.sig-mini-chart::before {
    content: '';
    position: absolute;
    inset: 6px 8px;
    background:
        linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
    background-size: 100% 7px, 14px 100%;
}

.sig-mini-chart::after {
    content: '';
    position: absolute;
    left: 6px;
    right: 6px;
    top: 7px;
    bottom: 7px;
    clip-path: polygon(0% 64%, 8% 62%, 14% 34%, 20% 78%, 29% 30%, 38% 56%, 47% 18%, 58% 74%, 68% 52%, 79% 40%, 90% 59%, 100% 54%);
    animation: sigMiniTrace 3.4s ease-in-out infinite;
}

.sig-mini-chart--ecg::after {
    background: linear-gradient(90deg, rgba(52, 211, 153, 0.16), rgba(52, 211, 153, 0.95), rgba(45, 212, 191, 0.32));
}

.sig-mini-chart--resp::after {
    clip-path: polygon(0% 55%, 11% 48%, 24% 60%, 38% 43%, 53% 64%, 67% 46%, 82% 58%, 100% 50%);
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.12), rgba(56, 189, 248, 0.9), rgba(125, 211, 252, 0.26));
    animation-delay: 0.4s;
}

@keyframes sigMiniTrace {
    0%, 100% { transform: translateX(0) translateY(0); opacity: 0.9; }
    50% { transform: translateX(1.5px) translateY(-1px); opacity: 1; }
}

.sig-mini-kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.sig-mini-kpi {
    padding: 8px 9px;
    border-radius: 10px;
    background: rgba(8, 15, 22, 0.88);
    border: 1px solid rgba(103, 232, 249, 0.12);
    display: grid;
    gap: 3px;
}

.sig-mini-kpi span {
    font-size: 0.58rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.86);
}

.sig-mini-kpi strong {
    font-size: 0.86rem;
    color: #ecfeff;
}

/* DoseFlow Styles */
.doseflow-bg {
    background:
        radial-gradient(circle at 18% 18%, rgba(245, 158, 11, 0.24), transparent 28%),
        radial-gradient(circle at 84% 16%, rgba(248, 113, 113, 0.16), transparent 24%),
        linear-gradient(145deg, #17100a, #140d12 52%, #070509 100%);
}

.dose-mini {
    position: relative;
    width: 180px;
    height: 122px;
    padding: 12px;
    border-radius: 22px;
    border: 1px solid rgba(251, 191, 36, 0.16);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0)),
        rgba(14, 9, 12, 0.82);
    box-shadow: 0 14px 32px rgba(6, 4, 8, 0.45);
}

.dose-mini-bag {
    position: absolute;
    left: 15px;
    top: 18px;
    width: 34px;
    height: 54px;
    border-radius: 16px 16px 12px 12px;
    border: 1px solid rgba(253, 230, 138, 0.3);
    background: linear-gradient(180deg, rgba(254, 243, 199, 0.08), rgba(251, 191, 36, 0.22));
    box-shadow: inset 0 -14px 0 rgba(245, 158, 11, 0.32);
}

.dose-mini-bag::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    width: 8px;
    height: 12px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: rgba(253, 230, 138, 0.9);
}

.dose-mini-line {
    position: absolute;
    left: 47px;
    top: 48px;
    width: 38px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.6), rgba(251, 191, 36, 0.08));
}

.dose-mini-line::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transform: translateY(-50%);
    background: #fde68a;
    box-shadow: 0 0 12px rgba(253, 230, 138, 0.65);
    animation: doseMiniFlow 1.8s ease-in-out infinite;
}

@keyframes doseMiniFlow {
    0%, 100% { transform: translate(-10px, -50%); opacity: 0.3; }
    55% { transform: translate(0, -50%); opacity: 1; }
}

.dose-mini-panel {
    position: absolute;
    inset: 16px 14px 16px 86px;
    padding: 10px;
    border-radius: 16px;
    background: rgba(17, 24, 39, 0.66);
    border: 1px solid rgba(251, 191, 36, 0.14);
    display: grid;
    gap: 8px;
}

.dose-mini-alert {
    height: 9px;
    width: 52%;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(248, 113, 113, 0.92), rgba(251, 191, 36, 0.84));
    box-shadow: 0 0 12px rgba(248, 113, 113, 0.28);
}

.dose-mini-row {
    height: 11px;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.1);
    position: relative;
    overflow: hidden;
}

.dose-mini-row::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.12), rgba(45, 212, 191, 0.86));
    animation: doseMiniRowSlide 3.1s ease-in-out infinite;
}

.dose-mini-row--one::after { width: 66%; }
.dose-mini-row--two::after { width: 86%; animation-delay: 0.25s; }
.dose-mini-row--three::after { width: 54%; animation-delay: 0.5s; }

@keyframes doseMiniRowSlide {
    0%, 100% { transform: scaleX(0.92); transform-origin: left; }
    50% { transform: scaleX(1); transform-origin: left; }
}

/* AtlasFold Styles */
.atlasfold-bg {
    background:
        radial-gradient(circle at 24% 20%, rgba(59, 130, 246, 0.2), transparent 30%),
        radial-gradient(circle at 82% 18%, rgba(34, 211, 238, 0.18), transparent 24%),
        linear-gradient(145deg, #07111f, #060c18 56%, #02040a 100%);
}

.atlas-mini {
    position: relative;
    width: 184px;
    height: 122px;
    border-radius: 22px;
    border: 1px solid rgba(96, 165, 250, 0.16);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0)),
        rgba(5, 10, 20, 0.82);
    box-shadow: 0 14px 32px rgba(2, 6, 23, 0.42);
}

.atlas-mini-core {
    position: absolute;
    top: 50%;
    left: 44%;
    width: 84px;
    height: 84px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(191, 219, 254, 0.76), rgba(56, 189, 248, 0.26) 38%, rgba(15, 23, 42, 0.2) 66%, rgba(15, 23, 42, 0));
    filter: drop-shadow(0 0 18px rgba(56, 189, 248, 0.18));
}

.atlas-mini-slice {
    position: absolute;
    inset: 50% auto auto 50%;
    width: 74px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid rgba(148, 197, 255, 0.34);
    background: rgba(96, 165, 250, 0.08);
    transform-origin: center;
}

.ams1 { transform: translate(-50%, -50%) rotate(10deg); }
.ams2 { transform: translate(-50%, -50%) rotate(-40deg); }
.ams3 { transform: translate(-50%, -50%) rotate(72deg); }

.atlas-mini-orbit {
    position: absolute;
    inset: 19px 40px 19px 18px;
    border-radius: 50%;
    border: 1px dashed rgba(125, 211, 252, 0.26);
    animation: atlasMiniOrbit 9s linear infinite;
}

@keyframes atlasMiniOrbit {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.atlas-mini-sidebar {
    position: absolute;
    top: 18px;
    right: 14px;
    width: 34px;
    display: grid;
    gap: 8px;
}

.atlas-mini-chip {
    height: 22px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(96, 165, 250, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

/* The Cell Styles */
.cellstudy-bg {
    background:
        radial-gradient(circle at 24% 18%, rgba(52, 211, 153, 0.24), transparent 28%),
        radial-gradient(circle at 78% 26%, rgba(96, 165, 250, 0.22), transparent 30%),
        linear-gradient(145deg, #071419, #08111c 54%, #04101a 100%);
}

.cellstudy-mini {
    position: relative;
    width: 190px;
    height: 122px;
}

.cellstudy-orb {
    position: absolute;
    inset: 8px 34px 8px 10px;
    border-radius: 999px;
    background:
        radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.18), transparent 32%),
        radial-gradient(circle at 46% 50%, rgba(52, 211, 153, 0.28), rgba(5, 18, 30, 0.92) 72%);
    border: 1px solid rgba(110, 231, 183, 0.2);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.04),
        0 20px 40px rgba(0, 0, 0, 0.26);
}

.cellstudy-orb::before {
    content: '';
    position: absolute;
    inset: 12px;
    border-radius: inherit;
    border: 1px dashed rgba(167, 243, 208, 0.18);
}

.cellstudy-nucleus {
    position: absolute;
    left: 50px;
    top: 40px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.86), rgba(96, 165, 250, 0.82) 48%, rgba(37, 99, 235, 0.2) 100%);
    box-shadow: 0 0 18px rgba(96, 165, 250, 0.24);
}

.cellstudy-mito {
    position: absolute;
    width: 34px;
    height: 16px;
    border-radius: 999px;
    border: 1px solid rgba(253, 186, 116, 0.26);
    background:
        repeating-linear-gradient(
            90deg,
            rgba(251, 146, 60, 0.24),
            rgba(251, 146, 60, 0.24) 5px,
            rgba(245, 158, 11, 0.5) 5px,
            rgba(245, 158, 11, 0.5) 10px
        );
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.16);
}

.cellstudy-mito--one {
    left: 34px;
    top: 22px;
    transform: rotate(-18deg);
}

.cellstudy-mito--two {
    right: 56px;
    bottom: 24px;
    transform: rotate(12deg);
}

.cellstudy-dna {
    position: absolute;
    right: 10px;
    top: 18px;
    width: 44px;
    height: 78px;
    border-radius: 999px;
    border-left: 2px solid rgba(96, 165, 250, 0.7);
    border-right: 2px solid rgba(52, 211, 153, 0.72);
    box-shadow: 0 0 14px rgba(96, 165, 250, 0.18);
}

.cellstudy-dna::before,
.cellstudy-dna::after {
    content: '';
    position: absolute;
    left: 4px;
    right: 4px;
    height: 2px;
    background: rgba(224, 242, 254, 0.82);
    box-shadow:
        0 12px 0 rgba(224, 242, 254, 0.75),
        0 24px 0 rgba(224, 242, 254, 0.68),
        0 36px 0 rgba(224, 242, 254, 0.72),
        0 48px 0 rgba(224, 242, 254, 0.62),
        0 60px 0 rgba(224, 242, 254, 0.58);
}

.cellstudy-dna::after {
    transform: rotate(18deg);
    opacity: 0.45;
}

.cellstudy-signal {
    position: absolute;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(52, 211, 153, 0), rgba(52, 211, 153, 0.82), rgba(96, 165, 250, 0));
    animation: cellstudySignalSweep 3.2s ease-in-out infinite;
}

.cellstudy-signal--one {
    left: 24px;
    top: 58px;
    width: 84px;
}

.cellstudy-signal--two {
    left: 62px;
    bottom: 28px;
    width: 74px;
    animation-delay: 0.9s;
}

@keyframes cellstudySignalSweep {
    0%, 100% { transform: scaleX(0.7); opacity: 0.42; }
    50% { transform: scaleX(1); opacity: 1; }
}

.cellstudy-chip {
    position: absolute;
    min-height: 20px;
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: rgba(7, 18, 28, 0.86);
    border: 1px solid rgba(148, 163, 184, 0.14);
    color: rgba(226, 232, 240, 0.88);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.cellstudy-chip--one { left: 12px; bottom: 10px; }
.cellstudy-chip--two { right: 6px; top: 8px; }
.cellstudy-chip--three { right: 22px; bottom: 8px; }

/* ——— DNA Bases Card ——— */
.dnabases-bg {
    background:
        radial-gradient(circle at 30% 20%, rgba(96, 165, 250, 0.18), transparent 34%),
        radial-gradient(circle at 76% 78%, rgba(6, 182, 212, 0.14), transparent 30%),
        linear-gradient(145deg, #080e18 0%, #0a1120 48%, #0c0f1a 100%);
}

.dnabases-mini {
    position: relative;
    width: 100%; height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.dnabases-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.dnabases-letter {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 38px;
    font-weight: 700;
    width: 56px; height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.15);
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(6px);
    transition: transform 0.3s ease;
}

.dnabases-letter--a { color: #60a5fa; }
.dnabases-letter--t { color: #f59e0b; }
.dnabases-letter--g { color: #34d399; }
.dnabases-letter--c { color: #c084fc; }

.dnabases-hbond-line {
    display: flex;
    gap: 16px;
}

.dnabases-pair {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 500;
    color: rgba(148, 163, 184, 0.6);
    letter-spacing: 0.05em;
}

/* ——— DNA Molecule Builder Card ——— */
.dnamol-bg {
    background:
        radial-gradient(circle at 24% 18%, rgba(20, 184, 166, 0.16), transparent 30%),
        radial-gradient(circle at 82% 78%, rgba(11, 120, 196, 0.14), transparent 30%),
        linear-gradient(145deg, #07111a 0%, #091823 48%, #0b1320 100%);
}

.dnamol-mini {
    position: relative;
    width: 100%;
    height: 100%;
}

.dnamol-backbone {
    position: absolute;
    left: 22px;
    right: 24px;
    top: 50%;
    height: 4px;
    transform: translateY(-50%);
    background: linear-gradient(90deg, rgba(226, 232, 240, 0.38), rgba(226, 232, 240, 0.65));
}

.dnamol-phosphate,
.dnamol-sugar {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
}

.dnamol-phosphate {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid rgba(45, 212, 191, 0.48);
    background: rgba(20, 184, 166, 0.2);
    box-shadow: 0 0 18px rgba(20, 184, 166, 0.16);
}

.dnamol-sugar {
    width: 30px;
    height: 30px;
    background: rgba(255, 250, 241, 0.9);
    clip-path: polygon(12% 46%, 38% 8%, 82% 18%, 88% 70%, 36% 92%);
    box-shadow: 0 0 18px rgba(255, 255, 255, 0.1);
}

.dnamol-phosphate--one { left: 16%; }
.dnamol-sugar--one { left: 34%; }
.dnamol-phosphate--two { left: 52%; }
.dnamol-sugar--two { left: 70%; }
.dnamol-phosphate--three { left: 88%; }

.dnamol-base {
    position: absolute;
    width: 36px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    font-weight: 700;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.56);
}

.dnamol-base--a {
    left: 28%;
    top: 24%;
    color: #60c8ff;
}

.dnamol-base--g {
    left: 63%;
    top: 24%;
    color: #74e39c;
}

.dnamol-base--t {
    left: 78%;
    top: 68%;
    color: #f7b955;
}

.dnamol-caption {
    position: absolute;
    left: 22px;
    bottom: 18px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.7);
}

body[data-theme-mode="light"] .ps-bg {
    background:
        radial-gradient(circle at 24% 18%, rgba(16, 185, 129, 0.14), transparent 34%),
        radial-gradient(circle at 78% 24%, rgba(245, 158, 11, 0.1), transparent 24%),
        linear-gradient(145deg, #eefbf5 0%, #ddf5ec 48%, #edf5ff 100%);
}

body[data-theme-mode="light"] .dnamol-bg {
    background:
        radial-gradient(circle at 24% 18%, rgba(20, 184, 166, 0.12), transparent 30%),
        radial-gradient(circle at 82% 78%, rgba(11, 120, 196, 0.1), transparent 30%),
        linear-gradient(145deg, #f4fbff 0%, #e5f2fb 48%, #edf8ff 100%);
}

body[data-theme-mode="light"] .dnamol-backbone {
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.28), rgba(15, 23, 42, 0.58));
}

body[data-theme-mode="light"] .dnamol-phosphate {
    border-color: rgba(15, 118, 110, 0.34);
    background: rgba(15, 118, 110, 0.12);
    box-shadow: 0 0 14px rgba(15, 118, 110, 0.14);
}

body[data-theme-mode="light"] .dnamol-sugar {
    box-shadow: 0 0 16px rgba(148, 163, 184, 0.18);
}

body[data-theme-mode="light"] .dnamol-base {
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(15, 23, 42, 0.12);
}

body[data-theme-mode="light"] .dnamol-base--a { color: #0369a1; }
body[data-theme-mode="light"] .dnamol-base--g { color: #166534; }
body[data-theme-mode="light"] .dnamol-base--t { color: #b45309; }

body[data-theme-mode="light"] .dnamol-caption {
    color: #334155;
}

body[data-theme-mode="light"] .carplay-bg {
    background: radial-gradient(ellipse at 50% 60%, #ecf5ff 0%, #dde9fb 100%);
}

body[data-theme-mode="light"] .notchill-bg {
    background: radial-gradient(ellipse at 50% 30%, #eef2f7, #dfe5ee);
}

body[data-theme-mode="light"] .powertool-bg {
    background: radial-gradient(circle at 20% 0%, #dbeafe, #f8fbff 54%, #edf4ff 100%);
}

body[data-theme-mode="light"] .orbital-bg {
    background: radial-gradient(circle at center, #d7f7ec, #edfdf7);
}

body[data-theme-mode="light"] .radiology-bg {
    background: radial-gradient(ellipse at 40% 60%, #dbeafe, #eef5ff 60%, #f8fbff 100%);
}

body[data-theme-mode="light"] .pianoviz-bg {
    background: radial-gradient(circle at top, #e9e7ff, #f5f3ff);
}

body[data-theme-mode="light"] .freeway-bg {
    background: linear-gradient(180deg, #eef2f7, #dbe4ef);
}

body[data-theme-mode="light"] .supasesh-bg {
    background: radial-gradient(ellipse at 30% 80%, #ede9fe, #f5f3ff 60%, #eef2ff 100%);
}

body[data-theme-mode="light"] .signalscope-bg {
    background:
        radial-gradient(circle at 20% 18%, rgba(34, 211, 238, 0.16), transparent 30%),
        radial-gradient(circle at 82% 18%, rgba(16, 185, 129, 0.12), transparent 26%),
        linear-gradient(145deg, #eefcff, #eefbf8 56%, #f8fbff 100%);
}

body[data-theme-mode="light"] .doseflow-bg {
    background:
        radial-gradient(circle at 18% 18%, rgba(245, 158, 11, 0.16), transparent 28%),
        radial-gradient(circle at 84% 16%, rgba(248, 113, 113, 0.1), transparent 24%),
        linear-gradient(145deg, #fff8ef, #fff4f2 52%, #fdfcff 100%);
}

body[data-theme-mode="light"] .atlasfold-bg {
    background:
        radial-gradient(circle at 24% 20%, rgba(59, 130, 246, 0.14), transparent 30%),
        radial-gradient(circle at 82% 18%, rgba(34, 211, 238, 0.12), transparent 24%),
        linear-gradient(145deg, #eef5ff, #f3f9ff 56%, #fbfdff 100%);
}

body[data-theme-mode="light"] .dnabases-bg {
    background:
        radial-gradient(circle at 30% 20%, rgba(59, 130, 246, 0.12), transparent 30%),
        radial-gradient(circle at 76% 78%, rgba(6, 182, 212, 0.1), transparent 26%),
        linear-gradient(145deg, #eef5ff, #f0f8ff 50%, #f8fbff 100%);
}

body[data-theme-mode="light"] .dnabases-letter {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(15, 23, 42, 0.1);
}

body[data-theme-mode="light"] .dnabases-letter--a { color: #2563eb; }
body[data-theme-mode="light"] .dnabases-letter--t { color: #d97706; }
body[data-theme-mode="light"] .dnabases-letter--g { color: #059669; }
body[data-theme-mode="light"] .dnabases-letter--c { color: #7c3aed; }

body[data-theme-mode="light"] .dnabases-pair {
    color: #334155;
}

/* ——— DNA Replication card ——— */
.dnarepl-bg {
    background:
        radial-gradient(circle at 20% 20%, rgba(16, 185, 129, 0.15), transparent 45%),
        radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.15), transparent 45%),
        linear-gradient(135deg, #090f19 0%, #111a2d 100%);
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.5);
}

.dnarepl-mini {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 10px;
    overflow: hidden;
}

.dnarepl-fork {
    position: relative;
    width: min(180px, 100%);
    height: 100px;
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.2));
}

.dnarepl-strand {
    position: absolute;
    border-radius: 6px;
}

.dnarepl-strand--parent {
    top: 42px;
    left: 0;
    width: 60px;
    height: 16px;
    border-top: 4px solid rgba(148, 163, 184, 0.8);
    border-bottom: 4px solid rgba(148, 163, 184, 0.8);
    box-shadow: 0 0 10px rgba(148, 163, 184, 0.2);
}

.dnarepl-strand--leading {
    top: 20px;
    left: 56px;
    width: 110px;
    height: 0;
    border-top: 4px solid #3b82f6;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
    transform: rotate(-25deg);
    transform-origin: left center;
}

.dnarepl-strand--lagging {
    top: 64px;
    left: 56px;
    width: 110px;
    height: 0;
    transform: rotate(25deg);
    transform-origin: left center;
    display: flex;
    gap: 8px;
}

.dnarepl-frag {
    flex: 1;
    height: 0;
    border-top: 4px solid #10b981;
    border-radius: 3px;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.dnarepl-frag:first-child {
    border-top-color: #ec4899;
    box-shadow: 0 0 10px rgba(236, 72, 153, 0.3);
    flex: 0.4;
}

.dnarepl-labels {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    z-index: 10;
}

.dnarepl-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dnarepl-label--enz { color: #3b82f6; }
.dnarepl-label--enz2 { color: #f59e0b; }
.dnarepl-label--enz3 { color: #10b981; }

body[data-theme-mode="light"] .dnarepl-bg {
    background:
    radial-gradient(circle at 22% 28%, rgba(16, 185, 129, 0.14), transparent 30%),
    radial-gradient(circle at 82% 70%, rgba(59, 130, 246, 0.12), transparent 26%),
    linear-gradient(145deg, #eefbf5, #eef8ff 50%, #f8fbff 100%);
}

body[data-theme-mode="light"] .dnarepl-label {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(15, 23, 42, 0.1);
}

body[data-theme-mode="light"] .dnarepl-label--enz { color: #1d4ed8; }
body[data-theme-mode="light"] .dnarepl-label--enz2 { color: #b45309; }
body[data-theme-mode="light"] .dnarepl-label--enz3 { color: #047857; }

body[data-theme-mode="light"] .dnarepl-strand--parent {
    border-top-color: rgba(71, 85, 105, 0.5);
    border-bottom-color: rgba(71, 85, 105, 0.5);
}

@media (max-width: 480px) {
    .dnarepl-mini {
        padding: 8px 9px;
        gap: 7px;
    }

    .dnarepl-fork {
        width: min(138px, 100%);
        height: 80px;
    }

    .dnarepl-strand--parent {
        top: 31px;
        width: 50px;
        height: 13px;
    }

    .dnarepl-strand--leading,
    .dnarepl-strand--lagging {
        left: 48px;
        width: 82px;
    }

    .dnarepl-strand--leading {
        top: 16px;
    }

    .dnarepl-strand--lagging {
        top: 50px;
        gap: 5px;
    }

    .dnarepl-labels {
        gap: 5px;
    }

    .dnarepl-label {
        font-size: 9px;
        padding: 2px 5px;
    }
}

body[data-theme-mode="light"] .cellstudy-bg {
    background:
        radial-gradient(circle at 24% 18%, rgba(52, 211, 153, 0.16), transparent 28%),
        radial-gradient(circle at 78% 26%, rgba(96, 165, 250, 0.14), transparent 30%),
        linear-gradient(145deg, #eefbf8, #eef7fb 54%, #f8fbff 100%);
}

body[data-theme-mode="light"] .ekg-bg {
    background: linear-gradient(135deg, #eefbf5, #eaf7f1 46%, #f6faf8 100%);
}

body[data-theme-mode="light"] .dct-bg {
    background: linear-gradient(135deg, #fff4e5, #ffedd5 40%, #fff8f1 100%);
}

body[data-theme-mode="light"] .miso-bg {
    background: radial-gradient(circle at 60% 40%, #ede9fe, #f5f3ff 60%, #f8f8ff 100%);
}

body[data-theme-mode="light"] .esp32car-bg {
    background: radial-gradient(circle at 50% 60%, #eef2ff, #f7f9ff);
}

body[data-theme-mode="light"] .cp-speed-box,
body[data-theme-mode="light"] .cp-mini-map,
body[data-theme-mode="light"] .cp-mini-media,
body[data-theme-mode="light"] .pat-mini,
body[data-theme-mode="light"] .sig-mini,
body[data-theme-mode="light"] .dose-mini,
body[data-theme-mode="light"] .atlas-mini,
body[data-theme-mode="light"] .miso-window,
body[data-theme-mode="light"] .supa-app-ui,
body[data-theme-mode="light"] .notch-media-bar {
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(148, 163, 184, 0.18);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
}

body[data-theme-mode="light"] .cp-speed-num,
body[data-theme-mode="light"] .sig-mini-kpi strong,
body[data-theme-mode="light"] .miso-vm-icon,
body[data-theme-mode="light"] .esp-chip span {
    color: #0f172a;
}

body[data-theme-mode="light"] .cp-speed-unit,
body[data-theme-mode="light"] .cp-nav-dist,
body[data-theme-mode="light"] .sig-mini-kpi span,
body[data-theme-mode="light"] .fw-hud {
    color: #334155;
}

body[data-theme-mode="light"] .fw-road-surface,
body[data-theme-mode="light"] .fw-shoulder {
    background: #e2e8f0;
}

body[data-theme-mode="light"] .fw-edge {
    background: rgba(100, 116, 139, 0.5);
}

body[data-theme-mode="light"] .fw-lane-mark {
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 20px,
        rgba(100, 116, 139, 0.45) 20px,
        rgba(100, 116, 139, 0.45) 40px
    );
}

/* Concept Project Pages */
.concept-showcase {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
    gap: 1.25rem;
    padding: 0 1.25rem 1.25rem;
    align-items: stretch;
}

.concept-showcase-copy,
.concept-showcase-visual {
    min-width: 0;
    border-radius: 22px;
    border: 1px solid var(--surface-lifted-border);
    background: var(--surface-lifted);
    box-shadow: var(--surface-lifted-shadow);
}

.concept-showcase-copy {
    padding: 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.concept-overline {
    font-size: 0.76rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--accent-label-color);
}

.concept-showcase-copy h2 {
    font-size: clamp(1.75rem, 2.8vw, 2.45rem);
    line-height: 1.04;
    letter-spacing: -0.04em;
    text-wrap: balance;
}

.concept-lead {
    color: color-mix(in srgb, var(--text-main) 82%, transparent);
    line-height: 1.78;
    font-size: 1rem;
}

.concept-showcase-visual {
    padding: 1.2rem;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.signal-console,
.dose-console,
.atlas-console {
    width: 100%;
    min-height: 100%;
}

.signal-console {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 1rem;
}

.signal-console__rail,
.signal-console__main,
.dose-console__panel,
.atlas-console__sidebar {
    display: grid;
    gap: 0.85rem;
}

.signal-console__rail {
    align-content: start;
}

.signal-console__patient,
.signal-console__banner,
.signal-console__chart,
.signal-console__metric,
.dose-console__lane,
.dose-console__summary,
.dose-console__check,
.atlas-console__chapter,
.atlas-console__chipset,
.atlas-console__floating-card {
    border-radius: 18px;
    border: 1px solid var(--soft-border);
    background:
        linear-gradient(180deg, color-mix(in srgb, white 4%, transparent), transparent),
        color-mix(in srgb, var(--bg-surface) 88%, transparent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.signal-console__patient {
    padding: 0.9rem;
    display: grid;
    gap: 0.35rem;
}

.signal-console__patient span,
.dose-console__lane span,
.atlas-console__chapter span,
.atlas-console__floating-card span {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(148, 163, 184, 0.85);
}

.signal-console__patient strong,
.dose-console__lane strong,
.dose-console__summary strong,
.atlas-console__chapter strong,
.atlas-console__floating-card strong {
    font-size: 0.96rem;
    color: var(--text-main);
}

.signal-console__patient small,
.dose-console__lane small,
.dose-console__summary small,
.atlas-console__chapter small,
.atlas-console__floating-card small {
    color: var(--text-muted);
    line-height: 1.55;
}

.signal-console__patient--active {
    border-color: rgba(45, 212, 191, 0.32);
    background:
        linear-gradient(180deg, rgba(45, 212, 191, 0.14), rgba(45, 212, 191, 0.02)),
        rgba(4, 15, 20, 0.92);
}

.signal-console__main {
    align-content: start;
}

.signal-console__banner {
    padding: 0.9rem 1rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.signal-console__banner em {
    font-style: normal;
    color: var(--text-muted);
    font-size: 0.84rem;
}

.signal-console__banner strong {
    font-size: 1rem;
    color: var(--text-main);
}

.signal-console__status-pill {
    padding: 0.42rem 0.72rem;
    border-radius: 999px;
    background: var(--status-pill-bg);
    border: 1px solid var(--status-pill-border);
    color: var(--status-pill-text);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
}

.signal-console__charts {
    display: grid;
    gap: 0.85rem;
}

.signal-console__chart {
    position: relative;
    padding: 0.95rem 1rem;
    min-height: 108px;
    overflow: hidden;
}

.signal-console__chart::before {
    content: '';
    position: absolute;
    inset: 18px 18px 18px 18px;
    border-radius: 12px;
    background:
        linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
    background-size: 100% 14px, 16px 100%;
}

.signal-console__chart::after {
    content: '';
    position: absolute;
    left: 22px;
    right: 22px;
    top: 38px;
    height: 34px;
    clip-path: polygon(0% 62%, 9% 60%, 16% 30%, 24% 76%, 33% 27%, 42% 58%, 51% 12%, 61% 72%, 71% 50%, 82% 36%, 90% 61%, 100% 56%);
    animation: signalConsoleTrace 4.2s ease-in-out infinite;
}

.signal-console__chart--resp::after {
    clip-path: polygon(0% 56%, 10% 48%, 22% 61%, 35% 42%, 48% 64%, 61% 44%, 74% 59%, 88% 46%, 100% 53%);
}

.signal-console__chart--ppg::after {
    clip-path: polygon(0% 54%, 8% 66%, 18% 48%, 27% 62%, 37% 46%, 48% 57%, 58% 40%, 70% 58%, 82% 44%, 92% 55%, 100% 50%);
}

.signal-console__chart--ecg::after {
    background: linear-gradient(90deg, rgba(45, 212, 191, 0.12), rgba(52, 211, 153, 0.95), rgba(45, 212, 191, 0.26));
}

.signal-console__chart--resp::after {
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.12), rgba(56, 189, 248, 0.92), rgba(125, 211, 252, 0.3));
    animation-delay: 0.35s;
}

.signal-console__chart--ppg::after {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.12), rgba(20, 184, 166, 0.92), rgba(103, 232, 249, 0.24));
    animation-delay: 0.7s;
}

@keyframes signalConsoleTrace {
    0%, 100% { transform: translateX(0) translateY(0); opacity: 0.92; }
    50% { transform: translateX(2px) translateY(-1px); opacity: 1; }
}

.signal-console__chart-label,
.dose-console__lane-head,
.atlas-console__stage-head {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: baseline;
}

.signal-console__chart-label strong,
.dose-console__lane-head strong,
.atlas-console__stage-head strong {
    font-size: 0.94rem;
    color: #f8fafc;
}

.signal-console__chart-label span,
.dose-console__lane-head span,
.atlas-console__stage-head span {
    font-size: 0.74rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.88);
}

.signal-console__metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.signal-console__metric {
    padding: 0.95rem;
    display: grid;
    gap: 0.35rem;
}

.signal-console__metric span {
    font-size: 0.74rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.88);
}

.signal-console__metric strong {
    font-size: 1.08rem;
    color: #ecfeff;
}

.signal-console__metric small {
    color: #9fb0c8;
    line-height: 1.5;
}

.dose-console {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 270px;
    gap: 1rem;
}

.dose-console__timeline {
    display: grid;
    gap: 0.9rem;
}

.dose-console__lane {
    padding: 1rem;
    display: grid;
    gap: 0.8rem;
}

.dose-console__track {
    position: relative;
    height: 60px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(180deg, rgba(15, 23, 42, 0.78), rgba(15, 23, 42, 0.48));
    background-size: 14% 100%, 100% 100%;
    overflow: hidden;
}

.dose-console__infusion {
    position: absolute;
    top: 11px;
    bottom: 11px;
    border-radius: 999px;
    box-shadow: 0 0 18px rgba(148, 163, 184, 0.1);
}

.dose-console__infusion--active {
    left: 10%;
    width: 54%;
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.84), rgba(248, 113, 113, 0.88));
}

.dose-console__infusion--queued {
    left: 28%;
    width: 40%;
    background: linear-gradient(90deg, rgba(96, 165, 250, 0.85), rgba(34, 211, 238, 0.88));
}

.dose-console__infusion--scheduled {
    left: 12%;
    width: 26%;
    background: linear-gradient(90deg, rgba(74, 222, 128, 0.82), rgba(45, 212, 191, 0.82));
}

.dose-console__summary,
.dose-console__check {
    padding: 1rem;
    display: grid;
    gap: 0.4rem;
}

.dose-console__summary em,
.dose-console__check em {
    font-style: normal;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(148, 163, 184, 0.86);
}

.dose-console__summary small,
.dose-console__check small {
    color: #9fb0c8;
    line-height: 1.55;
}

.dose-console__summary strong {
    font-size: 1.06rem;
}

.dose-console__summary--critical {
    border-color: rgba(248, 113, 113, 0.28);
    background:
        linear-gradient(180deg, rgba(248, 113, 113, 0.14), rgba(248, 113, 113, 0.02)),
        rgba(18, 10, 12, 0.88);
}

.dose-console__checklist {
    display: grid;
    gap: 0.85rem;
}

.atlas-console {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 1rem;
}

.atlas-console__chapter,
.atlas-console__chipset {
    padding: 1rem;
}

.atlas-console__chipset {
    display: grid;
    gap: 0.65rem;
}

.atlas-console__chip {
    min-height: 42px;
    border-radius: 14px;
    border: 1px solid rgba(96, 165, 250, 0.16);
    background: rgba(8, 15, 28, 0.88);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0 0.85rem;
    color: #dbeafe;
    font-size: 0.84rem;
}

.atlas-console__chip::after {
    content: '';
    width: 0.58rem;
    height: 0.58rem;
    border-radius: 50%;
    background: rgba(96, 165, 250, 0.82);
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.48);
}

.atlas-console__stage {
    position: relative;
    min-height: 400px;
    padding: 1rem;
    border-radius: 22px;
    border: 1px solid rgba(96, 165, 250, 0.16);
    background:
        radial-gradient(circle at top, rgba(191, 219, 254, 0.16), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0)),
        rgba(6, 12, 24, 0.84);
    overflow: hidden;
}

.atlas-console__model {
    position: absolute;
    inset: 64px 72px 58px 72px;
    display: grid;
    place-items: center;
}

.atlas-console__model-orb {
    position: relative;
    width: min(100%, 300px);
    aspect-ratio: 1;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 34%, rgba(219, 234, 254, 0.88), rgba(59, 130, 246, 0.24) 36%, rgba(6, 12, 24, 0.14) 62%, rgba(6, 12, 24, 0));
    filter: drop-shadow(0 0 26px rgba(96, 165, 250, 0.22));
}

.atlas-console__model-orb::before,
.atlas-console__model-orb::after {
    content: '';
    position: absolute;
    inset: 50% auto auto 50%;
    width: 86%;
    height: 24%;
    transform: translate(-50%, -50%);
    border-radius: 999px;
    border: 1px solid rgba(147, 197, 253, 0.34);
    background: rgba(96, 165, 250, 0.08);
}

.atlas-console__model-orb::after {
    transform: translate(-50%, -50%) rotate(72deg);
}

.atlas-console__orbit {
    position: absolute;
    inset: 8% 8%;
    border-radius: 50%;
    border: 1px dashed rgba(125, 211, 252, 0.22);
    animation: atlasMiniOrbit 14s linear infinite;
}

.atlas-console__orbit::after {
    content: '';
    position: absolute;
    top: 10%;
    left: 50%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transform: translateX(-50%);
    background: #7dd3fc;
    box-shadow: 0 0 18px rgba(125, 211, 252, 0.58);
}

.atlas-console__floating-card {
    position: absolute;
    width: 170px;
    padding: 0.9rem;
}

.atlas-console__floating-card--top {
    top: 74px;
    right: 20px;
}

.atlas-console__floating-card--bottom {
    left: 18px;
    bottom: 24px;
}

.atlas-console__floating-card small {
    display: block;
    margin-top: 0.3rem;
}

.project-role {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    color: var(--accent-label-color);
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.project-title {
    font-size: clamp(1.15rem, 1.6vw, 1.35rem);
    margin-bottom: 0.15rem;
    font-weight: 600;
    line-height: 1.1;
    text-wrap: balance;
}

.project-desc {
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 400;
    line-height: 1.55;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.55rem;
}

.ptag {
    background: var(--accent-chip-bg);
    border: 1px solid var(--accent-chip-border);
    color: var(--accent-chip-text);
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.67rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    letter-spacing: 0.2px;
    transition: var(--trans-fast);
}

.project-card:hover .ptag {
    background: color-mix(in srgb, var(--accent-chip-bg) 80%, white 6%);
    border-color: color-mix(in srgb, var(--accent-chip-border) 88%, var(--accent-1) 22%);
    color: var(--accent-chip-text);
}

/* Project Detail Pages */
.project-page {
    padding: 120px 0 80px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.project-page-header {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    display: grid;
    gap: 1rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1rem;
    margin: 0 auto;
    transition: var(--trans-fast);
}

.back-link:hover {
    color: var(--project-accent, var(--accent-1));
    transform: translateX(-4px);
}

.project-kicker {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--accent-label-color);
    font-weight: 700;
}

.project-page-title {
    font-size: clamp(3rem, 6vw, 4.9rem);
    line-height: 1.15;
    letter-spacing: -0.04em;
    text-wrap: balance;
    overflow-wrap: anywhere;
    padding-top: 0.1em;
    padding-bottom: 0.05em;
    background: linear-gradient(
        135deg,
        var(--project-accent, var(--accent-1)),
        var(--project-accent-alt, var(--accent-3))
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.project-summary {
    font-size: 1.08rem;
    color: var(--text-muted);
    line-height: 1.8;
    max-width: 760px;
    margin: 0 auto;
}

.project-stage-card {
    background: var(--project-stage-bg);
    border: 1px solid var(--project-stage-border);
    border-radius: 26px;
    overflow: hidden;
    box-shadow: var(--project-stage-shadow);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.project-stage-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.35rem;
    background: var(--project-stage-bar-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.project-stage-label {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    font-weight: 700;
}

.project-stage-label::before {
    content: '';
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 999px;
    background: var(--project-accent, var(--accent-1));
    box-shadow: 0 0 18px rgba(255, 255, 255, 0.18);
}

.project-stage-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.project-stage-insights {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    padding: 1.05rem 1.25rem 0.95rem;
}

.project-stage-insight {
    padding: 1.1rem 1rem;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.015)),
        rgba(15, 23, 42, 0.45);
    min-width: 0;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.project-stage-insight:hover {
    transform: translateY(-3px);
    border-color: rgba(125, 211, 252, 0.42);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.28);
}

.project-stage-insight span {
    display: block;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--accent-label-color);
}

.project-stage-insight strong {
    display: block;
    margin-top: 0.45rem;
    font-size: 1rem;
    color: var(--text-main);
}

.project-stage-insight p {
    margin-top: 0.4rem;
    color: var(--text-muted);
    font-size: 0.89rem;
    line-height: 1.6;
}

.project-inline-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.92rem;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    background: var(--soft-surface);
    border: 1px solid var(--soft-border);
    transition: var(--trans-fast);
}

.project-inline-link:hover {
    transform: translateY(-1px);
    background: var(--soft-surface-strong);
    border-color: var(--soft-border-strong);
}

.project-frame-shell {
    position: relative;
    height: var(--frame-height, 720px);
    background: #020617;
    overflow: hidden;
    transition: height 0.2s ease;
    margin: 0 1.25rem 1.25rem;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.project-frame-shell::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.project-frame {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #020617;
}

.project-frame-shell.auto-resize {
    height: auto;
    min-height: var(--frame-height, 720px);
}

.project-frame-shell.auto-resize .project-frame {
    height: var(--frame-height, 720px);
}

.project-frame-shell--preview {
    height: auto;
    min-height: clamp(320px, 46vw, var(--frame-height, 720px));
    aspect-ratio: var(--frame-ratio, 16 / 9);
}

.project-frame-shell--preview .project-frame {
    height: 100%;
}

.project-frame-theater-trigger {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.2rem;
    border: 0;
    border-radius: inherit;
    background:
        linear-gradient(180deg, rgba(2, 6, 23, 0) 0%, rgba(2, 6, 23, 0.14) 46%, rgba(2, 6, 23, 0.7) 100%);
    color: #f8fafc;
    cursor: pointer;
    text-align: left;
    z-index: 2;
}

.project-frame-theater-trigger:hover .project-frame-theater-pill,
.project-frame-theater-trigger:focus-visible .project-frame-theater-pill {
    transform: translateY(-1px);
    background: rgba(59, 130, 246, 0.24);
    border-color: rgba(96, 165, 250, 0.42);
}

.project-frame-theater-trigger:focus-visible {
    outline: 2px solid rgba(96, 165, 250, 0.55);
    outline-offset: 3px;
}

.project-frame-theater-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.68rem 0.95rem;
    border-radius: 999px;
    border: 1px solid rgba(96, 165, 250, 0.28);
    background: rgba(15, 23, 42, 0.72);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.project-frame-theater-pill::before {
    content: '';
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    background: #60a5fa;
    box-shadow: 0 0 16px rgba(96, 165, 250, 0.62);
}

.project-frame-theater-copy {
    max-width: 28rem;
    margin-left: auto;
    color: rgba(226, 232, 240, 0.86);
    font-size: 0.92rem;
    line-height: 1.5;
    text-shadow: 0 2px 10px rgba(2, 6, 23, 0.46);
}

.project-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.project-preview-modal[hidden] {
    display: none !important;
}

.project-preview-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.78);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.project-preview-modal__dialog {
    position: relative;
    width: min(1480px, calc(100vw - 3rem));
    height: min(92dvh, 1020px);
    margin: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0)),
        rgba(3, 7, 18, 0.96);
    box-shadow: 0 36px 90px rgba(2, 6, 23, 0.56);
}

.project-preview-modal__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.58);
}

.project-preview-modal__heading {
    display: grid;
    gap: 0.28rem;
}

.project-preview-modal__heading span {
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.project-preview-modal__heading strong {
    color: var(--text-main);
    font-size: 1.08rem;
    font-weight: 700;
}

.project-preview-modal__actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.project-preview-modal__close {
    appearance: none;
    min-height: 44px;
    padding: 0.78rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--soft-border);
    background: var(--soft-surface);
    color: var(--text-main);
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.project-preview-modal__close:hover,
.project-preview-modal__close:focus-visible {
    transform: translateY(-1px);
    background: var(--soft-surface-strong);
    border-color: var(--soft-border-strong);
}

.project-preview-modal__body {
    flex: 1;
    min-height: 0;
    padding: clamp(0.55rem, 1vw, 0.9rem);
    display: flex;
    align-items: stretch;
    justify-content: center;
    overflow: hidden;
    background:
        radial-gradient(circle at top, rgba(191, 219, 254, 0.35), transparent 32%),
        linear-gradient(180deg, #d9e8f5 0%, #f8fbff 100%);
}

.project-preview-modal__frame {
    width: min(100%, 1440px);
    height: 100%;
    margin: 0 auto;
    border: 0;
    display: block;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
}

body.modal-open {
    overflow: hidden;
}

.project-stage-note {
    padding: 1.05rem 1.3rem 1.25rem;
    color: #a8b3c7;
    font-size: 0.95rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.35);
}

.project-stage-note-link {
    color: var(--project-accent, var(--accent-1));
}

.project-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.project-meta-card,
.project-copy-card {
    background: var(--surface-lifted);
    border: 1px solid var(--surface-lifted-border);
    border-radius: 20px;
    padding: 1.45rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--surface-lifted-shadow);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.project-meta-card:hover,
.project-copy-card:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--accent-1) 30%, var(--surface-lifted-border));
    box-shadow: var(--surface-lifted-hover-shadow);
}

.project-meta-card h3,
.project-copy-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.85rem;
}

.project-meta-card p,
.project-copy-card p {
    color: var(--text-muted);
    line-height: 1.75;
}

.project-points {
    list-style: none;
    display: grid;
    gap: 0.7rem;
}

.project-points li {
    position: relative;
    padding-left: 1.05rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.project-points li::before {
    content: '•';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--project-accent, var(--accent-1));
}

.project-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.project-copy-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.ff-hardware-stage {
    position: relative;
    left: 50%;
    width: min(1520px, calc(100vw - 2rem));
    transform: translateX(-50%);
    overflow: hidden;
}

.ff-hardware-stage::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 18% 16%, rgba(239, 68, 68, 0.14), transparent 24%),
        radial-gradient(circle at 84% 18%, rgba(245, 158, 11, 0.12), transparent 26%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0));
    opacity: 0.92;
}

.ff-hardware-copy,
.ff-hardware-media,
.ff-hardware-insights,
.ff-hardware-stage .project-stage-note {
    position: relative;
    z-index: 1;
}

.ff-hardware-copy {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
    gap: 1.8rem;
    padding: 1.4rem 1.35rem 0;
}

.ff-hardware-heading {
    display: grid;
    gap: 0.8rem;
}

.ff-hardware-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-label-color);
}

.ff-hardware-eyebrow::before {
    content: '';
    width: 0.58rem;
    height: 0.58rem;
    border-radius: 999px;
    background: var(--project-accent, var(--accent-1));
    box-shadow: 0 0 16px color-mix(in srgb, var(--project-accent, var(--accent-1)) 42%, transparent);
}

.ff-hardware-heading h2 {
    font-size: clamp(1.85rem, 2.6vw, 2.85rem);
    line-height: 1.02;
    letter-spacing: -0.045em;
    text-wrap: balance;
    max-width: 13ch;
}

.ff-hardware-body {
    display: grid;
    align-content: start;
    gap: 1rem;
}

.ff-hardware-body p {
    color: var(--text-muted);
    line-height: 1.78;
    max-width: 60ch;
}

.ff-hardware-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.ff-hardware-chip {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--soft-border);
    background: var(--soft-surface);
    color: var(--text-main);
    font-size: 0.84rem;
    font-weight: 600;
}

.ff-hardware-media {
    margin: 1.2rem 1.3rem 0;
    padding: clamp(0.85rem, 1.4vw, 1.25rem);
    border-radius: 26px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background:
        radial-gradient(circle at top, rgba(239, 68, 68, 0.08), transparent 30%),
        linear-gradient(180deg, rgba(6, 11, 18, 0.94), rgba(3, 7, 16, 0.98));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.ff-hardware-media img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: #0f172a;
}

.ff-hardware-media figcaption {
    margin-top: 0.9rem;
    color: #a8b3c7;
    font-size: 0.92rem;
    line-height: 1.65;
    max-width: 72ch;
}

.ff-hardware-insights {
    padding-top: 1.15rem;
}

body[data-theme-mode="light"] .ff-hardware-stage::before {
    background:
        radial-gradient(circle at 18% 16%, rgba(239, 68, 68, 0.1), transparent 24%),
        radial-gradient(circle at 84% 18%, rgba(245, 158, 11, 0.08), transparent 26%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0));
}

body[data-theme-mode="light"] .ff-hardware-media {
    border-color: rgba(148, 163, 184, 0.18);
    background:
        radial-gradient(circle at top, rgba(239, 68, 68, 0.06), transparent 30%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(241, 245, 249, 0.92));
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.08);
}

body[data-theme-mode="light"] .ff-hardware-media figcaption {
    color: #475569;
}

.project-page > .project-stage-card--runtime {
    order: 1;
}

.project-page > .project-stage-card--overview {
    order: 2;
}

.project-page > .project-section-meta {
    order: 3;
}

.project-page > .project-section-copy {
    order: 4;
}

.project-copy-card {
    min-height: 100%;
}

.project-callout {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 auto;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    background: var(--soft-surface);
    border: 1px solid var(--soft-border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.project-callout strong {
    color: var(--text-main);
}

.project-page-header--pool .project-callout {
    background: var(--status-pill-bg);
    border-color: var(--status-pill-border);
}

.pool-showcase {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 1.25rem;
    align-items: stretch;
}

.pool-showcase-copy,
.pool-showcase-visual {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)),
        rgba(12, 16, 16, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-xl);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}

.pool-showcase-copy {
    background: var(--surface-lifted);
    border-color: var(--surface-lifted-border);
    box-shadow: var(--surface-lifted-shadow);
}

.pool-showcase-copy {
    padding: 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.pool-heading-block {
    display: grid;
    gap: 0.75rem;
}

.pool-overline {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--eyebrow-color);
    font-weight: 700;
}

.pool-heading-block h2 {
    font-size: clamp(1.75rem, 2.4vw, 2.5rem);
    line-height: 1.02;
    letter-spacing: -0.04em;
    text-wrap: balance;
}

.pool-heading-block p {
    max-width: 58ch;
    color: var(--text-muted);
    line-height: 1.75;
}

.pool-showcase-visual {
    padding: 1.25rem;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at top, rgba(16, 185, 129, 0.16), transparent 38%),
        linear-gradient(180deg, rgba(8, 25, 20, 0.92), rgba(4, 11, 15, 0.9));
}

.pool-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.pool-metric-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
}

.pool-metric-card {
    min-width: 0;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    border: 1px solid var(--surface-lifted-border);
    background: var(--surface-lifted);
}

.pool-metric-card strong {
    display: block;
    font-size: clamp(1.35rem, 2vw, 1.8rem);
    line-height: 1;
    color: var(--text-main);
}

.pool-metric-card span {
    display: block;
    margin-top: 0.45rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.pool-chip {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    background: var(--soft-surface);
    border: 1px solid var(--soft-border);
    color: var(--text-main);
    font-size: 0.84rem;
}

.pool-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

.pool-stat-card {
    min-width: 0;
    padding: 1rem;
    border-radius: 20px;
    border: 1px solid var(--surface-lifted-border);
    background: var(--surface-lifted);
}

.pool-stat-card span {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-muted);
}

.pool-stat-card strong {
    display: block;
    margin-top: 0.5rem;
    font-size: 1rem;
    color: var(--text-main);
    line-height: 1.35;
}

.pool-stat-card p {
    margin-top: 0.55rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.pool-runtime-frame {
    position: relative;
    height: auto;
    min-height: clamp(400px, 58vw, 700px);
    background:
        radial-gradient(circle at top, rgba(16, 185, 129, 0.12), transparent 30%),
        #020617;
}

.pool-runtime-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 18%),
        radial-gradient(circle at 18% 8%, rgba(16, 185, 129, 0.14), transparent 24%);
}

.pool-runtime-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(2, 6, 23, 0.72);
    color: rgba(226, 232, 240, 0.92);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.pool-systems {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.pool-system-card {
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--surface-lifted-border);
    background: var(--surface-lifted);
    box-shadow: var(--surface-lifted-shadow);
}

.pool-system-card span {
    display: block;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--eyebrow-color);
}

.pool-system-card h3 {
    margin-top: 0.6rem;
    font-size: 1.18rem;
    line-height: 1.2;
}

.pool-system-card p {
    margin-top: 0.6rem;
    color: var(--text-muted);
    line-height: 1.75;
}

/* Experience Section */
.experience-section {
    padding: 6rem 0;
}

.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    height: 100%;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 3rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: 14px;
    top: 5px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-1);
    box-shadow: 0 0 10px var(--accent-glow);
    border: 3px solid var(--bg-color);
}

.timeline-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1.6rem 1.8rem;
    border-radius: var(--radius-lg);
    transition: var(--trans-fast), background 0.25s ease, border-color 0.25s ease;
}

.timeline-content:hover {
    border-color: var(--soft-border-strong);
    background: var(--bg-surface-hover);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.timeline-header h3 {
    font-size: 1.1rem;
    color: var(--text-main);
}

.timeline-header h4 {
    font-size: 1rem;
    color: var(--accent-2);
    font-weight: 500;
    margin-top: 0.2rem;
}

.timeline-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: right;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
}

.timeline-content p {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.65;
}

/* Education Section */
.education-section {
    padding: 6rem 0;
}

.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.education-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: var(--trans-fast);
}

.education-card:hover {
    border-color: var(--accent-1);
    box-shadow: 0 10px 30px color-mix(in srgb, var(--accent-1) 16%, transparent);
}

.education-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--accent-1), var(--accent-3));
}

.edu-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.education-card h3 {
    font-size: 1.15rem;
    margin-bottom: 0.4rem;
}

.edu-degree {
    color: var(--accent-1);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.edu-details {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.edu-courses {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.tag-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    cursor: pointer;
}

/* Footer */
footer.site-footer {
    position: relative;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-top: 5.5rem;
    padding: 6rem 0 2rem;
    overflow: hidden;
    border-top: 1px solid var(--footer-border);
    background: var(--footer-bg);
}

.site-footer__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.26;
    pointer-events: none;
}

.site-footer__glow--one {
    width: 24rem;
    height: 24rem;
    left: -4rem;
    top: 2rem;
    background: rgba(52, 211, 153, 0.32);
}

.site-footer__glow--two {
    width: 30rem;
    height: 30rem;
    right: -8rem;
    bottom: -6rem;
    background: rgba(96, 165, 250, 0.24);
}

.site-footer__inner {
    position: relative;
    z-index: 1;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 2.25rem;
    display: grid;
    gap: 1.6rem;
}

.site-footer__lead {
    max-width: 52rem;
    display: grid;
    gap: 0.9rem;
}

.site-footer__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--eyebrow-color);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.site-footer__eyebrow::before {
    content: '';
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--eyebrow-dot);
    box-shadow: 0 0 14px color-mix(in srgb, var(--eyebrow-dot) 44%, transparent);
}

.site-footer__lead h2 {
    font-size: clamp(2.3rem, 4.6vw, 4rem);
    line-height: 1.02;
    letter-spacing: -0.045em;
    max-width: 18ch;
}

.site-footer__lead p {
    max-width: 42rem;
    color: var(--text-muted);
    font-size: 1.02rem;
    line-height: 1.75;
}

.site-footer__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.site-footer__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    padding: 0.8rem 1.1rem;
    border-radius: 999px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    border: 1px solid var(--footer-link-border);
    background: var(--footer-link-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.site-footer__link:hover {
    transform: translateY(-2px);
    border-color: var(--footer-link-hover-border);
    background: var(--footer-link-hover-bg);
    box-shadow: 0 16px 28px rgba(2, 6, 23, 0.24);
}

.site-footer__meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.site-footer__card {
    min-width: 0;
    padding: 1rem 1.05rem;
    border-radius: 20px;
    border: 1px solid var(--footer-card-border);
    background: var(--footer-card-bg);
    display: grid;
    gap: 0.35rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.site-footer__card:hover {
    transform: translateY(-2px);
    border-color: rgba(52, 211, 153, 0.26);
}

.site-footer__card span {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.site-footer__card strong {
    color: var(--text-main);
    font-size: 0.98rem;
    line-height: 1.45;
}

.site-footer__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.site-footer__backtop {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
}

.site-footer__backtop:hover {
    color: var(--eyebrow-color);
}

/* Animations */
.section-animate {
    opacity: 0;
    transform: translateY(20px);
    scroll-margin-top: calc(var(--navbar-clearance) + 1rem);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.section-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.35s ease-out, transform 0.35s ease-out;
    transition-delay: calc(var(--delay) * 60ms);
}

.slide-up.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Responsive */
@media (max-width: 992px) {
    .hero {
        text-align: center;
        padding-top: clamp(7.25rem, 14vw, 8.2rem);
    }

    .hero::before {
        inset: 5.25rem 0 2rem;
        border-radius: 30px;
    }

    .hero-layout {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        padding: 2.4rem 1.5rem 2.8rem;
    }
    
    .hero-desc {
        margin: 0 auto 2.5rem;
    }
    
    .hero-actions {
        justify-content: center;
        margin-bottom: 1.5rem;
    }

    .hero-chips {
        justify-content: center;
    }

    .hero-roles {
        justify-content: center;
    }

    .hero-metrics {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .hero-scroll-link {
        margin: 0 auto;
    }

    .hero-visual {
        min-height: auto;
        padding: 1rem 0 0.5rem;
    }

    .hero-visual-shell {
        width: min(100%, 34rem);
        margin-left: 0;
    }

    .project-meta-grid,
    .project-copy-grid {
        grid-template-columns: 1fr;
    }

    .site-footer__meta {
        grid-template-columns: 1fr;
    }

    .concept-showcase,
    .signal-console,
    .dose-console,
    .atlas-console {
        grid-template-columns: 1fr;
    }

    .signal-console__metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .atlas-console__stage {
        min-height: 360px;
    }

    .pool-showcase {
        grid-template-columns: 1fr;
    }

    .pool-metric-strip,
    .pool-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pool-systems {
        grid-template-columns: 1fr;
    }

    .project-stage-insights {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ff-hardware-copy {
        grid-template-columns: 1fr;
    }

    .ff-hardware-heading h2 {
        max-width: none;
    }

    .project-frame-shell.auto-resize {
        height: min(82vh, var(--frame-height, 720px));
    }

    .project-frame-shell--preview {
        min-height: clamp(320px, 56vw, var(--frame-height, 720px));
    }

    .project-frame-theater-copy {
        max-width: 22rem;
        font-size: 0.86rem;
    }
}

@media (max-width: 768px) {
    :root {
        --navbar-clearance: 72px;
    }

    .container {
        padding: 0 1rem;
    }

    .navbar {
        width: calc(100% - 20px);
        top: 10px;
        border-radius: 28px;
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
    }

    .nav-content {
        position: relative;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 0.65rem 1.1rem;
        column-gap: 1rem;
        row-gap: 0;
    }

    .logo {
        font-size: 1.4rem;
    }

    .navbar.has-nav-toggle .nav-menu-toggle {
        display: inline-flex;
        margin-left: auto;
    }

    .navbar.has-nav-toggle .nav-links {
        order: 3;
        flex: 0 0 100%;
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
        gap: 0.55rem;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        padding: 0;
        margin: 0;
        border-top: 0 solid transparent;
        transform: translateY(-8px);
        pointer-events: none;
        transition: max-height 0.24s ease, opacity 0.18s ease, transform 0.18s ease, padding 0.18s ease, margin 0.18s ease, border-color 0.18s ease;
    }

    .navbar.has-nav-toggle.is-open .nav-links {
        max-height: 24rem;
        opacity: 1;
        padding-top: 0.85rem;
        margin-top: 0.85rem;
        border-top: 1px solid var(--soft-border);
        transform: translateY(0);
        pointer-events: auto;
    }

    .navbar.has-nav-toggle .nav-links li {
        width: 100%;
    }

    .navbar.has-nav-toggle .nav-links a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 48px;
        padding: 0.82rem 1rem;
        border-radius: 16px;
        background: var(--soft-surface);
        border: 1px solid var(--soft-border);
        color: var(--text-main);
        font-size: 0.95rem;
        white-space: normal;
    }

    .navbar.has-nav-toggle .nav-links a::after {
        display: none;
    }

    .theme-toggle-btn {
        right: 0.85rem;
        bottom: max(0.85rem, env(safe-area-inset-bottom));
        width: 3.2rem;
        height: 3.2rem;
        min-width: 0;
        min-height: 0;
        padding: 0;
    }


    /* ── Mobile hero: full-bleed portrait background ─────────────── */
    .hero {
        min-height: 100svh;
        align-items: flex-end;
        padding-top: 0;
        padding-bottom: 0;
        background-color: var(--bg-color);
        background-image: url('coverimage.webp');
        /* auto width, 70% of viewport height → face at natural scale in upper portion */
        background-size: auto 70%;
        background-position: center var(--navbar-clearance);
        background-repeat: no-repeat;
    }

    /* Gradient scrim: dark at nav top → clear over face → solid dark text zone below image */
    .hero::before {
        inset: calc(var(--navbar-clearance) - 0.5rem) 0 0;
        border-radius: 0;
        border: none;
        box-shadow: none;
        background:
            linear-gradient(
                to bottom,
                rgba(7, 7, 8, 0.52) 0%,
                rgba(7, 7, 8, 0.0)  16%,
                rgba(7, 7, 8, 0.0)  56%,
                rgba(7, 7, 8, 0.90) 72%,
                rgba(7, 7, 8, 1.0)  100%
            );
    }

    /* Text anchored to the bottom */
    .hero-layout {
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        align-items: flex-start;
        min-height: 100svh;
        width: 100%;
        padding: 0 1.5rem calc(2.8rem + env(safe-area-inset-bottom, 0px));
        gap: 0;
    }

    /* Override the 992px centered alignment → left on mobile */
    .hero {
        text-align: left;
    }

    .hero-roles {
        font-size: 1.05rem;
        justify-content: flex-start;
    }

    .hero-chips {
        justify-content: flex-start;
        gap: 0.4rem;
        margin-bottom: 1.2rem;
    }

    .hero-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .hero-title {
        font-size: clamp(2.2rem, 9vw, 2.8rem);
        line-height: 1.12;
        margin-bottom: 0.65rem;
        text-shadow: 0 2px 18px rgba(0, 0, 0, 0.75);
    }

    .hero-roles {
        margin-bottom: 0.6rem;
        text-shadow: 0 1px 10px rgba(0, 0, 0, 0.6);
    }

    .hero-desc {
        /* reset the 992px margin: 0 auto that centers it */
        margin: 0 0 1.1rem;
        font-size: 0.96rem;
        line-height: 1.65;
        text-shadow: 0 1px 10px rgba(0, 0, 0, 0.6);
    }

    .hero-badge {
        margin-bottom: 0.85rem;
    }

    .hero-chip {
        font-size: 0.72rem;
        padding: 0.35rem 0.7rem;
    }

    /* Ensure text stays white/readable on the dark scrim */
    .hero-title,
    .hero-roles,
    .hero-desc,
    .hero-badge {
        color: #fafafa;
    }

    /* Hide elements that no longer apply in full-bleed mode */
    .hero-visual,
    .hero-backdrop-grid,
    .hero-ambient,
    .hero-particles-canvas,
    .hero-orbit-ring,
    .hero-metrics {
        display: none;
    }

    .site-footer__inner {
        padding: 0 1.25rem;
    }

    .site-footer__lead h2 {
        font-size: clamp(2rem, 10vw, 2.8rem);
    }

    .site-footer__actions {
        flex-direction: column;
    }

    .site-footer__link {
        width: 100%;
        justify-content: center;
    }

    .site-footer__bottom {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .timeline::before {
        left: 0;
    }
    
    .timeline-item {
        padding-left: 30px;
    }
    
    .timeline-dot {
        left: -6px;
    }
    
    .timeline-header {
        flex-direction: column;
    }
    
    .timeline-date {
        text-align: left;
    }
    
    .education-grid {
        grid-template-columns: 1fr;
    }

    .project-page {
        padding-top: 110px;
        padding-bottom: 64px;
        gap: 1.5rem;
    }

    .pool-showcase-copy,
    .pool-showcase-visual {
        padding: 1rem;
    }

    .concept-showcase {
        padding: 0 0.9rem 0.9rem;
    }

    .concept-showcase-copy,
    .concept-showcase-visual {
        padding: 1rem;
    }

    .signal-console__metrics {
        grid-template-columns: 1fr;
    }

    .signal-console__banner,
    .dose-console__lane-head,
    .atlas-console__stage-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .atlas-console__stage {
        min-height: 320px;
    }

    .atlas-console__model {
        inset: 88px 28px 84px;
    }

    .atlas-console__floating-card {
        position: static;
        width: 100%;
    }

    .pool-metric-strip,
    .pool-stat-grid {
        grid-template-columns: 1fr;
    }

    .project-page-header {
        text-align: left;
        gap: 0.85rem;
    }

    .back-link,
    .project-callout {
        margin: 0;
        justify-content: flex-start;
    }

    .project-page-title {
        font-size: clamp(2.35rem, 11vw, 3.05rem);
    }

    .project-summary {
        margin: 0;
        font-size: 1rem;
        line-height: 1.7;
    }

    .project-callout {
        width: 100%;
        border-radius: 20px;
        line-height: 1.5;
    }

    .project-stage-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .project-stage-insights {
        grid-template-columns: 1fr;
        padding: 0.9rem 0.9rem 0;
    }

    .ff-hardware-stage {
        width: calc(100vw - 1rem);
    }

    .ff-hardware-copy {
        padding: 1rem 1rem 0;
        gap: 1.1rem;
    }

    .ff-hardware-media {
        margin: 1rem 1rem 0;
        padding: 0.85rem;
        border-radius: 20px;
    }

    .ff-hardware-media img {
        border-radius: 16px;
    }

    .ff-hardware-insights {
        padding-top: 0.9rem;
    }

    .pool-showcase-visual {
        min-height: 260px;
    }

    .ps-card-scene--hero {
        width: min(100%, 360px);
    }

    .pool-runtime-badge {
        top: 0.8rem;
        left: 0.8rem;
        font-size: 0.72rem;
        padding: 0.45rem 0.75rem;
    }

    .project-stage-actions {
        width: 100%;
    }

    .project-inline-link {
        width: 100%;
        justify-content: center;
        min-height: 48px;
    }

    .project-frame-shell.auto-resize {
        height: min(70vh, 620px);
    }

    .project-frame-shell--preview {
        min-height: clamp(280px, 72vw, 420px);
    }

    .project-frame-theater-trigger {
        align-items: flex-end;
        justify-content: flex-start;
        flex-direction: column;
        gap: 0.7rem;
        padding: 0.95rem;
    }

    .project-frame-theater-copy {
        max-width: none;
        margin-left: 0;
        font-size: 0.82rem;
    }

    .project-preview-modal {
        padding: 0.85rem;
    }

    .project-preview-modal__dialog {
        width: min(100%, calc(100vw - 1.7rem));
        height: min(88vh, 780px);
        border-radius: 20px;
    }

    .project-preview-modal__bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .project-preview-modal__actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .project-preview-modal__actions .project-inline-link,
    .project-preview-modal__close {
        width: 100%;
        justify-content: center;
    }

    .project-stage-note,
    .project-meta-card,
    .project-copy-card {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

/* ── Light mode: full-bleed mobile hero swap ──────────────────────── */
@media (max-width: 768px) {
    body[data-theme-mode="light"] .hero {
        background-image: url('coverimage-light.webp');
        background-size: auto 70%;
        background-position: center var(--navbar-clearance);
        background-color: var(--bg-color);
    }

    /* Light-mode scrim: white-tinted fade matches the bg-color (#edf4ff) */
    body[data-theme-mode="light"] .hero::before {
        background:
            linear-gradient(
                to bottom,
                rgba(237, 244, 255, 0.45) 0%,
                rgba(237, 244, 255, 0.0)  16%,
                rgba(237, 244, 255, 0.0)  56%,
                rgba(237, 244, 255, 0.92) 72%,
                rgba(237, 244, 255, 1.0)  100%
            );
    }

    /* Force dark text for light mode on white image */
    body[data-theme-mode="light"] .hero-title,
    body[data-theme-mode="light"] .hero-roles,
    body[data-theme-mode="light"] .hero-desc,
    body[data-theme-mode="light"] .hero-badge {
        color: #0f172a;
        text-shadow: none;
    }

    body[data-theme-mode="light"] .hero-title span {
        background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    body[data-theme-mode="light"] .hero-role-typed,
    body[data-theme-mode="light"] .typed-cursor {
        color: var(--accent-1);
    }

    body[data-theme-mode="light"] .hero-badge {
        background: var(--status-pill-bg);
        border-color: var(--status-pill-border);
        color: var(--status-pill-text);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.7rem;
    }

    .skills-section,
    .projects-section,
    .ideas-section {
        padding: 4.25rem 0;
    }

    .section-title {
        font-size: 1.72rem;
        margin-bottom: 1.9rem;
    }

    .hero {
        /* On smaller phones, shrink face a bit more */
        background-size: auto 62%;
        background-position: center var(--navbar-clearance);
    }

    .hero::before {
        background:
            linear-gradient(
                to bottom,
                rgba(7, 7, 8, 0.55) 0%,
                rgba(7, 7, 8, 0.0)  16%,
                rgba(7, 7, 8, 0.0)  50%,
                rgba(7, 7, 8, 0.92) 64%,
                rgba(7, 7, 8, 1.0)  100%
            );
    }

    .hero-layout {
        padding: 0 1.1rem calc(2.2rem + env(safe-area-inset-bottom, 0px));
    }

    .hero-title {
        font-size: clamp(1.95rem, 8vw, 2.38rem);
        line-height: 1.08;
    }

    .hero-roles {
        font-size: 0.98rem;
    }

    .hero-desc {
        font-size: 0.95rem;
        line-height: 1.6;
        margin-bottom: 1rem;
    }

    .hero-chip {
        font-size: 0.68rem;
        padding: 0.32rem 0.62rem;
    }

    .hero-metrics {
        display: none;
    }

    .hero-visual-shell,
    .hero-image-wrapper {
        display: none;
    }

    .theme-toggle-btn {
        right: 0.6rem;
        bottom: max(0.6rem, env(safe-area-inset-bottom));
        width: 3rem;
        height: 3rem;
        min-width: 0;
        min-height: 0;
        padding: 0;
    }

    .theme-toggle-icon {
        width: 1.45rem;
        height: 1.45rem;
        margin-top: -0.725rem;
        margin-left: -0.725rem;

    }

    .ideas-header {
        grid-template-columns: 1fr;
    }

    .ideas-grid {
        grid-template-columns: 1fr;
    }


    .skill-category {
        padding: 1.15rem;
        border-radius: 18px;
    }

    .project-card {
        border-radius: 18px;
    }

    .project-image-placeholder {
        height: 176px;
    }

    .project-info {
        padding: 1rem 1rem 1.05rem;
    }

    .project-title {
        font-size: 1.15rem;
    }

    .project-desc {
        font-size: 0.92rem;
    }

    .project-page {
        padding-top: 92px;
        padding-bottom: 48px;
        gap: 1rem;
    }

    .project-page-title {
        font-size: clamp(1.9rem, 9vw, 2.35rem);
    }

    .project-summary,
    .project-stage-insight p,
    .project-copy-card p,
    .project-meta-card p {
        font-size: 0.94rem;
        line-height: 1.62;
    }

    .project-stage-card,
    .concept-showcase-copy,
    .concept-showcase-visual,
    .pool-showcase-copy,
    .pool-showcase-visual {
        border-radius: 20px;
    }

    .project-stage-bar,
    .project-stage-note,
    .project-meta-card,
    .project-copy-card {
        padding-left: 0.82rem;
        padding-right: 0.82rem;
    }

    .ff-hardware-copy {
        padding-left: 0.82rem;
        padding-right: 0.82rem;
    }

    .ff-hardware-media {
        margin-left: 0.82rem;
        margin-right: 0.82rem;
        padding: 0.72rem;
    }

    .ff-hardware-heading h2 {
        font-size: clamp(1.5rem, 8vw, 2rem);
    }

    .ff-hardware-body p,
    .ff-hardware-media figcaption {
        font-size: 0.9rem;
        line-height: 1.62;
    }

    .project-frame-shell {
        margin-left: 0.82rem;
        margin-right: 0.82rem;
        margin-bottom: 0.82rem;
        border-radius: 16px;
    }

    .site-footer__inner {
        padding: 0 0.72rem;
    }

    .site-footer__lead p {
        font-size: 0.95rem;
        line-height: 1.65;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   MOBILE REDESIGN v2 — native-app-style experience
   Bottom tab bar, refined hero, category-scroll projects,
   horizontal skill decks, story timeline.
   ═══════════════════════════════════════════════════════════════════ */

/* Hidden by default — only visible on mobile */
.m-tabbar,
.m-progress {
    display: none;
}

@media (max-width: 768px) {

    /* ── Scroll progress indicator at very top ─────────────────── */
    .m-progress {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 2px;
        z-index: 120;
        background: transparent;
        pointer-events: none;
    }
    .m-progress__fill {
        display: block;
        height: 100%;
        width: 0%;
        background: linear-gradient(90deg, var(--accent-3), var(--accent-1), var(--accent-2));
        box-shadow: 0 0 12px rgba(59, 130, 246, 0.55);
        transition: width 0.08s linear;
    }

    /* ── Streamline top nav: logo only + theme toggle; bottom bar takes over ── */
    .navbar {
        top: max(8px, env(safe-area-inset-top));
        width: calc(100% - 16px);
        border-radius: 22px;
        padding: 0;
        background: linear-gradient(180deg, rgba(8, 10, 14, 0.72), rgba(8, 10, 14, 0.52));
        border: 1px solid rgba(255, 255, 255, 0.06);
        backdrop-filter: blur(22px) saturate(160%);
        -webkit-backdrop-filter: blur(22px) saturate(160%);
    }
    .nav-content {
        padding: 0.55rem 0.85rem 0.55rem 1rem;
    }
    .logo {
        font-size: 1.3rem;
    }

    /* Hide the hamburger + expandable menu — bottom tab bar replaces it */
    .navbar.has-nav-toggle .nav-menu-toggle {
        display: none !important;
    }
    .navbar.has-nav-toggle .nav-links,
    .navbar .nav-links {
        display: none !important;
    }

    body[data-theme-mode="light"] .navbar {
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.5));
        border: 1px solid rgba(15, 23, 42, 0.08);
    }

    /* Small circular theme toggle sits nicely in the top bar now */
    .theme-toggle-btn {
        position: fixed;
        top: max(14px, calc(env(safe-area-inset-top) + 8px));
        right: 14px;
        bottom: auto;
        width: 2.55rem;
        height: 2.55rem;
        border-radius: 50%;
        z-index: 105;
        background: linear-gradient(180deg, rgba(18, 22, 30, 0.92), rgba(10, 12, 16, 0.9));
        border: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    }
    body[data-theme-mode="light"] .theme-toggle-btn {
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(240, 244, 251, 0.9));
        border: 1px solid rgba(15, 23, 42, 0.08);
    }
    .theme-toggle-icon {
        width: 1.25rem;
        height: 1.25rem;
        margin-top: -0.625rem;
        margin-left: -0.625rem;
    }

    /* Give body bottom padding so tabbar never covers content */
    body {
        padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px));
    }

    /* ── Bottom tab bar ─────────────────────────────────────────── */
    .m-tabbar {
        display: flex;
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: max(10px, calc(env(safe-area-inset-bottom, 0px) + 4px));
        z-index: 110;
        padding: 0.5rem 0.4rem;
        border-radius: 26px;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
            rgba(10, 12, 18, 0.82);
        border: 1px solid rgba(255, 255, 255, 0.08);
        backdrop-filter: blur(26px) saturate(180%);
        -webkit-backdrop-filter: blur(26px) saturate(180%);
        box-shadow:
            0 18px 40px rgba(0, 0, 0, 0.45),
            0 0 0 1px rgba(255, 255, 255, 0.02) inset;
        justify-content: space-around;
        align-items: center;
        gap: 0.15rem;
    }
    body[data-theme-mode="light"] .m-tabbar {
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.75));
        border: 1px solid rgba(15, 23, 42, 0.08);
        box-shadow: 0 18px 40px rgba(15, 23, 42, 0.15);
    }

    .m-tab {
        flex: 1 1 0;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.22rem;
        padding: 0.5rem 0.2rem;
        border-radius: 18px;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 0.65rem;
        font-weight: 500;
        letter-spacing: 0.02em;
        min-height: 56px;
        position: relative;
        transition: color 0.22s ease, transform 0.22s ease;
    }
    .m-tab__icon {
        width: 22px;
        height: 22px;
        stroke: currentColor;
        transition: transform 0.22s ease, stroke-width 0.22s ease;
    }
    .m-tab__label {
        line-height: 1;
        opacity: 0.85;
    }

    /* Active tab */
    .m-tab.is-active {
        color: var(--text-main);
    }
    .m-tab.is-active .m-tab__icon {
        transform: translateY(-1px) scale(1.08);
    }
    .m-tab.is-active::before {
        content: '';
        position: absolute;
        inset: 4px;
        border-radius: 14px;
        background:
            linear-gradient(180deg, rgba(59, 130, 246, 0.22), rgba(139, 92, 246, 0.18));
        border: 1px solid rgba(96, 165, 250, 0.28);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
        z-index: -1;
    }
    body[data-theme-mode="light"] .m-tab {
        color: #334155;
    }
    body[data-theme-mode="light"] .m-tab.is-active {
        color: #0f172a;
    }
    body[data-theme-mode="light"] .m-tab.is-active::before {
        background:
            linear-gradient(180deg, rgba(59, 130, 246, 0.14), rgba(139, 92, 246, 0.1));
        border-color: rgba(59, 130, 246, 0.32);
    }

    /* Center "Work" tab gets a lifted pill treatment */
    .m-tab--primary {
        flex: 0 0 auto;
        min-width: 56px;
    }
    .m-tab--primary .m-tab__orb {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
        box-shadow:
            0 10px 22px rgba(59, 130, 246, 0.45),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
        color: #fff;
        margin-top: -18px;
        margin-bottom: 2px;
        border: 2px solid rgba(10, 12, 18, 0.9);
        transition: transform 0.22s ease, box-shadow 0.22s ease;
    }
    .m-tab--primary .m-tab__icon {
        width: 20px;
        height: 20px;
    }
    .m-tab--primary.is-active .m-tab__orb {
        transform: scale(1.08);
        box-shadow:
            0 14px 28px rgba(59, 130, 246, 0.55),
            inset 0 1px 0 rgba(255, 255, 255, 0.35);
    }
    .m-tab--primary.is-active::before {
        display: none;
    }
    body[data-theme-mode="light"] .m-tab--primary .m-tab__orb {
        border-color: rgba(255, 255, 255, 0.95);
    }

    /* ── Hero redesign for mobile ────────────────────────────────
       Strategy: photo lives ONLY in the top portion of the hero so
       the face is clean and unobstructed; text sits on a solid
       background below the photo — never over the face. */
    .hero {
        min-height: 100svh;
        background-color: var(--bg-color);
        background-image: url('coverimage.webp');
        background-size: auto 54vh;
        background-position: center calc(var(--navbar-clearance) - 24px);
        background-repeat: no-repeat;
    }
    body[data-theme-mode="light"] .hero {
        background-image: url('coverimage-light.webp');
        background-size: auto 54vh;
        background-position: center calc(var(--navbar-clearance) - 24px);
    }

    /* Gentle scrim blends the photo's bottom edge into the solid content zone */
    .hero::before {
        inset: 0;
        border: none;
        border-radius: 0;
        box-shadow: none;
        background:
            linear-gradient(
                to bottom,
                rgba(7, 7, 8, 0.35) 0%,
                rgba(7, 7, 8, 0.0)  14%,
                rgba(7, 7, 8, 0.0)  38%,
                rgba(7, 7, 8, 0.65) 48%,
                var(--bg-color) 58%,
                var(--bg-color) 100%
            );
    }
    body[data-theme-mode="light"] .hero::before {
        background:
            linear-gradient(
                to bottom,
                rgba(237, 244, 255, 0.25) 0%,
                rgba(237, 244, 255, 0.0)  14%,
                rgba(237, 244, 255, 0.0)  38%,
                rgba(237, 244, 255, 0.7)  48%,
                var(--bg-color) 58%,
                var(--bg-color) 100%
            );
    }

    /* Content starts below the photo zone — clean solid area */
    .hero-layout {
        min-height: 100svh;
        padding: 58vh 1.25rem calc(1rem + env(safe-area-inset-bottom, 0px) + 86px);
        gap: 0;
        justify-content: flex-start;
    }

    /* No backdrop needed — content lives on solid bg now */
    .hero-content {
        position: relative;
        padding: 0;
    }
    .hero-content::before { display: none; }

    .hero-badge {
        align-self: flex-start;
        background: rgba(16, 185, 129, 0.18);
        border: 1px solid rgba(52, 211, 153, 0.42);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        padding: 0.42rem 0.9rem;
        border-radius: 999px;
        font-size: 0.72rem;
        margin-bottom: 0.7rem;
        box-shadow: 0 8px 22px rgba(16, 185, 129, 0.15);
    }

    .hero-title {
        font-size: clamp(1.95rem, 8.6vw, 2.55rem);
        line-height: 1.05;
        letter-spacing: -0.02em;
        margin-bottom: 0.55rem;
        text-shadow: none;
        color: var(--text-main);
    }
    .hero-title br { display: none; }
    .hero-title span {
        background: linear-gradient(135deg, #60a5fa, #a78bfa, #34d399);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .hero-roles {
        font-size: 0.95rem;
        margin-bottom: 0.55rem;
        display: block;
        white-space: normal;
    }
    .hero-role-static,
    .hero-role-typed,
    .typed-cursor {
        display: inline;
    }
    .hero-desc {
        font-size: 0.9rem;
        line-height: 1.55;
        margin-bottom: 0.85rem;
        max-width: 42ch;
        text-shadow: none;
        color: var(--text-muted);
    }

    .hero-chips {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
        margin-bottom: 0.9rem;
    }
    .hero-chip {
        padding: 0.3rem 0.58rem;
        font-size: 0.68rem;
        background: rgba(15, 20, 30, 0.55);
        border: 1px solid rgba(255, 255, 255, 0.12);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-radius: 999px;
        white-space: nowrap;
    }
    .hero-chip .chip-dot {
        width: 5px;
        height: 5px;
    }
    body[data-theme-mode="light"] .hero-chip {
        background: rgba(255, 255, 255, 0.68);
        border-color: rgba(15, 23, 42, 0.12);
        color: #0f172a;
    }

    .hero-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1.4fr 1fr;
        gap: 0.55rem;
        flex-direction: row;
        margin-top: 0.4rem;
    }
    .hero-actions .btn {
        width: 100%;
        min-height: 54px;
        padding: 0.8rem 0.95rem;
        border-radius: 16px;
    }
    .hero-actions .btn-primary {
        background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
        border: none;
        box-shadow: 0 12px 26px rgba(59, 130, 246, 0.35);
    }
    .hero-actions .btn-secondary {
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.16);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
    }
    .hero-cta-kicker {
        font-size: 0.62rem;
        letter-spacing: 0.14em;
        opacity: 0.75;
    }
    .hero-cta-label {
        font-size: 0.92rem;
    }

    .hero-metrics { display: none; }

    /* Remove heroPulse scroll hint on mobile to keep the frame clean */

    /* ── Section titles: animated gradient underline ─────────────── */
    .section-title {
        font-size: 1.78rem;
        font-weight: 700;
        letter-spacing: -0.015em;
        margin-bottom: 1.4rem;
        padding-bottom: 0.7rem;
        position: relative;
        text-align: left;
    }
    .section-title::after {
        content: '';
        position: absolute;
        left: 0;
        bottom: 0;
        width: 44px;
        height: 3px;
        border-radius: 999px;
        background: linear-gradient(90deg, var(--accent-3), var(--accent-1), var(--accent-2));
    }

    /* ── Skills: horizontal snap-scroll deck ─────────────────────── */
    .skills-section {
        padding: 3.2rem 0 3.4rem;
    }
    .skills-section .section-title {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .skills-grid {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 78%;
        gap: 0.85rem;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding: 0.3rem 1rem 1rem;
        margin: 0 -0.7rem;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .skills-grid::-webkit-scrollbar { display: none; }
    .skill-category {
        scroll-snap-align: start;
        padding: 1.35rem 1.25rem;
        border-radius: 22px;
        min-height: 210px;
        display: flex;
        flex-direction: column;
        gap: 0.9rem;
        background:
            linear-gradient(160deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.05) 55%, transparent),
            var(--glass-card-bg);
        border: 1px solid rgba(255, 255, 255, 0.08);
        position: relative;
        overflow: hidden;
    }
    .skill-category:nth-child(2n) {
        background:
            linear-gradient(160deg, rgba(16, 185, 129, 0.08), rgba(59, 130, 246, 0.05) 55%, transparent),
            var(--glass-card-bg);
    }
    .skill-category:nth-child(3n) {
        background:
            linear-gradient(160deg, rgba(245, 158, 11, 0.08), rgba(236, 72, 153, 0.05) 55%, transparent),
            var(--glass-card-bg);
    }
    .skill-category::before {
        content: '';
        position: absolute;
        top: -30px;
        right: -30px;
        width: 110px;
        height: 110px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(59, 130, 246, 0.18), transparent 70%);
        pointer-events: none;
    }
    .skill-category h3 {
        font-size: 1.05rem;
        font-weight: 600;
        margin: 0;
        letter-spacing: -0.01em;
    }
    .skill-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 0.36rem;
    }
    .skill-category .tag {
        font-size: 0.73rem;
        padding: 0.32rem 0.62rem;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    /* ── Projects: hero pick + 2-column compact grid ─────────────── */
    .projects-section {
        padding: 3rem 0 2.8rem;
    }
    .projects-section .section-title {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .projects-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        padding: 0 0.9rem;
    }
    /* Featured first card full-width */
    .projects-grid .project-card:first-child {
        grid-column: 1 / -1;
    }
    .projects-grid .project-card:first-child .project-image-placeholder {
        height: 220px;
    }
    .projects-grid .project-card:first-child .project-title {
        font-size: 1.45rem;
    }

    .project-card {
        border-radius: 20px;
        overflow: hidden;
        background: var(--project-card-bg);
        border: 1px solid var(--project-card-border);
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
        transition: transform 0.22s ease, box-shadow 0.22s ease;
    }
    .project-card:active {
        transform: scale(0.98);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    }
    .project-image-placeholder {
        height: 130px;
    }
    .project-info {
        padding: 0.78rem 0.82rem 0.88rem;
    }
    .project-role {
        font-size: 0.62rem;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        opacity: 0.8;
    }
    .project-title {
        font-size: 0.98rem;
        line-height: 1.2;
        margin: 0.2rem 0 0.28rem;
        letter-spacing: -0.01em;
    }
    .project-desc {
        font-size: 0.78rem;
        line-height: 1.4;
        opacity: 0.82;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-bottom: 0.5rem;
    }
    .project-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    .project-tags .ptag {
        font-size: 0.6rem;
        padding: 0.22rem 0.45rem;
        border-radius: 8px;
    }
    /* Hide extra tags to prevent overflow on tiny cards */
    .projects-grid .project-card:not(:first-child) .project-tags .ptag:nth-child(n+3) {
        display: none;
    }
    .projects-grid .project-card:not(:first-child) .project-desc {
        -webkit-line-clamp: 1;
    }

    /* ── Ideas: editorial intro + signal feed ───────────────────── */
    .ideas-section {
        padding: 3rem 0 2.6rem;
    }
    .ideas-shell {
        padding: 0 1rem;
    }
    .ideas-header {
        gap: 0.9rem;
        margin-bottom: 1.1rem;
    }
    .ideas-copy {
        max-width: none;
    }
    .ideas-summary {
        padding-left: 0;
        padding-top: 0.85rem;
        border-left: none;
        border-top: 1px solid var(--soft-border-strong);
    }
    .ideas-section .section-title {
        margin-bottom: 0.7rem;
        padding-left: 0;
        padding-right: 0;
    }
    .ideas-intro {
        font-size: 0.92rem;
        line-height: 1.68;
    }
    .ideas-lanes {
        grid-template-columns: 1fr;
        gap: 0.7rem;
        margin-bottom: 2rem;
        padding: 0.9rem 0 1rem;
    }
    .ideas-lane {
        padding-right: 0;
        padding-bottom: 0.8rem;
        border-right: none;
        border-bottom: 1px solid var(--soft-border);
    }
    .ideas-lane:last-child {
        padding-bottom: 0;
        border-bottom: none;
    }
    .ideas-feed__intro {
        display: block;
        margin-bottom: 1rem;
    }
    .ideas-feed__screen {
        min-height: 22.5rem;
        padding: 0.9rem;
        border-radius: 20px;
    }
    .ideas-feed__hud {
        min-height: calc(22.5rem - 1.8rem);
        gap: 1rem;
    }
    .ideas-feed__hud-main {
        padding-top: 1.25rem;
        gap: 0.7rem;
    }
    .ideas-feed__title {
        font-size: 1.45rem;
        max-width: 12ch;
    }
    .ideas-feed__summary {
        font-size: 0.86rem;
        line-height: 1.62;
        max-width: none;
    }
    .ideas-feed__line-list li {
        min-height: 2.15rem;
        padding: 0.56rem 0.68rem;
        font-size: 0.63rem;
    }
    .ideas-feed__footer {
        gap: 0.35rem;
        font-size: 0.66rem;
    }
    .ideas-step {
        min-height: auto;
        grid-template-columns: 1fr;
        gap: 0.65rem;
        padding: 1.1rem 0 1.1rem 1rem;
    }
    .ideas-step__copy {
        gap: 0.65rem;
    }
    .ideas-role-pills span,
    .ideas-step__tags span {
        min-height: 1.8rem;
        font-size: 0.68rem;
        padding: 0.34rem 0.62rem;
    }
    .ideas-step h3 {
        font-size: 1rem;
        max-width: none;
    }
    .ideas-step p {
        font-size: 0.84rem;
        line-height: 1.55;
        max-width: none;
    }
    .ideas-byte-column {
        width: 2.9rem;
        font-size: 0.55rem;
    }

    /* ── Timeline: story-card style ─────────────────────────────── */
    .experience-section {
        padding: 3rem 0 2.4rem;
    }
    .experience-section .section-title {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .timeline {
        padding: 0 1rem;
        position: relative;
    }
    .timeline::before {
        left: 14px;
        top: 6px;
        bottom: 6px;
        width: 2px;
        background: linear-gradient(
            180deg,
            var(--accent-3) 0%,
            var(--accent-1) 50%,
            var(--accent-2) 100%
        );
        opacity: 0.45;
    }
    .timeline-item {
        padding-left: 40px;
        margin-bottom: 1.1rem;
        position: relative;
    }
    .timeline-dot {
        left: 6px;
        top: 1.2rem;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        background:
            radial-gradient(circle, #fff 0 2px, transparent 3px),
            linear-gradient(135deg, var(--accent-1), var(--accent-2));
        box-shadow: 0 0 0 4px rgba(10, 12, 18, 0.9), 0 0 18px rgba(59, 130, 246, 0.45);
        border: none;
    }
    body[data-theme-mode="light"] .timeline-dot {
        box-shadow: 0 0 0 4px rgba(237, 244, 255, 0.9), 0 0 18px rgba(59, 130, 246, 0.35);
    }
    .timeline-content {
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)),
            rgba(12, 16, 24, 0.62);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 18px;
        padding: 1rem 1.05rem 1.05rem;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
    body[data-theme-mode="light"] .timeline-content {
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.82));
        border-color: rgba(15, 23, 42, 0.08);
    }
    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.45rem;
        margin-bottom: 0.55rem;
    }
    .timeline-header h3 {
        font-size: 1.02rem;
        margin: 0;
        letter-spacing: -0.01em;
    }
    .timeline-header h4 {
        font-size: 0.85rem;
        margin: 0.15rem 0 0;
        opacity: 0.85;
    }
    .timeline-date {
        order: 2;
        font-size: 0.72rem;
        padding: 0.3rem 0.6rem;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.08);
        align-self: flex-start;
        white-space: nowrap;
        line-height: 1.2;
    }
    .timeline-date small {
        opacity: 0.7;
        font-size: 0.65rem;
    }
    .timeline-content p {
        font-size: 0.86rem;
        line-height: 1.55;
        margin: 0;
        opacity: 0.88;
    }

    /* ── Education: refined cards ────────────────────────────────── */
    .education-section {
        padding: 2.8rem 0 3rem;
    }
    .education-section .section-title {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .education-grid {
        padding: 0 1rem;
        gap: 0.85rem;
    }
    .education-card {
        padding: 1.3rem 1.2rem;
        border-radius: 20px;
        background:
            linear-gradient(160deg, rgba(59, 130, 246, 0.08), transparent 55%),
            var(--glass-card-bg);
        border: 1px solid rgba(255, 255, 255, 0.08);
    }
    .edu-icon {
        font-size: 1.75rem;
        margin-bottom: 0.5rem;
    }
    .education-card h3 {
        font-size: 1.05rem;
        letter-spacing: -0.01em;
        margin-bottom: 0.25rem;
    }
    .edu-degree {
        font-size: 0.88rem;
        margin-bottom: 0.2rem;
    }
    .edu-details {
        font-size: 0.78rem;
        opacity: 0.78;
        margin-bottom: 0.65rem;
    }
    .edu-courses {
        display: flex;
        flex-wrap: wrap;
        gap: 0.32rem;
    }
    .edu-courses .tag-small {
        font-size: 0.7rem;
        padding: 0.28rem 0.55rem;
    }

    /* ── Footer compact ──────────────────────────────────────────── */
    .site-footer {
        padding: 2.6rem 0 3.5rem;
    }
    .site-footer__lead h2 {
        font-size: clamp(1.6rem, 7.5vw, 2rem);
        line-height: 1.15;
        letter-spacing: -0.015em;
    }
    .site-footer__lead p {
        font-size: 0.88rem;
        line-height: 1.55;
    }
    .site-footer__actions {
        gap: 0.5rem;
    }
    .site-footer__link {
        min-height: 48px;
        border-radius: 14px;
        font-size: 0.88rem;
    }
    .site-footer__meta {
        gap: 0.6rem;
    }
    .site-footer__card {
        padding: 0.9rem 1rem;
        border-radius: 16px;
    }
    .site-footer__bottom {
        gap: 0.5rem;
        font-size: 0.78rem;
    }
}

/* ── Extra-small phones (≤ 400px) ─────────────────────────────────── */
@media (max-width: 400px) {
    .m-tab__label {
        font-size: 0.6rem;
    }
    .m-tab__icon {
        width: 20px;
        height: 20px;
    }
    .hero-actions {
        grid-template-columns: 1fr;
    }
    .hero-title {
        font-size: clamp(1.85rem, 8vw, 2.3rem);
    }
    .project-title {
        font-size: 0.9rem;
    }
    .projects-grid .project-card:first-child .project-title {
        font-size: 1.3rem;
    }
    .section-title {
        font-size: 1.55rem;
    }
}
