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

:root {
    --color-bg: #0A0A0A;
    --color-surface: #141414;
    --color-surface-2: #1A1A1A;
    --color-text: #F5F5F3;
    --color-text-secondary: #8A8A8A;
    --color-accent: #C8FF00;
    --color-accent-dim: rgba(200, 255, 0, 0.08);
    --color-border: #222222;
    --color-overlay-strong: rgba(0, 0, 0, 0.85);
    --color-overlay-mid: rgba(0, 0, 0, 0.3);
    --color-overlay-light: rgba(0, 0, 0, 0.05);
    --color-card-shadow: rgba(0, 0, 0, 0.3);
    --color-label-muted: rgba(255, 255, 255, 0.06);
    --color-label-muted-text: rgba(255, 255, 255, 0.65);
    --color-mockup-bg: #fff;
    --color-mockup-notch: #000;
    --color-mockup-shadow: rgba(0, 0, 0, 0.4);
    --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'DM Serif Display', Georgia, serif;
    --max-width: 1200px;
    --radius: 16px;
    --radius-sm: 8px;
    --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --color-bg: #FAFAFA;
    --color-surface: #F0F0F0;
    --color-surface-2: #E8E8E8;
    --color-text: #1A1A1A;
    --color-text-secondary: #666666;
    --color-accent: #70C270;
    --color-accent-dim: rgba(90, 122, 0, 0.06);
    --color-border: #DDDDDD;
    --color-overlay-strong: rgba(0, 0, 0, 0.7);
    --color-overlay-mid: rgba(0, 0, 0, 0.2);
    --color-overlay-light: rgba(0, 0, 0, 0.03);
    --color-card-shadow: rgba(0, 0, 0, 0.1);
    --color-label-muted: rgba(0, 0, 0, 0.05);
    --color-label-muted-text: rgba(0, 0, 0, 0.5);
    --color-mockup-bg: #fff;
    --color-mockup-notch: #1A1A1A;
    --color-mockup-shadow: rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
}

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

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

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

.accent {
    color: var(--color-accent);
    font-weight: inherit;
}

/* === Cursor Glow === */
.cursor-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(200, 255, 0, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s;
    opacity: 0;
}

body:hover .cursor-glow {
    opacity: 1;
}

/* === Navigation === */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1.25rem 2rem;
    transition: var(--transition);
}

.nav.scrolled {
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--color-border);
}

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

.nav-logo {
    position: relative;
    display: inline-block;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    transition: color 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}

/* Hairline underline — wipes in from the left on hover, and on mouse-out
   exits by continuing to the right instead of retreating. Gives it that
   "swipe through" feel — same technique Apple, Stripe, Linear use. */
.nav-logo::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right center;
    transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
    will-change: transform;
}

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

.nav-logo:hover::after {
    transform: scaleX(1);
    transform-origin: left center;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    list-style: none;
}

.nav-links a {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: color 0.45s cubic-bezier(0.65, 0, 0.35, 1);
    letter-spacing: 0.01em;
}

/* Hairline underline — same "swipe through" behaviour as the logo.
   Scoped to non-button links so the Let's Talk pill is untouched. */
.nav-links a:not(.btn-nav) {
    position: relative;
    display: inline-block;
}

.nav-links a:not(.btn-nav)::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right center;
    transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
    will-change: transform;
}

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

.nav-links a:not(.btn-nav):hover::after {
    transform: scaleX(1);
    transform-origin: left center;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
}

.nav-toggle span {
    width: 24px;
    height: 1.5px;
    background: var(--color-text);
    border-radius: 2px;
    transition: var(--transition);
    display: block;
}

.nav-toggle.active span:first-child {
    transform: rotate(45deg) translate(2px, 2px);
}

.nav-toggle.active span:last-child {
    transform: rotate(-45deg) translate(2px, -2px);
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.85rem 2rem;
    border-radius: 100px;
    border: none;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: var(--color-accent);
    color: var(--color-bg);
}

.btn-primary:hover {
    background: #fff;
    color: #0A0A0A;
}

.btn-primary svg {
    transition: transform var(--transition);
}

.btn-primary:hover svg {
    transform: translateX(3px);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 100px;
}

.btn-ghost:hover {
    background: #fff;
    color: #0A0A0A;
    border-color: #fff;
}

[data-theme="light"] .btn-ghost {
    border-color: rgba(0, 0, 0, 0.2);
    color: var(--color-text);
}

[data-theme="light"] .btn-ghost:hover {
    background: #fff;
    color: #0A0A0A;
    border-color: #fff;
}

.btn-nav {
    padding: 0.6rem 1.5rem;
    background: transparent;
    color: var(--color-text);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 100px;
    font-size: 0.85rem;
}

.btn-nav:hover,
.nav-links a.btn-nav:hover {
    background: var(--color-accent);
    color: #0A0A0A !important;
    border-color: var(--color-accent);
}

[data-theme="light"] .btn-nav {
    background: transparent;
    border-color: rgba(0, 0, 0, 0.2);
    color: var(--color-text);
}

.btn-large {
    padding: 1.1rem 3rem;
    font-size: 0.95rem;
}

/* === Hero === */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 14rem 2rem 0;
    max-width: var(--max-width);
    margin: 0 auto;
    position: relative;
}

.hero-content {
    max-width: 1050px;
    position: relative;
    z-index: 2;
}

.hero-eyebrow {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-secondary);
    margin-bottom: 2.5rem;
    position: relative;
    top: -3.5rem;
}

#heroTime {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.hero-eyebrow-sep {
    color: var(--color-text-secondary);
    opacity: 0.5;
}

.hero-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-accent);
    box-shadow: 0 0 0 0 rgba(200, 255, 0, 0.5);
    animation: pulse 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

#heroTime {
    font-variant-numeric: tabular-nums;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(200, 255, 0, 0.5); }
    50% { box-shadow: 0 0 0 10px rgba(200, 255, 0, 0); }
}

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(3.5rem, 9vw, 7rem);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin-bottom: 2rem;
}

.hero-title em {
    font-style: italic;
    color: var(--color-accent);
}

.hero-subtitle {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    line-height: 1.75;
    max-width: 520px;
    margin-bottom: 3rem;
}

.hero-cta {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    position: relative;
}

/* === Marquee === */
.hero-marquee {
    margin-top: 0;
    border-top: 1px solid var(--color-border);
    padding: 1.5rem 0;
    overflow: hidden;
}

.marquee-track {
    display: flex;
    gap: 2rem;
    animation: marquee 25s linear infinite;
    width: max-content;
}

.marquee-track span {
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.marquee-dot {
    width: 4px !important;
    height: 4px;
    border-radius: 50%;
    background: var(--color-text-secondary);
    display: inline-block;
    flex-shrink: 0;
    align-self: center;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* === Sections === */
.section {
    padding: 8rem 2rem;
    max-width: var(--max-width);
    margin: 0 auto;
}

.section-header {
    margin-bottom: 4rem;
}

.section-number {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--color-accent);
    display: block;
    margin-bottom: 1rem;
}

.section-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

@media (max-width: 768px) {
    .section-title {
        font-size: 3.75rem;
    }
}

/* === Project Thumbnails (index page — Lummi style) === */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.project-thumb-wrap {
    min-width: 0;
}

.project-thumb-wrap--full {
    grid-column: 1 / -1;
}

.project-thumb {
    position: relative;
    display: block;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    color: #fff; /* always white on thumbnails */
    height: 500px;
}

/* === Image Carousel (Marquee) === */
.carousel-section {
    padding: 0;
    margin: 0;
    max-width: none;
    width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    overflow: hidden;
}

.carousel-marquee {
    width: 100%;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    gap: 1rem;
    width: max-content;
    animation: marquee-scroll 40s linear infinite;
}

.carousel-item {
    flex-shrink: 0;
    width: 280px;
    height: 200px;
    border-radius: var(--radius);
    overflow: hidden;
}

.carousel-item img,
.carousel-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-placeholder {
    width: 100%;
    height: 100%;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.case-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface);
    border: 1px dashed var(--color-border);
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

@keyframes marquee-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.carousel-marquee:hover .carousel-track {
    animation-play-state: paused;
}

.project-thumb-media {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.project-thumb-media video,
.project-thumb-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-thumb:hover .project-thumb-media video,
.project-thumb:hover .project-thumb-media img {
    transform: scale(1.05);
}

.project-thumb--zoom:hover .project-thumb-media img {
    transform: scale(1.18);
}

.project-thumb--zoomed .project-thumb-media img {
    transform: scale(1.35);
}

.project-thumb--zoomed:hover .project-thumb-media img {
    transform: scale(1.42);
}

.project-thumb--crop-top .project-thumb-media img {
    object-position: center bottom;
    transform-origin: center bottom;
}

.project-thumb--crop-top.project-thumb--zoomed .project-thumb-media img {
    transform: scale(1.15);
}

.project-thumb--crop-top.project-thumb--zoomed:hover .project-thumb-media img {
    transform: scale(1.2);
}

.project-thumb-media--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface-2);
    color: var(--color-text-secondary);
    opacity: 0.3;
}

/* Overlay — hidden by default, appears on hover */
.project-thumb-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(to top, var(--color-overlay-strong) 0%, var(--color-overlay-mid) 50%, var(--color-overlay-light) 100%);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-thumb:hover .project-thumb-overlay {
    opacity: 1;
}

.project-thumb-text {
    transform: translateY(10px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-thumb:hover .project-thumb-text {
    transform: translateY(0);
}

.project-thumb-company {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
}

.project-thumb-title {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 0.4rem;
    letter-spacing: -0.01em;
}

.project-thumb-desc {
    font-size: 0.85rem;
    color: var(--color-label-muted-text);
    line-height: 1.5;
    max-width: 400px;
}

.project-thumb-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-accent);
    color: var(--color-bg);
    flex-shrink: 0;
    transform: translateY(10px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-thumb:hover .project-thumb-arrow {
    transform: translateY(0);
}

.project-thumb--placeholder .project-thumb-company {
    color: var(--color-text-secondary);
}

.project-company--soon {
    color: var(--color-text-secondary);
}

/* === Shared project meta === */
.project-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.project-company {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-accent);
}

.project-divider {
    color: var(--color-text-secondary);
    opacity: 0.6;
    font-size: 0.7rem;
}

.project-year {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-text-secondary);
}

.project-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.35rem 0.85rem;
    border-radius: 100px;
    background: var(--color-accent-dim);
    color: var(--color-accent);
    border: 1px solid rgba(200, 255, 0, 0.1);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* === Case Study Page === */
.case-header {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 7rem 2rem 3rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: color var(--transition);
    margin-bottom: 2.5rem;
}

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

.back-link svg {
    transition: transform var(--transition);
}

.back-link:hover svg {
    transform: translateX(-3px);
}

.case-header-content {
    max-width: 1050px;
}

.case-title {
    font-family: var(--font-serif);
    font-size: clamp(2.75rem, 7vw, 6rem);
    font-weight: 400;
    line-height: 0.98;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
    max-width: 22ch;
}

.case-title em {
    font-style: italic;
    color: var(--color-accent);
}

/* Chapter-level title (under each section eyebrow like "The tension") */
.case-section-title {
    font-family: var(--font-serif);
    font-size: clamp(1.6rem, 2.6vw, 2.4rem);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--color-text);
    margin-bottom: 1rem;
}

/* Subsection-level title (inside cards / columns) */
.case-subsection-title {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.015em;
    color: var(--color-text);
    margin-bottom: 1rem;
}

.case-lead {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--color-text);
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.case-subtitle {
    font-size: 1.05rem;
    color: var(--color-text-secondary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.case-subtitle strong,
.case-subtitle .accent {
    color: var(--color-text);
    font-weight: 700;
}

.case-body {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem 4rem;
}

.case-role {
    text-align: right;
    padding: 1rem 0;
    margin-bottom: 0.5rem;
}

.case-role--split {
    display: flex;
    justify-content: flex-start;
    gap: 3rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1.5rem;
    margin-bottom: 4rem;
}

.case-role-col {
    text-align: left;
    max-width: 280px;
}

.case-role--split .case-role-col:first-child {
    max-width: 520px;
    flex: 0 1 520px;
}

.case-role-title {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-accent);
    margin-bottom: 0.25rem;
}

.case-role-desc {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    letter-spacing: 0.02em;
}

.case-section {
    margin-bottom: 2rem;
}

.case-section--flush {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    margin-bottom: 3rem;
}

/* More breathing room when a full-bleed section follows a content section */
.case-section + .case-section--flush {
    margin-top: 4rem;
}

.case-hero-img {
    width: 100%;
    display: block;
    aspect-ratio: 16/9;
    object-fit: cover;
}

@media (max-width: 768px) {
    .case-hero-img {
        /* Taller portrait crop on mobile so the hero has more presence —
           the 16:9 source gets cropped on the sides via object-fit: cover. */
        aspect-ratio: 3/4;
    }
}

.case-next {
    text-align: center;
    padding: 4rem 0 2rem;
    border-top: 1px solid var(--color-border);
    margin-top: 4rem;
}

.case-divider {
    border: 0;
    border-top: 1px solid var(--color-border);
    width: 100%;
    margin: 4rem 0;
    height: 0;
}

/* Wireframes block — text in grid, image bleeds to the right viewport edge */
.wireframes-section {
    width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

.wireframes-inner {
    display: flex;
    align-items: center;
    gap: 3rem;
    padding-left: max(2rem, calc((100vw - var(--max-width)) / 2));
}

.wireframes-text {
    flex: 0 0 360px;
    max-width: 360px;
}

.wireframes-image {
    flex: 1 1 auto;
    min-width: 0;
    border-radius: var(--radius) 0 0 var(--radius);
    overflow: hidden;
}

.wireframes-image img {
    width: 100%;
    display: block;
}

@media (max-width: 1024px) {
    .wireframes-inner {
        flex-direction: column;
        gap: 2rem;
        padding-left: 0;
        padding-inline: 1.5rem;
    }
    .wireframes-text {
        flex: none;
        max-width: 100%;
    }
    .wireframes-image {
        width: 100%;
        border-radius: var(--radius);
    }
}

.case-ba-label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 1;
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: var(--color-surface);
    color: var(--color-text-secondary);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.case-next-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
}

.case-end-meta {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-secondary);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.case-end-meta-sep {
    color: var(--color-text-secondary);
    opacity: 0.5;
    padding-inline: 0.6em;
}

.case-end-meta a {
    color: var(--color-text-secondary);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    text-decoration-color: var(--color-border);
    transition: color var(--transition), text-decoration-color var(--transition);
}

.case-end-meta a:hover {
    color: var(--color-text);
    text-decoration-color: var(--color-accent);
}

.case-next-link {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-serif);
    font-size: clamp(1.75rem, 3.5vw, 3rem);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--color-text);
    transition: color var(--transition), gap 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.case-next-link em {
    color: var(--color-accent);
    font-style: italic;
}

.case-next-link:hover { gap: 1.5rem; }
.case-next-link:hover em { color: var(--color-text); }

.case-next-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    color: var(--color-text);
    transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.36s cubic-bezier(0.4, 0, 0.2, 1);
}

.case-next-link:hover .case-next-arrow {
    background: var(--color-accent);
    color: var(--color-bg);
    border-color: var(--color-accent);
    transform: translateX(8px);
}

/* Placeholder page cover */
.placeholder-cover--page {
    min-height: 450px;
}

.placeholder-cover--page .placeholder-inner p {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    max-width: 360px;
    text-align: center;
    line-height: 1.6;
    margin-top: 0.5rem;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
    .projects-grid .project-thumb-wrap {
        width: 100%;
    }

    .project-thumb-overlay {
        opacity: 1;
        background: linear-gradient(to top, var(--color-overlay-strong) 0%, var(--color-overlay-mid) 60%, transparent 100%);
    }

    .project-thumb-text {
        transform: translateY(0);
    }

    .project-thumb-arrow {
        transform: translateY(0);
    }

    .project-thumb-title {
        font-size: 1.9rem;
        line-height: 1.15;
    }

    .project-thumb-desc {
        font-size: 0.95rem;
    }

    .case-header {
        padding: 6rem 1.5rem 2rem;
    }

    .case-body {
        padding: 0 1.5rem 3rem;
    }

    /* Case-header tag row: single line + horizontal scroll if overflow */
    .case-header .project-tags {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        /* Keep left aligned with content, extend past right edge so the
           last tag can scroll all the way to the screen edge. */
        margin-left: 0;
        margin-right: -1.5rem;
        padding: 0;
        scrollbar-width: none; /* Firefox */
    }

    .case-header .project-tags::-webkit-scrollbar {
        display: none; /* Chrome/Safari/iOS */
    }

    .case-header .project-tags .tag {
        flex-shrink: 0;
        white-space: nowrap;
    }
}

/* === Gallery === */
.project-gallery {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.gallery-row {
    display: grid;
    gap: 1rem;
}

.gallery-row-hero {
    grid-template-columns: 1fr;
}

.gallery-row-2 {
    grid-template-columns: repeat(3, 1fr);
}

.gallery-row-2col {
    grid-template-columns: repeat(2, 1fr);
}

.gallery-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    transition: all var(--transition);
}

.gallery-item--clean {
    background: none;
    border: none;
}

.gallery-item--clean:hover {
    border-color: transparent;
    box-shadow: none;
    transform: none;
}

.gallery-item:hover {
    border-color: rgba(200, 255, 0, 0.15);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover img {
    transform: scale(1.02);
}

/* === Zoomable Image === */
.zoomable-container {
    cursor: zoom-in;
    overflow: hidden;
}

.zoomable-container[data-zoomed="true"] {
    cursor: grab;
    overflow: hidden;
}

.zoomable-container[data-zoomed="true"][data-dragging="true"] {
    cursor: grabbing;
}

.zoomable-img {
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: center center;
}

.zoomable-container[data-zoomed="true"] .zoomable-img {
    transform: scale(3);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-caption {
    display: block;
    padding: 0.85rem 1.25rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    letter-spacing: 0.02em;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 0 0 var(--radius) var(--radius);
}

[data-theme="light"] .gallery-caption {
    color: rgba(0, 0, 0, 0.8);
    background: rgba(255, 255, 255, 0.6);
}

/* === Project Outcomes === */
.project-outcomes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 4rem;
    border-top: 1px solid var(--color-border);
}

.outcome {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
}

.outcome-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
}

.outcome-value {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

/* === Context + Mobile Screens Row === */
.gallery-context-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    padding: 2rem 0;
}

.gallery-context-text {
    padding-right: 1rem;
}

.case-text-block {
    max-width: 640px;
    padding: 4rem 0;
}

/* Trade-offs section — edge-to-edge image with drag */
.tradeoffs-section {
    max-width: none;
    width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    overflow: hidden;
    padding: 3rem 0;
}

.tradeoffs-inner {
    display: flex;
    align-items: center;
    gap: 0;
    padding-left: max(2rem, calc((100vw - var(--max-width)) / 2));
}

.tradeoffs-text {
    flex: 0 0 calc(var(--max-width) * 0.4);
    max-width: calc(var(--max-width) * 0.4);
    padding-right: 3rem;
}

.tradeoffs-image-wrap {
    flex: 1;
    overflow: hidden;
    cursor: grab;
    position: relative;
}

.tradeoffs-image-wrap:active {
    cursor: grabbing;
}

/* Scroll hint — right edge fade + bouncing chevron */
.wireframe-scroll-hint {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 80px;
    background: linear-gradient(to right, transparent, rgba(10, 10, 10, 0.2));
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 14px;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.4s ease;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.wireframe-scroll-hint svg {
    color: rgba(255, 255, 255, 0.85);
    animation: hint-bounce 1.2s ease-in-out infinite;
}

@keyframes hint-bounce {
    0%, 100% { transform: translateX(0); }
    50%       { transform: translateX(6px); }
}

/* Nudge the image briefly on first view */
.tradeoffs-img.hint-nudge {
    animation: wireframe-nudge 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes wireframe-nudge {
    0%   { transform: translateX(0); }
    35%  { transform: translateX(-30px); }
    70%  { transform: translateX(-8px); }
    100% { transform: translateX(0); }
}

/* Hide hint once user has interacted */
.wireframe-scroll-hint.hidden {
    opacity: 0;
    pointer-events: none;
}

.tradeoffs-img {
    width: 180%;
    max-width: none;
    display: block;
    will-change: transform;
    pointer-events: none;
    user-select: none;
    border-radius: var(--radius) 0 0 var(--radius);
}

@media (max-width: 768px) {
    .tradeoffs-inner {
        flex-direction: column;
        padding-left: 0;
    }
    .tradeoffs-text {
        flex: none;
        max-width: 100%;
        width: 100%;
        padding: 0 1.5rem;
        margin-bottom: 2rem;
        box-sizing: border-box;
    }
    .tradeoffs-image-wrap {
        width: 100%;
    }

    .handoff-row .gallery-item,
    .handoff-images .gallery-item {
        max-width: 100% !important;
        width: 100% !important;
    }
    .tradeoffs-img {
        width: 200%;
    }
}

/* Decision cards */
.decision-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.decision-cards--three {
    grid-template-columns: 1fr 1fr 1fr;
}

.decision-card {
    background: var(--color-accent-dim);
    border: 1px solid rgba(200, 255, 0, 0.1);
    border-radius: var(--radius);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: border-color 0.3s ease, transform 0.2s ease;
}

.decision-card:hover {
    border-color: var(--color-accent);
    transform: translateY(-2px);
}

[data-theme="light"] .decision-card {
    border-color: rgba(80, 160, 80, 0.25);
}

[data-theme="light"] .metric {
    border-color: rgba(80, 160, 80, 0.25);
}

.decision-card-number {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-accent);
}

.decision-card-title {
    font-family: var(--font-sans);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.35;
}

.decision-card-desc {
    font-size: 0.85rem;
    color: var(--color-muted);
    line-height: 1.6;
}

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

.context-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-accent);
    margin-bottom: 0.6rem;
}

.context-title:not(:first-child) {
    margin-top: 1.75rem;
}

.context-desc {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    line-height: 1.75;
}

.context-list {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    line-height: 1.75;
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
}

.context-list li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
}

.context-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.75rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-accent);
}

.gallery-context-screens {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.gallery-item-mobile {
    max-width: 240px;
    flex-shrink: 0;
}

.gallery-item-mobile img {
    border-radius: 12px 12px 0 0;
}

.gallery-item-mobile--large {
    max-width: 50vw;
    width: 50vw;
}

.gallery-item-mobile--large video {
    width: 100%;
    border-radius: 12px;
}

@media (max-width: 768px) {
    .gallery-context-row {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .gallery-context-text {
        padding-right: 0;
    }

    .gallery-context-screens {
        justify-content: center;
    }

    .gallery-item-mobile {
        max-width: 150px;
    }

    .gallery-item-mobile--large {
        max-width: 100%;
        width: 100%;
    }

    /* receipts: text before image on mobile only */
    .receipts-reorder__text  { order: 1; }
    .receipts-reorder__media { order: 2; }

    .decision-card--split {
        grid-template-columns: 1fr !important;
    }

    .decision-card--split .gallery-item {
        max-width: 70% !important;
        width: 70% !important;
        height: auto !important;
        min-height: 180px !important;
        margin: 0 auto;
    }
}

/* === Reversed context row (images left, text right) === */
.gallery-context-row-reverse {
    grid-template-columns: 1.2fr 1fr;
}

.gallery-context-row-reverse .gallery-context-text[style*="order: 1"] {
    order: 2;
}
.gallery-context-row-reverse .gallery-context-screens[style*="order: 2"] {
    order: 1;
}

.gallery-context-screens-stacked {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.gallery-context-row-reverse .gallery-context-text {
    padding-right: 0;
    padding-left: 1rem;
}

/* === Phone Mockup === */
.phone-mockup {
    position: relative;
    width: 260px;
    margin: 0 auto;
    background: var(--color-mockup-bg);
    border-radius: 40px;
    padding: 14px;
    box-shadow: 0 0 0 2px var(--color-border), 0 20px 60px var(--color-mockup-shadow);
}

.phone-mockup::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 24px;
    background: var(--color-mockup-notch);
    border-radius: 20px;
    z-index: 2;
}

.phone-mockup video,
.phone-mockup img {
    width: 100%;
    display: block;
    border-radius: 28px;
}

@media (max-width: 768px) {
    .phone-mockup {
        width: 220px;
    }
}

@media (max-width: 768px) {
    .gallery-context-row-reverse {
        grid-template-columns: 1fr;
    }

    .gallery-context-row-reverse .gallery-context-text {
        padding-left: 0;
    }
}

/* === Before / After Comparison === */
.before-after-section {
    max-width: var(--max-width);
    margin: 0 auto;
}

.before-after-header {
    margin-bottom: 2rem;
}

.before-after-header--centered {
    text-align: center;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 3rem;
}

.before-after-comparison {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 2rem;
}

.before-after-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
}

.before-after-middle {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 200px;
    padding: 2rem 0;
    align-self: center;
}

.before-after-insight {
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--color-text-secondary);
    text-align: center;
    font-style: italic;
}

.phone-mockup--comparison {
    width: 240px;
    height: 480px;
    overflow: hidden;
}

.phone-mockup--comparison video,
.phone-mockup--comparison img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.before-after-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    margin-bottom: 1rem;
}

.before-after-label--before {
    background: var(--color-label-muted);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.before-after-label--after {
    background: rgba(200, 255, 0, 0.12);
    color: var(--color-accent);
    border: 1px solid rgba(200, 255, 0, 0.2);
}

@media (max-width: 768px) {
    .before-after-comparison {
        flex-direction: column;
        align-items: center;
    }

    .before-after-middle {
        max-width: 100%;
        padding: 1rem 0;
    }

    .phone-mockup--comparison {
        width: 220px;
    }

    /* Stacked layout has plenty of room — make the before/after videos
       noticeably larger than the desktop 160px min. Overrides the inline
       width="clamp(160px, 22vw, 280px)" on the gallery-item wrappers. */
    .before-after-side .gallery-item {
        width: clamp(260px, 72vw, 340px) !important;
    }
}

/* === Project Metrics === */
.metrics-with-context {
    display: flex;
    gap: 3rem;
    align-items: center;
}

.metrics-with-context .project-metrics {
    flex: 0 0 auto;
    margin: 0;
    grid-template-columns: repeat(3, 160px);
}

.metrics-context {
    flex: 1;
    padding-top: 1rem;
}

.project-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 3rem;
    margin-bottom: 2rem;
}

.metric {
    background: var(--color-accent-dim);
    border: 1px solid rgba(200, 255, 0, 0.1);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    aspect-ratio: 2/1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: visible;
}

/* Impact copy card — matches metric card aesthetic */
.impact-card {
    background: var(--color-accent-dim);
    border: 1px solid rgba(200, 255, 0, 0.1);
    border-radius: var(--radius);
    padding: 2rem 2.5rem;
    max-width: 720px;
}

[data-theme="light"] .impact-card {
    border-color: rgba(80, 160, 80, 0.25);
}

.impact-card .context-title {
    margin-top: 0;
}

.impact-card .context-desc:last-child {
    margin-bottom: 0;
}

@media (max-width: 640px) {
    .impact-card {
        padding: 1.5rem 1.5rem;
    }
}

.metric-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
}

.metric.celebrate .metric-particle {
    animation: particle-burst 1.2s ease-out 3;
}

@keyframes particle-burst {
    0% {
        opacity: 0.7;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0);
    }
}

.metric-value {
    display: block;
    font-family: var(--font-sans);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--color-accent);
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

.metric-label {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

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

    .metric {
        padding: 1rem;
        aspect-ratio: 3/1;
    }

    .metric-value {
        font-size: 1.1rem;
        margin-bottom: 0.25rem;
    }

    .metric-label {
        font-size: 0.6rem;
    }
}

/* === Hero Video === */
.video-hero {
    border: 1px solid rgba(200, 255, 0, 0.12);
}

.video-hero video {
    width: 100%;
    display: block;
}

.gallery-item video {
    width: 100%;
    display: block;
}

/* === Smaller gallery row (handoff + anatomy) === */
.gallery-row-small {
    max-width: 80%;
}

/* === Placeholder Projects === */
.project-placeholder {
    margin-bottom: 4rem;
}

.placeholder-cover {
    border: 1px dashed var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
}

.placeholder-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--color-text-secondary);
    opacity: 0.4;
}

.placeholder-inner span {
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

/* === About === */
.about-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 4rem;
    align-items: start;
}

.about-lead {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 400;
    line-height: 1.35;
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
}

.about-text {
    font-size: 1rem;
    color: var(--color-text-secondary);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.about-highlight {
    font-size: 0.95rem;
    color: var(--color-accent);
    line-height: 1.7;
    padding: 1.25rem 1.5rem;
    background: var(--color-accent-dim);
    border: 1px solid rgba(200, 255, 0, 0.1);
    border-radius: var(--radius-sm);
    margin-top: 1.5rem;
}

.about-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    transition: border-color var(--transition);
}

.detail-card:hover {
    border-color: rgba(200, 255, 0, 0.15);
}

.detail-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-text-secondary);
    margin-bottom: 0.35rem;
}

.detail-value {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text);
}

/* === Process === */
.process-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.process-card {
    background: var(--color-accent-dim);
    border: 1px solid rgba(200, 255, 0, 0.1);
    border-radius: var(--radius);
    padding: 2rem 1.75rem;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

[data-theme="light"] .process-card {
    border-color: rgba(80, 160, 80, 0.25);
}

.process-card:hover {
    border-color: var(--color-accent);
    transform: translateY(-4px);
}

.process-card:hover .process-number {
    color: var(--color-accent);
}

.process-number {
    font-size: 3rem;
    font-weight: 700;
    color: rgba(200, 255, 0, 0.25);
    line-height: 1;
    margin-bottom: 1.5rem;
    transition: color var(--transition);
}

[data-theme="light"] .process-number {
    color: var(--color-border);
}

.process-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.process-desc {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
}

/* === Contact === */
.contact {
    text-align: center;
    padding-bottom: 6rem;
    background: rgba(200, 255, 0, 0.75);
    max-width: none;
    width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

[data-theme="light"] .contact {
    background: rgba(90, 122, 0, 0.2);
}

.contact-inner {
    max-width: 600px;
    margin: 0 auto;
}

.contact .section-number {
    margin-bottom: 1.5rem;
}

.contact .section-number {
    color: rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .contact .section-number {
    color: var(--color-accent);
}

.contact-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    color: #0A0A0A;
    white-space: nowrap;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.contact-subtitle {
    font-size: 1.05rem;
    color: #333;
    max-width: 460px;
    margin: 0 auto 2.5rem;
    line-height: 1.75;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
}

.contact-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: #333;
    transition: color var(--transition);
    padding-bottom: 2px;
    border-bottom: 1px solid transparent;
}

.contact-link:hover {
    color: #0A0A0A;
    border-color: #0A0A0A;
}

.contact .btn-primary {
    background: #fff;
    color: #0A0A0A;
}

.contact .btn-primary:hover {
    background: #f0f0f0;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* === About Summary (index page) === */
.about-summary {
    border-bottom: 1px solid var(--color-border);
}

.about-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 4rem;
    align-items: start;
}

.about-summary-lead {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1.4;
    margin-bottom: 1.25rem;
    letter-spacing: -0.01em;
}

.about-summary-lead strong {
    color: var(--color-accent);
    font-weight: 400;
}

.about-summary-text {
    font-size: 1rem;
    color: var(--color-text-secondary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.about-summary-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-accent);
    transition: gap var(--transition);
}

.about-summary-link:hover {
    gap: 0.85rem;
}

@media (max-width: 768px) {
    .about-summary-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Process grid inside about page */
.process-grid--about {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 480px) {
    .process-grid--about {
        grid-template-columns: 1fr;
    }
}

/* === About Page === */
.about-hero {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 8rem 2rem 4rem;
}

.about-hero-inner {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
    align-items: start;
}

.about-hero .about-cta-photo {
    flex: none;
    width: 100%;
    max-width: 380px;
    justify-self: end;
}

.about-intro .about-stats {
    margin-top: 2rem;
    flex-wrap: nowrap;
}

.about-intro .about-stats .about-stat {
    min-width: 0;
    flex: 1 1 0;
}

.about-hero-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 2rem;
}

.about-hero-title em {
    font-style: italic;
    color: var(--color-accent);
}

.about-hero-text {
    font-size: 1.05rem;
    color: var(--color-text-secondary);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.about-stats {
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    align-items: stretch;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.about-stat {
    padding: 1.25rem 1.5rem;
    background: var(--color-accent-dim);
    border: 1px solid rgba(200, 255, 0, 0.1);
    border-radius: var(--radius-sm);
    flex: 1 1 0;
    min-width: 200px;
}

[data-theme="light"] .about-stat {
    border-color: rgba(80, 160, 80, 0.25);
}

.about-stat-number {
    display: block;
    font-family: var(--font-sans);
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--color-accent);
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

.about-stat-label {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* === Journey Section (sticky left / scroll right) === */
.journey-section {
    border-top: 1px solid var(--color-border);
}

.journey-wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 6rem 2rem;
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 4rem;
}

.journey-sticky {
    position: sticky;
    top: 6rem;
    align-self: start;
    height: fit-content;
}

.journey-sticky-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.journey-sticky-desc {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
    max-width: 280px;
}

/* Timeline roles */
.journey-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.journey-role {
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--color-border);
}

.journey-role:first-child {
    padding-top: 0;
}

.journey-role:last-child {
    border-bottom: none;
}

.journey-role-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.journey-company {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.journey-dates {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.journey-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.journey-desc {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    line-height: 1.8;
    margin-bottom: 1.25rem;
}

.journey-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.journey-tag {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.3rem 0.75rem;
    border-radius: 100px;
    background: var(--color-surface);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* === About Page Sections (skills, personal) === */
.about-page-section {
    border-top: 1px solid var(--color-border);
}

.about-page-section-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 6rem 2rem;
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 4rem;
}

/* Skills columns */
.skills-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.skill-group-title {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-accent);
    margin-bottom: 1.25rem;
}

.skill-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.skill-list li {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.4;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--color-border);
}

.skill-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Personal section */
.personal-content {
    max-width: 560px;
}

.personal-cta {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-top: 2rem;
}

/* Nav active state */
.nav-active {
    color: var(--color-text) !important;
}

/* About page responsive */
@media (max-width: 1024px) {
    .about-hero-inner {
        grid-template-columns: 1fr;
        grid-template-areas:
            "photo"
            "intro"
            "stats";
        gap: 3rem;
    }

    .about-hero .about-cta-photo {
        justify-self: center;
        max-width: 360px;
    }

    .about-stats {
        flex-direction: row;
        gap: 1rem;
    }

    .about-stat {
        flex: 1;
        min-width: 0;
    }

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

@media (max-width: 768px) {
    .journey-wrapper,
    .about-page-section-inner {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .journey-sticky {
        position: static;
    }

    .about-hero {
        padding: 6rem 1.5rem 3rem;
    }

    .journey-wrapper,
    .about-page-section-inner {
        padding: 4rem 1.5rem;
    }

    .about-stats {
        flex-direction: column;
        align-items: stretch;
    }

    .about-stat {
        max-width: 100%;
    }

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

    .personal-cta {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* === About CTA === */
.about-cta {
    padding: 6rem 2rem;
    background: #D4F089;
}

[data-theme="light"] .about-cta {
    background: rgba(90, 122, 0, 0.2);
}

.about-cta-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 4rem;
}

.about-cta-photo {
    flex: 0 0 320px;
    position: relative;
}

.about-cta-photo img {
    width: 100%;
    border-radius: 20px;
    object-fit: cover;
    display: block;
}

/* === Chat bubbles overlay === */
.chat-bubbles {
    position: absolute;
    left: 5%;
    right: 5%;
    bottom: 5%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    pointer-events: none;
}

.chat-bubble {
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #FFFFFF;
    padding: 0 0.95rem;
    border-radius: 20px;
    border-bottom-left-radius: 6px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.3;
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    white-space: nowrap;
    opacity: 0;
    max-height: 0;
    margin-top: 0;
    overflow: hidden;
    transform: translateY(8px);
    transition:
        max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
        padding 0.45s cubic-bezier(0.4, 0, 0.2, 1),
        margin-top 0.45s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.35s ease,
        transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.4s ease;
    pointer-events: auto;
    display: flex;
    align-items: center;
    max-width: 100%;
}

.chat-bubble.visible {
    opacity: 1;
    max-height: 3rem;
    padding: 0.55rem 0.95rem;
    margin-top: 6px;
    transform: translateY(0);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.chat-bubble:first-child.visible {
    margin-top: 0;
}

.chat-bubble a {
    color: #FFFFFF;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 600;
}

.chat-bubble a:hover {
    text-decoration: none;
}

/* Typing dots */
.chat-bubble-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    height: 1rem;
}

.chat-bubble-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.75);
    animation: chat-typing-bounce 1.2s infinite ease-in-out;
}

.chat-bubble-dots span:nth-child(2) { animation-delay: 0.15s; }
.chat-bubble-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes chat-typing-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
    30% { transform: translateY(-4px); opacity: 0.9; }
}

.chat-bubble-text {
    display: none;
}

/* Visible (bubble appeared, dots typing) */
.chat-bubble.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Shown (dots swapped for text) */
.chat-bubble.shown .chat-bubble-dots {
    display: none;
}
.chat-bubble.shown .chat-bubble-text {
    display: inline;
}

/* Mobile: smaller bubbles (same collapse/grow animation as desktop) */
@media (max-width: 768px) {
    .chat-bubble {
        font-size: 0.8rem;
        border-radius: 16px;
        border-bottom-left-radius: 5px;
        /* Bump opacity so bubbles stay legible on iOS Safari where
           backdrop-filter can render near-invisible over the photo. */
        background: rgba(255, 255, 255, 0.38);
    }
    .chat-bubble.visible {
        padding: 0.45rem 0.8rem;
        max-height: 2.6rem;
        margin-top: 5px;
    }
    .chat-bubble:first-child.visible {
        margin-top: 0;
    }
}

.about-cta-content {
    flex: 1;
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.about-cta-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #0A0A0A;
    margin-bottom: 1rem;
}

.about-cta-text {
    font-size: 1.1rem;
    color: #333;
    line-height: 1.7;
    margin: 0 auto 2rem;
    max-width: 500px;
}

.about-cta-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
}

.about-cta .btn-primary {
    background: #fff;
    color: #0A0A0A;
}

.about-cta .btn-primary:hover {
    background: #f0f0f0;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}


.about-cta .btn-ghost {
    background: transparent;
    color: #0A0A0A;
    border: 1px solid rgba(0, 0, 0, 0.25);
    border-radius: 100px;
}

.about-cta .btn-ghost:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* === Footer === */
.footer {
    padding: 2rem;
    border-top: 1px solid var(--color-border);
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.footer-note {
    color: var(--color-accent);
    font-weight: 500;
}

/* === Scroll Animations === */
body.animations-ready .fade-up:not(.project-thumb) {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

body.animations-ready .fade-up.visible:not(.project-thumb) {
    opacity: 1;
    transform: translateY(0);
}

/* Thumb wraps need flex transition alongside fade-up */
body.animations-ready .project-thumb-wrap.fade-up {
    transition: opacity 0.7s ease, transform 0.7s ease, flex 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@media (prefers-reduced-motion: reduce) {
    body.animations-ready .fade-up {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* Stagger children */
.stagger-children .fade-up:nth-child(1) { transition-delay: 0s; }
.stagger-children .fade-up:nth-child(2) { transition-delay: 0.08s; }
.stagger-children .fade-up:nth-child(3) { transition-delay: 0.16s; }
.stagger-children .fade-up:nth-child(4) { transition-delay: 0.24s; }

/* === Responsive === */
@media (max-width: 1024px) {
    .gallery-row-2 {
        grid-template-columns: 1fr;
    }

    .gallery-row-2col {
        grid-template-columns: 1fr;
    }

    .process-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .project-outcomes {
        grid-template-columns: 1fr;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .about-cta-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 3rem;
    }

    .about-cta-photo {
        flex: 0 0 auto;
        max-width: 360px;
        width: 100%;
        margin: 0 auto;
    }

    .about-cta-content {
        text-align: center;
    }

    .about-cta-text {
        margin-left: auto;
        margin-right: auto;
    }

    .about-cta-buttons {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(10, 10, 10, 0.95);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        padding: 2rem;
        gap: 1.25rem;
        border-bottom: 1px solid var(--color-border);
    }

    .nav-links.open {
        display: flex;
    }

    .hero {
        padding-top: 11rem;
        min-height: auto;
    }

    .hero-title {
        font-size: clamp(4.5rem, 16vw, 6rem);
    }

    .contact-title {
        font-size: 3.75rem;
    }

    .hero-marquee {
        margin-top: 4rem;
    }

    .section {
        padding: 5rem 1.5rem;
    }

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

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

    .footer-inner {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .cursor-glow {
        display: none;
    }

    .project-videos {
        padding: 0 1.5rem 4rem;
    }

    /* About CTA — stack & resize for mobile */
    .about-cta {
        padding: 4rem 1.5rem;
    }

    .about-cta-inner {
        gap: 2.5rem;
    }

    .about-cta-photo {
        max-width: 100%;
        /* Give the container an explicit aspect so it has height
           BEFORE the image loads — IntersectionObserver needs real
           dimensions to trigger the chat-bubble animation on iOS. */
        aspect-ratio: 1 / 1;
        width: 100%;
    }

    .about-cta-photo img {
        width: 100%;
        height: 100%;
        aspect-ratio: 1 / 1;
        object-fit: cover;
        object-position: center 25%;
    }

    .about-cta-title {
        font-size: 3.75rem;
        line-height: 1.05;
    }

    .about-cta-text {
        font-size: 1rem;
        max-width: 100%;
    }

    .about-cta-buttons {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

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

@media (max-width: 480px) {
    .hero-cta {
        flex-direction: column;
        align-items: flex-start;
    }

    .contact-links {
        flex-direction: column;
        gap: 1rem;
    }

    .about-cta-title {
        font-size: 2.75rem;
    }

    .about-cta-photo {
        max-width: 100%;
    }

    .about-cta-photo img {
        aspect-ratio: 1 / 1;
        object-position: center 25%;
    }
}

/* === Floating Controls (Lang + Theme toggle) === */
.floating-controls {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    align-items: center;
}

/* === Theme Toggle === */
.theme-toggle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), border-color var(--transition), transform 0.2s;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px var(--color-card-shadow);
}

.theme-toggle:hover {
    border-color: var(--color-accent);
    transform: scale(1.08);
}

/* === Language Toggle === */
.lang-toggle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    transition: background var(--transition), border-color var(--transition), transform 0.2s, color var(--transition);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px var(--color-card-shadow);
}

.lang-toggle:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    transform: scale(1.08);
}

.lang-toggle-text {
    display: inline-block;
    line-height: 1;
}

/* Variant used inline inside the top nav — smaller pill, no shadow */
.lang-toggle--nav {
    width: 38px;
    height: 38px;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
}

.lang-toggle--nav:hover {
    transform: none;
    border-color: var(--color-accent);
    color: var(--color-accent);
}

@media (max-width: 640px) {
    .floating-controls {
        bottom: 1.25rem;
        right: 1.25rem;
        gap: 0.5rem;
    }
    .lang-toggle,
    .theme-toggle {
        width: 42px;
        height: 42px;
    }
    .lang-toggle {
        font-size: 0.75rem;
    }
}

.theme-toggle-icon {
    width: 20px;
    height: 20px;
    transition: opacity 0.3s, transform 0.3s;
}

/* Dark mode (default): show sun icon, hide moon */
.theme-toggle-icon--sun {
    display: block;
}
.theme-toggle-icon--moon {
    display: none;
}

/* Light mode: show moon icon, hide sun */
[data-theme="light"] .theme-toggle-icon--sun {
    display: none;
}
[data-theme="light"] .theme-toggle-icon--moon {
    display: block;
}

/* Light mode: hide cursor glow */
[data-theme="light"] .cursor-glow {
    display: none;
}

/* Light mode: adjust nav background */
[data-theme="light"] .nav.scrolled {
    background: rgba(250, 250, 250, 0.9);
    border-color: var(--color-border);
}

/* Light mode: selection color */
[data-theme="light"] ::selection {
    background: var(--color-accent);
    color: #fff;
}

/* Thumbnail overlay text always white (sits on dark gradient) */
[data-theme="light"] .project-thumb-overlay {
    color: #fff;
}

[data-theme="light"] .project-thumb-company,
[data-theme="light"] .project-thumb-title,
[data-theme="light"] .project-thumb-desc {
    color: #fff;
}

[data-theme="light"] .project-thumb-arrow {
    color: #fff;
}

/* Smooth transition on theme change */
body,
.nav,
.footer,
.case-header,
.project-thumb--empty {
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

/* === Problem Grid (checkout) === */
.problem-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
        "image text"
        "insight text";
    gap: 1.5rem 3rem;
    align-items: start;
}

.problem-grid__text  { grid-area: text; }
.problem-grid__image { grid-area: image; }
.problem-grid__insight { grid-area: insight; }

@media (max-width: 768px) {
    .problem-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "text"
            "image"
            "insight";
    }
}

/* === Insight Card === */
.insight-card {
    margin-top: 2rem;
    padding: 1.5rem;
    border-left: 3px solid var(--color-accent);
    background: var(--color-surface);
    border-radius: 0 var(--radius) var(--radius) 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
}

.insight-card-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-accent);
}

.insight-card-text {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--color-text-secondary);
    margin: 0;
}

.insight-card-highlight {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
    line-height: 1.5;
}

/* === Handoff row — wider images column === */
.handoff-row {
    grid-template-columns: 1fr 2.5fr !important;
    align-items: start !important;
}

/* === Handoff images (stacked vertically) === */
.handoff-images {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1 1 auto;
    min-width: 0;
    align-items: stretch;
}

.handoff-images .gallery-item {
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.handoff-images .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

@media (max-width: 768px) {
    .handoff-row {
        grid-template-columns: 1fr !important;
    }

    .handoff-images {
        flex-direction: column;
    }

    .handoff-images .gallery-item,
    .handoff-images .gallery-item:first-child {
        flex: none;
        width: 100% !important;
        max-width: 100% !important;
    }

    .handoff-images .gallery-item img {
        height: auto;
        object-fit: unset;
    }
}

/* === Frames Carousel (receipts case) === */
.frames-carousel {
    position: relative;
    width: 100%;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: none !important;
    border: none !important;
}

.frames-carousel-track {
    position: relative;
    width: 100%;
    aspect-ratio: 2400/2048;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-surface);
}

.gallery-item .frames-carousel-slide,
.frames-carousel-slide {
    position: absolute !important;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    transform: none !important;
}

.gallery-item .frames-carousel-slide.active,
.frames-carousel-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.gallery-item:hover .frames-carousel-slide {
    transform: none !important;
}

.frames-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    color: var(--color-text);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, opacity 0.25s ease;
    z-index: 2;
    opacity: 0;
    pointer-events: none;
}

.frames-carousel:hover .frames-carousel-btn {
    opacity: 1;
    pointer-events: auto;
}

.frames-carousel-btn:hover {
    background: rgba(0, 0, 0, 0.75);
}

.frames-carousel-btn--prev {
    left: 0.25rem;
}

.frames-carousel-btn--next {
    right: 0.25rem;
}

.frames-carousel-dots {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    padding: 0.25rem 0;
}

.frames-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: var(--color-border);
    cursor: pointer;
    padding: 0;
    transition: background 0.2s ease, transform 0.2s ease;
}

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

/* ===== Hero gallery — scroll-scrubbed zoom-out grid ===== */
.hero-gallery {
    position: relative;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-top: clamp(4rem, 8vw, 8rem);
    background: var(--color-bg);
    overflow: hidden;
    --hg-amp: 110px;
    --hg-stage: 168vh;
}
.hero-gallery-sticky {
    display: block;
    width: 100%;
}
.hero-gallery-stage {
    display: grid;
    grid-template-columns: 1fr 1.55fr 1fr;
    align-items: start;
    gap: clamp(6px, 1vw, 14px);
    width: 100%;
    padding: clamp(2.5rem, 6vw, 5rem) clamp(8px, 1vw, 16px);
}
.hero-gallery-col {
    display: grid;
    gap: clamp(6px, 1vw, 14px);
}
.hero-gallery-item {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--color-surface);
    border-radius: 5px;
}
.hero-gallery-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* Animated mode — added by JS only when motion is allowed */
.hero-gallery.is-animated {
    height: var(--hg-stage);
}
.hero-gallery.is-animated .hero-gallery-sticky {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-gallery.is-animated .hero-gallery-stage {
    display: flex;
    flex-flow: row;
    align-items: center;
    justify-content: center;
    gap: clamp(8px, 1vw, 16px);
    height: var(--hg-stage);
    padding: 0 clamp(8px, 1vw, 16px);
    overflow: hidden;
    transform: scale(2);
    transform-origin: center center;
    opacity: 0.62;
    will-change: transform, opacity;
}
.hero-gallery.is-animated .hero-gallery-col {
    display: flex;
    flex-flow: column;
    flex: 1 1 0;
    min-width: 0;
    align-items: stretch;
    gap: clamp(8px, 1vw, 16px);
    height: calc(var(--hg-stage) + (2 * var(--hg-amp)));
    will-change: transform;
}
.hero-gallery.is-animated .hero-gallery-col[data-col="1"] {
    flex-grow: 1.55;
}
.hero-gallery.is-animated .hero-gallery-item {
    flex: 1 1 0;
    min-height: 0;
    aspect-ratio: auto;
}
@media (max-width: 720px) {
    .hero-gallery.is-animated { --hg-stage: 150vh; --hg-amp: 70px; }
    .hero-gallery.is-animated .hero-gallery-stage { transform: scale(1.7); }
}

/* Use dynamic viewport height where supported (iOS Safari URL bar collapse) */
@supports (height: 100dvh) {
    .hero-gallery { --hg-stage: 168dvh; }
    @media (max-width: 720px) {
        .hero-gallery.is-animated { --hg-stage: 150dvh; }
    }
}

/* === Small-mobile refinements (iPhone-sized viewports ~390px) === */
@media (max-width: 480px) {
    /* Container padding tighter so content doesn't get squeezed */
    .hero,
    .case-header,
    .case-body,
    .section,
    .about-hero {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    /* Hero — smaller everything, less vertical air */
    .hero {
        padding-top: 9rem;
        min-height: auto;
    }
    .hero-content {
        max-width: 100%;
    }
    .hero-title {
        font-size: clamp(2.5rem, 12vw, 4rem);
        line-height: 1.05;
    }
    .hero-subtitle {
        font-size: 0.95rem;
        line-height: 1.6;
        margin-bottom: 2rem;
    }
    .hero-eyebrow {
        top: -2rem;
        font-size: 0.65rem;
        gap: 0.4rem;
    }
    .hero-cta {
        gap: 0.75rem;
    }
    .hero-cta .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.8rem;
    }

    /* Marquee text smaller */
    .marquee-track span {
        font-size: 0.7rem;
    }

    /* Section titles & numbers */
    .section-title,
    .about-hero-title,
    .journey-sticky-title,
    .about-cta-title {
        font-size: clamp(1.75rem, 7vw, 2.5rem);
    }
    .section-number {
        font-size: 0.65rem;
    }

    /* Case study header — tighter top padding, smaller title */
    .case-header {
        padding-top: 5rem;
        padding-bottom: 2rem;
    }
    .case-title {
        font-size: clamp(2rem, 9vw, 3rem);
        line-height: 1.05;
    }
    .case-subtitle {
        font-size: 0.95rem;
        line-height: 1.65;
    }
    .case-section-title {
        font-size: clamp(1.35rem, 5vw, 1.75rem);
    }
    .case-subsection-title {
        font-size: 1.2rem;
    }

    /* Case Role/Scope/Year strip — stack vertically */
    .case-role--split {
        flex-direction: column;
        gap: 1.25rem;
        padding-bottom: 1.25rem;
        margin-bottom: 2.5rem;
    }
    .case-role--split .case-role-col,
    .case-role--split .case-role-col:first-child {
        max-width: 100%;
        flex: none;
    }

    /* Project thumbs — shorter on mobile */
    .project-thumb {
        height: 380px;
    }
    .project-thumb-title {
        font-size: 1.65rem;
        line-height: 1.15;
    }
    .project-thumb-desc {
        font-size: 0.85rem;
    }

    /* About stats — stack vertically on tiny screens */
    .about-intro .about-stats {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    .about-intro .about-stats .about-stat {
        flex: 1 1 100%;
        min-width: 0;
    }

    /* Project metrics — single column */
    .project-metrics {
        grid-template-columns: 1fr;
    }

    /* About CTA — smaller title and tighter buttons */
    .about-cta {
        padding: 4rem 1.25rem;
    }
    .about-cta-title {
        font-size: clamp(1.75rem, 7vw, 2.5rem);
    }
    .about-cta-text {
        font-size: 0.95rem;
    }
    .about-cta-buttons {
        flex-direction: column;
        width: 100%;
    }
    .about-cta-buttons .btn {
        width: 100%;
        justify-content: center;
    }

    /* Journey timeline tighter */
    .journey-wrapper {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
    .journey-role {
        margin-bottom: 2.5rem;
    }
    .journey-title {
        font-size: 1.1rem;
    }
    .journey-desc {
        font-size: 0.9rem;
    }

    /* Case-next link — smaller arrow circle */
    .case-next-link {
        font-size: clamp(1.5rem, 6vw, 2rem);
        gap: 0.75rem;
        text-align: center;
        flex-wrap: wrap;
        justify-content: center;
    }
    .case-next-arrow {
        width: 52px;
        height: 52px;
    }

    /* Wireframes block — already stacks at 1024px, just tighten padding */
    .wireframes-inner {
        padding-inline: 1.25rem;
    }

    /* Footer */
    .footer-inner {
        padding: 1.5rem 1.25rem;
        font-size: 0.75rem;
    }
}

/* Mobile only: swap order inside specific rows so text appears first */
@media (max-width: 768px) {
    .gallery-context-row--text-first-mobile .gallery-context-text { order: 1; }
    .gallery-context-row--text-first-mobile .gallery-context-screens { order: 2; }
}

/* Receipts toolkit: center the image on mobile (override inline justify-content: flex-end) */
@media (max-width: 768px) {
    .receipts-reorder .receipts-reorder__media {
        justify-content: center !important;
    }
}

/* Critical entry points video — larger on mobile only */
@media (max-width: 480px) {
    .gallery-item-mobile--code {
        width: 88vw !important;
        max-width: 88vw !important;
    }
}
