/* ==========================================================================
   Team Page — page-specific styles
   Global reset, variables, fonts, body, container, buttons, header/footer
   are inherited from style.css (loaded first). Only team-page-specific
   layout lives here.

   ANIMATION SYSTEM
   One shared easing curve + duration scale is used everywhere below so
   every motion on the page reads as part of the same, deliberate system
   rather than a grab-bag of effects.
   ========================================================================== */

   :root {
    --ease-lux: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --dur-fast: 0.4s;
    --dur-mid: 0.8s;
    --dur-slow: 1.2s;
}

/* --------------------------------------------------------------------
   No-JS / JS-failure fallback
   If team.js never loads or errors out (blocked script, 404, wrong
   path/case on a case-sensitive host like Netlify, etc.), these
   elements would otherwise stay permanently invisible since only JS
   ever adds the .in-view / .hero-animate classes (and only JS wraps
   the hero h1's words in .word spans). This forces them visible after
   a short delay as a pure-CSS safety net. NOTE: .hero-animate and
   .hero h1 .word are included here too — they were missed originally,
   which is what let the hero paragraph/subtitle/button stay stuck at
   opacity:0 with no recovery path when team.js failed to run.
   -------------------------------------------------------------------- */
@keyframes forceVisibleFallback {
    to {
        opacity: 1;
        clip-path: none;
        transform: none;
    }
}

.heart-text,
.heart-title,
.member-card,
.cta-section,
.hero-animate,
.hero h1 .word {
    animation: forceVisibleFallback 0.01s 3s forwards;
}

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

/* --- Hero Section --- */
.hero {
    text-align: center;
    padding: 100px 20px;
    overflow: hidden;
}

/* #1 Staggered hero reveal + #3 parallax wrapper */
.hero-animate {
    opacity: 0;
    transform: translateY(24px);
    animation: heroRise var(--dur-mid) var(--ease-lux) forwards;
}

.hero .subtitle.hero-animate { animation-delay: 0.1s; }
.hero h1.hero-animate { animation-delay: 0.25s; }
.hero p.hero-animate { animation-delay: 0.4s; }
.hero .btn.hero-animate { animation-delay: 0.55s; }

@keyframes heroRise {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* #2 Word-split title reveal — each .word span rises with blur-to-sharp */
.hero h1 .word {
    display: inline-block;
    opacity: 0;
    filter: blur(6px);
    transform: translateY(30px);
    animation: wordReveal var(--dur-mid) var(--ease-lux) forwards;
}

@keyframes wordReveal {
    to {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0);
    }
}

.subtitle {
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 20px;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 20px;
}

.hero p {
    max-width: 500px;
    margin: 0 auto 40px auto;
    color: var(--muted);
    font-size: 0.95rem;
}

/* --- Heart of the Studio Section --- */
.heart-section {
    background-color: var(--bg);
    padding: 80px 0;
    margin-bottom: 100px;
}

.heart-content {
    display: flex;
    gap: 100px;
    align-items: flex-start;
}

.heart-title {
    font-size: 1.8rem;
    font-weight: 500;
    flex: 1;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    padding-bottom: 18px;
}

/* #5 Title underline draw — animates width when .in-view is added */
.heart-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 0;
    background-color: var(--muted);
    transition: width var(--dur-slow) var(--ease-lux);
}

.heart-title.in-view::after {
    width: 60px;
}

.heart-text {
    flex: 2;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.8;
    /* #4 Text reveal on scroll — slide up + fade in */
    opacity: 0;
    transform: translateY(40px);
    transition: opacity var(--dur-slow) var(--ease-lux),
                transform var(--dur-slow) var(--ease-lux);
}

.heart-text.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* --- Visionaries (Team) Section --- */
.visionaries-section {
    padding-bottom: 100px;
}

.section-title {
    font-size: 3rem;
    margin-bottom: 60px;
}

/* STRUCTURALLY ANCHORED MASONRY GRID */
.masonry-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 60px 24px;
    position: relative;
}

.member-card {
    display: flex;
    flex-direction: column;
    gap: 24px;
    cursor: pointer;
    /* #6 Scroll-triggered card entrance */
    opacity: 0;
    transform: translateY(40px);
    transition: opacity var(--dur-slow) var(--ease-lux),
                transform var(--dur-slow) var(--ease-lux);
}

.member-card.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* Hover animations and overlays */
.image-container {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    /* #7 Magnetic image tilt perspective */
    perspective: 1000px;
    transform-style: preserve-3d;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transform: scale(1.05);
    /* #8 Slow-reveal grayscale-to-color, shared easing curve */
    transition: filter var(--dur-slow) var(--ease-lux),
                transform var(--dur-slow) var(--ease-lux);
    background-color: var(--alt-bg);
    will-change: transform, filter;
}

.member-card:hover .image-container img {
    filter: grayscale(0%);
    transform: scale(1);
}

/* Text alignment */
.member-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 16px;
}

.member-info h3 {
    font-size: 1.5rem;
    position: relative;
    display: inline-block;
    width: fit-content;
}

/* #11 Name underline on card hover — draws left to right */
.member-info h3::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    height: 1px;
    width: 0;
    background-color: var(--fg, currentColor);
    transition: width var(--dur-mid) var(--ease-lux);
}

.member-card:hover .member-info h3::after {
    width: 100%;
}

.member-info p {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    font-weight: 500;
}

/*
 * EXPLICIT GRID PLACEMENT
 * Using grid-row to guarantee the layout never collapses or overlaps.
 */

.member-1 { grid-column: 1 / 8; grid-row: 1; }
.member-1 .image-container { aspect-ratio: 4/5; }

.member-2 { grid-column: 9 / 13; grid-row: 1; margin-top: 120px; }
.member-2 .image-container { aspect-ratio: 3/4; }

.member-3 { grid-column: 2 / 7; grid-row: 2; margin-top: 20px; }
.member-3 .image-container { aspect-ratio: 1/1; }

/* Modified to Portrait (3/4) */
.member-4 { grid-column: 8 / 13; grid-row: 2; margin-top: 80px; }
.member-4 .image-container { aspect-ratio: 3/4; }

/* Modified to Portrait (4/5) */
.member-5 { grid-column: 4 / 10; grid-row: 3; margin-top: 60px; }
.member-5 .image-container { aspect-ratio: 4/5; }


/* --- CTA Section (floating card) --- */
.cta-section {
    box-sizing: border-box;
    background-color: #1a1a1a;
    background-image: radial-gradient(circle at 20% 30%, rgba(255,255,255,0.06), transparent 50%),
                       radial-gradient(circle at 80% 70%, rgba(255,255,255,0.05), transparent 50%);
    background-size: 180% 180%;
    background-position: 0% 0%;
    color: #ffffff;
    text-align: center;
    padding: 100px 40px;
    margin: 100px auto;
    max-width: 1200px;
    border-radius: 24px;
    overflow: hidden;
    /* #12 Ambient gradient shimmer, slow continuous loop */
    animation: ctaShimmer 14s ease-in-out infinite;
    /* #14 Scroll-triggered CTA entrance */
    opacity: 0;
    transform: translateY(40px);
    transition: opacity var(--dur-slow) var(--ease-lux),
                transform var(--dur-slow) var(--ease-lux);
}

.cta-section.in-view {
    opacity: 1;
    transform: translateY(0);
}

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

.cta-section h2 {
    font-style: italic;
    font-size: 3.5rem;
    margin-bottom: 24px;
    color: #ffffff;
}

.cta-section p {
    color: rgba(255, 255, 255, 0.55);
    max-width: 500px;
    margin: 0 auto 40px auto;
    font-size: 0.95rem;
    line-height: 1.7;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.cta-buttons a,
.cta-buttons button {
    background-color: #ffffff;
    color: #1a1a1a;
    border: 1px solid #ffffff;
    padding: 20px 40px;
    font-size: 0.95rem;
    font-family: inherit;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    /* #13 Hover: fill fades out to a transparent/outline state */
    transition: background-color var(--dur-fast) var(--ease-lux),
                color var(--dur-fast) var(--ease-lux),
                border-color var(--dur-fast) var(--ease-lux);
}

/* FIX: bumped specificity (.cta-section .cta-buttons ...) so this always
   wins over a global .btn:hover rule from style.css, regardless of
   stylesheet load order. */
.cta-section .cta-buttons a:hover,
.cta-section .cta-buttons button:hover {
    background-color: transparent;
    color: #ffffff;
    border-color: #ffffff;
}

/* --- Responsive Adjustments ---
   Masonry grid keeps the exact desktop layout (grid-column spans,
   margin-top offsets) on tablet and mobile per request — only the
   "Heart of the Studio" section stacks, and spacing/type scale down
   so everything stays usable down to 340px wide. */
@media (max-width: 992px) {
    .heart-content { flex-direction: column; gap: 30px; }
}

@media (max-width: 768px) {
    .hero {
        padding: 70px 20px; 
    }

    .hero h1 {
        font-size: 2.6rem;
    }

    .hero p {
        font-size: 0.9rem;
        margin-bottom: 32px;
    }

    .heart-section {
        padding: 60px 0;
        margin-bottom: 60px;
    }

    .heart-title {
        font-size: 1.4rem;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 36px;
    }

    .visionaries-section {
        padding-bottom: 60px;
    }

    .masonry-grid {
        gap: 40px 12px;
    }

    .member-info h3 {
        font-size: 1.2rem;
    }

    .cta-section {
        width: auto;
        margin: 48px 16px;
        padding: 48px 24px;
        border-radius: 16px;
    }

    .cta-section h2 {
        font-size: 2.2rem;
    }

    .cta-section p {
        font-size: 0.85rem;
        margin-bottom: 32px;
    }

    .cta-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .cta-buttons a,
    .cta-buttons button {
        box-sizing: border-box;
        width: 100%;
        padding: 16px 24px;
        font-size: 0.8rem;
        letter-spacing: 0.05em;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 56px 16px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 0.7rem;
        letter-spacing: 1.5px;
    }

    .hero p {
        font-size: 0.85rem;
        margin-bottom: 24px;
    }

    .btn {
        padding: 14px 24px;
        font-size: 0.75rem;
    }

    .heart-section {
        padding: 48px 0;
        margin-bottom: 48px;
    }

    .heart-title {
        font-size: 1.2rem;
    }

    .heart-text {
        font-size: 0.85rem;
        line-height: 1.7;
    }

    .section-title {
        font-size: 1.6rem;
        margin-bottom: 28px;
    }

    .visionaries-section {
        padding-bottom: 48px;
    }

    .masonry-grid {
        gap: 28px 8px;
    }

    .member-card {
        gap: 14px;
    }

    .member-1 { margin-top: 0; }
    .member-2 { margin-top: 60px; }
    .member-3 { margin-top: 10px; }
    .member-4 { margin-top: 40px; }
    .member-5 { margin-top: 30px; }

    .member-info h3 {
        font-size: 1rem;
    }

    .member-info p {
        font-size: 0.65rem;
        letter-spacing: 0.5px;
    }

    .cta-section {
        margin: 32px 12px;
        padding: 36px 18px;
        border-radius: 14px;
    }

    .cta-section h2 {
        font-size: 1.6rem;
    }

    .cta-section p {
        font-size: 0.8rem;
        margin-bottom: 24px;
    }
}

/* --- Mobile menu button alignment (team page) --- */
.nav-toggle {
    margin-right: -16px;
}

/* --- #15 Sticky header shrink --- */
header {
    transition: padding var(--dur-mid) var(--ease-lux),
                box-shadow var(--dur-mid) var(--ease-lux),
                transform var(--dur-mid) var(--ease-lux);
}

header.scrolled .header-inner {
    padding-top: 10px;
    padding-bottom: 10px;
}

header.scrolled {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
}

.header-inner {
    transition: padding var(--dur-mid) var(--ease-lux);
}

/* --- #16 Nav underline slide (center-out) --- */
header nav ul li a {
    position: relative;
    display: inline-block;
}

header nav ul li a::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -6px;
    width: 0;
    height: 1px;
    background-color: currentColor;
    transform: translateX(-50%);
    transition: width var(--dur-mid) var(--ease-lux);
}

header nav ul li a:hover::after,
header nav ul li a.nav-active::after {
    width: 100%;
}

/* --- #17 Page transition fade overlay --- */
.page-transition-overlay {
    position: fixed;
    inset: 0;
    background-color: var(--bg, #ffffff);
    z-index: 9999;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.5s var(--ease-lux);
}

.page-transition-overlay.hidden {
    opacity: 0;
}

.page-transition-overlay.leaving {
    opacity: 1;
    pointer-events: all;
}

/* --- #18 Custom cursor ring --- */
.cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(26, 26, 24, 0.6);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: width var(--dur-fast) var(--ease-spring),
                height var(--dur-fast) var(--ease-spring),
                background-color var(--dur-fast) var(--ease-lux),
                opacity var(--dur-fast) var(--ease-lux);
    opacity: 0;
    mix-blend-mode: difference;
}

.cursor-ring.active {
    opacity: 1;
}

.cursor-ring.hovering {
    width: 56px;
    height: 56px;
    background-color: rgba(26, 26, 24, 0.08);
}

/* Custom cursor is a desktop-only luxury detail — disable on touch/mobile */
@media (max-width: 992px), (pointer: coarse) {
    .cursor-ring {
        display: none;
    }
}