/* ============================================
   APPLE HIG-INSPIRED DESIGN SYSTEM
   A refined foundation for expressive interfaces
   ============================================ */

/* Root Variables - The DNA of the design */
:root {
    /* Spatial Scale - Fibonacci-inspired rhythm */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --space-8: 4rem;
    --space-9: 6rem;
    --space-10: 8rem;
    --space-11: 12rem;

    /* Typography Scale */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.25rem;
    --text-xl: 1.5rem;
    --text-2xl: 2rem;
    --text-3xl: 2.5rem;
    --text-4xl: 3.5rem;
    --text-5xl: 4.5rem;
    --text-6xl: 6rem;
    
    /* Line heights for different contexts */
    --leading-tight: 1.1;
    --leading-snug: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.7;
    --leading-loose: 1.9;
    
    /* Letter spacing */
    --tracking-tighter: -0.04em;
    --tracking-tight: -0.02em;
    --tracking-normal: 0;
    --tracking-wide: 0.02em;
    --tracking-wider: 0.05em;
    --tracking-widest: 0.1em;

    /* Font Stacks */
    --font-display: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-text: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: "SF Mono", ui-monospace, "Cascadia Code", Menlo, monospace;

    /* Motion */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);

    --duration-fast: 150ms;
    --duration-normal: 300ms;
    --duration-slow: 500ms;
    --duration-slower: 700ms;

    /* Z-Index */
    --z-base: 0;
    --z-raised: 10;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-overlay: 300;
    --z-modal: 400;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
}

/* ============================================
   DARK THEME (Default)
   ============================================ */
:root, [data-theme="dark"] {
    --color-bg: #000000;
    --color-bg-secondary: #0a0a0a;
    --color-bg-elevated: #1c1c1e;
    --color-bg-overlay: rgba(0, 0, 0, 0.85);

    --color-surface: #1c1c1e;
    --color-surface-hover: #2c2c2e;
    --color-surface-active: #3a3a3c;
    --color-surface-warm: #1e1a18;
    --color-surface-cool: #181a1e;

    --color-border: rgba(255, 255, 255, 0.1);
    --color-border-subtle: rgba(255, 255, 255, 0.06);
    --color-border-accent: rgba(10, 132, 255, 0.3);

    --color-text: #f5f5f7;
    --color-text-secondary: rgba(245, 245, 247, 0.7);
    --color-text-tertiary: rgba(245, 245, 247, 0.5);
    --color-text-muted: rgba(245, 245, 247, 0.3);

    /* Primary accent - blue */
    --color-accent: #0a84ff;
    --color-accent-hover: #409cff;
    --color-accent-subtle: rgba(10, 132, 255, 0.15);
    
    /* Secondary accent - warm amber/gold */
    --color-accent-secondary: #f59e0b;
    --color-accent-secondary-hover: #fbbf24;
    --color-accent-secondary-subtle: rgba(245, 158, 11, 0.15);
    
    /* Tertiary accent - soft purple */
    --color-accent-tertiary: #a855f7;
    --color-accent-tertiary-hover: #c084fc;
    --color-accent-tertiary-subtle: rgba(168, 85, 247, 0.15);
    
    /* Semantic colors */
    --color-success: #34d399;
    --color-success-subtle: rgba(52, 211, 153, 0.15);

    --text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 4px rgba(0, 0, 0, 0.6);

    --gradient-hero: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(120, 119, 198, 0.25) 0%, transparent 50%);
    --gradient-glow: radial-gradient(circle at center, var(--color-accent-subtle) 0%, transparent 70%);
    --gradient-warm: linear-gradient(135deg, var(--color-accent-secondary-subtle) 0%, transparent 60%);
    --gradient-rich: linear-gradient(135deg, rgba(10, 132, 255, 0.1) 0%, rgba(168, 85, 247, 0.1) 50%, rgba(245, 158, 11, 0.05) 100%);
}

/* ============================================
   LIGHT THEME
   ============================================ */
[data-theme="light"] {
    --color-bg: #ffffff;
    --color-bg-secondary: #f8f8fa;
    --color-bg-elevated: #ffffff;
    --color-bg-overlay: rgba(255, 255, 255, 0.9);

    --color-surface: #f2f2f7;
    --color-surface-hover: #e5e5ea;
    --color-surface-active: #d1d1d6;
    --color-surface-warm: #faf8f5;
    --color-surface-cool: #f5f7fa;

    --color-border: rgba(0, 0, 0, 0.1);
    --color-border-subtle: rgba(0, 0, 0, 0.05);
    --color-border-accent: rgba(0, 102, 204, 0.25);

    --color-text: #1d1d1f;
    --color-text-secondary: rgba(29, 29, 31, 0.7);
    --color-text-tertiary: rgba(29, 29, 31, 0.5);
    --color-text-muted: rgba(29, 29, 31, 0.3);

    /* Primary accent - blue */
    --color-accent: #0066cc;
    --color-accent-hover: #0077ed;
    --color-accent-subtle: rgba(0, 102, 204, 0.1);
    
    /* Secondary accent - warm amber */
    --color-accent-secondary: #d97706;
    --color-accent-secondary-hover: #b45309;
    --color-accent-secondary-subtle: rgba(217, 119, 6, 0.1);
    
    /* Tertiary accent - soft purple */
    --color-accent-tertiary: #9333ea;
    --color-accent-tertiary-hover: #7c3aed;
    --color-accent-tertiary-subtle: rgba(147, 51, 234, 0.1);
    
    /* Semantic colors */
    --color-success: #059669;
    --color-success-subtle: rgba(5, 150, 105, 0.1);

    --gradient-hero: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(120, 119, 198, 0.12) 0%, transparent 50%);
    --gradient-glow: radial-gradient(circle at center, var(--color-accent-subtle) 0%, transparent 70%);
    --gradient-warm: linear-gradient(135deg, var(--color-accent-secondary-subtle) 0%, transparent 60%);
    --gradient-rich: linear-gradient(135deg, rgba(0, 102, 204, 0.06) 0%, rgba(147, 51, 234, 0.06) 50%, rgba(217, 119, 6, 0.03) 100%);

    --text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9), 0 0 4px rgba(255, 255, 255, 0.6);
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-text);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    text-shadow: var(--text-shadow);
    overflow-x: clip;
    min-height: 100vh;
    animation: pageFadeIn 0.8s ease both;
}

html.theme-fade-out body {
    opacity: 0;
    transition: opacity 0.25s ease !important;
}

html.theme-fade-in body {
    opacity: 1;
    transition: opacity 0.35s ease !important;
}

body.page-leaving {
    opacity: 0;
    transition: opacity 0.25s ease;
}

@keyframes pageFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

[data-theme="light"] body::after {
    content: "";
    position: fixed;
    bottom: 100vh;
    left: 0;
    width: 100%;
    height: 200px;
    background: white;
    z-index: -2;
    pointer-events: none;
}

:root body::after,
[data-theme="dark"] body::after {
    display: none;
}

:root body::before,
[data-theme="dark"] body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: url('images/starry-night.svg') center / cover no-repeat;
    filter: blur(8px) saturate(1.3);
    opacity: 0.4;
    pointer-events: none;
}

[data-theme="light"] body::before {
    display: none;
}

::selection {
    background: var(--color-accent);
    color: white;
}

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

img, video {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-6);
}

.container-lg {
    max-width: 1400px;
}

.container-sm {
    max-width: 800px;
}

@media (max-width: 480px) {
.container {
        padding: 0 var(--space-4);
    }
}

/* ============================================
   NAVIGATION - Glass Effect
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-sticky);
    padding: var(--space-4) 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--color-border-subtle);
    transition: all var(--duration-normal) var(--ease-smooth);
}

[data-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.8);
}

.navbar.scrolled {
    background: rgba(0, 0, 0, 0.9);
    padding: var(--space-3) 0;
}

[data-theme="light"] .navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-6);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 var(--space-4);
    }
}

.nav-logo h2,
.nav-logo a {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--color-text);
    text-decoration: none;
    transition: opacity var(--duration-fast) var(--ease-smooth);
}

.nav-logo a:hover {
    opacity: 0.7;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--space-6);
}

.nav-link {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    text-decoration: none;
    padding: var(--space-2) 0;
    position: relative;
    transition: color var(--duration-fast) var(--ease-smooth);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: width var(--duration-normal) var(--ease-out-expo);
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-text);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.header-links {
    display: flex;
    align-items: center;
    gap: var(--space-5);
}

.header-link {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: color var(--duration-fast) var(--ease-smooth);
}

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

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-2);
    background: var(--color-surface);
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border);
}

.theme-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    color: var(--color-text-secondary);
    transition: all var(--duration-fast) var(--ease-smooth);
}

.theme-icon:hover {
    color: var(--color-text);
    background: var(--color-surface-hover);
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 22px;
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-track {
    position: absolute;
    inset: 0;
    background: var(--color-surface-active);
    border-radius: var(--radius-full);
    transition: 
        background var(--duration-fast) var(--ease-smooth),
        box-shadow var(--duration-fast) var(--ease-smooth);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
}

.toggle-icon {
    color: var(--color-text-tertiary);
    transition: color var(--duration-fast) var(--ease-smooth), opacity var(--duration-fast) var(--ease-smooth);
    z-index: 1;
}

.toggle-sun {
    opacity: 0.4;
}

.toggle-moon {
    opacity: 1;
}

.toggle-switch input:checked ~ .switch-track .toggle-sun {
    opacity: 1;
}

.toggle-switch input:checked ~ .switch-track .toggle-moon {
    opacity: 0.4;
}

.switch-track::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    top: 3px;
    background: var(--color-text);
    border-radius: var(--radius-full);
    transition: 
        transform var(--duration-fast) var(--ease-spring),
        box-shadow var(--duration-fast) var(--ease-smooth);
}

.toggle-switch input:checked + .switch-track::after {
    transform: translateX(22px);
}

/* Toggle hover effect */
@keyframes toggle-pulse {
    0%, 100% { 
        box-shadow: 0 0 0 2px var(--color-accent-primary), 0 0 12px rgba(10, 132, 255, 0.4); 
    }
    50% { 
        box-shadow: 0 0 0 3px var(--color-accent-primary), 0 0 20px rgba(10, 132, 255, 0.6); 
    }
}

.toggle-switch:hover .switch-track {
    animation: toggle-pulse 1.5s ease-in-out infinite;
}

.toggle-switch:hover .switch-track::after {
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.3),
        0 0 8px rgba(255, 255, 255, 0.3);
    transform: translateX(0) scale(1.1);
}

.toggle-switch:hover input:checked + .switch-track::after {
    transform: translateX(22px) scale(1.1);
}

/* Focus state for accessibility */
.toggle-switch:focus-within .switch-track {
    animation: toggle-pulse 1.5s ease-in-out infinite;
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 44px;
    height: 44px;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.hamburger .bar {
    width: 22px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: all var(--duration-normal) var(--ease-out-expo);
}

@media (max-width: 1024px) {
    .nav-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        z-index: var(--z-overlay);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: var(--space-6);
        background: var(--color-bg);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity var(--duration-normal) var(--ease-smooth),
                    visibility var(--duration-normal) var(--ease-smooth);
    }

    .nav-menu.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .nav-menu .nav-link {
        font-size: var(--text-2xl);
        font-weight: 600;
        padding: var(--space-3) var(--space-6);
        opacity: 0;
        transform: translateY(20px);
        transition: opacity var(--duration-normal) var(--ease-out-expo),
                    transform var(--duration-normal) var(--ease-out-expo),
                    color var(--duration-fast) var(--ease-smooth);
    }

    .nav-menu.active .nav-link {
        opacity: 1;
        transform: translateY(0);
    }

    /* Staggered animation for menu items */
    .nav-menu.active .nav-link:nth-child(1) { transition-delay: 50ms; }
    .nav-menu.active .nav-link:nth-child(2) { transition-delay: 100ms; }
    .nav-menu.active .nav-link:nth-child(3) { transition-delay: 150ms; }
    .nav-menu.active .nav-link:nth-child(4) { transition-delay: 200ms; }

    .header-links {
        display: none;
}

.hamburger {
        display: flex;
        z-index: calc(var(--z-overlay) + 1);
    }

    /* Hamburger active state - transform to X */
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
}

/* Prevent body scroll when menu is open */
body.menu-open {
    overflow: hidden;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    padding: var(--space-11) 0 var(--space-10);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-hero);
    pointer-events: none;
}

/* Rich gradient overlay for visual depth */
.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(to bottom, var(--color-bg) 0%, var(--color-bg) 5%, transparent 100%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-5);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s var(--ease-out-expo) 0.2s forwards;
}

.hero-eyebrow::before {
    content: '';
    width: 24px;
    height: 2px;
    background: linear-gradient(90deg, var(--color-accent) 0%, var(--color-accent-tertiary) 100%);
    border-radius: 1px;
}

.hero-title {
    font-family: var(--font-display);
    font-size: var(--text-6xl);
    font-weight: 700;
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tighter);
    margin-bottom: var(--space-6);
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s var(--ease-out-expo) 0.4s forwards;
}

.hero-title .highlight {
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-tertiary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

[data-theme="light"] .hero-title .highlight {
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-tertiary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

.hero-description {
    font-size: var(--text-xl);
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
    max-width: 560px;
    margin-bottom: var(--space-8);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s var(--ease-out-expo) 0.6s forwards;
}

.hero-cta {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s var(--ease-out-expo) 0.8s forwards;
}

/* Responsive hero - graceful transitions */
@media (max-width: 1024px) {
    .hero {
        min-height: 90svh;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: var(--space-10) 0 var(--space-8);
        min-height: 85svh;
    }

    .hero-title {
        font-size: var(--text-5xl);
    }

    .hero-description {
        font-size: var(--text-lg);
    }

    .hero-cta {
        flex-direction: column;
        gap: var(--space-3);
    }

    .hero-cta .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero {
        min-height: auto;
        padding: var(--space-9) 0 var(--space-7);
    }
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: var(--space-7);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    letter-spacing: var(--tracking-widest);
    text-transform: uppercase;
    opacity: 0;
    animation: fadeIn 1s var(--ease-out-expo) 1.2s forwards;
    z-index: 2;
}

.scroll-indicator::after {
    content: '';
    width: 1px;
    height: 32px;
    background: linear-gradient(to bottom, var(--color-text-tertiary) 0%, transparent 100%);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { transform: scaleY(1); opacity: 1; }
    50% { transform: scaleY(0.6); opacity: 0.4; }
}

@media (max-width: 768px) {
    .scroll-indicator {
        display: none;
    }
}

/* Hero Ambient Elements */
.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    pointer-events: none;
    will-change: transform;
}

.hero-orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(10, 132, 255, 0.35) 0%, rgba(99, 102, 241, 0.2) 40%, transparent 70%);
    top: -200px;
    right: -150px;
    animation: float 25s ease-in-out infinite;
}

.hero-orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.3) 0%, rgba(245, 158, 11, 0.1) 50%, transparent 70%);
    bottom: 5%;
    left: -100px;
    animation: float 30s ease-in-out infinite reverse;
}

/* Third orb for richer ambient effect */
.hero-orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.2) 0%, transparent 70%);
    top: 40%;
    right: 10%;
    animation: float 20s ease-in-out infinite;
    animation-delay: -5s;
}

[data-theme="light"] .hero-orb {
    opacity: 0.3;
    filter: blur(120px);
}

[data-theme="light"] .hero-orb-1 {
    background: radial-gradient(circle, rgba(0, 102, 204, 0.25) 0%, rgba(99, 102, 241, 0.15) 40%, transparent 70%);
}

[data-theme="light"] .hero-orb-2 {
    background: radial-gradient(circle, rgba(147, 51, 234, 0.2) 0%, rgba(217, 119, 6, 0.08) 50%, transparent 70%);
}

[data-theme="light"] .hero-orb-3 {
    background: radial-gradient(circle, rgba(217, 119, 6, 0.15) 0%, transparent 70%);
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(var(--color-border-subtle) 1px, transparent 1px),
        linear-gradient(90deg, var(--color-border-subtle) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: radial-gradient(ellipse 60% 50% at 50% 40%, black 0%, transparent 100%);
    opacity: 0.3;
    pointer-events: none;
}

[data-theme="light"] .hero-grid {
    opacity: 0.4;
}

@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0) scale(1); }
    25% { transform: translateY(-25px) translateX(15px) scale(1.02); }
    50% { transform: translateY(15px) translateX(-15px) scale(0.98); }
    75% { transform: translateY(-15px) translateX(20px) scale(1.01); }
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-sm);
    font-weight: 500;
    border-radius: var(--radius-full);
    transition: 
        transform var(--duration-fast) var(--ease-out-expo),
        background var(--duration-fast) var(--ease-smooth),
        box-shadow var(--duration-normal) var(--ease-smooth),
        border-color var(--duration-fast) var(--ease-smooth);
    cursor: pointer;
}

.btn-primary {
    background: var(--color-text);
    color: var(--color-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9), 0 0 4px rgba(255, 255, 255, 0.6);
}

[data-theme="light"] .btn-primary {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 4px rgba(0, 0, 0, 0.6);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 30px -8px rgba(0, 0, 0, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .btn-primary:hover {
    box-shadow: 
        0 8px 30px -8px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-text-tertiary);
    transform: translateY(-1px);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* Accent button variant */
.btn-accent {
    background: var(--color-accent);
    color: white;
    border: none;
}

.btn-accent:hover {
    background: var(--color-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px -8px var(--color-accent);
}

.btn i, .btn svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
    padding: var(--space-10) 0;
    position: relative;
}

/* Varied section spacing for rhythm */
.section--spacious {
    padding: var(--space-11) 0;
}

.section--compact {
    padding: var(--space-8) 0;
}

@media (max-width: 768px) {
    .section {
        padding: var(--space-8) 0;
    }
    
    .section--spacious {
        padding: var(--space-9) 0;
    }
    
    .section--compact {
        padding: var(--space-7) 0;
    }
}

.section-header {
    margin-bottom: var(--space-8);
}

.section-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-accent);
    letter-spacing: var(--tracking-widest);
    text-transform: uppercase;
    margin-bottom: var(--space-3);
}

/* Alternate label colors for visual variety */
.section-label--secondary {
    color: var(--color-accent-secondary);
}

.section-label--tertiary {
    color: var(--color-accent-tertiary);
}

.section-title {
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    font-weight: 600;
    letter-spacing: var(--tracking-tight);
    line-height: var(--leading-tight);
}

.section-title--large {
    font-size: var(--text-5xl);
    font-weight: 700;
    letter-spacing: var(--tracking-tighter);
}

/* ============================================
   PROJECT GRID
   ============================================ */
.project-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-5);
}

/* Asymmetric grid for visual interest */
.project-grid--asymmetric {
    grid-template-columns: 1.1fr 0.9fr;
    grid-auto-rows: auto;
}

.project-grid--asymmetric > *:nth-child(even) {
    transform: translateY(var(--space-6));
}

@media (max-width: 900px) {
    .project-grid,
    .project-grid--asymmetric {
        grid-template-columns: 1fr;
        gap: var(--space-5);
    }
    
    .project-grid--asymmetric > *:nth-child(even) {
        transform: none;
    }
}

/* Project Card */
.project-card {
    display: flex;
    flex-direction: column;
    position: relative;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    background: var(--color-surface);
    border: 1px solid var(--color-border-subtle);
    text-decoration: none;
    color: inherit;
    transition: 
        transform var(--duration-slow) var(--ease-out-expo),
        border-color var(--duration-normal) var(--ease-smooth),
        box-shadow var(--duration-slow) var(--ease-out-expo);
}

.project-card:hover {
    transform: translateY(-6px);
    border-color: var(--color-border);
    box-shadow: 
        0 20px 40px -12px rgba(0, 0, 0, 0.2),
        0 0 0 1px var(--color-border-subtle);
}

[data-theme="light"] .project-card:hover {
    box-shadow: 
        0 20px 40px -12px rgba(0, 0, 0, 0.12),
        0 0 0 1px var(--color-border);
}

/* Card accent variants */
.project-card--accent-secondary {
    border-color: var(--color-accent-secondary-subtle);
}

.project-card--accent-secondary:hover {
    border-color: var(--color-accent-secondary);
}

.project-card--accent-tertiary {
    border-color: var(--color-accent-tertiary-subtle);
}

.project-card--accent-tertiary:hover {
    border-color: var(--color-accent-tertiary);
}

.project-card-image {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--color-bg-secondary);
}

.project-card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 60%, rgba(0, 0, 0, 0.03) 100%);
    pointer-events: none;
}

.project-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-slower) var(--ease-out-expo);
}

.project-card:hover .project-card-image img {
    transform: scale(1.03);
}

.project-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--space-5) var(--space-5) var(--space-6);
}

.project-card-category {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-accent);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    margin-bottom: var(--space-2);
}

.project-card--accent-secondary .project-card-category {
    color: var(--color-accent-secondary);
}

.project-card--accent-tertiary .project-card-category {
    color: var(--color-accent-tertiary);
}

.project-card-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 600;
    letter-spacing: var(--tracking-tight);
    line-height: var(--leading-snug);
    margin-bottom: var(--space-2);
}

.project-card-description {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
    flex: 1;
}

.project-card-arrow {
    position: absolute;
    bottom: var(--space-5);
    right: var(--space-5);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--color-text);
    color: var(--color-bg);
    font-size: var(--text-sm);
    opacity: 0;
    transform: translateX(-8px);
    transition: 
        opacity var(--duration-normal) var(--ease-out-expo),
        transform var(--duration-normal) var(--ease-out-expo);
}

.project-card:hover .project-card-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Featured Project - enhanced visual treatment */
.project-featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: var(--space-8);
    align-items: center;
    padding: var(--space-7);
    background: var(--gradient-rich);
    border: 1px solid var(--color-border);
}

.project-featured:hover {
    transform: none;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .project-featured:hover {
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.project-featured .project-card-image {
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-xl);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .project-featured .project-card-image {
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1);
}

.project-featured .project-card-content {
    padding: var(--space-4) 0;
}

.project-featured .project-card-title {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-4);
}

.project-featured .project-card-description {
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-6);
}

@media (max-width: 1024px) {
    .project-featured {
        grid-template-columns: 1fr;
        padding: var(--space-5);
    }
    
    .project-featured .project-card-content {
        padding: var(--space-4) 0 0;
    }
}

/* ============================================
   ABOUT SECTION
   ============================================ */
.about-grid {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: var(--space-9);
    align-items: start;
}

@media (max-width: 1024px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: var(--space-7);
    }
}

.about-image {
    position: relative;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    aspect-ratio: 4 / 5;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px var(--color-border-subtle);
}

[data-theme="light"] .about-image {
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.1),
        0 0 0 1px var(--color-border);
}

/* Subtle gradient overlay on image */
.about-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        transparent 70%,
        rgba(0, 0, 0, 0.1) 100%
    );
    pointer-events: none;
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-slower) var(--ease-out-expo);
}

.about-image:hover img {
    transform: scale(1.02);
}

@media (max-width: 1024px) {
    .about-image {
        max-width: 400px;
        margin: 0 auto;
    }
}

.about-content {
    padding-top: var(--space-4);
}

@media (max-width: 1024px) {
    .about-content {
        padding-top: 0;
    }
}

.about-text {
    font-size: var(--text-lg);
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-5);
}

.about-text:first-of-type {
    font-size: var(--text-xl);
    color: var(--color-text);
    line-height: var(--leading-relaxed);
}

/* Lead paragraph styling */
.about-lead {
    font-size: var(--text-2xl);
    color: var(--color-text);
    line-height: var(--leading-snug);
    margin-bottom: var(--space-6);
    letter-spacing: var(--tracking-tight);
}

.about-skills {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-7);
}

.skill-tag {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    background: var(--color-surface);
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border);
    transition: 
        background var(--duration-fast) var(--ease-smooth),
        color var(--duration-fast) var(--ease-smooth),
        border-color var(--duration-fast) var(--ease-smooth),
        transform var(--duration-fast) var(--ease-smooth);
}

.skill-tag:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
    transform: translateY(-1px);
}

/* Skill tag color variants */
.skill-tag--accent {
    border-color: var(--color-accent-subtle);
    color: var(--color-accent);
}

.skill-tag--accent:hover {
    background: var(--color-accent-subtle);
    border-color: var(--color-accent);
}

.skill-tag--secondary {
    border-color: var(--color-accent-secondary-subtle);
    color: var(--color-accent-secondary);
}

.skill-tag--secondary:hover {
    background: var(--color-accent-secondary-subtle);
    border-color: var(--color-accent-secondary);
}

.skill-tag--tertiary {
    border-color: var(--color-accent-tertiary-subtle);
    color: var(--color-accent-tertiary);
}

.skill-tag--tertiary:hover {
    background: var(--color-accent-tertiary-subtle);
    border-color: var(--color-accent-tertiary);
}

/* Expanded About Section */
.about-expanded {
    padding-top: var(--space-8);
    border-top: 1px solid var(--color-border);
}

.about-section-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-8) var(--space-10);
}

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

.about-block {
    max-width: 520px;
}

.about-block-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--space-4);
    letter-spacing: var(--tracking-tight);
}

.about-block .about-text {
    font-size: var(--text-base);
    margin-bottom: var(--space-4);
}

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

/* ============================================
   EXPERIENCE
   ============================================ */
.experience-list {
    display: flex;
        flex-direction: column;
}

.experience-item {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: var(--space-6);
    padding: var(--space-6) 0;
    border-bottom: 1px solid var(--color-border-subtle);
    transition: all var(--duration-fast) var(--ease-smooth);
}

.experience-item:hover {
    padding-left: var(--space-4);
    background: var(--color-surface);
    margin: 0 calc(var(--space-4) * -1);
    padding-right: var(--space-4);
    border-radius: var(--radius-lg);
    border-color: transparent;
}

.experience-company {
    font-weight: 600;
}

.experience-role {
    color: var(--color-text-secondary);
}

.experience-period {
    text-align: right;
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
    font-family: var(--font-mono);
}

@media (max-width: 768px) {
    .experience-item {
        grid-template-columns: 1fr;
        gap: var(--space-2);
    }

    .experience-period {
        text-align: left;
    }
}

/* ============================================
   CTA BLOCK
   ============================================ */
.cta-block {
        text-align: center;
    padding: var(--space-10) var(--space-8);
    background: var(--gradient-rich);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-2xl);
    position: relative;
    overflow: hidden;
}

.cta-block::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 50% 120%, var(--color-accent-subtle) 0%, transparent 60%);
    opacity: 0.8;
}

.cta-block::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, var(--color-accent-tertiary-subtle) 0%, transparent 40%);
    opacity: 0.5;
    pointer-events: none;
}

.cta-block > * {
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .cta-block {
        padding: var(--space-8) var(--space-6);
    }
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    padding: var(--space-9) 0 var(--space-7);
    border-top: 1px solid var(--color-border-subtle);
    background: var(--color-bg-secondary);
}

@media (max-width: 768px) {
    .footer {
        padding: var(--space-7) 0 var(--space-6);
    }
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-8);
    margin-bottom: var(--space-10);
}

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

.footer-brand {
    max-width: 300px;
}

.footer-logo {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 600;
    margin-bottom: var(--space-4);
}

.footer-tagline {
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    line-height: 1.6;
}

.footer-section h4 {
    font-size: var(--text-sm);
    font-weight: 600;
    margin-bottom: var(--space-4);
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.footer-link {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    transition: color var(--duration-fast) var(--ease-smooth);
}

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

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-4);
    padding-top: var(--space-6);
    border-top: 1px solid var(--color-border-subtle);
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
}

@media (max-width: 600px) {
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

.footer-social {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.footer-social a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    transition: all var(--duration-fast) var(--ease-smooth);
}

.footer-social a:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
    transform: translateY(-2px);
}

.footer-social .theme-toggle {
    margin-left: var(--space-2);
    padding: var(--space-1) var(--space-2);
    background: var(--color-surface);
    border-radius: var(--radius-full);
}

.footer-content {
    text-align: center;
    color: var(--color-text-tertiary);
    font-size: var(--text-sm);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll Animations */
[data-animate] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--duration-slower) var(--ease-out-expo),
                transform var(--duration-slower) var(--ease-out-expo);
}

[data-animate].visible {
    opacity: 1;
    transform: translateY(0);
}

[data-stagger] > * {
    opacity: 0;
    transform: translateY(20px);
}

[data-stagger].visible > * {
    animation: fadeInUp 0.6s var(--ease-out-expo) forwards;
}

[data-stagger].visible > *:nth-child(1) { animation-delay: 0ms; }
[data-stagger].visible > *:nth-child(2) { animation-delay: 100ms; }
[data-stagger].visible > *:nth-child(3) { animation-delay: 200ms; }
[data-stagger].visible > *:nth-child(4) { animation-delay: 300ms; }
[data-stagger].visible > *:nth-child(5) { animation-delay: 400ms; }
[data-stagger].visible > *:nth-child(6) { animation-delay: 500ms; }

/* ============================================
   CURSOR GLOW
   ============================================ */
.cursor-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    pointer-events: none;
    z-index: -1;
    top: -200px;
    left: -200px;
    background: radial-gradient(circle, var(--color-accent-subtle) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--duration-slow) var(--ease-smooth);
    will-change: transform;
}

.cursor-glow.active {
    opacity: 0.6;
}

@media (pointer: coarse) {
    .cursor-glow {
        display: none;
    }
}

/* ============================================
   UTILITIES
   ============================================ */
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.text-secondary { color: var(--color-text-secondary); }
.text-tertiary { color: var(--color-text-tertiary); }
.text-accent { color: var(--color-accent); }
.text-accent-secondary { color: var(--color-accent-secondary); }
.text-accent-tertiary { color: var(--color-accent-tertiary); }
.text-center { text-align: center; }

.flex { display: flex; }
.gap-4 { gap: var(--space-4); }

/* Visually hidden but accessible */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Gradient text utility */
.text-gradient {
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-tertiary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient--warm {
    background: linear-gradient(135deg, var(--color-accent-secondary) 0%, var(--color-accent-tertiary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   CASE STUDY PAGES
   ============================================ */

/* Case Study Hero */
.case-hero {
    min-height: 85svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-11) 0 var(--space-9);
    position: relative;
    overflow: hidden;
}

.case-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-hero);
    pointer-events: none;
}

.case-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30%;
    background: linear-gradient(to bottom, var(--color-bg) 0%, transparent 100%);
    pointer-events: none;
}

.case-hero-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
}

.case-hero-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--color-accent-subtle);
    border: 1px solid rgba(10, 132, 255, 0.3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    vertical-align: bottom;
    font-weight: 600;
    color: var(--color-accent);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: var(--space-6);
}

.case-hero-title {
    font-family: var(--font-display);
    font-size: var(--text-5xl);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-top: var(--space-6);
    margin-bottom: var(--space-5);
}

.case-hero-subtitle {
    font-size: var(--text-xl);
    color: var(--color-text-secondary);
    line-height: 1.7;
    max-width: 700px;
}

.case-hero-meta {
    display: flex;
    gap: var(--space-8);
    margin-top: var(--space-8);
    padding-top: var(--space-6);
    border-top: 1px solid var(--color-border-subtle);
}

.case-meta-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.case-meta-label {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.case-meta-value {
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--color-text);
}

@media (max-width: 768px) {
    .case-hero {
        padding-top: var(--space-10);
    }

    .case-hero-title {
        font-size: var(--text-3xl);
        margin-top: var(--space-4);
    }

    .case-hero-subtitle {
        font-size: var(--text-lg);
    }

    .case-hero-meta {
    flex-wrap: wrap;
        gap: var(--space-4);
    }

    .case-meta-item {
        min-width: 120px;
    }
}

/* Case Study Sections */
.case-section {
    padding: var(--space-8) 0;
}

.case-section + .case-section {
    border-top: 1px solid var(--color-border-subtle);
}

.case-section-header {
    margin-bottom: var(--space-8);
}

.case-section-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-accent);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: var(--space-3);
}

.case-section-title {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-4);
    transition: color 0.4s ease, opacity 0.4s ease;
}

.case-section-subtitle {
    font-size: var(--text-lg);
    color: var(--color-text-secondary);
    line-height: 1.7;
    max-width: 700px;
}

/* Case Content */
.case-content {
    max-width: 700px;
}

.case-content p {
    font-size: var(--text-lg);
    line-height: 1.8;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-5);
}

.case-content p:first-of-type {
    font-size: var(--text-xl);
    color: var(--color-text);
}

.case-content h3 {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 600;
    margin-top: var(--space-8);
    margin-bottom: var(--space-4);
}

.case-content ul {
    margin-bottom: var(--space-5);
    padding-left: var(--space-5);
}

.case-content li {
    font-size: var(--text-base);
    line-height: 1.7;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-3);
    position: relative;
}

.case-content li::marker {
    color: var(--color-accent);
}

/* Feature with Image Layout */
.case-feature-with-image {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-8);
    align-items: start;
}

.case-feature-text {
    max-width: 600px;
}

.case-feature-content {
    margin-bottom: var(--space-6);
}

.case-feature-content:last-child {
    margin-bottom: 0;
}

.case-feature-content h3 {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 600;
    margin-bottom: var(--space-3);
}

.case-feature-content p {
    font-size: var(--text-base);
    line-height: 1.7;
    color: var(--color-text-secondary);
    margin: 0;
}

.case-feature-image {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.case-feature-image img {
    display: block;
    width: 100%;
    height: auto;
}

.case-feature-image--small {
    max-width: 280px;
}

@media (max-width: 900px) {
    .case-feature-with-image {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
    
    .case-feature-image--small {
        max-width: 100%;
    }
    
    .case-feature-text {
        max-width: none;
    }
}

/* Full Width Media */
.case-media {
    margin: var(--space-9) 0;
}

.case-media-full {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    width: 100vw;
    max-width: 100vw;
    padding: var(--space-6);
    background: var(--color-surface);
}

.case-media-inner {
    max-width: 1400px;
    margin: 0 auto;
}

.case-image {
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.case-image img {
    width: 100%;
    height: auto;
    display: block;
}

.case-image-caption {
    margin-top: var(--space-4);
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
    text-align: center;
}

/* Image Grid */
.case-image-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
}

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

/* Quote */
.case-quote {
    margin: var(--space-9) 0;
    padding: var(--space-6) 0;
    border-left: 3px solid var(--color-accent);
    padding-left: var(--space-6);
}

.case-quote blockquote {
    font-size: var(--text-xl);
    font-style: italic;
    color: var(--color-text);
    line-height: 1.7;
    margin-bottom: var(--space-4);
}

.case-quote cite {
    font-size: var(--text-sm);
    font-style: normal;
    color: var(--color-text-tertiary);
}

/* Metrics */
.case-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
    margin: var(--space-9) 0;
    padding: var(--space-8);
    background: var(--color-surface);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--color-border);
}

.case-metric {
    text-align: center;
    padding: var(--space-4);
}

.case-metric-value {
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    font-weight: 700;
    color: var(--color-accent);
    line-height: 1;
    margin-bottom: var(--space-2);
}

.case-metric-label {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

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

/* Back Link */
.case-back {
    display: flex;
    width: fit-content;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4) 0;
    margin-bottom: var(--space-4);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: color var(--duration-fast) var(--ease-smooth);
}

.case-back:hover {
    color: var(--color-text);
}

.case-back svg {
    width: 16px;
    height: 16px;
    transition: transform var(--duration-fast) var(--ease-smooth);
}

.case-back:hover svg {
    transform: translateX(-4px);
}

/* Process Timeline */
.case-timeline {
    position: relative;
    padding-left: var(--space-8);
    margin: var(--space-8) 0;
}

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

.case-timeline-item {
    position: relative;
    padding-bottom: var(--space-8);
}

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

.case-timeline-item::before {
    content: '';
    position: absolute;
    left: calc(-1 * var(--space-8) - 5px);
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-accent);
    border: 3px solid var(--color-bg);
}

.case-timeline-title {
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.case-timeline-content {
    font-size: var(--text-base);
    color: var(--color-text-secondary);
    line-height: 1.7;
}

/* Before/After Comparison */
.case-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
    margin: var(--space-8) 0;
}

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

.comparison-item {
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    border: 1px solid var(--color-border-subtle);
}

.comparison-item h4 {
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-border-subtle);
}

.comparison-before h4 {
    color: var(--color-text-tertiary);
}

.comparison-after h4 {
    color: var(--color-accent);
}

.comparison-item ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comparison-item li {
    position: relative;
    padding-left: var(--space-5);
    margin-bottom: var(--space-3);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: 1.6;
}

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

.comparison-item li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.comparison-before li::before {
    background: var(--color-text-tertiary);
}

.comparison-after li::before {
    background: var(--color-accent);
}

/* Next Project */
.case-next {
    text-align: center;
    padding: var(--space-10) 0;
    border-top: 1px solid var(--color-border-subtle);
    margin: 0 var(--space-6);
}

.case-next-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-text-tertiary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: var(--space-4);
}

.case-next-title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 600;
    color: var(--color-text);
    transition: color var(--duration-fast) var(--ease-smooth);
}

.case-next:hover .case-next-title {
    color: var(--color-accent);
}

/* ============================================
   IMAGE GALLERY & LIGHTBOX
   ============================================ */
.case-gallery {
    margin-top: var(--space-8);
}

.case-gallery-label {
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
    margin-bottom: var(--space-4);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
}

.case-gallery-thumbnails {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.gallery-thumb {
    position: relative;
    width: 200px;
    height: 140px;
    border: none;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    background: var(--color-surface);
    transition: 
        transform var(--duration-fast) var(--ease-smooth),
        box-shadow var(--duration-fast) var(--ease-smooth);
}

.gallery-thumb:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.gallery-thumb:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-normal) var(--ease-smooth);
}

.gallery-thumb:hover img {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .case-gallery-thumbnails {
        gap: var(--space-3);
    }
    
    .gallery-thumb {
        width: 150px;
        height: 105px;
    }
}

@media (max-width: 480px) {
    .gallery-thumb {
        width: calc(50% - var(--space-2));
        height: 100px;
    }
}

/* Carousel */
.case-carousel {
    margin-top: var(--space-8);
}

.carousel-container {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.carousel-track-wrapper {
    flex: 1;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.carousel-track {
    display: flex;
    gap: var(--space-3);
    transition: transform var(--duration-normal) var(--ease-smooth);
}

.carousel-slide {
    flex: 0 0 200px;
    height: 140px;
    border: none;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    background: var(--color-surface);
    transition: 
        transform var(--duration-fast) var(--ease-smooth),
        box-shadow var(--duration-fast) var(--ease-smooth);
}

.carousel-slide:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.carousel-slide:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-normal) var(--ease-smooth);
}

.carousel-slide:hover img {
    transform: scale(1.05);
}

.carousel-nav {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    color: var(--color-text);
    cursor: pointer;
    transition: 
        background var(--duration-fast) var(--ease-smooth),
        transform var(--duration-fast) var(--ease-smooth),
        opacity var(--duration-fast) var(--ease-smooth);
}

.carousel-nav:hover {
    background: var(--color-surface-hover);
    transform: scale(1.05);
}

.carousel-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-4);
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border: none;
    border-radius: var(--radius-full);
    background: var(--color-border);
    cursor: pointer;
    transition: 
        background var(--duration-fast) var(--ease-smooth),
        transform var(--duration-fast) var(--ease-smooth);
}

.carousel-dot:hover {
    background: var(--color-text-tertiary);
}

.carousel-dot.active {
    background: var(--color-accent);
    transform: scale(1.25);
}

@media (max-width: 768px) {
    .carousel-slide {
        flex: 0 0 160px;
        height: 110px;
    }
    
    .carousel-nav {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .carousel-container {
        gap: var(--space-2);
    }
    
    .carousel-slide {
        flex: 0 0 140px;
        height: 95px;
    }
    
    .carousel-nav {
        width: 32px;
        height: 32px;
    }
}

/* Full-width expandable image */
.case-image-expand {
    position: relative;
    display: block;
    width: 100%;
    margin-top: var(--space-8);
    border: none;
    border-radius: var(--radius-xl);
    overflow: hidden;
    cursor: pointer;
    background: var(--color-surface);
    transition: 
        transform var(--duration-fast) var(--ease-smooth),
        box-shadow var(--duration-fast) var(--ease-smooth);
}

.case-image-expand:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.case-image-expand:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.case-image-expand img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform var(--duration-normal) var(--ease-smooth);
}

.case-image-expand:hover img {
    transform: scale(1.02);
}

.case-image-expand-hint {
    position: absolute;
    bottom: var(--space-4);
    right: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
    opacity: 0;
    transform: translateY(4px);
    transition: 
        opacity var(--duration-fast) var(--ease-smooth),
        transform var(--duration-fast) var(--ease-smooth);
}

.case-image-expand:hover .case-image-expand-hint {
    opacity: 1;
    transform: translateY(0);
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
        justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: 
        opacity var(--duration-normal) var(--ease-smooth),
        visibility var(--duration-normal) var(--ease-smooth);
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
}

.lightbox-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: var(--space-8);
}

.lightbox-image-container {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    opacity: 0;
    transition: 
        transform var(--duration-normal) var(--ease-smooth),
        opacity var(--duration-normal) var(--ease-smooth);
}

.lightbox.active .lightbox-image {
    transform: scale(1);
    opacity: 1;
}

.lightbox-close {
    position: absolute;
    top: var(--space-6);
    right: var(--space-6);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    color: var(--color-text);
    cursor: pointer;
    transition: 
        background var(--duration-fast) var(--ease-smooth),
        transform var(--duration-fast) var(--ease-smooth);
    z-index: 10;
}

.lightbox-close:hover {
    background: var(--color-surface-hover);
    transform: scale(1.05);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    color: var(--color-text);
    cursor: pointer;
    transition: 
        background var(--duration-fast) var(--ease-smooth),
        transform var(--duration-fast) var(--ease-smooth),
        opacity var(--duration-fast) var(--ease-smooth);
    z-index: 10;
}

.lightbox-nav:hover {
    background: var(--color-surface-hover);
}

.lightbox-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.lightbox-prev {
    left: var(--space-6);
}

.lightbox-next {
    right: var(--space-6);
}

.lightbox-counter {
    position: absolute;
    bottom: var(--space-6);
    left: 50%;
    transform: translateX(-50%);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    background: var(--color-surface);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border);
}

@media (max-width: 768px) {
    .lightbox-content {
        padding: var(--space-4);
    }
    
    .lightbox-close,
    .lightbox-nav {
        width: 40px;
        height: 40px;
    }
    
    .lightbox-close {
        top: var(--space-4);
        right: var(--space-4);
    }
    
    .lightbox-prev {
        left: var(--space-2);
    }
    
    .lightbox-next {
        right: var(--space-2);
    }
}

/* ============================================
   COLLAPSIBLE CASE SECTIONS
   ============================================ */
.case-section--collapsible .case-section-header {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
}

.case-section--collapsible .case-section-header:hover .case-section-title {
    color: color-mix(in srgb, var(--color-text) 70%, white 30%);
    opacity: 0.95;
}

.case-collapse-toggle {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-1);
}

.case-collapse-label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-tertiary);
    transition: color var(--duration-fast) var(--ease-smooth);
}

.case-section--collapsible .case-section-header:hover .case-collapse-label {
    color: var(--color-text-secondary);
}

.case-collapse-label--more {
    display: inline;
}

.case-collapse-label--less {
    display: none;
}

.case-section--collapsible.is-expanded .case-collapse-label--more {
    display: none;
}

.case-section--collapsible.is-expanded .case-collapse-label--less {
    display: inline;
}

.case-collapse-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--color-surface);
    border: 1px solid var(--color-border-subtle);
    transition:
        transform var(--duration-normal) var(--ease-smooth),
        background var(--duration-fast) var(--ease-smooth);
}

.case-section--collapsible .case-section-header:hover .case-collapse-icon {
    background: var(--color-surface-hover);
}

.case-collapse-icon svg {
    width: 14px;
    height: 14px;
    color: var(--color-text-secondary);
    transition: transform var(--duration-normal) var(--ease-smooth);
}

.case-section--collapsible.is-expanded .case-collapse-icon svg {
    transform: rotate(180deg);
}

.case-section-summary {
    font-size: var(--text-base);
    line-height: 1.7;
    color: var(--color-text-secondary);
    margin-top: var(--space-3);
    max-width: 700px;
}

.case-collapsible-body {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition:
        max-height var(--duration-slow, 500ms) var(--ease-smooth),
        opacity var(--duration-normal) var(--ease-smooth);
}

.case-section--collapsible.is-expanded .case-collapsible-body {
    max-height: 2000px;
    opacity: 1;
}

/* ============================================
   IMAGE ANNOTATIONS & CALLOUTS
   ============================================ */
.case-image-annotated {
    position: relative;
}

.case-annotation {
    position: absolute;
    z-index: 2;
}

.case-annotation-marker {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-full);
    background: var(--color-accent);
    color: var(--color-bg);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 700;
    cursor: pointer;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.3),
        0 0 0 3px rgba(var(--color-accent-rgb, 99, 102, 241), 0.25);
    transition:
        transform var(--duration-fast) var(--ease-smooth),
        box-shadow var(--duration-fast) var(--ease-smooth);
    animation: annotation-pulse 3s ease-in-out infinite;
}

@keyframes annotation-pulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(99, 102, 241, 0.2); }
    50% { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 6px rgba(99, 102, 241, 0.1); }
}

.case-annotation-marker:hover {
    transform: scale(1.15);
}

.case-annotation-popover {
    position: absolute;
    bottom: calc(100% + var(--space-3));
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    width: 280px;
    padding: var(--space-4) var(--space-5);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(16px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity var(--duration-fast) var(--ease-smooth),
        transform var(--duration-fast) var(--ease-smooth),
        visibility var(--duration-fast) var(--ease-smooth);
    z-index: 10;
}

.case-annotation.is-active .case-annotation-popover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.case-annotation-popover::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--color-border);
}

.case-annotation-popover-title {
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--space-2);
}

.case-annotation-popover-text {
    font-size: var(--text-sm);
    line-height: 1.6;
    color: var(--color-text-secondary);
    margin: 0;
}

/* Popover position variants */
.case-annotation--bottom .case-annotation-popover {
    bottom: auto;
    top: calc(100% + var(--space-3));
    transform: translateX(-50%) translateY(-8px);
}

.case-annotation--bottom.is-active .case-annotation-popover {
    transform: translateX(-50%) translateY(0);
}

.case-annotation--bottom .case-annotation-popover::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: var(--color-border);
}

.case-annotation--left .case-annotation-popover {
    left: auto;
    right: 0;
    transform: translateX(0) translateY(8px);
}

.case-annotation--left.is-active .case-annotation-popover {
    transform: translateX(0) translateY(0);
}

.case-annotation--right .case-annotation-popover {
    left: 0;
    transform: translateX(0) translateY(8px);
}

.case-annotation--right.is-active .case-annotation-popover {
    transform: translateX(0) translateY(0);
}

@media (max-width: 768px) {
    .case-annotation-popover {
        width: 220px;
        padding: var(--space-3) var(--space-4);
    }

    .case-annotation-marker {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
}

/* ============================================
   SECTION WITH SIDE-BY-SIDE MEDIA
   ============================================ */
.case-section-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
    align-items: start;
}

.case-section-layout > .case-section-text:only-child {
    grid-column: 1 / -1;
}

.case-section-media {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    position: sticky;
    top: calc(var(--space-11) + var(--space-4));
    align-self: start;
}

.case-section-thumb {
    display: block;
    border: none;
    padding: 0;
    background: none;
    cursor: pointer;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform var(--duration-fast) var(--ease-smooth);
}

.case-section-thumb:hover {
    transform: translateY(-3px);
}

.case-section-thumb:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.case-section-thumb img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform var(--duration-normal) var(--ease-smooth);
}

.case-section-thumb:hover img {
    transform: scale(1.02);
}

.case-section-thumb-caption {
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
    margin-top: var(--space-2);
    text-align: center;
}

.case-section-media-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
    align-items: start;
}

@media (max-width: 900px) {
    .case-section-layout {
        grid-template-columns: 1fr;
    }

    .case-section-media {
        position: static;
        order: -1;
    }
}

/* ============================================
   IMAGE SEQUENCE (step-by-step flows)
   ============================================ */
.case-image-sequence {
    margin: var(--space-8) 0;
}

.case-image-sequence-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    margin-bottom: var(--space-4);
}

.case-image-sequence-track {
    display: flex;
    gap: var(--space-4);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: var(--space-4);
    -webkit-overflow-scrolling: touch;
}

.case-image-sequence-track::-webkit-scrollbar {
    height: 4px;
}

.case-image-sequence-track::-webkit-scrollbar-track {
    background: var(--color-surface);
    border-radius: 2px;
}

.case-image-sequence-track::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 2px;
}

.case-image-sequence-track::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-tertiary);
}

.case-sequence-item {
    flex: 0 0 auto;
    scroll-snap-align: start;
    width: 320px;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
    text-align: left;
}

.case-sequence-item-image {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition:
        transform var(--duration-fast) var(--ease-smooth),
        box-shadow var(--duration-fast) var(--ease-smooth);
    background: var(--color-surface);
}

.case-sequence-item:hover .case-sequence-item-image {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.case-sequence-item-image img {
    width: 100%;
    height: auto;
    display: block;
}

.case-sequence-item-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    background: var(--color-accent);
    color: var(--color-bg);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    margin-top: var(--space-3);
    margin-right: var(--space-2);
    vertical-align: middle;
}

.case-sequence-item-caption {
    display: inline;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: 22px;
    vertical-align: middle;
}

.case-sequence-item-meta {
    margin-top: var(--space-3);
}

@media (max-width: 768px) {
    .case-sequence-item {
        width: 260px;
    }
}

@media (max-width: 480px) {
    .case-sequence-item {
        width: 85vw;
    }
}

/* ============================================
   PROJECT SHOWCASE - Expanding Panels
   ============================================ */
.project-showcase {
    display: flex;
    gap: 6px;
    height: 560px;
    width: 100%;
}

.showcase-panel {
    position: relative;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    border-radius: var(--radius-xl);
    cursor: pointer;
    text-decoration: none;
    color: white;
    filter: brightness(0.55) saturate(0.4);
    transition:
        flex 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        filter 0.4s ease;
}

.showcase-panel.is-active {
    flex: 1.8;
    filter: brightness(1) saturate(1);
}

.showcase-panel.is-expanded {
    flex: 3;
}

.showcase-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.95) 0%,
        rgba(0, 0, 0, 0.7) 35%,
        rgba(0, 0, 0, 0.2) 65%,
        transparent 100%
    );
    z-index: 1;
    pointer-events: none;
}

.showcase-panel-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top left;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.showcase-panel.is-active .showcase-panel-image {
    transform: scale(1.02);
}

.showcase-panel-overlay {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 400px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--space-6);
    z-index: 2;
    pointer-events: none;
}

.showcase-panel-category {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: var(--space-2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.showcase-panel.is-active .showcase-panel-category {
    opacity: 1;
}

.showcase-panel-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 600;
    line-height: var(--leading-tight);
    color: white;
    margin: 0;
    text-shadow: 0 0 16px rgba(255, 255, 255, 0.3), 0 1px 3px rgba(0, 0, 0, 0.9);
}

.showcase-panel.is-active .showcase-panel-title {
    text-shadow: 0 0 24px rgba(255, 255, 255, 0.5), 0 0 50px rgba(255, 255, 255, 0.15), 0 1px 3px rgba(0, 0, 0, 0.9);
}

.showcase-panel-synopsis {
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    margin-top: var(--space-3);
    height: 48px;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.showcase-panel.is-expanded .showcase-panel-synopsis {
    opacity: 1;
}

.showcase-panel:not(.is-active) .showcase-panel-title {
    opacity: 0.7;
}

.showcase-panel-cta {
    display: none;
}

/* Subtle border between panels in light mode */
[data-theme="light"] .showcase-panel {
    filter: brightness(0.7) saturate(0.5);
}

[data-theme="light"] .showcase-panel.is-active {
    filter: brightness(1) saturate(1);
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .project-showcase {
        height: 480px;
    }

    .showcase-panel-overlay {
        padding: var(--space-4);
    }
}

@media (max-width: 768px) {
    .project-showcase {
        flex-direction: column;
        height: auto;
        gap: 4px;
    }

    .showcase-panel {
        flex: none !important;
        height: 80px;
        border-radius: var(--radius-lg);
        filter: brightness(0.6) saturate(0.5);
        transition:
            height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
            filter 0.4s ease;
    }

    .showcase-panel.is-active {
        height: 320px;
        filter: brightness(1) saturate(1);
    }

    .showcase-panel-overlay {
        width: 100%;
        padding: var(--space-4);
    }

    .showcase-panel-title {
        font-size: var(--text-base);
    }

    .showcase-panel.is-active .showcase-panel-title {
        font-size: var(--text-lg);
    }

    .showcase-panel.is-active .showcase-panel-synopsis {
        opacity: 1;
    }

    .showcase-panel-cta {
        display: inline-flex;
        align-items: center;
        align-self: flex-start;
        margin-top: var(--space-3);
        padding: var(--space-2) var(--space-4);
        font-size: var(--text-sm);
        font-weight: 600;
        color: white;
        background: var(--color-accent);
        border-radius: var(--radius-full);
        pointer-events: auto;
        opacity: 0;
        transform: translateY(8px);
        transition: opacity 0.3s ease 0.15s, transform 0.3s ease 0.15s;
    }

    .showcase-panel.is-active .showcase-panel-cta {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .navbar, .footer, .scroll-indicator, .cursor-glow, .hero-orb, .hero-grid {
        display: none !important;
    }

    .hero {
        min-height: auto;
        padding: var(--space-8) 0;
    }

    body {
        background: white;
        color: black;
        text-shadow: none !important;
    }

    * {
        text-shadow: none !important;
    }
}
