/* ========== ROOT TOKENS & THEME ========== */

:root {
    --bg: #0e0e10;
    --text: #eaeaea;
    --muted: #b5b5b6;
    --accent: #8b5cf6;
    --accent-2: #22c1c3;
    --card: #151518;
    --gap: clamp(16px, 2.5vw, 28px);
    --radius: 16px;
    --shadow: 0 8px 24px rgba(0, 0, 0, .35);
    --hairline: color-mix(in oklab, var(--text) 12%, transparent);
    --page-pad: clamp(16px, 4vw, 56px);
    --header-h: 56px;
    --rail-offset: 16px;
    --rail-btn: 44px;
    --rail-gap: 40px;

    /* Animation tokens */
    --transition-fast: 0.18s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.45s ease;

    /* Gradient definitions */
    --gradient-primary: linear-gradient(90deg, #3b82f6, #a855f7, #ec4899);
    --gradient-subtle: linear-gradient(145deg, rgba(255, 255, 255, .06), transparent 45%);
}

html.light {
    --bg: #f7f8f9;
    --text: #0c0c0d;
    --muted: #5b5b5c;
    --card: #ffffff;
    --hairline: color-mix(in oklab, var(--text) 12%, transparent);
}

/* ========== BASE / RESETS ========== */

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    font: 400 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    display: block;
}

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

/* ========== LAYOUT ========== */

.container {
    width: 100%;
    margin-inline: 0;
    padding-inline: var(--page-pad);
}

.wrap {
    width: min(1080px, calc(100% - 2 * var(--page-pad)));
    margin-inline: auto;
}

section {
    padding: 56px 0;
    position: relative;
}

section + section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--hairline);
}

/* ========== TYPOGRAPHY ========== */

.overline {
    text-transform: uppercase;
    letter-spacing: .16em;
    font-size: .8rem;
    color: var(--muted);
    margin: 0 0 8px;
}

.title {
    margin: 6px 0 10px 0;
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -.02em;
    font-size: clamp(40px, 7.5vw, 66px);
}

.lede {
    color: var(--muted);
    font-size: clamp(16px, 2.2vw, 20px);
    max-width: 65ch;
}

.h2 {
    font-weight: 800;
    line-height: 1.18;
    font-size: clamp(22px, 2.6vw, 32px);
    margin: 0 0 10px;
}

/* Body copy */
.muted {
    color: var(--muted);
    line-height: 1.7;
}

/* Case study reading rhythm */
.case-study p {
    margin: 0 0 1.1rem;
    line-height: 1.7;
    max-width: 72ch;
}

.case-study ul {
    margin: .5rem 0 1.3rem;
    padding-left: 1.1rem;
}

.case-study ul li {
    margin-bottom: 0.7rem;
    line-height: 1.6;
    max-width: 72ch;
}

.stack {
    display: grid;
    gap: var(--gap);
}

.grid-2 {
    display: grid;
    gap: var(--gap);
    grid-template-columns: 1fr 1fr;
}

.caption {
    color: var(--muted);
    font-size: .95rem;
    margin-top: 10px;
}

.lucide {
    color: #8c8c8c;
    width: 32px;
    height: 32px;
    stroke-width: 1.5px;
}

/* ========== HEADER / NAV ========== */

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 5000;
    transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
}

/* Scrolled state - nav becomes visible */
header.scrolled {
    backdrop-filter: saturate(1.2) blur(8px);
    -webkit-backdrop-filter: saturate(1.2) blur(8px);
    background: color-mix(in oklab, var(--bg) 85%, transparent);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px var(--page-pad);
    max-width: 1360px;
    margin: 0 auto;
}

.brand {
    font-weight: 500;
    letter-spacing: .3px;
    color: var(--text);
}

.menu {
    display: flex;
    gap: 18px;
    align-items: center;
}

.menu a {
    color: var(--text);
    transition: opacity 0.3s ease;
}

.menu a:hover {
    opacity: 0.6;
}

/* Theme toggle */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    min-width: 34px;
    min-height: 34px;
    line-height: 1;
    color: color-mix(in oklab, var(--text) 40%, var(--bg));
    transition: color .25s ease, transform .2s ease;
}

.theme-toggle:hover {
    color: var(--text);
    transform: scale(1.05);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 6px;
}

.theme-icon-moon, .icon {
    display: inline-block;
    fill: currentColor;
}

.icon-heart {
    color: #8b5cf6;
    vertical-align: -6px;
    margin: 0 4px;
    animation: heartbeat 2.5s ease-in-out infinite;
}


@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

/* ========== HERO SECTION ========== */

.hero {
    padding: clamp(56px, 10vh, 120px) 0;
}

.hero h1 {
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -.02em;
    font-size: clamp(40px, 7.5vw, 84px);
    margin: 0 0 12px 0;
    background: linear-gradient(92deg, var(--text), color-mix(in oklab, var(--accent) 65%, var(--text)));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p {
    max-width: 65ch;
    color: var(--muted);
    font-size: clamp(16px, 2.2vw, 20px);
}

#hero {
    padding: calc(var(--header-h) + clamp(56px, 9vh, 128px)) 0 clamp(56px, 9vh, 128px);
    scroll-margin-top: var(--header-h);
    overflow: hidden;
}

#hero .wrap {
    position: relative;
    z-index: 10;
}

#hero .overline {
    color: var(--accent);
}

#hero .title {
    background: linear-gradient(90deg, var(--text), color-mix(in oklab, var(--accent) 65%, var(--text)));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-main {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding-top: calc(var(--header-h) + 40px);
    padding-bottom: 80px;
}

.bloom-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.bloom, .work-bloom, .timeline-bloom, .contact-bloom,
.project-card-bloom {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
}

.bloom-1 {
    top: -160px;
    left: -160px;
    width: 384px;
    height: 384px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.4) 0%, rgba(168, 85, 247, 0.4) 50%, transparent 100%);
    animation: bloom-float 25s infinite;
}

.bloom-2 {
    top: 33%;
    right: -160px;
    width: 384px;
    height: 384px;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.4) 0%, rgba(168, 85, 247, 0.4) 50%, transparent 100%);
    animation: bloom-float 30s infinite;
}

.bloom-3 {
    bottom: -160px;
    left: 33%;
    width: 384px;
    height: 384px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(236, 72, 153, 0.3) 50%, transparent 100%);
    animation: bloom-float 22s infinite;
}

/* Consolidated bloom animation */
@keyframes bloom-float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(var(--bloom-x, 100px), var(--bloom-y, 50px)) scale(var(--bloom-scale, 1.4));
    }
}

@keyframes bloom-float-1 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(80px, 60px) scale(1.3);
    }
}

.bloom-1 {
    --bloom-x: 100px;
    --bloom-y: 50px;
    --bloom-scale: 1.4;
}

.bloom-2 {
    --bloom-x: -80px;
    --bloom-y: 100px;
    --bloom-scale: 1.5;
}

.bloom-3 {
    --bloom-x: -50px;
    --bloom-y: -80px;
    --bloom-scale: 1.3;
}

.work-bloom {
    top: 80px;
    right: 0;
    width: 384px;
    height: 384px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, transparent 70%);
    animation: bloom-float 22s infinite;
}

/* Case study page blooms */
.cover-bloom {
    position: absolute;
    top: 20%;
    right: -100px;
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(168, 85, 247, 0.15));
    border-radius: 50%;
    filter: blur(60px);
    animation: bloom-float-1 20s ease-in-out infinite;
}

.problem-bloom {
    position: absolute;
    top: 0;
    left: -200px;
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.08), transparent);
    border-radius: 50%;
    filter: blur(80px);
    animation: bloom-float-2 25s ease-in-out infinite;
}

.solution-bloom {
    position: absolute;
    bottom: 0;
    right: -150px;
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), transparent);
    border-radius: 50%;
    filter: blur(70px);
    animation: bloom-float-1 22s ease-in-out infinite;
}

.ia-carousel-glow {
    position: absolute;
    top: -100px;
    right: -100px;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15), transparent);
    filter: blur(50px);
    animation: bloom-float-3 18s ease-in-out infinite;
}

/* Advanced Camera Module blooms */
.cover-bloom-camera {
    position: absolute;
    top: 30%;
    left: -80px;
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.12), rgba(59, 130, 246, 0.12));
    border-radius: 50%;
    filter: blur(60px);
    animation: bloom-float-2 22s ease-in-out infinite;
}

.results-bloom-camera {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.08), transparent 70%);
    filter: blur(90px);
}

/* Deutsche Bank blooms */
.cover-bloom-deutsche {
    position: absolute;
    top: 25%;
    left: -70px;
    width: 260px;
    height: 260px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(168, 85, 247, 0.12));
    border-radius: 50%;
    filter: blur(60px);
    animation: bloom-float-1 21s ease-in-out infinite;
}

.results-bloom-deutsche {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.08), transparent 70%);
    filter: blur(85px);
}

/* Garmin Connect blooms */
.cover-bloom-garmin {
    position: absolute;
    top: 28%;
    left: -75px;
    width: 255px;
    height: 255px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.12), rgba(59, 130, 246, 0.12));
    border-radius: 50%;
    filter: blur(60px);
    animation: bloom-float-1 20s ease-in-out infinite;
}

.results-bloom-garmin {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.09), transparent 70%);
    filter: blur(95px);
}

.problem-bloom-camera {
    position: absolute;
    top: 20%;
    right: -100px;
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.08), transparent);
    border-radius: 50%;
    filter: blur(70px);
    animation: bloom-float-1 20s ease-in-out infinite;
}

.problem-bloom-deutsche {
    position: absolute;
    top: 15%;
    right: -110px;
    width: 360px;
    height: 360px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), transparent);
    border-radius: 50%;
    filter: blur(75px);
    animation: bloom-float-2 21s ease-in-out infinite;
}

.problem-bloom-garmin {
    position: absolute;
    top: 18%;
    right: -105px;
    width: 355px;
    height: 355px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.09), transparent);
    border-radius: 50%;
    filter: blur(72px);
    animation: bloom-float-1 19s ease-in-out infinite;
}

.solution-bloom-camera {
    position: absolute;
    top: 30%;
    left: -120px;
    width: 320px;
    height: 320px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), transparent);
    border-radius: 50%;
    filter: blur(70px);
    animation: bloom-float-3 24s ease-in-out infinite;
}

.solution-bloom-deutsche {
    position: absolute;
    top: 25%;
    left: -115px;
    width: 310px;
    height: 310px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), transparent);
    border-radius: 50%;
    filter: blur(68px);
    animation: bloom-float-2 23s ease-in-out infinite;
}

.solution-bloom-garmin {
    position: absolute;
    top: 28%;
    left: -118px;
    width: 315px;
    height: 315px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), transparent);
    border-radius: 50%;
    filter: blur(69px);
    animation: bloom-float-1 22s ease-in-out infinite;
}

.ia-glow-camera {
    position: absolute;
    bottom: -80px;
    left: -80px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.12), transparent);
    filter: blur(50px);
    animation: bloom-float-2 20s ease-in-out infinite;
}

.ia-glow-deutsche {
    position: absolute;
    bottom: -75px;
    left: -75px;
    width: 215px;
    height: 215px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.12), transparent);
    filter: blur(48px);
    animation: bloom-float-1 21s ease-in-out infinite;
}

.ia-glow-garmin {
    position: absolute;
    bottom: -78px;
    left: -78px;
    width: 218px;
    height: 218px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.12), transparent);
    filter: blur(49px);
    animation: bloom-float-3 19s ease-in-out infinite;
}

@keyframes bloom-float-2 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(120px, 80px) scale(1.2);
    }
}

@keyframes bloom-float-3 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(-60px, 70px) scale(1.25);
    }
}

.timeline-bloom {
    opacity: 0.15;
}

.timeline-bloom-1 {
    top: 25%;
    left: 0;
    width: 320px;
    height: 320px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, transparent 70%);
    animation: bloom-float 20s infinite;
}

.timeline-bloom-2 {
    bottom: 25%;
    right: 0;
    width: 320px;
    height: 320px;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.3) 0%, transparent 70%);
    animation: bloom-float 18s infinite;
}

.contact-bloom {
    opacity: 0.25;
}

.contact-bloom-1 {
    top: 0;
    left: 25%;
    width: 384px;
    height: 384px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(168, 85, 247, 0.3) 50%, transparent 100%);
    animation: bloom-float 20s infinite;
}

.contact-bloom-2 {
    bottom: 0;
    right: 25%;
    width: 384px;
    height: 384px;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.3) 0%, rgba(168, 85, 247, 0.3) 50%, transparent 100%);
    animation: bloom-float 24s infinite;
}

.hero-content {
    max-width: 1280px;
    position: relative;
    z-index: 10;
}

.hero-badge {
    display: inline-block;
    margin-bottom: 24px;
    padding: 6px 16px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.1), rgba(168, 85, 247, 0.1), rgba(236, 72, 153, 0.1));
    border: 1px solid rgba(59, 130, 246, 0.2);
    transition: transform .2s ease;
}

html.light .hero-badge {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.08), rgba(168, 85, 247, 0.08), rgba(236, 72, 153, 0.08));
}

.hero-badge:hover {
    transform: scale(1.05);
}

.hero-badge span {
    font-size: 14px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-heading {
    font-size: clamp(50px, 8.5vw, 96px);
    font-weight: 300;
    line-height: 1.20;
    letter-spacing: -0.02em;
    margin: 0 0 48px 0;
}

.hero-name {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    background-size: 200% 200%;
    animation: gradient-shift 8s linear infinite;
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.hero-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    max-width: 100%;
}

.hero-card {
    padding: 24px;
    border-radius: 24px;
    background: color-mix(in oklab, var(--card) 75%, transparent);
    border: 1px solid var(--hairline);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

html.light .hero-card {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(0, 0, 0, 0.1);
}

.hero-card:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.hero-card-emoji {
    font-size: 32px;
    margin-bottom: 8px;
}

.hero-card-text {
    opacity: 0.6;
}

/* ========== CASE STUDY COMPONENTS ========== */

/* Info card pattern - used in overview sidebar */
.info-card {
    padding: 24px;
    border-radius: 16px;
    background: linear-gradient(135deg, color-mix(in oklab, var(--card) 90%, transparent), color-mix(in oklab, var(--card) 75%, transparent));
    border: 1px solid var(--hairline);
    position: relative;
    overflow: hidden;
}

.info-card .overline {
    color: var(--accent);
}

.info-card p {
    margin: 0;
}

.info-card-content {
    position: relative;
    z-index: 2;
}

.info-card-glow {
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.1), transparent);
    border-radius: 50%;
}

/* Cover section media */
#cover .media {
    position: relative;
    overflow: hidden;
}

#cover .media span {
    position: relative;
    z-index: 2;
}

/* Case study sections - overlines and lists */
#overview .overline,
#problem .overline,
#research .overline,
#ia .overline,
#milestones .overline,
#solution .overline,
#lessons .overline,
#recognition .overline {
    color: var(--accent);
}

#overview ul,
#problem ul,
#research ul,
#ia ul,
#solution ul,
#lessons ul,
#recognition ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1.1rem;
}

#problem ul,
#research ul,
#ia ul,
#solution ul,
#lessons ul {
    max-width: 70ch;
}

#research ul,
#ia ul,
#solution ul {
    margin: 0 0 1.5rem 0;
}

/* Problem section */
.insight-box {
    padding: 24px;
    border-radius: 16px;
    background: linear-gradient(135deg, color-mix(in oklab, var(--card) 88%, transparent), color-mix(in oklab, var(--card) 72%, transparent));
    border: 1px solid var(--hairline);
    margin-top: 24px;
}

/* Research section */
.research-quote {
    font-style: italic;
}

/* IA section */
#ia-carousel {
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 80px rgba(168, 85, 247, 0.15) inset;
}

/* Milestones section */
#milestones .stack {
    gap: 1.25rem;
}

#milestones .milestone-item p {
    margin: 0.25rem 0 0 0;
}

/* Solution section */
#solution {
    overflow: hidden;
}

.flow-caption {
    max-width: 32ch;
    text-align: center;
    position: relative;
    z-index: 2;
    margin: 0 auto;
}

/* Recognition section */
#recognition .grid-2 {
    gap: 1.5rem;
}

/* Case navigation */
#nav {
    border-top: 1px solid var(--hairline);
}

#case-nav {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    justify-content: space-between;
    align-items: center;
}

#case-nav .btn {
    transition: transform 0.3s ease, border-color 0.3s ease;
}

#case-nav .btn[data-prev] {
    justify-self: flex-start;
}

#case-nav .btn[data-next] {
    justify-self: flex-end;
}

/* ========== WORK SECTION ========== */

.work-section {
    padding: clamp(80px, 10vh, 128px) 0;
    position: relative;
    overflow: hidden;
}

.work-header {
    margin-bottom: 64px;
}

.section-title {
    font-size: clamp(32px, 5vw, 56px);
    margin-bottom: 16px;
}

.section-lede {
    font-size: clamp(18px, 2vw, 24px);
    opacity: 0.6;
}

.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 500px), 1fr));
    gap: 24px;
}

/* ========== PROJECT CARDS ========== */

.project-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 400px;
    padding: clamp(32px, 4vw, 48px);
    border-radius: 24px;
    background: linear-gradient(135deg,
    color-mix(in oklab, var(--card) 90%, transparent) 0%,
    color-mix(in oklab, var(--card) 75%, transparent) 100%);
    border: 1px solid var(--hairline);
    overflow: hidden;
    transition: transform var(--transition-normal),
    border-color var(--transition-normal),
    box-shadow var(--transition-normal);
}

html.light .project-card {
    background: linear-gradient(135deg, rgba(250, 250, 250, 0.9) 0%, rgba(245, 245, 245, 0.8) 100%);
}

.project-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(168, 85, 247, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.project-image {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4;
    transition: opacity .7s ease, transform .7s ease;
}

.project-card:hover .project-image img {
    opacity: 0.5;
    transform: scale(1.05);
}

.project-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
    var(--bg),
    color-mix(in oklab, var(--bg) 60%, transparent) 50%,
    color-mix(in oklab, var(--bg) 30%, transparent) 100%);
    z-index: 1;
}

.project-card-bloom {
    top: 0;
    right: 0;
    width: 256px;
    height: 256px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(168, 85, 247, 0.2), rgba(236, 72, 153, 0.2));
    animation: project-bloom-rotate 15s ease-in-out infinite;
    z-index: 1;
}

@keyframes project-bloom-rotate {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.2) rotate(90deg);
    }
}

/* Consolidated floating dots */
.project-floating-dot {
    position: absolute;
    border-radius: 50%;
    z-index: 1;
    opacity: 0.3;
    animation: float-dot 4s ease-in-out infinite;
}

.project-dot-1 {
    top: 25%;
    left: 25%;
    width: 8px;
    height: 8px;
    background: rgba(59, 130, 246, 0.4);
}

.project-dot-2 {
    bottom: 33%;
    right: 33%;
    width: 12px;
    height: 12px;
    background: rgba(168, 85, 247, 0.4);
    animation-delay: 1s;
    animation-duration: 5s;
}

@keyframes float-dot {
    0%, 100% {
        transform: translate(0, 0);
        opacity: 0.3;
    }
    50% {
        transform: translate(0, -20px);
        opacity: 0.6;
    }
}

.project-content {
    position: relative;
    z-index: 10;
}

.project-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-radius: 16px;
    background: color-mix(in oklab, var(--card) 50%, transparent);
    backdrop-filter: blur(4px);
    margin-bottom: 16px;
    transition: transform 0.6s ease;
}

html.light .project-icon-wrap {
    background: rgba(255, 255, 255, 0.6);
}

.project-card:hover .project-icon-wrap {
    transform: rotate(360deg);
}

.project-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--gradient-primary);
}

.project-arrow {
    position: absolute;
    top: clamp(32px, 4vw, 48px);
    right: clamp(32px, 4vw, 48px);
    color: var(--text);
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity var(--transition-normal), transform var(--transition-normal);
}

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

.project-title {
    font-size: clamp(24px, 3vw, 32px);
    margin: 0 0 12px 0;
    color: var(--text);
    transition: transform var(--transition-normal);
}

.project-card:hover .project-title {
    transform: translateX(8px);
}

.project-desc {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

/* ========== TIMELINE SECTION ========== */

.timeline-wrapper {
    position: relative;
    z-index: 0;
    max-width: 1400px;
    margin: 0 auto;
}

.timeline-section {
    padding: clamp(80px, 10vh, 128px) 0;
    background: color-mix(in oklab, var(--card) 30%, transparent);
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
}

.timeline-section .container {
    max-width: 1100px;
    width: 100%;
}

html.light .timeline-section {
    background: rgba(250, 250, 250, 0.5);
}

.timeline-header {
    max-width: 1280px;
    margin: 0 auto 80px;
}

.timeline-eyebrow {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.6;
    margin-bottom: 16px;
}

.timeline-title {
    font-size: clamp(40px, 6vw, 60px);
    line-height: 1.2;
    margin-bottom: 24px;
    font-weight: 500;
}

.timeline-svg {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 100%; /* ← THIS IS THE FIX */
    width: 8px;
    pointer-events: none;
    z-index: 1;
}

.timeline-items {
    display: flex;
    flex-direction: column;
    gap: clamp(64px, 8vw, 96px);
    position: relative;
}

/* Desktop: Centered timeline with alternating layout */
@media (min-width: 900px) {
    .timeline-item {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: clamp(32px, 4vw, 64px);
        align-items: start;
        position: relative;
        padding-left: 0;
        margin-bottom: clamp(40px, 6vw, 80px);
    }

    /* Odd items (default): Content LEFT, Media RIGHT */
    .timeline-item .timeline-content {
        grid-column: 1;
        text-align: right;
        padding-right: clamp(24px, 3vw, 48px);
        justify-self: end;
    }

    .timeline-item .timeline-media {
        grid-column: 2;
        margin-left: clamp(24px, 3vw, 48px);
        justify-self: start;
    }

    /* Even items (alt): Media LEFT, Content RIGHT */
    .timeline-item.timeline-item-alt .timeline-content {
        grid-column: 2;
        text-align: left;
        padding-left: clamp(24px, 3vw, 48px);
        padding-right: 0;
        justify-self: start;
    }

    .timeline-item.timeline-item-alt .timeline-media {
        grid-column: 1;
        margin-right: clamp(24px, 3vw, 48px);
        padding-left: 0;
        justify-self: end;
    }

    .timeline-dot {
        position: absolute;
        left: 50%;
        top: 0;
        width: 16px;
        height: 16px;
        transform: translateX(-50%);
        border-radius: 50%;
        background: var(--gradient-primary);
        box-shadow: 0 0 16px rgba(168, 85, 247, 0.6);
        z-index: 2;
        animation: timeline-pulse 2s ease-in-out infinite;
    }
}

/* Mobile: Left-aligned timeline */
@media (max-width: 899px) {
    .timeline-svg {
        left: 0;
        transform: none;
    }

    .timeline-item {
        display: grid;
        grid-template-columns: 1fr;
        gap: 32px;
        align-items: start;
        position: relative;
        padding-left: 48px;
    }

    .timeline-dot {
        position: absolute;
        left: 0;
        top: 0;
        width: 16px;
        height: 16px;
        margin-left: -8px;
        border-radius: 50%;
        background: var(--gradient-primary);
        box-shadow: 0 0 16px rgba(168, 85, 247, 0.6);
        z-index: 2;
        animation: timeline-pulse 2s ease-in-out infinite;
    }

    .timeline-content {
        text-align: left;
        padding: 0;
    }

    .timeline-media {
        order: -1;
    }
}

@keyframes timeline-pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 16px rgba(168, 85, 247, 0.6);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
        box-shadow: 0 0 24px rgba(168, 85, 247, 0.8), 0 0 40px rgba(168, 85, 247, 0.4);
    }
}

@keyframes media-float {
    0%, 100% { transform: scale(1.3); }
    50% { transform: scale(1.25); }
}

/* Medium screens - slightly smaller images */
@media (max-width: 1400px) {
    @keyframes media-float {
        0%, 100% { transform: scale(1.15); }
        50% { transform: scale(1.18); }
    }
}

/* Smaller screens - even smaller images */
@media (max-width: 1100px) {
    @keyframes media-float {
        0%, 100% { transform: scale(1.1); }
        50% { transform: scale(1.13); }
    }
}

/* Mobile - normal size images */
@media (max-width: 899px) {
    @keyframes media-float {
        0%, 100% { transform: scale(1); }
        50% { transform: scale(1.03); }
    }
}

.timeline-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.timeline-item-eyebrow {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    font-weight: 500;
}

.timeline-item-title {
    font-size: clamp(20px, 2.5vw, 28px);
    margin: 0;
}

.timeline-item-body {
    margin: 0;
    opacity: 0.7;
    line-height: 1.6;
}

.timeline-media {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 24px;
    overflow: hidden;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: media-float 4s ease-in-out infinite;
}

/*
.timeline-media:hover {
    transform: scale(1.05) rotate(2deg);
}
*/

.timeline-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.timeline-media img.light-only {
    display: none;
}

.timeline-media img.dark-only {
    display: block;
}

html.light .timeline-media img.light-only {
    display: block;
}

html.light .timeline-media img.dark-only {
    display: none;
}

/*.timeline-media-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer-slide 3s ease-in-out infinite;
    z-index: 2;
}

@keyframes shimmer-slide {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.timeline-emoji {
    position: relative;
    z-index: 10;
    font-size: 64px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    animation: emoji-float 3s ease-in-out infinite;
}

@keyframes emoji-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}*/

.timeline-closing {
    margin-top: clamp(64px, 10vw, 128px);
    text-align: center;
    padding: 50px 0 0 0;
}

.timeline-closing p {
    font-size: clamp(20px, 2.5vw, 28px);
    opacity: 0.8;
    margin: 0;
}

/* ========== CONTACT SECTION ========== */

.contact-section {
    padding: clamp(80px, 10vh, 128px) 0;
    position: relative;
    overflow: hidden;
}

.contact-content {
    max-width: 1024px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 10;
}

.contact-lede {
    margin-bottom: 48px;
}

.contact-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    border-radius: 999px;
    background: var(--gradient-primary);
    color: white;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
}

.contact-button:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 40px rgba(168, 85, 247, 0.4);
}

.contact-button:active {
    transform: scale(0.95);
}

.contact-button-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: contact-shine 2s ease-in-out infinite;
}

@keyframes contact-shine {
    0% {
        transform: translateX(-100%);
    }
    50%, 100% {
        transform: translateX(200%);
    }
}

.contact-icon {
    position: relative;
    z-index: 10;
    animation: contact-icon-wiggle 2s ease-in-out infinite;
}

@keyframes contact-icon-wiggle {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(15deg);
    }
    50% {
        transform: rotate(0deg);
    }
    75% {
        transform: rotate(-15deg);
    }
}

.contact-button span {
    position: relative;
    z-index: 10;
}

.contact-social {
    margin-top: 64px;
    padding-top: 64px;
    border-top: 1px solid var(--hairline);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 32px;
}

.contact-social-link {
    opacity: 0.6;
    transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.contact-social-link:hover {
    opacity: 1;
    transform: translateY(-2px) scale(1.1);
}

/* ========== FOOTER ========== */

footer {
    padding: 48px 0;
    color: var(--muted);
    border-top: 1px solid var(--hairline);
    text-align: center;
}

footer .container {
    color: var(--muted);
}

/* ========== SHARED COMPONENTS ========== */

.media, .carousel {
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    background: var(--gradient-subtle),
    radial-gradient(60% 60% at 15% 15%, color-mix(in oklab, var(--accent) 18%, transparent), transparent 70%),
    var(--card);
    color: var(--muted);
    display: grid;
    place-items: center;
}

.media.wide, .carousel.wide {
    aspect-ratio: 21/9;
}

.media.land, .carousel.land {
    aspect-ratio: 16/9;
}

.media.tall {
    aspect-ratio: 9/16;
}

.grid {
    display: grid;
    gap: var(--gap);
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.grid.first {
    padding: 0 0 20px 0;
}

.card {
    background: color-mix(in oklab, var(--card) 75%, transparent);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .35s ease, border-color .2s ease, box-shadow .2s ease, opacity .6s ease;
}

.card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in oklab, var(--text) 22%, transparent);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .25);
}

.thumb {
    aspect-ratio: 16/10;
    background: radial-gradient(80% 80% at 20% 0%, color-mix(in oklab, var(--accent) 28%, transparent), transparent 70%), #1c1c20;
}

.card-body {
    padding: 18px;
}

.card h3 {
    margin: 0 0 6px 0;
    font-size: 18px;
}

.card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.story-row {
    display: grid;
    gap: var(--gap);
    grid-template-columns: 1.1fr .9fr;
    align-items: start;
}

.story-row.reverse {
    grid-template-columns: .9fr 1.1fr;
}

.story-copy p {
    margin: 0;
    color: var(--muted);
    max-width: 65ch;
}

.story-illustration {
    aspect-ratio: 4/3;
    border-radius: var(--radius);
    display: grid;
    place-items: center;
    background: radial-gradient(80% 80% at 20% 0%, color-mix(in oklab, var(--accent) 10%, transparent), transparent 68%);
}

.story-svg {
    width: min(84%, 520px);
    height: auto;
}

.story-svg path, .story-svg circle {
    fill: none;
    stroke: color-mix(in oklab, var(--text) 60%, var(--accent));
    stroke-width: 1.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .88;
}

.story-grid {
    display: grid;
    gap: var(--gap);
    grid-template-columns: 1fr 1fr;
}

.story-grid h3 {
    margin: 0 0 6px 0;
    font-size: 18px;
}

.story-grid p {
    margin: 0;
    color: var(--muted);
}

.story-center {
    text-align: center;
    color: var(--muted);
    font-size: clamp(16px, 2vw, 20px);
}

.story-mini {
    display: grid;
    gap: var(--gap);
    grid-template-columns: repeat(3, 1fr);
}

.mini {
    display: grid;
    grid-template-columns: 14px 1fr;
    gap: 10px;
    align-items: start;
}

.mini h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
}

.mini p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, var(--accent), color-mix(in oklab, var(--text) 5%, transparent));
    box-shadow: 0 0 0 2px color-mix(in oklab, var(--accent) 30%, transparent);
}

.left-rail {
    position: fixed;
    top: var(--header-h);
    left: calc(max(16px, (100% - 1080px) / 2 - (var(--rail-btn) + var(--rail-gap))));
    width: var(--rail-btn);
    z-index: 3;
    will-change: top;

    /* Initial hidden state */
    opacity: 0;
    transform: translateX(-40px);
    pointer-events: none;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.left-rail.rail-visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.back-btn {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid var(--hairline);
    background: color-mix(in oklab, var(--card) 92%, transparent);
    color: color-mix(in oklab, var(--text) 85%, var(--bg));
    text-decoration: none;
    font-size: 18px;
    line-height: 1;
    transition: transform var(--transition-fast), background var(--transition-fast),
    color var(--transition-fast), border-color var(--transition-fast);
}

.back-btn:hover {
    transform: translateY(-1px) scale(1.03);
    color: var(--text);
}

.back-btn:active {
    transform: translateY(0) scale(.98);
}

.back-btn:focus-visible {
    outline: 2px solid color-mix(in oklab, var(--accent) 45%, transparent);
    outline-offset: 2px;
}

.right-rail {
    position: fixed;
    top: calc(var(--header-h) + var(--rail-offset));
    right: calc(max(16px, (100% - 1080px) / 2 - 260px));
    width: 220px;
    z-index: 3;
    display: grid;
    gap: 10px;
    will-change: top;

    /* Initial hidden state */
    opacity: 0;
    transform: translateX(40px);
    pointer-events: none;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.right-rail.rail-visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.toc {
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: var(--radius);
    background: color-mix(in oklab, var(--card) 50%, transparent);
    backdrop-filter: blur(20px) saturate(1.4);
}

.toc h6 {
    margin: 0 0 10px;
    font-size: .75rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--muted);
}

.toc a {
    display: block;
    padding: 6px 4px;
    color: var(--muted);
    border-radius: 6px;
    line-height: 1.1;
    transition: color var(--transition-fast);
}

.toc a:hover {
    color: color-mix(in oklab, var(--accent) 65%, var(--muted));
}

.toc a[aria-current="true"] {
    color: color-mix(in oklab, var(--accent) 85%, var(--text));
    font-weight: 600;
}

.toc a:focus-visible {
    outline: 2px solid color-mix(in oklab, var(--accent) 35%, transparent);
    outline-offset: 2px;
}

/* Refined TOC Typography & Spacing */
.toc {
    font-size: 0.875rem;
}

.toc h6 {
    font-size: 0.7rem;
    font-weight: 600;
    opacity: 0.5;
    margin-bottom: 1.25em;
}

.toc > a {
    margin: 0.75em 0;
    font-weight: 400;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.toc > a:hover {
    opacity: 1;
}

.toc > a.active,
.toc > a[aria-current="true"] {
    opacity: 1;
    font-weight: 500;
}

/* TOC Groups */
.toc-group {
    margin: 1.25em 0;
}

.toc-group-label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.35;
    margin-bottom: 0.5em;
    font-weight: 600;
    color: var(--muted);
}

.toc-group a {
    display: block;
    margin: 0.5em 0;
    padding-left: 0.75em;
    font-size: 0.85rem;
    font-weight: 400;
    opacity: 0.65;
    transition: opacity 0.2s ease;
}

.toc-group a:hover {
    opacity: 1;
}

.toc-group a.active,
.toc-group a[aria-current="true"] {
    opacity: 1;
    font-weight: 500;
}

/* Jump Navigation Links (in-context links to hidden sections) */
/* Only target jump navigation paragraphs, not all anchor links */
section p[style*="opacity: 0.7"] a[href^="#"] {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid rgba(183, 148, 246, 0.4);
    padding-bottom: 1px;
    transition: all 0.2s ease;
}

section p[style*="opacity: 0.7"] a[href^="#"]:hover {
    border-bottom-color: rgba(183, 148, 246, 0.85);
    padding-bottom: 2px;
}

/* Jump navigation list specifically */
section p[style*="opacity: 0.7"] a {
    font-weight: 500;
}

/* Case study cross-reference links */
.caption a[href$=".html"] {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid rgba(183, 148, 246, 0.4);
    padding-bottom: 1px;
    transition: all 0.2s ease;
}

.caption a[href$=".html"]:hover {
    border-bottom-color: rgba(183, 148, 246, 0.85);
    padding-bottom: 2px;
}

#ia-carousel {
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

#ia-carousel .carousel-track {
    display: flex;
    height: 100%;
    width: 100%;
    transform: translate3d(0, 0, 0);
    transition: transform .45s cubic-bezier(.22, .61, .36, 1);
    touch-action: pan-y;
    will-change: transform;
}

#ia-carousel .slide {
    min-width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    padding: clamp(10px, 1.8vw, 18px);
}

#ia-carousel .slide > .ph {
    width: 100%;
    height: 100%;
    border-radius: calc(var(--radius) - 6px);
    display: grid;
    place-items: center;
    text-align: center;
    font-size: .95rem;
    color: color-mix(in oklab, var(--text) 70%, var(--muted));
    background: radial-gradient(80% 80% at 20% 0%, color-mix(in oklab, var(--accent) 22%, transparent), transparent 65%), #1a1b1f;
    border: 1px solid var(--hairline);
}

#ia-carousel .car-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    border: 1px solid var(--hairline);
    background: color-mix(in oklab, var(--card) 90%, transparent);
    color: var(--text);
    opacity: .95;
    cursor: pointer;
    transition: opacity .2s, background .2s, transform .2s;
    z-index: 2;
}

#ia-carousel .car-btn:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.04);
}

#ia-carousel .car-btn:active {
    transform: translateY(-50%) scale(.98);
}

#ia-carousel .car-btn.prev {
    left: 10px;
}

#ia-carousel .car-btn.next {
    right: 10px;
}

#ia-carousel .car-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: 999px;
    background: color-mix(in oklab, var(--bg) 70%, transparent);
    border: 1px solid var(--hairline);
    backdrop-filter: saturate(1.2) blur(6px);
    flex-wrap: nowrap;
    z-index: 2;
}

#ia-carousel .car-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: color-mix(in oklab, var(--text) 35%, transparent);
    border: 1px solid var(--hairline);
    cursor: pointer;
    opacity: .8;
    transition: opacity .2s, transform .2s, background .2s, border-color .2s;
    padding: 6px;
    box-sizing: content-box;
}

#ia-carousel .car-dot[aria-current="true"] {
    transform: scale(1.6);
    background: color-mix(in oklab, var(--accent) 70%, var(--text));
    border-color: color-mix(in oklab, var(--accent) 50%, var(--hairline));
    opacity: 1;
}

/* ========== UTILITIES ========== */

.tag {
    display: inline-block;
    padding: .25rem .6rem;
    border: 1px solid color-mix(in oklab, var(--text) 18%, transparent);
    border-radius: 999px;
    font-size: 12px;
    color: var(--muted);
}

.row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid color-mix(in oklab, var(--text) 18%, transparent);
}

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

/* Spacing utilities */
.mt-constraints {
    margin-top: 1.75rem;
}

/* ===== RESULTS SECTION – Invisalign Practice App ===== */

.case-results {
    position: relative;
    overflow: hidden;
}

.case-results::before {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.08), transparent 70%);
    filter: blur(100px);
    pointer-events: none;
}

.case-results .wrap {
    position: relative;
    z-index: 1;
}

/* 3 cards on top, 1 wide card on second row (IPA default) */
.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-top: 32px;
}

/* 2 cards stacked (Deutsche Bank variant) */
.results-grid-two {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    margin-top: 32px;
}

/* 4 cards in a single row (ACM variant) */
.results-grid-four {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    margin-top: 32px;
}

.result-card-wide {
    grid-column: 1 / -1;
}

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

@media (max-width: 768px) {
    .result-card-wide {
        grid-column: auto;
    }
}

.result-card {
    position: relative;
    padding: 32px;
    border-radius: 24px;
    border: 1px solid var(--hairline);
    background: radial-gradient(circle at 20% 0%, rgba(15, 23, 42, 0.75), transparent 60%),
    radial-gradient(circle at 80% 100%, rgba(15, 23, 42, 0.95), transparent 60%),
    color-mix(in oklab, var(--card) 95%, transparent);
    box-shadow: inset 0 0 40px rgba(255, 255, 255, 0.02),
    0 20px 60px rgba(0, 0, 0, 0.6);
    text-align: center;
    overflow: hidden;
    transition: transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

/* Light mode override */
html.light .result-card {
    background: radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.8), transparent 60%),
    radial-gradient(circle at 80% 100%, rgba(248, 250, 252, 0.9), transparent 60%),
    var(--card);
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.02),
    0 8px 24px rgba(0, 0, 0, 0.08);
}

.result-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.75);
    border-color: color-mix(in oklab, var(--accent) 40%, var(--hairline));
}

html.light .result-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

/* ========== ARTIFACT IMAGE HOVER EFFECTS ========== */

.artifact-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.artifact-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.6s ease, opacity 0.4s ease;
    opacity: 0.92;
}

.artifact-image:hover {
    transform: translateY(-4px) scale(1.015);
}

.artifact-image:hover img {
    transform: scale(1.03);
    opacity: 1;
}

html.light .artifact-image {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

html.light .artifact-image:hover {
    box-shadow: 0 16px 40px rgba(139, 92, 246, 0.12);
}

/* Dark/light mode image toggle */
.artifact-image img.light-only {
    display: none;
}

.artifact-image img.dark-only {
    display: block;
}

html.light .artifact-image img.light-only {
    display: block;
}

html.light .artifact-image img.dark-only {
    display: none;
}

/* VALUE ROW – flex container, no gradient here */
.result-value {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.4rem;
    font-weight: 400;
    font-size: 4rem;
    line-height: 1;
    margin-bottom: 12px;
}

/* GRADIENT NUMBER TEXT */
.result-number {
    display: inline-block;
    line-height: 1;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Negative vs positive gradients (no orange) */
.result-negative .result-number {
    background-image: linear-gradient(90deg, #a855f7, #ec4899); /* purple → pink */
}

.result-positive .result-number {
    background-image: linear-gradient(90deg, #3b82f6, #a855f7); /* blue → purple */
}

/* Unit text */
.result-unit {
    font-size: 0.95rem;
    color: var(--muted);
}

/* Labels & supporting copy */
.result-label {
    font-weight: 600;
    margin-top: 6px;
}

.result-sub {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Override case-study p max-width for centering */
.result-card p,
.result-card .result-sub {
    max-width: none;
}

.results-note {
    font-size: 0.92rem;
    margin-top: 18px;
}

.overline-accent {
    color: var(--accent);
}

/* ========== ANIMATIONS & REVEALS ========== */

.reveal {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
    will-change: opacity, transform;
}

.revealed {
    opacity: 1;
    transform: none;
}

.reveal-delay-1 {
    animation-delay: 0.1s;
}

/* ========== PROGRESS BAR & PARTICLES ========== */

.progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    width: 0%;
    z-index: 99999;
    background: var(--gradient-primary);
    box-shadow: 0 0 12px color-mix(in oklab, var(--accent) 50%, transparent);
    pointer-events: none;
    will-change: width;
}

::selection {
    background: color-mix(in oklab, var(--accent) 40%, transparent);
    color: #fff;
}

#particles-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}

/* ========== RESPONSIVE / MEDIA QUERIES ========== */

@media (max-width: 1280px) {
    .left-rail, .right-rail {
        display: none;
    }
}

@media (max-width: 900px) {
    .grid-2, .story-row, .story-row.reverse,
    .story-grid, .story-mini {
        grid-template-columns: 1fr;
    }

    /* Mobile timeline: left-aligned, stacked */
    .timeline-line,
    .timeline-line-progress {
        left: var(--page-pad);
        transform: none;
    }

    .milestone-dot {
        left: var(--page-pad);
        transform: translate(-50%, 0);
    }

    .timeline-wrapper {
        padding-top: .5rem;
    }

    .timeline-section {
        display: flex;
        flex-direction: column;
        gap: 1.25rem;
        padding-left: calc(var(--page-pad) + 24px);
        margin-bottom: clamp(48px, 8vw, 80px);
    }

    .timeline-section .text-col,
    .timeline-section .media-col,
    .timeline-section.alt .text-col,
    .timeline-section.alt .media-col {
        text-align: left;
        padding: 0;
        justify-self: flex-start;
    }

    .timeline-section .media-col,
    .timeline-section.alt .media-col {
        order: -1;
    }

    .intro-block {
        text-align: left;
        margin-inline: 0;
        padding-left: calc(var(--page-pad) + 24px);
    }

    .results-grid,
    .results-grid-four {
        grid-template-columns: repeat(1, 1fr);
    }

    .result-card-wide {
        grid-column: auto;
    }
}

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

    .work-grid {
        grid-template-columns: 1fr;
    }

    .project-card {
        min-height: 350px;
    }
}

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

    .bloom, .work-bloom, .timeline-bloom, .contact-bloom,
    .project-card-bloom, .project-floating-dot, .timeline-dot,
    .timeline-media-shimmer, .timeline-emoji,
    .contact-button-shine, .contact-icon, .hero-name {
        animation: none !important;
    }

    #ia-carousel .carousel-track {
        transition: none;
    }
}