

/* ============================================
   DESIGN SYSTEM TOKENS
   ============================================ */
:root {
    /* Colors — Light Theme */
    --color-bg:          #f5f7fa;
    --color-surface:     #ffffff;
    --color-surface-hover: #f0f4f9;
    --color-border:      rgba(0, 0, 0, 0.08);
    --color-border-hover: rgba(0, 0, 0, 0.18);

    --color-text-primary:   #0d1117;
    --color-text-secondary: #4b5563;
    --color-text-muted:     #9ca3af;

    --color-accent:      #1a6ee8;  /* Slightly deeper blue — better contrast on white */
    --color-accent-dim:  rgba(26, 110, 232, 0.10);
    --color-accent-glow: rgba(26, 110, 232, 0.20);

    /* Spacing scale (4px base) */
    --space-1:  0.25rem;
    --space-2:  0.5rem;
    --space-3:  0.75rem;
    --space-4:  1rem;
    --space-6:  1.5rem;
    --space-8:  2rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-24: 6rem;
    --space-32: 8rem;

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body:    'Inter', sans-serif;

    /* Shape */
    --radius-sm:  6px;
    --radius-md:  10px;
    --radius-lg:  14px;
    --radius-xl:  20px;

    /* Shadows */
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-card-hover: 0 2px 8px rgba(0, 0, 0, 0.10), 0 8px 24px rgba(0, 0, 0, 0.12);

    /* Transitions */
    --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
    --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);
    --duration-fast:   150ms;
    --duration-base:   250ms;
    --duration-slow:   400ms;
    --duration-reveal: 600ms;
}

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

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

body {
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    overflow-x: hidden;
}

/* Subtle radial ambient — static, light tint */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -5%, rgba(26, 110, 232, 0.05) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.25;
    color: var(--color-text-primary);
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.75rem, 6vw, 4.5rem); font-weight: 800; }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }

p {
    color: var(--color-text-secondary);
    line-height: 1.75;
    margin-bottom: var(--space-4);
}

p:last-child { margin-bottom: 0; }

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

code {
    font-size: 0.875em;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0.1em 0.4em;
    color: var(--color-accent);
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 var(--space-8);
}

section {
    padding: var(--space-32) 0;
    position: relative;
    z-index: 1;
}

/* ============================================
   SURFACE / CARD BASE
   ============================================ */
.surface {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

/* Legacy alias */
.glass { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); }

/* ============================================
   NAVIGATION
   ============================================ */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 900;
    padding: var(--space-6) 0;
    transition: padding var(--duration-base) var(--ease-out),
                background var(--duration-base) var(--ease-out),
                border-color var(--duration-base) var(--ease-out);
    border-bottom: 1px solid transparent;
}

nav.scrolled {
    background: rgba(245, 247, 250, 0.90);
    backdrop-filter: blur(20px) saturate(1.8);
    -webkit-backdrop-filter: blur(20px) saturate(1.8);
    border-bottom-color: var(--color-border);
    padding: var(--space-4) 0;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-8);
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--color-text-primary);
    letter-spacing: -0.01em;
}

.logo span { color: var(--color-accent); }

.nav-links {
    display: flex;
    gap: var(--space-8);
    list-style: none;
    align-items: center;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: color var(--duration-fast) var(--ease-out);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--color-accent);
    transition: width var(--duration-base) var(--ease-out);
    border-radius: 2px;
}

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

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

/* Accent resume link */
.nav-links .nav-resume {
    color: var(--color-accent);
    font-weight: 600;
}
.nav-links .nav-resume:hover { color: var(--color-text-primary); }

/* Mobile hamburger button */
.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: var(--space-2);
    background: none;
    border: none;
}

.nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-text-primary);
    border-radius: 2px;
    transition: transform var(--duration-base) var(--ease-out),
                opacity var(--duration-fast) var(--ease-out);
}

/* Mobile Nav Drawer */
.nav-mobile {
    display: none;
    position: fixed;
    inset: 0;
    top: 61px;
    background: rgba(245, 247, 250, 0.97);
    backdrop-filter: blur(20px);
    z-index: 800;
    padding: var(--space-8);
    flex-direction: column;
    gap: var(--space-6);
    border-top: 1px solid var(--color-border);
}

.nav-mobile.open { display: flex; }
.nav-mobile a {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--color-border);
    transition: color var(--duration-fast) var(--ease-out);
}
.nav-mobile a:hover { color: var(--color-text-primary); }

/* ============================================
   SECTION HEADERS
   ============================================ */
.section-header {
    margin-bottom: var(--space-16);
}

.section-label {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: var(--space-3);
}

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

/* Underline accent — proportional width */
.section-header h2::after {
    display: none; /* Handled by section-label instead */
}

.section-header p {
    max-width: 560px;
    font-size: 1.0625rem;
}

/* ============================================
   HERO
   ============================================ */
.hero {
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding-top: 5rem;
    position: relative;
    z-index: 1;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-8);
}

.hero-content {
    max-width: 700px;
    flex: 1 1 65%;
}

.hero-image-wrapper {
    position: relative;
    width: 312px;
    flex: 0 0 312px;
    margin-left: auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.picture-frame-wrapper {
    position: relative;
    width: 312px;
    height: 392px;
    animation: float 6s ease-in-out infinite;
    transform-origin: center;
}

.picture-frame {
    position: absolute;
    top: 0; left: 0;
    width: 312px;
    height: 392px;
    z-index: 2;
    box-shadow: 2px 2px 15px rgba(0,0,0,0.2);
}

.hero-image-framed {
    position: absolute;
    top: 36px;
    left: 36px;
    width: 240px;
    height: 320px;
    object-fit: cover;
    object-position: center 15%;
    z-index: 1;
}

.outFrame { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }
.frameTopBorder { position: absolute; top: 0; left: 0; width: 288px; height: 0; border-left: 12px solid transparent; border-right: 12px solid transparent; border-top: 12px solid rgba(238,238,238,1); }
.frameTopBorder::after { content: ""; display: block; position: absolute; top: 368px; left: -12px; width: 288px; height: 0; border-left: 12px solid transparent; border-right: 12px solid transparent; border-bottom: 12px solid rgba(238,238,238,1); box-shadow: 1px 1px 10px #696969; }
.frameLeftBorder { position: absolute; top: 12px; left: 0; height: 368px; width: 0; border-top: 12px solid transparent; border-bottom: 12px solid transparent; border-left: 12px solid rgba(230,230,230,1); }
.frameLeftBorder::after { content: ""; display: block; position: absolute; top: -12px; left: 288px; height: 368px; width: 0; border-top: 12px solid transparent; border-bottom: 12px solid transparent; border-right: 12px solid rgba(230,230,230,1); }

.midFrame { position: absolute; top: 12px; left: 12px; width: 288px; height: 368px; z-index: 4; pointer-events: none; }
.midFrameTopBorder { position: absolute; top: 0; left: 0; width: 240px; height: 0; border-left: 24px solid transparent; border-right: 24px solid transparent; border-top: 24px solid rgba(218,218,218,1); box-shadow: inset 0px 0px 2px #696969; }
.midFrameTopBorder::after { content: ""; display: block; position: absolute; top: 320px; left: -24px; width: 240px; height: 0; border-left: 24px solid transparent; border-right: 24px solid transparent; border-bottom: 24px solid rgba(218,218,218,1); }
.midFrameLeftBorder { position: absolute; top: 24px; left: 0; height: 320px; width: 0; border-top: 24px solid transparent; border-bottom: 24px solid transparent; border-left: 24px solid rgba(210,210,210,1); }
.midFrameLeftBorder::after { content: ""; display: block; position: absolute; top: -24px; left: 240px; height: 320px; width: 0; border-top: 24px solid transparent; border-bottom: 24px solid transparent; border-right: 24px solid rgba(210,210,210,1); }

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

@keyframes pulseGlow {
    0% { opacity: 0.15; transform: scale(0.95); }
    100% { opacity: 0.35; transform: scale(1.05); }
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-accent);
    margin-bottom: var(--space-6);
    border: 1px solid var(--color-border);
    background: var(--color-accent-dim);
    padding: var(--space-2) var(--space-4);
    border-radius: 999px;
    width: fit-content;
}

.hero-eyebrow::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-accent);
    box-shadow: 0 0 6px var(--color-accent);
    animation: pulse 2s ease-in-out infinite;
}

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

.hero h1 {
    margin-bottom: var(--space-6);
}

.hero h1 .line { display: block; }

.accent-text { 
    background: linear-gradient(90deg, var(--color-accent), #00c6ff, var(--color-accent));
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: shine 3s linear infinite;
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

.hero-description {
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    max-width: 560px;
    line-height: 1.8;
    margin-bottom: var(--space-8);
}

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

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0.625rem 1.25rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    cursor: pointer;
    text-decoration: none;
    transition:
        background   var(--duration-fast) var(--ease-out),
        border-color var(--duration-fast) var(--ease-out),
        color        var(--duration-fast) var(--ease-out),
        box-shadow   var(--duration-fast) var(--ease-out),
        transform    var(--duration-fast) var(--ease-out);
    white-space: nowrap;
    color: var(--color-text-primary);
    background: var(--color-surface);
}

.btn:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-border-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

@keyframes btnPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(26, 110, 232, 0.6);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(26, 110, 232, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(26, 110, 232, 0);
    }
}

.btn-primary {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
    font-weight: 600;
    animation: btnPulse 2s infinite;
}

.btn-primary:hover {
    background: #4a9df8;
    border-color: #4a9df8;
    color: #fff;
    box-shadow: 0 4px 16px var(--color-accent-glow);
}

/* ============================================
   SKILL CARDS
   ============================================ */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-6);
}

.skill-card {
    padding: var(--space-8);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    transition:
        border-color var(--duration-base) var(--ease-out),
        box-shadow   var(--duration-base) var(--ease-out),
        transform    var(--duration-base) var(--ease-out);
}

.skill-card:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-card-hover), 0 0 0 1px var(--color-accent-glow);
    transform: translateY(-3px);
}

.skill-card:hover .skill-card-icon {
    animation: wiggle 0.6s ease-in-out infinite alternate;
}

@keyframes wiggle {
    0% { transform: rotate(0deg) scale(1); }
    100% { transform: rotate(15deg) scale(1.15); }
}

.skill-card-icon {
    font-size: 1.5rem;
    margin-bottom: var(--space-4);
    display: inline-block;
}

.skill-card h3 {
    margin-bottom: var(--space-4);
    font-size: 1.0625rem;
    color: var(--color-text-primary);
}

.skill-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.skill-card ul li {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.skill-card ul li::before {
    content: '';
    display: block;
    flex-shrink: 0;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--color-accent);
}

/* ============================================
   TIMELINE
   ============================================ */
.timeline {
    position: relative;
    max-width: 680px;
    padding-left: var(--space-8);
}

/* Track */
.timeline-track {
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 1px;
    background: var(--color-border);
    overflow: hidden;
}

/* Animated fill line */
.timeline-track-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--color-accent);
    height: 0%;
    transition: height 0.1s linear;
    box-shadow: 0 0 8px var(--color-accent-glow);
}

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

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

.timeline-dot {
    position: absolute;
    left: calc(-1 * var(--space-8) - 4px);
    top: 6px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--color-bg);
    border: 2px solid var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-dim);
    transition: box-shadow var(--duration-base) var(--ease-out), transform var(--duration-base) var(--ease-out);
    z-index: 1;
}

.timeline-item:hover .timeline-dot {
    box-shadow: 0 0 0 4px var(--color-accent-glow);
    transform: scale(1.3);
}

.timeline-content {
    padding: var(--space-6);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition:
        border-color var(--duration-base) var(--ease-out),
        transform    var(--duration-base) var(--ease-out);
}

.timeline-content:hover {
    border-color: var(--color-border-hover);
    transform: translateX(3px);
}

.timeline-date {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-accent);
    display: block;
    margin-bottom: var(--space-2);
}

.timeline-content h3 {
    font-size: 1.0625rem;
    margin-bottom: var(--space-1);
    color: var(--color-text-primary);
}

.timeline-org {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-3);
}

/* ============================================
   PROJECT CARDS
   ============================================ */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-6);
}

.project-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition:
        border-color var(--duration-base) var(--ease-out),
        box-shadow   var(--duration-base) var(--ease-out),
        transform    var(--duration-base) var(--ease-out);
}

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

.project-header {
    padding: var(--space-6) var(--space-6) 0;
}

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

.project-number {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: var(--space-3);
}

.project-title {
    font-family: var(--font-heading);
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: var(--space-3);
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.tag {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 2px 10px;
    background: var(--color-accent-dim);
    color: var(--color-accent);
    border-radius: 999px;
    border: 1px solid rgba(47, 129, 247, 0.2);
}

.project-description {
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
    line-height: 1.65;
    flex: 1;
    margin-bottom: var(--space-6);
}

.project-actions {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
    margin-top: auto;
}

.project-actions .btn {
    font-size: 0.8125rem;
    padding: 0.4rem 0.875rem;
}

/* ============================================
   CONTACT SECTION
   ============================================ */
.contact-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-16) var(--space-12);
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
}

.contact-card h2 { margin-bottom: var(--space-4); }

.contact-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin: var(--space-8) 0;
    align-items: center;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    font-size: 1rem;
    color: var(--color-text-secondary);
    transition: color var(--duration-fast) var(--ease-out);
}

.contact-link:hover { color: var(--color-accent); }

.contact-link-icon {
    width: 18px;
    text-align: center;
    color: var(--color-accent);
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    padding: var(--space-12) 0;
    border-top: 1px solid var(--color-border);
    position: relative;
    z-index: 1;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-4);
}

footer p {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 0;
}

.footer-links {
    display: flex;
    gap: var(--space-6);
    list-style: none;
}

.footer-links a {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    transition: color var(--duration-fast) var(--ease-out);
}

.footer-links a:hover { color: var(--color-text-primary); }

/* ============================================
   SCROLL REVEAL ANIMATIONS
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition:
        opacity  var(--duration-reveal) var(--ease-out),
        transform var(--duration-reveal) var(--ease-out);
    will-change: transform, opacity;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays for child items */
.reveal-stagger > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger > *:nth-child(2) { transition-delay: 80ms; }
.reveal-stagger > *:nth-child(3) { transition-delay: 160ms; }
.reveal-stagger > *:nth-child(4) { transition-delay: 240ms; }
.reveal-stagger > *:nth-child(5) { transition-delay: 320ms; }

/* ============================================
   CASE STUDY — Dark unified theme
   ============================================ */
.cs-nav {
    padding: var(--space-8) 0 var(--space-6);
}

.cs-back {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: color var(--duration-fast) var(--ease-out);
}

.cs-back:hover { color: var(--color-text-primary); }
.cs-back::before { content: '←'; }

.cs-hero {
    padding: var(--space-16) 0 var(--space-24);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--space-16);
}

.cs-hero h1 {
    font-size: clamp(2rem, 5vw, 3.25rem);
    margin-bottom: var(--space-4);
}

.cs-hero-meta {
    display: flex;
    gap: var(--space-8);
    flex-wrap: wrap;
    margin-top: var(--space-8);
}

.cs-meta-item label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: var(--space-1);
}

.cs-meta-item span {
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

/* Metrics */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-4);
    margin: var(--space-10, 2.5rem) 0;
}

.metric-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    text-align: center;
}

.metric-number {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--color-accent);
    line-height: 1;
    margin-bottom: var(--space-2);
}

.metric-label {
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
}

/* Case study body */
.cs-body {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: var(--space-12);
    align-items: start;
}

.cs-content { min-width: 0; }

.cs-section {
    margin-bottom: var(--space-16);
}

.cs-section h2 {
    font-size: 1.375rem;
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-border);
}

/* Kill the default h2::after on case study */
.cs-section h2::after { display: none; }

.cs-section h3 {
    font-size: 1rem;
    color: var(--color-text-primary);
    margin: var(--space-6) 0 var(--space-3);
}

.cs-section ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.cs-section ul li {
    display: flex;
    gap: var(--space-3);
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
    line-height: 1.65;
}

.cs-section ul li::before {
    content: '→';
    color: var(--color-accent);
    flex-shrink: 0;
    margin-top: 2px;
}

/* Sticky sidebar */
.cs-sidebar {
    position: sticky;
    top: 90px;
}

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

.cs-toc h4 {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: var(--space-4);
}

.cs-toc ol {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    counter-reset: toc;
}

.cs-toc ol li a {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    transition: color var(--duration-fast) var(--ease-out);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    border-left: 2px solid transparent;
}

.cs-toc ol li a:hover,
.cs-toc ol li a.active {
    color: var(--color-accent);
    border-left-color: var(--color-accent);
    background: var(--color-accent-dim);
}

/* Screenshot */
.cs-screenshot {
    margin: var(--space-8) 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.cs-screenshot img {
    width: 100%;
    height: auto;
    display: block;
}

.cs-caption {
    padding: var(--space-3) var(--space-6);
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    text-align: center;
}

/* Tech badges */
.badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.badge {
    font-size: 0.8125rem;
    font-weight: 500;
    padding: var(--space-1) var(--space-4);
    background: var(--color-accent-dim);
    color: var(--color-accent);
    border: 1px solid rgba(47, 129, 247, 0.2);
    border-radius: 999px;
}

/* Progress bar */
.cs-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--color-accent);
    z-index: 9999;
    transition: width 0.1s linear;
}

/* ============================================
   PERFORMANCE: Reduced motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal { opacity: 1; transform: none; }
    .hero-eyebrow::before { animation: none; }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .cs-body {
        grid-template-columns: 1fr;
    }
    .cs-sidebar { position: static; }
    .cs-toc { display: none; }
}

@media (max-width: 768px) {
    .container { padding: 0 var(--space-6); }
    section { padding: var(--space-24) 0; }

    .nav-links { display: none; }
    .nav-hamburger { display: flex; }

    h1 { font-size: 2.25rem; }
    h2 { font-size: 1.5rem; }

    .hero-container {
        flex-direction: column-reverse;
        text-align: center;
        gap: var(--space-6);
    }
    
    .hero-eyebrow {
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-description {
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-image-wrapper {
        width: 100%;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
        justify-content: center;
        margin-bottom: var(--space-6);
        overflow: visible;
    }
    
    .picture-frame-wrapper {
        transform: scale(0.75);
        margin: 0 auto;
    }

    .hero-actions { flex-direction: column; }
    .hero-actions .btn { width: 100%; justify-content: center; }

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

    .cs-hero-meta { gap: var(--space-6); }
    .contact-card { padding: var(--space-8); }

    .footer-content { flex-direction: column; align-items: flex-start; }

    .timeline { padding-left: var(--space-6); }
}

@media (max-width: 480px) {
    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
}
