@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@300;400;500;600&display=swap');

:root {
    /* Style Tokens */
    --color-bg: #030306;
    --color-text-primary: #ffffff;
    --color-text-secondary: #94a3b8;
    --color-text-muted: #64748b;
    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-glow: rgba(99, 102, 241, 0.15);
    
    /* Phase Colors */
    --color-dev: #10b981;
    --color-marketing: #f59e0b;
    --color-design: #3b82f6;
    --color-ai: #8b5cf6;
    --color-active: var(--color-ai);
    
    /* World Object Scale (Character & Desks strictly linked 1:1) */
    --world-scale: 1.0;
    
    /* Meticulously Calibrated Typography Hierarchy */
    --font-brand: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-heading: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Layout & Spacing */
    --roadmap-bottom: 40px;
    --pathway-bottom: 80px;
    
    /* Transitions */
    --transition-smooth: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-walk: transform 0.1s linear;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    position: relative;
}

/* Global backdrop glow */
.backdrop-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--color-active) 0%, transparent 70%);
    filter: blur(120px);
    opacity: 0.10;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    transition: background 1s ease, opacity 0.5s ease;
}

/* Header & Controls */
header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 28px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.viewport-center-header {
    position: absolute;
    top: 32vh;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 95vw;
    max-width: 800px;
    animation: header-fade-in 1.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes header-fade-in {
    0% {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.viewport-center-header h1 {
    font-family: var(--font-brand);
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    word-spacing: 0.25em;
    text-transform: uppercase;
    color: #ffffff;
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.7);
    line-height: 1.1;
}

.viewport-center-header p {
    display: none;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-active);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: color 0.5s ease;
}

.viewport-center-header p::before {
    content: '●';
    animation: blink 1.5s infinite;
}

.controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Language selector */
.lang-selector {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    padding: 2px;
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 18px;
    transition: var(--transition-smooth);
}

.lang-btn:hover {
    color: var(--color-text-primary);
}

.lang-btn.active {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text-primary);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Hamburger button */
.menu-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--color-border);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    transition: var(--transition-smooth);
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.menu-btn span {
    display: block;
    width: 18px;
    height: 1.5px;
    background-color: var(--color-text-primary);
    transition: var(--transition-smooth);
}

/* Side navigation menu */
.side-menu {
    position: fixed;
    inset: 0;
    background: rgba(3, 3, 6, 0.95);
    backdrop-filter: blur(20px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.side-menu.active {
    opacity: 1;
    pointer-events: all;
}

.side-menu-close {
    position: absolute;
    top: 30px;
    right: 40px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--color-border);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition-smooth);
}

.side-menu-close:hover {
    background: rgba(255, 255, 255, 0.08);
}

.side-menu-close span {
    display: block;
    width: 18px;
    height: 1.5px;
    background-color: var(--color-text-primary);
    position: absolute;
}

.side-menu-close span:nth-child(1) { transform: rotate(45deg); }
.side-menu-close span:nth-child(2) { transform: rotate(-45deg); }

.side-menu-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 40px;
    max-width: 600px;
}

.side-menu-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.side-menu-links a {
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: var(--transition-smooth);
    display: inline-block;
}

.side-menu-links a:hover {
    color: var(--color-text-primary);
    transform: translateY(-2px);
}

.side-menu-links p {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    margin-top: 5px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    transition: var(--transition-smooth);
}

.social-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--color-active);
    box-shadow: 0 0 15px var(--color-border-glow);
}

/* Master Stage Layout */
.stage {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* The horizontal tracks */
.track-viewport {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.parallax-bg {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 400vw;
    display: flex;
    align-items: center;
    pointer-events: none;
    z-index: 1;
    will-change: transform;
}

.parallax-drawing {
    width: 100vw;
    min-width: 100vw;
    max-width: 100vw;
    height: 100%;
    flex-shrink: 0;
    flex-grow: 0;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0.32; /* Low-contrast, subtle watermark elegance */
    transition: opacity 0.4s ease;
    overflow: hidden;
}

.bg-svg-layer {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

/* Floating animation micro-interactions */
.float-slow {
    animation: bg-float-1 9s ease-in-out infinite;
}

.float-reverse {
    animation: bg-float-2 10s ease-in-out infinite;
}

@keyframes bg-float-1 {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

@keyframes bg-float-2 {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(6px); }
}

/* Pure Monochrome / Low-Contrast Blueprint Vector Styles */
.bg-wire-rect {
    fill: rgba(255, 255, 255, 0.02);
    stroke: rgba(255, 255, 255, 0.14);
    stroke-width: 1;
}

.bg-wire-dashed {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 1;
    stroke-dasharray: 4, 4;
}

.bg-wire-solid {
    fill: rgba(255, 255, 255, 0.03);
    stroke: rgba(255, 255, 255, 0.25);
    stroke-width: 1.2;
}

.bg-wire-line {
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 1;
}

.bg-dot {
    fill: rgba(255, 255, 255, 0.25);
}

.bg-mono-label {
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    font-weight: 500;
    fill: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.05em;
}

.bg-mono-accent {
    font-family: var(--font-mono, monospace);
    font-size: 12px;
    font-weight: 600;
    fill: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.05em;
}

.bg-code-text {
    font-family: var(--font-mono, monospace);
    font-size: 12px;
    fill: rgba(255, 255, 255, 0.35);
}

.bg-token-pill {
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    fill: rgba(255, 255, 255, 0.2);
    letter-spacing: 0.04em;
}

.cursor-blink {
    animation: bg-cursor 1s infinite steps(1);
}

@keyframes bg-cursor {
    0%, 49% { opacity: 1; fill: rgba(255, 255, 255, 0.7); }
    50%, 100% { opacity: 0; }
}

/* Stage 0 (Dev) - Monochrome */
.bg-stage-dev .code-kw { fill: rgba(255, 255, 255, 0.55); font-weight: 600; }
.bg-stage-dev .code-str { fill: rgba(255, 255, 255, 0.4); }
.bg-stage-dev .code-fn { fill: rgba(255, 255, 255, 0.5); }
.bg-stage-dev .code-val { fill: rgba(255, 255, 255, 0.6); }
.bg-stage-dev .bg-code-green { font-family: var(--font-mono); font-size: 12px; fill: rgba(255, 255, 255, 0.55); }

/* Stage 1 (Marketing) - Monochrome */
.bg-stage-marketing .bg-growth-stroke {
    fill: none;
    stroke: rgba(255, 255, 255, 0.35);
    stroke-width: 1.8;
}
.bg-stage-marketing .bg-growth-node { fill: rgba(255, 255, 255, 0.7); stroke: rgba(0, 0, 0, 0.5); stroke-width: 1.5; }
.bg-stage-marketing .bg-growth-label { font-family: var(--font-mono); font-size: 11px; font-weight: 600; fill: rgba(255, 255, 255, 0.45); }
.bg-stage-marketing .bg-funnel-1 { fill: rgba(255, 255, 255, 0.03); stroke: rgba(255, 255, 255, 0.15); stroke-width: 1.2; }
.bg-stage-marketing .bg-funnel-2 { fill: rgba(255, 255, 255, 0.05); stroke: rgba(255, 255, 255, 0.18); stroke-width: 1.2; }
.bg-stage-marketing .bg-funnel-3 { fill: rgba(255, 255, 255, 0.07); stroke: rgba(255, 255, 255, 0.22); stroke-width: 1.2; }
.bg-stage-marketing .bg-funnel-4 { fill: rgba(255, 255, 255, 0.1); stroke: rgba(255, 255, 255, 0.28); stroke-width: 1.2; }
.bg-stage-marketing .bg-funnel-text { font-family: var(--font-mono); font-size: 10px; font-weight: 600; fill: rgba(255, 255, 255, 0.5); }
.bg-stage-marketing .bg-radar-shape { fill: rgba(255, 255, 255, 0.04); stroke: rgba(255, 255, 255, 0.22); stroke-width: 1.2; }

/* Stage 2 (Design Systems) - Monochrome */
.bg-stage-design .bg-bezier-curve {
    fill: none;
    stroke: rgba(255, 255, 255, 0.35);
    stroke-width: 2;
}
.bg-stage-design .bg-bezier-anchor { fill: rgba(255, 255, 255, 0.7); stroke: rgba(0, 0, 0, 0.5); stroke-width: 1.5; }
.bg-stage-design .bg-bezier-handle { fill: rgba(255, 255, 255, 0.4); stroke: rgba(255, 255, 255, 0.6); stroke-width: 1; }
.bg-stage-design .bg-handle-line { stroke: rgba(255, 255, 255, 0.2); stroke-dasharray: 2, 2; }
.bg-stage-design .bg-caliper-line { stroke: rgba(255, 255, 255, 0.25); stroke-width: 1; }
.bg-stage-design .bg-caliper-text { font-family: var(--font-mono); font-size: 10px; fill: rgba(255, 255, 255, 0.45); }
.bg-stage-design .bg-code-green { font-family: var(--font-mono); font-size: 12px; fill: rgba(255, 255, 255, 0.55); }

/* Stage 3 (AI Systems Architecture) - Monochrome */
.bg-stage-ai .bg-neural-node { fill: rgba(255, 255, 255, 0.05); stroke: rgba(255, 255, 255, 0.2); stroke-width: 1.2; }
.bg-stage-ai .bg-neural-active {
    fill: rgba(255, 255, 255, 0.75);
    stroke: #fff;
    stroke-width: 1.5;
}
.bg-stage-ai .bg-synapse-line { stroke: rgba(255, 255, 255, 0.1); stroke-width: 1; }
.bg-stage-ai .bg-synapse-active {
    stroke: rgba(255, 255, 255, 0.35);
    stroke-width: 1.4;
    animation: bg-synapse-pulse 3s infinite ease-in-out;
}
.bg-stage-ai .bg-agent-core { stroke: rgba(255, 255, 255, 0.35); stroke-width: 1.5; }
.bg-stage-ai .bg-agent-line { stroke: rgba(255, 255, 255, 0.18); stroke-dasharray: 4, 3; stroke-width: 1.2; }
.bg-stage-ai .code-val { fill: rgba(255, 255, 255, 0.6); font-weight: 600; }

@keyframes bg-synapse-pulse {
    0%, 100% { stroke-opacity: 0.2; }
    50% { stroke-opacity: 0.6; }
}

/* Timeline elements track */
.timeline-track {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    display: flex;
    align-items: center;
    /* transition removed to allow smooth requestAnimationFrame position updates */
    z-index: 2;
}

.epoch-stage {
    width: 100vw;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Walking pathway road */
.pathway {
    position: absolute;
    bottom: var(--pathway-bottom);
    left: -1000vw;
    width: 2000vw;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent,
        rgba(255,255,255,0.08) 5%,
        rgba(255,255,255,0.08) 95%,
        transparent
    );
    z-index: 2;
}

/* Milestone nodes in foreground track */
.milestone-marker {
    position: absolute;
    bottom: var(--pathway-bottom);
    left: 50%;
    transform: translate(-50%, 50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-text-muted);
    border: 2px solid var(--color-bg);
    z-index: 3;
    transition: var(--transition-smooth);
}

.epoch-stage.active .milestone-marker {
    background: var(--color-active);
    box-shadow: 0 0 15px var(--color-active);
    transform: translate(-50%, 50%) scale(1.5);
}

/* Container for milestones under the centered brand header */
.viewport-milestones-container {
    position: relative;
    width: 100%;
    height: 120px; /* height to contain title, date, View Details button */
    margin-top: 10px; /* space between name and active milestone text */
    pointer-events: none;
}

/* Milestone Text Block (Horizontal Centered Text Stack under name) */
.milestone-text-block {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, 15px);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    z-index: 5;
    opacity: 0;
    pointer-events: none;
    filter: blur(8px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.6s ease;
}

.milestone-text-block.active {
    opacity: 1;
    transform: translate(-50%, 0);
    filter: blur(0);
    pointer-events: all;
}

.milestone-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    word-spacing: 0.12em;
    color: #ffffff;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7);
    line-height: 1.25;
}

.milestone-date {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-active);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
    transition: color 0.5s ease;
    margin-top: 2px;
}

.milestone-more {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    margin-top: 6px;
    padding: 6px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    transition: var(--transition-smooth);
}

.milestone-more:hover {
    color: #ffffff;
    border-color: var(--color-active);
    background: rgba(255, 255, 255, 0.09);
    box-shadow: 0 0 16px var(--color-border-glow);
    transform: translateY(-1px);
}

/* Detailed Milestone Popup Modal */
.detail-popup {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.detail-popup.active {
    opacity: 1;
    pointer-events: all;
}

/* Fullscreen backdrop with rich blur */
.popup-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 3, 6, 0.75);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    z-index: 1;
}

/* Redesigned Obsidian Glass Modal Card */
.popup-window {
    position: relative;
    width: 92%;
    max-width: 650px;
    background: rgba(12, 13, 18, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 24px;
    padding: 32px 38px 36px 38px;
    z-index: 2;
    transform: scale(0.92) translateY(10px);
    box-shadow: 0 32px 80px -16px rgba(0, 0, 0, 0.9),
                inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.detail-popup.active .popup-window {
    transform: scale(1) translateY(0);
}

/* Clean Header Row: Badges on Left, Close on Right */
.popup-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 18px;
    margin-bottom: 22px;
}

.popup-badges {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.popup-epoch {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--popup-accent, var(--color-active));
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color 0.4s ease;
}

.popup-tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    padding: 4px 12px;
    color: rgba(255, 255, 255, 0.8);
}

/* Custom circular close button */
.popup-close {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    flex-shrink: 0;
    transition: var(--transition-smooth);
}

.popup-close:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.06);
}

.popup-close span {
    display: block;
    width: 14px;
    height: 1.5px;
    background-color: rgba(255, 255, 255, 0.85);
    position: absolute;
}

.popup-close span:nth-child(1) { transform: rotate(45deg); }
.popup-close span:nth-child(2) { transform: rotate(-45deg); }

/* Popup Content & Typography */
.popup-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.popup-title {
    font-family: var(--font-heading);
    font-size: 1.42rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    word-spacing: 0.06em;
    line-height: 1.2;
    color: #ffffff;
    white-space: nowrap;
}

.popup-desc {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.65;
}

/* Bullet list inside popup */
.popup-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 6px;
}

.popup-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.55;
}

.popup-list li::before {
    content: '→';
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--popup-accent, var(--color-active));
    margin-top: 1px;
    flex-shrink: 0;
    transition: color 0.4s ease;
}

/* Epoch Desks on Timeline Pathway */
.action-env {
    position: absolute;
    bottom: var(--pathway-bottom);
    left: calc(50% + (5px * var(--world-scale))); /* Positioned naturally so Anton's hands rest on keyboard/tablet */
    transform: translate(0, 0);
    pointer-events: none;
    z-index: 6; /* Front layer so hands rest on desk */
    opacity: 1; /* Real physical landmarks along the pathway */
    display: flex;
    align-items: flex-end;
}

.epoch-desk {
    height: calc(220px * var(--world-scale));
    width: auto;
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.7));
}

/* Character Frame Container */
.char-container {
    position: absolute;
    bottom: var(--pathway-bottom);
    left: 50%;
    transform: translate(-50%, 0);
    width: 220px;
    height: 280px;
    z-index: 5;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: flex-end; /* Feet stand on pathway */
    transition: transform 0.4s ease;
}

/* 2D High-Detail Standalone Pixel Art Character (0% Bleed Guaranteed) */
.char-sprite-window {
    --char-scale: var(--world-scale);
    width: 220px;
    height: 280px;
    position: relative;
    background-position: center bottom;
    background-repeat: no-repeat;
    background-size: contain;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    transform-origin: bottom center;
    /* Clean thematic glow outline */
    filter: drop-shadow(0 0 10px var(--color-active));
    transition: filter 0.5s ease;
}

/* Walk Cycle: 7 Standalone Frames (Calm 0.95s walking cadence) */
body.is-walking .char-sprite-window {
    animation: char-walk-frames 0.95s infinite steps(1);
}

@keyframes char-walk-frames {
    0%, 14.27% { background-image: url('assets/char/walk_0.png'); }
    14.28%, 28.56% { background-image: url('assets/char/walk_1.png'); }
    28.57%, 42.84% { background-image: url('assets/char/walk_2.png'); }
    42.85%, 57.13% { background-image: url('assets/char/walk_3.png'); }
    57.14%, 71.41% { background-image: url('assets/char/walk_4.png'); }
    71.42%, 85.70% { background-image: url('assets/char/walk_5.png'); }
    85.71%, 100% { background-image: url('assets/char/walk_6.png'); }
}

/* Idle (Standing next to chair) */
body.is-idle .char-sprite-window {
    background-image: url('assets/char/stand_idle.png');
}

/* Web Dev (Stage 0): Sitting & typing calmly on mechanical keyboard */
body.state-coding .char-sprite-window {
    animation: char-coding-frames 1.2s infinite steps(1);
}
@keyframes char-coding-frames {
    0%, 50% { background-image: url('assets/char/coding_1.png'); }
    50.01%, 100% { background-image: url('assets/char/coding_2.png'); }
}

/* Digital Marketing (Stage 1): Seated reviewing & pointing at analytics */
body.state-marketing .char-sprite-window {
    animation: char-marketing-frames 2.5s infinite steps(1);
}
@keyframes char-marketing-frames {
    0%, 65% { background-image: url('assets/char/sit_idle.png'); }
    65.01%, 100% { background-image: url('assets/char/pointing.png'); }
}

/* Design Systems (Stage 2): Working on tablet / design system */
body.state-designing .char-sprite-window {
    animation: char-design-frames 1.6s infinite steps(1);
}
@keyframes char-design-frames {
    0%, 50% { background-image: url('assets/char/coding_1.png'); }
    50.01%, 100% { background-image: url('assets/char/coding_2.png'); }
}

/* AI Systems (Stage 3): Spatial swipe interacting with autonomous AI holograms */
body.state-ai .char-sprite-window {
    animation: char-ai-swipe 1.6s infinite steps(1);
}
@keyframes char-ai-swipe {
    0%, 55% { background-image: url('assets/char/ai_gesture_1.png'); }
    55.01%, 100% { background-image: url('assets/char/ai_gesture_2.png'); }
}

/* VCR VHS-style rewind aesthetics */
.rewind-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 90;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: rgba(3, 3, 6, 0.15);
}

body.is-rewinding .rewind-overlay {
    opacity: 1;
}

.vcr-rew-text {
    position: absolute;
    top: 110px;
    left: 40px;
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-active);
    text-shadow: 0 0 8px var(--color-active);
    letter-spacing: 0.1em;
    animation: vcr-blink 0.6s infinite steps(2);
}

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

.vcr-glitch-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    opacity: 0;
}

body.is-rewinding .vcr-glitch-line {
    opacity: 1;
    animation: vcr-glitch-roll 1.2s infinite linear;
}

@keyframes vcr-glitch-roll {
    0% { top: -5%; }
    100% { top: 105%; }
}

body.is-rewinding .rewind-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%, 
        rgba(0, 0, 0, 0.25) 50%
    ), linear-gradient(
        90deg, 
        rgba(255, 0, 0, 0.06), 
        rgba(0, 255, 0, 0.02), 
        rgba(0, 0, 255, 0.06)
    );
    background-size: 100% 4px, 6px 100%;
    z-index: 1;
}

/* Shake stage and filter background during rewind */
body.is-rewinding .stage {
    animation: rewind-shake 0.08s infinite alternate ease-in-out;
    filter: blur(0.5px) contrast(1.15) saturate(1.2);
}

body.is-rewinding .backdrop-glow {
    opacity: 0.25;
}

@keyframes rewind-shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    100% { transform: translate(-1px, -1px) rotate(0.1deg); }
}

/* Character shaking vibration during rewind */
body.is-rewinding .char-container {
    animation: rewind-char-vibe 0.05s infinite alternate;
}

@keyframes rewind-char-vibe {
    0% { transform: translate(-50%, 0) translate(-1px, 0); }
    100% { transform: translate(-50%, 0) translate(1px, -1px); }
}

/* Environment Animations (Glows and lines) */
/* Dev CRT monitor */
.crt-monitor {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 50px;
    border: 2px solid var(--color-dev);
    border-radius: 8px;
    background: rgba(16, 185, 129, 0.05);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}
.crt-monitor::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 12px;
    background-image: linear-gradient(transparent 50%, rgba(16, 185, 129, 0.15) 50%);
    background-size: 100% 4px;
}
.crt-table {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 6px;
    background: var(--color-text-secondary);
    border-radius: 2px;
}

/* Marketing holograph */
.marketing-hologram {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    height: 100px;
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    padding: 0 10px 10px;
}
.holo-bar {
    width: 10px;
    background: var(--color-marketing);
    border-radius: 4px 4px 0 0;
    opacity: 0.4;
    box-shadow: 0 0 8px var(--color-marketing);
    animation: bar-pulsing 1.5s infinite alternate ease-in-out;
}
.holo-bar:nth-child(1) { height: 40px; animation-delay: 0.1s; }
.holo-bar:nth-child(2) { height: 75px; animation-delay: 0.4s; }
.holo-bar:nth-child(3) { height: 50px; animation-delay: 0.2s; }
.holo-bar:nth-child(4) { height: 90px; animation-delay: 0.6s; }

@keyframes bar-pulsing {
    0% { transform: scaleY(1); opacity: 0.3; }
    100% { transform: scaleY(1.1); opacity: 0.7; }
}

/* Design vectors */
.vector-editor {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 100px;
}
.vector-node {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--color-bg);
    border: 2px solid var(--color-design);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--color-design);
}
.v-node-1 { top: 20px; left: 20px; }
.v-node-2 { top: 60px; left: 100px; }
.vector-path {
    position: absolute;
    width: 120px;
    height: 100px;
    border-bottom: 2px dashed var(--color-design);
    border-radius: 0 0 100% 0;
    transform: rotate(-15deg);
    opacity: 0.5;
}

/* AI Neural Connections */
.ai-core {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, var(--color-ai) 0%, transparent 60%);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
    animation: core-glow 2s infinite alternate ease-in-out;
}
.ai-orbit {
    position: absolute;
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 50%;
    animation: orbit-rotate 6s infinite linear;
}
.orbit-1 {
    width: 110px;
    height: 50px;
    top: 15px;
    left: -15px;
    transform: rotate(30deg);
}
.orbit-2 {
    width: 50px;
    height: 110px;
    top: -15px;
    left: 15px;
    transform: rotate(-45deg);
}
.droid {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--color-text-primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--color-text-primary);
    top: 0;
    left: 50%;
}

@keyframes core-glow {
    0% { transform: translateX(-50%) scale(0.9); opacity: 0.5; }
    100% { transform: translateX(-50%) scale(1.1); opacity: 0.9; }
}
@keyframes orbit-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Roadmap navigation (Bottom) */
.roadmap-container {
    position: absolute;
    bottom: var(--roadmap-bottom);
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 10;
}

.roadmap-track {
    position: relative;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
}

.roadmap-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--color-active);
    box-shadow: 0 0 8px var(--color-active);
    transition: width 0.4s ease, background 0.5s ease;
}

.roadmap-nodes {
    position: absolute;
    top: -5px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
}

.roadmap-node {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-bg);
    border: 2px solid var(--color-text-muted);
    cursor: pointer;
    position: relative;
    transition: var(--transition-smooth);
}

.roadmap-node:hover,
.roadmap-node.active {
    border-color: var(--color-active);
    background: var(--color-active);
    box-shadow: 0 0 10px var(--color-active);
    transform: scale(1.3);
}

/* Roadmap tooltips */
.node-tooltip {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid var(--color-border);
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--color-text-secondary);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.roadmap-node:hover .node-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Animations helper keys */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Media Queries for responsive adaptations */
@media (max-width: 1024px) {
    :root {
        --world-scale: 0.90;
    }
}

@media (max-width: 768px) {
    :root {
        --world-scale: 0.82;
        --roadmap-bottom: 28px;
        --pathway-bottom: 68px;
    }
    
    header {
        padding: 20px;
    }
    
    .viewport-center-header {
        top: 90px;
    }
    
    .viewport-center-header h1 {
        font-size: 1.45rem;
    }
    
    .viewport-milestones-container {
        height: 100px;
        margin-top: 10px;
    }
    
    .milestone-title {
        font-size: 1.15rem;
    }
    
    .popup-window {
        padding: 30px 20px;
        width: 95%;
        border-radius: 20px;
    }
    
    .popup-title {
        font-size: 1.25rem;
        white-space: normal;
        line-height: 1.25;
    }
    
    .popup-desc {
        font-size: 0.95rem;
    }
    
    .roadmap-container {
        bottom: 28px;
    }
    
    .node-tooltip {
        display: none; /* Hide tooltips on mobile */
    }
}

@media (max-width: 480px) {
    :root {
        --world-scale: 0.75;
        --roadmap-bottom: 24px;
        --pathway-bottom: 60px;
    }
    
    .viewport-center-header {
        top: 80px;
    }
    
    .viewport-center-header h1 {
        font-size: 1.3rem;
    }
}

/* Media Queries for responsive height adaptations */
@media (max-height: 720px) {
    :root {
        --world-scale: 0.72;
        --roadmap-bottom: 20px;
        --pathway-bottom: 50px;
    }
    
    .viewport-center-header {
        top: 70px;
    }
}

@media (max-height: 520px) {
    :root {
        --world-scale: 0.58;
        --roadmap-bottom: 14px;
        --pathway-bottom: 36px;
    }
    
    .viewport-center-header {
        top: 45px;
    }
}