@font-face {
    font-family: 'Google Sans';
    src: url('https://fonts.gstatic.com/s/productsans/v5/HYvgU2fE2nRJvZ5JFAumwegdm0LZdjqr5-oayXSOefg.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Google Sans';
    src: url('https://fonts.gstatic.com/s/productsans/v5/HYvgU2fE2nRJvZ5JFAumweK-pd00LqA0ZgT0D5wD71M.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Google Sans';
    src: url('https://fonts.gstatic.com/s/productsans/v5/HYvgU2fE2nRJvZ5JFAumweK-pd00LqA0ZgT0D5wD71M.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
}

/* Theme Variables */
:root {
    /* Shared */
    --font-sans: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --sidebar-width: 280px;
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
    --transition-fast: 0.2s var(--ease-out-expo);
    --transition-slow: 0.6s var(--ease-out-expo);
}

/* Light Mode (Default) */
:root,
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-sidebar: #f7f7f9;
    --bg-elevated: #ffffff;
    --bg-hover: #eef0f2;

    --text-primary: #111114;
    --text-secondary: #5f6368;
    --text-tertiary: #9aa0a6;

    --border-color: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);

    --accent-color: #0A0A0C;
    --accent-fade: rgba(10, 10, 12, 0.05);

    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 12px 24px rgba(0, 0, 0, 0.08);
}

/* Dark Mode */
[data-theme="dark"] {
    --bg-primary: #0a0a0c;
    --bg-sidebar: #131417;
    --bg-elevated: #1e1e24;
    --bg-hover: #25262e;

    --text-primary: #f0f0f5;
    --text-secondary: #9ea0aa;
    --text-tertiary: #6b6d76;

    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);

    --accent-color: #ffffff;
    --accent-fade: rgba(255, 255, 255, 0.05);

    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 12px 24px rgba(0, 0, 0, 0.3);
}

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

html,
body {
    height: 100%;
    overflow: hidden;
    /* App view; scrolling handled in workspace */
    font-size: 16px;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition-slow), color var(--transition-slow);
}

/* Typography Utilities */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.3;
    color: var(--text-primary);
}

a {
    color: inherit;
    text-decoration: none;
}

/* Custom Cursor */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
    mix-blend-mode: difference;
}

.cursor-dot {
    width: 6px;
    height: 6px;
    background-color: var(--accent-color);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(128, 128, 128, 0.5);
    transition: width 0.3s var(--ease-out-expo), height 0.3s var(--ease-out-expo), background-color 0.3s;
}

.cursor-outline.hovering {
    width: 60px;
    height: 60px;
    background-color: rgba(128, 128, 128, 0.1);
    border-color: transparent;
}

.cursor-outline::after {
    content: attr(data-text);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--bg-primary);
    /* Inverts due to mix-blend-mode */
    opacity: 0;
    transition: opacity 0.3s;
}

.cursor-outline.has-text {
    width: 80px;
    height: 80px;
    background-color: var(--accent-color);
    border-color: transparent;
    mix-blend-mode: normal;
    /* remove difference mode for text readability */
}

.cursor-outline.has-text::after {
    opacity: 1;
    color: var(--bg-primary);
}


/* App Layout */
.app-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* Fixed Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    flex-shrink: 0;
    transition: background-color var(--transition-slow), border-color var(--transition-slow);
    z-index: 100;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4rem;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    color: var(--text-primary);
}

.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: none;
    /* override for custom cursor config */
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
    background: var(--accent-fade);
}

.theme-toggle .material-symbols-outlined {
    font-size: 18px;
}

.main-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.nav-item {
    position: relative;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: color 0.4s var(--ease-out-expo);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: none;
    z-index: 1;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-hover);
    border-radius: var(--border-radius-sm);
    transform: scale(0.95);
    opacity: 0;
    transition: all 0.4s var(--ease-out-expo);
    z-index: -1;
}

.nav-item:hover {
    color: var(--text-primary);
}

.nav-item:hover::before {
    opacity: 1;
    transform: scale(1);
}

.nav-item.active {
    color: var(--text-primary);
}

.nav-item .active-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--text-primary);
    opacity: 0;
    transform: scale(0.5) translateX(-10px);
    transition: all 0.5s var(--ease-out-expo);
}

.nav-item.active .active-indicator {
    opacity: 1;
    transform: scale(1) translateX(0);
}

.sidebar-footer {
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: color var(--transition-fast);
}

.social-link:hover {
    color: var(--text-primary);
}


/* Workspace (Right Area) */
.workspace {
    flex-grow: 1;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    background-color: var(--bg-primary);
    /* For Lenis smooth scroll target */
}

/* Panel Container */
.panel {
    padding: 5rem 5%;
    max-width: 1200px;
    margin: 0 auto;
    min-height: auto; /* Removed 100vh — prevents excessive section gaps */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Content Elements styles to be added in next step */
/* Panel Content Utilities */
.panel-header {
    margin-bottom: 3rem;
}

.panel-title {
    font-size: clamp(2.25rem, 8vw, 3.5rem);
    margin-bottom: 1rem;
    line-height: 1.1;
}

.panel-subtitle {
    font-size: clamp(1rem, 4vw, 1.25rem);
    color: var(--text-secondary);
    max-width: 800px;
    line-height: 1.5;
}

/* Projects Grid (Work Panel) */
.projects-grid {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.project-card {
    position: relative;
    border-radius: var(--border-radius-md);
    background-color: var(--bg-hover);
    overflow: hidden;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-sm);
}

.project-visual {
    width: 100%;
    height: 400px;
    border-radius: var(--border-radius-sm);
    background: #2a2a35;
    /* placeholder gradient */
    position: relative;
    overflow: hidden;
}

.bg-gradient-1 {
    background: linear-gradient(135deg, #1e1e24, #2a2a35);
}

.bg-gradient-2 {
    background: linear-gradient(135deg, #151518, #22222b);
}

.bg-gradient-3 {
    background: linear-gradient(135deg, #1c1c21, #25252e);
}

.project-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.project-meta {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    display: flex;
    justify-content: space-between;
}

.project-title {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.project-reveal {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    height: 0;
    opacity: 0;
    overflow: hidden;
    transition: height 0.4s var(--ease-out-expo), opacity 0.4s var(--ease-out-expo), margin 0.4s;
}

.project-card:hover .project-reveal {
    height: 90px;
    opacity: 1;
    margin-top: 1rem;
}

.project-reveal p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 3; /* 1 line for strong label, 2 lines for body text */
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-reveal strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.25rem;
}

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

.thought-card {
    padding: 2.5rem;
    background: var(--bg-elevated);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.thought-card:hover {
    border-color: var(--text-tertiary);
    transform: translateY(10px);
}

/* --- 6. READING TIME & TTS METADATA ROW --- */
.cs-metadata-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    color: var(--text-tertiary);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
}

.cs-metadata-item {
    color: var(--text-secondary);
}

.cs-metadata-dot {
    opacity: 0.5;
}

.cs-listen-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 0.5rem;
}

.cs-listen-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cs-listen-btn svg {
    color: var(--accent-blue, #60A5FA);
    /* A subtle blue accent for play */
}

/* --- 7. TTS PLAYER CONTROL BAR --- */
.cs-tts-player {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(18, 18, 18, 0.85);
    /* Dark slightly transparent */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.cs-tts-player.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

.cs-tts-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cs-tts-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.cs-tts-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.cs-tts-play-btn {
    background: var(--text-primary);
    color: #000;
    width: 44px;
    height: 44px;
}

.cs-tts-play-btn:hover {
    background: var(--text-primary);
    transform: scale(1.05);
    color: #000;
}

.cs-tts-progress-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding-left: 1.5rem;
}

.cs-tts-timer {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
    min-width: 38px;
}

.cs-tts-progress-bar {
    width: 150px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.cs-tts-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--text-primary);
    border-radius: 2px;
    transition: width 0.1s linear;
}

.cs-tts-close-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.5rem;
    transition: color 0.2s;
}

.cs-tts-close-btn:hover {
    color: var(--text-primary);
}

/* TTS Text Highlighting */
.tts-highlight {
    color: #ffffff !important;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 0 2px;
    transition: all 0.3s ease;
}

.thought-number {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: 1.5rem;
}

.thought-card h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

/* Playground Grid */
.playground-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    grid-auto-rows: 250px;
    gap: 1.5rem;
    grid-auto-flow: dense;
}

.play-item {
    position: relative;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.item-large {
    grid-column: span 2;
    grid-row: span 2;
}

.play-visual {
    width: 100%;
    height: 100%;
    transition: transform var(--transition-slow);
}

.play-item:hover .play-visual {
    transform: scale(1.05);
}

.play-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: #fff;
    transform: translateY(100%);
    transition: transform var(--transition-fast);
    font-size: 0.875rem;
}

.play-item:hover .play-caption {
    transform: translateY(0);
}

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

.skill-card {
    background: var(--bg-hover);
    padding: 2.5rem 2rem;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    transition: box-shadow 0.4s var(--ease-out-expo), transform 0.1s linear;
    transform-style: preserve-3d;
}

.skill-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--text-tertiary);
}

.skill-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-primary);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.skill-title {
    font-size: 1.25rem;
}

.skill-desc {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.5;
}

/* Experience Timeline */
.timeline-container {
    position: relative;
    max-width: 900px;
    padding-left: 48px; /* Offset the whole timeline from the panel edge */
}

.timeline-track {
    position: absolute;
    left: 0; /* Align with container start */
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
    border-radius: 2px;
}

.timeline-progress {
    position: absolute;
    left: 0;
    top: 0;
    width: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    height: 0%;
    transform-origin: top;
}

.timeline-item {
    position: relative;
    padding-bottom: 4rem;
    padding-left: 32px; /* Content distance from the line */
}

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

.timeline-dot {
    position: absolute;
    left: 0; /* Anchor to the item start (which is the track) */
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 2px solid var(--text-tertiary);
    transform: translateX(-50%); /* PERFECT CENTER ON 2px track */
    transition: all 0.3s ease;
    z-index: 2;
}

.timeline-item:hover .timeline-dot,
.timeline-item.active .timeline-dot {
    border-color: var(--text-primary);
    background: var(--text-primary);
    transform: translateX(-50%) scale(1.25);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}



.exp-card {
    background: var(--bg-elevated);
    padding: 2rem;
    border-radius: var(--border-radius-md);
    border: 1px solid transparent;
    transition: all 0.4s var(--ease-out-expo);
}

.exp-card:hover,
.timeline-item.active .exp-card {
    background: var(--bg-hover);
    border-color: var(--border-color);
    transform: translateX(8px);
}

.exp-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.exp-logo {
    width: 56px;
    height: 56px;
    background: var(--bg-primary);
    border-radius: 50%;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: transform 0.4s var(--ease-out-expo), box-shadow 0.4s var(--ease-out-expo);
}

.exp-card:hover .exp-logo {
    transform: scale(1.1);
    box-shadow: var(--shadow-sm);
}

.exp-role {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.exp-company {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.exp-date {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.exp-desc {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Testimonials */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.testimonial-card {
    background: var(--bg-elevated);
    padding: 2.5rem;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: box-shadow 0.4s var(--ease-out-expo), transform 0.4s var(--ease-out-expo);
}

.testimonial-card:hover {
    box-shadow: var(--shadow-md);
}

.test-icon {
    color: var(--text-tertiary);
}

.test-icon .material-symbols-outlined {
    font-size: 2rem;
}

.test-quote {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--text-primary);
    font-style: italic;
    flex-grow: 1;
}

.test-author {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.test-author strong {
    font-size: 1rem;
    color: var(--text-primary);
}

.test-author span {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* --- CASE STUDY PAGE STYLES (A8 Essential) --- */
.cs-content {
    max-width: 720px;
}

.cs-section-title {
    font-size: 2rem;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.cs-text {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.cs-text:last-child {
    margin-bottom: 0;
}

.cs-list li {
    position: relative;
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
}

.cs-list li::before {
    content: "•";
    position: absolute;
    left: -1.25rem;
    color: var(--text-tertiary);
}

.cs-meta-card {
    position: sticky;
    top: 6rem;
}

.cs-meta-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cs-meta-list div {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cs-meta-list dt {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.cs-meta-list dd {
    color: var(--text-primary);
    font-size: 1rem;
    margin: 0;
}

/* Architecture Diagram */
.architecture-flow .arch-node {
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.architecture-flow .arch-node:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--text-tertiary) !important;
}

/* Right Sticky Timeline */
.cs-workspace {
    padding-right: 280px;
}

.right-timeline {
    width: 250px;
    height: 100vh;
    position: fixed;
    top: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem;
    z-index: 10;
    pointer-events: none;
}

.cs-timeline-nav {
    display: flex;
    flex-direction: column;
    position: relative;
    pointer-events: auto;
    padding-left: 2rem;
}

.cs-timeline-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    position: relative;
    padding: 0.75rem 0;
    min-height: 44px;
    transition: color 0.3s ease, transform 0.3s ease;
}

.cs-timeline-item:hover {
    color: var(--text-secondary);
    transform: translateX(-4px);
}

.cs-timeline-item.active {
    color: var(--text-primary);
}

.cs-timeline-dot-wrapper {
    width: 12px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cs-timeline-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-color);
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 2;
}

.cs-timeline-item:hover .cs-timeline-dot {
    background: var(--text-tertiary);
}

.cs-timeline-item.active .cs-timeline-dot {
    background: #ffffff;
    transform: scale(1.4);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
}

.cs-timeline-line {
    position: absolute;
    left: calc(2rem + 6px - 0.5px);
    /* padding-left + half dot-wrapper - half line-width */
    width: 1px;
    background: var(--border-color);
    z-index: 1;
    opacity: 0.2;
}

.cs-active-progress-line {
    position: absolute;
    left: calc(2rem + 6px - 1px);
    /* padding-left + half dot-wrapper - half line-width */
    width: 2px;
    background: #ffffff;
    z-index: 2;
    transition: height 0.4s cubic-bezier(0.16, 1, 0.3, 1), top 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Responsive Utilities & Grid Stacking */
.cs-grid-2,
.cs-problem-vision,
.metrics-grid {
    display: grid;
    gap: 4rem; /* Desktop gap */
}

.cs-grid-2 {
    grid-template-columns: 2fr 1fr;
}

.cs-problem-vision {
    grid-template-columns: 1fr 1fr;
}

/* Image Utilities */
.cs-image, .cs-visual {
    width: 100% !important;
    height: auto !important;
    max-width: 100%;
    object-fit: contain;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    margin: 2rem 0;
    box-shadow: var(--shadow-sm);
}

/* Architecture Flow Responsive */
.architecture-flow {
    width: 100% !important;
    max-width: 600px;
    margin: 0 auto;
}

.arch-node {
    width: 100% !important;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: none;
    z-index: 1000;
}

@media (max-width: 900px) {
    .app-layout {
        flex-direction: column;
    }

    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar {
        width: 100%;
        height: 70px;
        padding: 1rem 1.5rem;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 200;
        background-color: var(--bg-sidebar);
        /* Mobile menu open state handling */
        transition: height 0.6s var(--ease-out-expo), background-color var(--transition-slow);
        overflow: hidden;
    }

    .sidebar.menu-open {
        height: 100vh;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
    }

    .sidebar-header {
        margin-bottom: 0;
        display: flex;
        align-items: center;
        width: 100%;
        justify-content: space-between;
    }

    .sidebar-header .left-actions {
        display: flex;
        align-items: center;
        gap: 1.5rem;
    }

    .main-nav {
        display: none;
        margin-top: 4rem;
    }

    .sidebar-footer {
        display: none;
        margin-top: auto;
        padding-bottom: 2rem;
    }

    .sidebar.menu-open .main-nav,
    .sidebar.menu-open .sidebar-footer {
        display: flex;
        opacity: 0;
        animation: fadeIn 0.6s var(--ease-out-expo) forwards 0.2s;
    }

    @keyframes fadeIn {
        to {
            opacity: 1;
        }
    }

    .workspace, .cs-workspace {
        height: 100vh;
        padding-top: 70px;
        padding-right: 0 !important; /* Remove sticky timeline padding */
        /* Offset for fixed header */
    }

    /* Typography Scale */
    .panel-title {
        font-size: 32px !important;
        line-height: 1.2 !important;
        margin-bottom: 16px !important;
    }

    .panel-subtitle {
        font-size: 16px !important;
        line-height: 1.5 !important;
        margin-top: 0.5rem !important;
    }

    .cs-section-title {
        font-size: 24px !important;
        line-height: 1.3 !important;
        margin-bottom: 12px !important;
    }

    .cs-text, .cs-list li {
        font-size: 15px !important;
        line-height: 1.5 !important;
    }

    .case-study-hero {
        margin-bottom: 32px !important;
    }

    .cs-meta-card h3, .feature-block h3 {
        font-size: 18px !important;
        margin-bottom: 16px !important;
    }

    /* Force Grid Stacking */
    .cs-grid-2,
    .cs-problem-vision,
    .metrics-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
        margin-bottom: 40px !important;
    }

    .projects-grid,
    .thinking-grid,
    .playground-grid {
        gap: 2rem;
    }

    .project-visual {
        height: 280px !important;
    }

    .project-reveal {
        grid-template-columns: 1fr;
        height: auto !important;
        opacity: 1 !important;
        margin-top: 1rem;
    }

    /* Vertical Spacing & Density */
    .panel {
        padding: 1.25rem 1.25rem !important; /* 20px top/bottom = 40px total gap between contents */
    }

    #system, #features, #outcomes, #prototype {
        margin-bottom: 32px !important;
        gap: 24px !important;
    }

    /* Metadata Grouping (Project Snapshot) */
    .cs-meta-card {
        padding: 20px !important;
    }

    .cs-meta-list {
        gap: 16px !important; /* Spacing between groups */
    }

    .cs-meta-list div {
        display: flex;
        flex-direction: column;
        gap: 4px !important; /* Tight pairing: Label to Value */
    }

    .cs-meta-list dt {
        font-size: 11px !important;
        margin-bottom: 0 !important;
    }

    .cs-meta-list dd {
        font-size: 14px !important;
        line-height: 1.4 !important;
    }

    /* Card Density */
    .cs-card, .feature-block {
        padding: 20px !important;
    }

    .right-timeline, #cs-timeline {
        display: none !important;
    }
}

/* TABLET SPECIFIC (641px - 1024px) */
@media (max-width: 1024px) and (min-width: 641px) {
    .panel {
        padding: 4rem 2.5rem;
    }
    
    .projects-grid,
    .thinking-grid,
    .case-studies-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 2rem;
    }
    
    .playground-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* MOBILE SPECIFIC (up to 640px) */
@media (max-width: 640px) {
    .panel {
        padding: 3.5rem 1.25rem;
    }
    
    /* Strict Single Column Grids */
    .projects-grid,
    .thinking-grid,
    .skills-grid,
    .playground-grid,
    .case-studies-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }

    /* Cards Responsive Padding */
    .exp-card, 
    .thought-card, 
    .skill-card, 
    .project-card,
    .cs-meta-card {
        padding: 1.5rem;
    }

    /* Experience Timeline Alignment Fix */
    .timeline-container {
        padding-left: 24px; /* Move entire timeline closer to panel edge on mobile */
    }
    
    .timeline-track,
    .timeline-progress {
        left: 0; /* Align with container start */
    }
    
    .timeline-item {
        padding-bottom: 3rem;
        padding-left: 24px;
    }
    
    .timeline-dot {
        display: block !important;
        width: 12px !important;
        height: 12px !important;
        left: 0 !important;
        transform: translateX(-50%) !important;
        background: var(--bg-primary) !important;
        border: 2px solid var(--text-tertiary) !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .exp-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    /* Typography scaling */
    .panel-title {
        font-size: 2rem;
        line-height: 1.1;
    }
    
    .panel-subtitle {
        font-size: 0.9375rem;
        line-height: 1.5;
    }
    
    h2, .project-title, .exp-role {
        font-size: 1.125rem;
    }

    /* Case Study Hero Adjustments */
    .cs-hero {
        padding: 5rem 1.25rem 2rem;
    }
    
    .cs-title {
        font-size: 2rem;
    }

    .right-timeline {
        display: none !important;
    }
}

/* SMALL MOBILE (up to 375px) */
@media (max-width: 375px) {
    .panel-title {
        font-size: 1.75rem;
    }
}