/* === CASE STUDY PAGE (isolated) === */

/* Override base.css 'proximity' snap and ensure strict mandatory snap */
html:has(body.is-case-study),
body.is-case-study {
    scroll-snap-type: y mandatory !important;
    background: var(--color-bg-about);

    /* Force all text to Space Grotesk */
    --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif !important;
    --font-body: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.case-study {
    background: var(--color-text-white);
}

/* ── Hero ── */
.case-study__hero {
    position: relative;
    width: 100%;
    display: flex;
    align-items: flex-end;
    background: var(--color-text-white);
    padding-top: clamp(2rem, 5vh, 4rem);
    scroll-snap-align: start;
}

.case-study__hero-content {
    position: relative;
    z-index: 2;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-4xl) var(--content-padding) var(--space-3xl);
    width: 100%;
}

.case-study__hero-top {
    margin-bottom: clamp(1.5rem, 4vh, 3rem);
}

.case-study__back {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: var(--text-nav);
    color: var(--color-text-secondary);
    transition: color var(--duration-fast) var(--ease-smooth);
    text-decoration: none;
}

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

.case-study__hero-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: clamp(3rem, 6vw, 5rem);
    line-height: 1.1;
    color: var(--color-text-primary);
    margin-bottom: var(--space-md);
    /* Reduced bottom margin */
    letter-spacing: -0.02em;
}

/* Hero layout: single column — subtitle then meta below */
.case-study__hero-layout {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    /* Reduced gap between subtitle and buttons */
    padding-top: 0;
    /* Removed extra top padding to keep title close */
}

.case-study__hero-subtitle {
    font-family: var(--font-body);
    font-size: 1.375rem;
    /* Increased from 1.125rem */
    line-height: 1.6;
    color: var(--color-text-secondary);
    max-width: 75rem;
    /* Increased width to accommodate longer text */
}

/* ── Hero Actions (Buttons) ── */
.case-study__hero-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: 0;
    /* Relying purely on parent flex gap */
}

.case-study__hero-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-dark-card);
    color: var(--color-text-white);
    font-family: var(--font-body);
    font-size: 1.125rem;
    /* Increased text size inside buttons */
    font-weight: 500;
    padding: 1rem 3.25rem;
    /* 16px 52px */
    border-radius: var(--radius-pill);
    text-decoration: none;
    transition: background var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
}

.case-study__hero-btn:hover {
    background: var(--color-dark-card-hover);
    transform: translateY(-2px);
}

.case-study__hero-meta {
    display: grid;
    grid-template-columns: repeat(3, auto);
    gap: var(--space-3xl);
    margin-top: var(--space-xl);
    padding-top: var(--space-2xl);
}

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

.case-study__hero-meta-label {
    font-family: var(--font-body);
    font-size: var(--text-small);
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.case-study__hero-meta-value {
    font-family: var(--font-body);
    font-size: var(--text-body);
    font-weight: 500;
    color: var(--color-text-primary);
    line-height: 1.4;
}

/* ── Hero cover (image placeholder) ── */
.case-study__hero-cover {
    width: 100%;
    height: clamp(300px, 60vh, 800px);
    background: rgba(0, 0, 0, 0.04);
    border-radius: var(--radius-lg);
    margin-bottom: 0;
}

.case-study__hero-cover.mix-bg-full {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    width: 100vw;
    border-radius: 0;
}
/* ── Parallax Scroll ── */
.parallax-scroll {
    position: relative;
    width: 100vw;
    height: 180vh; /* Tighter track for even faster "two-scroll" fall */
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    background: #000;
    overflow: clip; /* Ensure no horizontal scrollbars */
    scroll-snap-align: start;
}

.parallax-scroll__sticky {
    position: sticky;
    top: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.parallax-scroll__bg {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.parallax-scroll__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.parallax-scroll__text-wrap {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    pointer-events: none;
}

.parallax-scroll__text-img {
    height: 20vh; /* Further reduced from 35vh for a more subtle feel */
    width: auto;
    max-width: none; /* Keep this to prevent image shrinking */
    object-fit: contain;
    will-change: transform;
    padding-left: 20vw; 
}

/* ── Nav hidden on case-study first screen ── */
body.is-case-study .nav {
    opacity: 0 !important;
    pointer-events: none;
    visibility: hidden;
    animation: none !important;
    transition: opacity var(--duration-normal) var(--ease-smooth),
        visibility 0s var(--duration-normal);
}

body.is-case-study .nav.nav--cs-visible {
    opacity: 1 !important;
    pointer-events: auto;
    visibility: visible;
    transition: opacity var(--duration-normal) var(--ease-smooth),
        visibility 0s 0s;
}

/* ── Content ── */
.case-study__content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--content-padding);
}

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

.case-study__section-title {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: clamp(2rem, 4vw, 3rem);
    /* Slightly smaller than previous default */
    color: var(--color-text-primary);
    margin-bottom: var(--space-xl);
    letter-spacing: -0.02em;
}

/* Narrow readable text */
.case-study__text-narrow {
    max-width: 65rem;
    /* Increased from 50rem to stretch wider */
}

.case-study__text {
    font-family: var(--font-body);
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-md);
}

/* ═══════════════════════════════════════════
   Spacer for sections
   ═══════════════════════════════════════════ */
.case-study__spacer {
    height: clamp(5rem, 10vh, 10rem);
    width: 100%;
    background: var(--color-text-white);
    scroll-snap-align: start;
}

/* ═══════════════════════════════════════════
   Story Scroll — fullscreen snap (on main page)
   ═══════════════════════════════════════════ */
.case-study__story-scroll {
    position: relative;
    width: 100%;
}

.case-study__story-step {
    height: 100vh;
    min-height: 100vh;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: var(--space-4xl) var(--content-padding);
    box-sizing: border-box;
}

.case-study__story-content {
    width: 100%;
    max-width: 900px;
    /* Increased from 700px */
}

.case-study__story-step .case-study__section-title {
    font-size: clamp(2.25rem, 4.5vw, 3.5rem);
    /* Increased slightly */
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--space-md);
}

.case-study__story-step .case-study__text {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    line-height: 1.65;
    margin-bottom: var(--space-xl);
}

/* ═══════════════════════════════════════════
   Features — fullscreen snap storytelling (on main page)
   ═══════════════════════════════════════════ */
.case-study__features {
    position: relative;
    background: var(--color-text-white);
}

.case-study__feature-panel {
    display: flex;
    flex-direction: row-reverse;
    /* Text on right, image on left */
    width: 100%;
    height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.case-study__feature-visual {
    flex: 0 0 50%;
    height: 100%;
    background: var(--color-text-white);
    overflow: hidden;
}

.case-study__feature-video {
    width: 102%; /* Slightly wider to cover subpixel edge gaps */
    height: 102%; /* Slightly taller to cover subpixel edge gaps */
    margin: -1%; /* Center the overflow */
    object-fit: cover;
    display: block;
}

.case-study__feature-info {
    flex: 0 0 50%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-right: clamp(2rem, 5vw, 6rem); /* Reduced padding to widen text */
    padding-left: clamp(2rem, 5vw, 6rem);
    box-sizing: border-box;
    border: none !important;
}

.case-study__feature-info .case-study__feature-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    color: var(--color-text-primary);
    margin-bottom: var(--space-lg);
    letter-spacing: -0.02em;
}

.case-study__feature-info .case-study__text {
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    line-height: 1.65;
    margin-bottom: var(--space-lg);
}

/* Lists */
.case-study__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.case-study__list li {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-sm);
    position: relative;
    padding-left: var(--space-lg);
}

.case-study__list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--color-text-primary);
    font-weight: bold;
}

/* ═══════════════════════════════════════════
   Feature Stats Callout
   ═══════════════════════════════════════════ */
.case-study__feature-stats {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
    margin-top: var(--space-md);
    margin-bottom: var(--space-xl);
    padding: 0;
    background: transparent;
    border-radius: 0;
}

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

.case-study__stat-value {
    font-family: var(--font-heading);
    font-size: 36px;
    font-weight: 700;
    color: #3a3a45;
    line-height: 1.2;
}

.case-study__stat-label {
    font-family: var(--font-body);
    font-size: 14px;
    color: #acacb8;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.case-study__stat-note {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 700;
    color: #3a3a45;
    margin-top: var(--space-xl);
    margin-bottom: var(--space-md);
}

/* ═══════════════════════════════════════════
   Impact — clean white layout
   ═══════════════════════════════════════════ */
.case-study__section--impact {
    background: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-4xl) 0;
    margin-bottom: 0;
    scroll-snap-align: center;
    box-sizing: border-box;
}

.case-study__footer-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    scroll-snap-align: center;
    background: #ffffff;
}

.case-study__last-screen {
    flex: 1;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    overflow: hidden;
}

.case-study__last-screen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}



/* ═══════════════════════════════════════════
   Bottom Navigation
   ═══════════════════════════════════════════ */
.case-study__bottom-nav {
    padding-top: var(--space-lg);
}

.case-study__bottom-nav.mix-bg-full {
    background: #ffffff;
    margin: 0 calc(-50vw + 50%);
    padding: var(--space-xl) calc(50vw - 50% + var(--content-padding)) var(--space-3xl);
    margin-top: 0;
}

.case-study__bottom-nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: var(--space-3xl);
    padding-top: var(--space-3xl);
}

.case-study__nav-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    flex: 1;
}

.case-study__nav-info-block {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.case-study__next-label {
    font-family: var(--font-body);
    font-size: var(--text-small);
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.case-study__nav-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: clamp(2rem, 3.5vw, 3rem);
    color: var(--color-text-primary);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.case-study__nav-desc {
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    max-width: 500px;
    line-height: 1.5;
}

.case-study__nav-main-link {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.case-study__nav-arrows {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    flex-shrink: 0;
    margin-bottom: var(--space-xs);
}

.case-study__nav-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(3rem, 5vw, 4rem);
    height: clamp(3rem, 5vw, 4rem);
    color: var(--color-text-primary);
    transition: transform var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), opacity var(--duration-fast) var(--ease-out);
    position: relative;
    z-index: 2;
}

.case-study__nav-arrow svg {
    width: 32px;
    height: 32px;
}

.case-study__nav-arrow--prev {
    opacity: 0.25;
}

.case-study__nav-arrow--next {
    opacity: 1;
}

.case-study__nav-arrow:hover {
    color: var(--color-text-primary);
    transform: scale(1.1);
    opacity: 1;
}

.case-study__nav-arrow--prev:hover {
    transform: scale(1.1) translateX(-4px);
}

.case-study__nav-arrow--next:hover {
    transform: scale(1.1) translateX(4px);
}
/* ═══════════════════════════════════════════
   Inverse Theme: Reccall Page
   ═══════════════════════════════════════════ */
body.page-reccall {
    background: var(--color-black) !important;
}

.page-reccall .case-study {
    background: var(--color-black) !important;
}

.page-reccall .case-study__hero,
.page-reccall .case-study__spacer,
.page-reccall .case-study__features,
.page-reccall .case-study__feature-visual,
.page-reccall .case-study__feature-info,
.page-reccall .case-study__bottom-nav.mix-bg-full,
.page-reccall .case-study__footer-wrap,
.page-reccall .case-study__story-step {
    background: var(--color-black) !important;
}

/* Headings: Full white */
.page-reccall .case-study__hero-title,
.page-reccall .case-study__section-title,
.page-reccall .case-study__feature-title,
.page-reccall .case-study__nav-title,
.page-reccall .case-study__hero-meta-value,
.page-reccall .case-study__stat-value,
.page-reccall .case-study__stat-note {
    color: var(--color-text-white) !important;
}

/* Other texts: 60% white */
.page-reccall .case-study__hero-subtitle,
.page-reccall .case-study__text,
.page-reccall .case-study__hero-meta-label,
.page-reccall .case-study__next-label,
.page-reccall .case-study__nav-desc,
.page-reccall .case-study__stat-label,
.page-reccall .case-study__back,
.page-reccall .case-study__list li {
    color: rgba(255, 255, 255, 0.6) !important;
}

.page-reccall .case-study__back:hover {
    color: var(--color-text-white) !important;
}

/* Hero Actions: Invert button style if needed */
.page-reccall .case-study__hero-btn {
    background: var(--color-text-white);
    color: var(--color-black);
}

.page-reccall .case-study__hero-btn:hover {
    background: rgba(255, 255, 255, 0.9);
}

/* Nav/Footer navigation */
.page-reccall .case-study__nav-arrow {
    color: var(--color-text-white);
}

.page-reccall .case-study__nav-link:hover .case-study__nav-arrow {
    background: var(--color-text-white);
    color: var(--color-black);
}

/* Nav pill adjustment for Reccall Page */
.page-reccall .nav__pill {
    background: #222225 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.page-reccall .nav__link,
.page-reccall .nav__cv {
    color: #97979A !important;
}

.page-reccall .nav__link:hover,
.page-reccall .nav__cv:hover,
.page-reccall .nav__link--active {
    color: var(--color-text-white) !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

.page-reccall .nav__hamburger-line {
    background: #97979A !important;
}

.page-reccall .case-study__nav-arrow svg path {
    stroke: currentColor;
}

.page-reccall .case-study__hero-cover {
    background: rgba(255, 255, 255, 0.05); /* Slight visibility for the placeholder */
}

/* ── Parallax Scroll Reccall ── */

.parallax-scroll--reccall {
    background-color: var(--color-black); /* Fallback */
}

.parallax-scroll__text-composition {
    display: flex;
    align-items: center;
    gap: 4vw;
    white-space: nowrap;
    will-change: transform;
}

.parallax-word {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro", var(--font-heading);
    font-weight: 900;
    font-stretch: expanded;
    font-size: 15vh;
    color: var(--color-text-white);
    letter-spacing: -0.02em;
    line-height: 1;
}

.soundtrack-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 15vh;
}

.soundtrack-icon svg {
    height: 100%;
    width: auto;
}

.soundtrack-icon rect {
    transform-origin: center;
    animation: soundtrack-wave 1.2s ease-in-out infinite;
}

.soundtrack-icon rect:nth-child(2) {
    animation-delay: 0.2s;
}

.soundtrack-icon rect:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes soundtrack-wave {
    0%, 100% {
        transform: scaleY(0.7);
    }
    50% {
        transform: scaleY(1.3);
    }
}

/* Specific adjustment for Reccall Page Theme */
.page-reccall .parallax-scroll {
    background-color: #000;
}

.case-study__last-screen--reccall {
    position: relative !important;
    width: 100% !important;
    height: 500px !important;
    background: #DE3B3B !important;
    overflow: hidden !important;
    display: block !important;
    perspective: 1200px !important;
}

.case-study__last-screen--reccall .last-screen-bg {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    opacity: 1 !important;
}

.page-reccall .case-study__last-phones {
    position: absolute !important;
    bottom: -40px !important; 
    left: 50% !important;
    transform: translateX(-50%) translateY(0) !important;
    height: 300px !important; /* Larger size as requested */
    width: auto !important;
    z-index: 2 !important;
    transition: transform 0.15s ease-out !important;
}

.page-reccall .case-study__footer-wrap {
    background: #000;
}

.page-reccall .case-study__bottom-nav.mix-bg-full {
    background: #000;
}

.page-reccall .case-study__nav-title {
    color: var(--color-text-white);
}

.page-reccall .case-study__nav-desc {
    color: rgba(255, 255, 255, 0.6);
}

/* ── Scroll To Bottom Button ── */
.scroll-down-btn {
    position: fixed;
    right: 2.5rem;
    bottom: 2.5rem;
    width: 3.5rem;
    height: 3.5rem;
    background: var(--color-dark-card);
    color: var(--color-text-white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--duration-normal) var(--ease-smooth);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.scroll-down-btn svg {
    width: 20px;
    height: 20px;
    animation: bounce-small 2s infinite;
}

.scroll-down-btn.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-down-btn:hover {
    background: var(--color-dark-card-hover);
    transform: translateY(-4px);
}

@keyframes bounce-small {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(4px);
    }
    60% {
        transform: translateY(2px);
    }
}

/* Growth Parallax Specifics */
.parallax-scroll--growth .parallax-scroll__text-composition {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    white-space: nowrap;
    will-change: transform;
}

.parallax-scroll--growth .parallax-word {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 8vw;
    line-height: 1;
    color: var(--color-text-white);
    text-transform: uppercase;
    display: block;
}
