/* ==========================================
   TechSentinals // Editorial Showcase 3.0
   Pulsenova-inspired · Switzer + JetBrains Mono
   ========================================== */

:root {
    /* Warm brand palette */
    --bg: #F2EDE8;
    --bg-alt: #E8E2DA;
    --cream: #FEF9ED;
    --text: #1a1a1a;
    --text-muted: #6b6560;
    --text-light: #9e9892;
    --border: #d5cec5;
    --white: #fffdf9;
    --accent: #C4553A;

    /* Main-site nav tokens */
    --nav-bg: #FEF9ED;
    --nav-color: #5D524B;

    /* Typography */
    --font-sans: 'Switzer', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;

    /* Spacing */
    --section-pad: clamp(6rem, 12vh, 14rem);
    --side-pad: clamp(1.5rem, 5vw, 6rem);

    /* Transitions */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

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

html {
    font-size: 14.5px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: auto;
}

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

a { text-decoration: none; color: inherit; }
img, video { display: block; max-width: 100%; }
ul { list-style: none; }

/* Editorial display heading defaults */
h1, h2, h3 {
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.02;
}

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

/* Mono label utility — the editorial signature */
.mono-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-light);
}

.section-num {
    color: var(--accent);
    margin-right: 0.5rem;
}

/* ==========================================
   Scroll Progress
   ========================================== */
.scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0%;
    background: var(--accent);
    z-index: 9998;
    transition: width 0.1s linear;
    pointer-events: none;
}

/* ==========================================
   Preloader
   ========================================== */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.preloader.done {
    pointer-events: none;
}

.preloader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3.5rem;
    transition: opacity 0.5s ease;
}

.preloader.done .preloader-content {
    opacity: 0;
}

.preloader-logo-container {
    position: relative;
    width: clamp(140px, 20vw, 220px);
}

.preloader-logo {
    width: 100%;
    height: auto;
    display: block;
}

.preloader-logo.base {
    opacity: 0.15;
}

.preloader-logo-mask {
    position: absolute;
    inset: 0;
    clip-path: inset(0 100% 0 0);
    transition: clip-path 0.1s linear;
}

.preloader-loading-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    width: 280px;
}

.preloader-small-counter {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    min-width: 4ch;
}

.preloader-bar-bg {
    flex-grow: 1;
    height: 1px;
    background: rgba(26, 26, 26, 0.1);
    position: relative;
}

.preloader-bar-fill {
    position: absolute;
    left: 0; top: 0;
    height: 100%;
    width: 0%;
    background: var(--text);
    transition: width 0.1s linear;
}

/* ==========================================
   Navigation (floating pill — mirrors main site)
   ========================================== */
.nav {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    z-index: 10000;
    padding: clamp(0.9rem, 2vh, 1.4rem) var(--side-pad);
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.nav-pill {
    pointer-events: auto;
    width: 100%;
    max-width: 1180px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    background: var(--nav-bg);
    color: var(--nav-color);
    border: 1px solid rgba(93, 82, 75, 0.08);
    border-radius: 20px;
    padding: 0.7rem 0.8rem 0.7rem 1.5rem;
    box-shadow: 0 4px 60px rgba(93, 82, 75, 0.16);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: transform 0.5s var(--ease-out-expo), opacity 0.4s ease;
    will-change: transform;
}

.nav.hidden .nav-pill {
    transform: translateY(calc(-100% - clamp(0.9rem, 2vh, 1.4rem)));
    opacity: 0;
}

.nav-logo-link { display: flex; align-items: center; flex-shrink: 0; }
.nav-logo { height: 30px; width: auto; }

.nav-menu { display: flex; align-items: center; gap: 0.3rem; }

.nav-menu > li > a {
    position: relative;
    display: inline-block;
    padding: 0.55rem 1rem;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--nav-color);
    border-radius: 100px;
    transition: color 0.3s ease;
}

.nav-menu > li > a:not(.nav-cta-pill)::after {
    content: '';
    position: absolute;
    left: 1rem; right: 1rem; bottom: 0.35rem;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s var(--ease-out-expo);
}

.nav-menu > li > a:not(.nav-cta-pill):hover { color: var(--accent); }
.nav-menu > li > a:not(.nav-cta-pill):hover::after { transform: scaleX(1); }

.nav-cta-pill {
    background: var(--accent);
    color: var(--nav-bg) !important;
    font-weight: 600 !important;
}
.nav-cta-pill::after { display: none; }
.nav-cta-pill:hover { background: var(--text); transform: translateY(-1px); }

.nav-burger {
    display: none;
    width: 44px; height: 44px;
    border: none; background: transparent;
    position: relative; cursor: pointer; flex-shrink: 0;
}

.nav-burger span {
    position: absolute; left: 50%;
    width: 20px; height: 2px;
    background: var(--nav-color); border-radius: 2px;
    transform: translateX(-50%);
    transition: transform 0.4s var(--ease-out-expo), opacity 0.3s ease;
}

.nav-burger span:nth-child(1) { top: calc(50% - 4px); }
.nav-burger span:nth-child(2) { top: calc(50% + 4px); }

body.is-menu-open .nav-burger span:nth-child(1) { top: 50%; transform: translateX(-50%) rotate(45deg); }
body.is-menu-open .nav-burger span:nth-child(2) { top: 50%; transform: translateX(-50%) rotate(-45deg); }

/* Mobile menu panel */
.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: var(--nav-bg);
    color: var(--nav-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 6rem var(--side-pad) 3rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-2%);
    transition: opacity 0.5s var(--ease-out-expo), transform 0.6s var(--ease-out-expo), visibility 0.5s;
}

body.is-menu-open .mobile-menu { opacity: 1; visibility: visible; transform: translateY(0); }

.mobile-menu-list { display: flex; flex-direction: column; gap: 0.25rem; margin-top: auto; }

.mobile-menu-list a {
    font-family: var(--font-sans);
    font-size: clamp(2.2rem, 9vw, 3.5rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--nav-color);
    display: inline-block;
    padding: 0.4rem 0;
    opacity: 0;
    transform: translateY(20px);
    transition: color 0.3s ease;
}

body.is-menu-open .mobile-menu-list a { animation: mobileLinkIn 0.6s var(--ease-out-expo) forwards; }
body.is-menu-open .mobile-menu-list li:nth-child(1) a { animation-delay: 0.1s; }
body.is-menu-open .mobile-menu-list li:nth-child(2) a { animation-delay: 0.16s; }
body.is-menu-open .mobile-menu-list li:nth-child(3) a { animation-delay: 0.22s; }
body.is-menu-open .mobile-menu-list li:nth-child(4) a { animation-delay: 0.28s; }
body.is-menu-open .mobile-menu-list li:nth-child(5) a { animation-delay: 0.34s; }
.mobile-menu-list a:hover { color: var(--accent); }

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

.mobile-menu-footer {
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid rgba(93, 82, 75, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    opacity: 0.7;
}

/* ==========================================
   Hero — Fullscreen rotating media showreel
   ========================================== */
.hero {
    position: relative;
    height: 100vh;
    min-height: 640px;
    overflow: hidden;
    background: var(--bg);
    cursor: none;
    --mx: 50%;
    --my: 42%;
}

.hero-media { position: absolute; inset: 0; z-index: 0; }

.hero-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transform: scale(1.08);
    transition: opacity 1.4s var(--ease-out-quart);
    will-change: opacity, transform;
}

.hero-slide video {
    width: 100%; height: 100%;
    object-fit: cover;
}

.hero-slide.is-active {
    opacity: 1;
    animation: kenBurns 8s ease-out forwards;
}

@keyframes kenBurns {
    from { transform: scale(1.12); }
    to { transform: scale(1); }
}

/* Soft cream wash so dark text reads; image stays strongest toward upper-right */
.hero-scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(to top, rgba(242,237,232,0.78) 0%, rgba(242,237,232,0.18) 46%, rgba(242,237,232,0.50) 100%),
        radial-gradient(120% 90% at 82% 4%, rgba(196,85,58,0.10), transparent 55%);
}

/* Frosted glass layer — a radial hole at the cursor reveals the sharp image beneath */
.hero-blur {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: rgba(242, 237, 232, 0.45);
    -webkit-backdrop-filter: blur(40px) saturate(1.4);
    backdrop-filter: blur(40px) saturate(1.4);
    -webkit-mask: radial-gradient(circle 250px at var(--mx) var(--my), transparent 0, transparent 120px, #000 300px);
    mask: radial-gradient(circle 250px at var(--mx) var(--my), transparent 0, transparent 120px, #000 300px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero.hero-revealed .hero-blur {
    opacity: 0;
}

.hero-cursor {
    position: absolute;
    top: var(--my);
    left: var(--mx);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10;
    background: var(--cream);
    color: var(--nav-color);
    padding: 0.75rem 1.4rem;
    border-radius: 100px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.hero:hover .hero-cursor {
    opacity: 1;
}

.hero.hero-revealed .hero-cursor {
    opacity: 0;
}

.hero.hero-revealed {
    cursor: auto;
}

.hero-overlay {
    position: relative;
    z-index: 3;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(6rem, 13vh, 9rem) var(--side-pad) clamp(2.5rem, 5vh, 4rem);
    color: var(--text);
}

.hero-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    opacity: 0;
}
.hero-top .mono-label { color: var(--text-muted); }

.hero-center { display: flex; align-items: center; }

.hero-title {
    font-family: var(--font-sans);
    font-size: clamp(2.5rem, 8.5vw, 9.5rem);
    font-weight: 600;
    line-height: 1.0;
    letter-spacing: -0.045em;
    color: var(--text);
    /* soft cream halo so dark type stays crisp over any busier patch */
    text-shadow: 0 1px 28px rgba(242, 237, 232, 0.75);
}

/* generous vertical room so ascenders/descenders are never clipped by the reveal mask */
.hero-line {
    display: block;
    overflow: hidden;
    padding: 0.14em 0.04em 0.16em;
    margin-bottom: -0.08em;
}

.hero-word {
    display: inline-block;
    transform: translateY(115%);
    will-change: transform;
}

.hero-title .lit { color: var(--accent); }

.hero-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 2rem;
}

.hero-sub {
    font-size: clamp(1rem, 1.3vw, 1.2rem);
    color: var(--text-muted);
    max-width: 460px;
    line-height: 1.6;
    opacity: 0;
    transform: translateY(20px);
}

.hero-controls {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    opacity: 0;
    transform: translateY(20px);
}

.hero-progress {
    width: 120px;
    height: 2px;
    background: rgba(26, 26, 26, 0.15);
    border-radius: 2px;
    overflow: hidden;
}

.hero-progress span {
    display: block;
    height: 100%;
    width: 0%;
    background: var(--text);
}

.hero-playpause {
    width: 42px; height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(26, 26, 26, 0.22);
    background: rgba(255, 253, 249, 0.55);
    color: var(--text);
    cursor: pointer;
    font-size: 0.7rem;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.3s ease, transform 0.3s ease;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.hero-playpause:hover { background: rgba(255, 253, 249, 0.9); transform: scale(1.06); }
.hero-playpause .pp-play { display: none; }
.hero-playpause[data-playing="false"] .pp-pause { display: none; }
.hero-playpause[data-playing="false"] .pp-play { display: inline; }

/* ==========================================
   Marquee
   ========================================== */
.marquee-section {
    padding: 2.5rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    background: var(--bg);
    /* Blur fade on both edges */
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 18%,
        black 82%,
        transparent 100%
    );
    mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 18%,
        black 82%,
        transparent 100%
    );
}

.marquee-track {
    display: flex;
    animation: marqueeScroll 30s linear infinite;
    width: max-content;
}

.marquee-item {
    display: flex;
    align-items: center;
    gap: 3rem;
    padding: 0 3rem;
    white-space: nowrap;
    font-family: var(--font-sans);
    font-size: clamp(1.4rem, 2.4vw, 2.1rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--text);
}

.marquee-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }

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

/* ==========================================
   Work — Editorial hover-reveal grid
   ========================================== */
.work-section {
    padding: var(--section-pad) var(--side-pad);
}

.work-header {
    max-width: 1500px;
    margin: 0 auto 4rem;
}

.work-header .mono-label { display: block; margin-bottom: 1.5rem; }

.work-heading {
    font-size: clamp(2.6rem, 6vw, 6rem);
    font-weight: 600;
    letter-spacing: -0.045em;
    margin-bottom: 1.5rem;
}

.work-intro { display: block; }

.filter-bar {
    max-width: 1500px;
    margin: 0 auto 4rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.filter-chip {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    transition: all 0.4s var(--ease-out-expo);
    white-space: nowrap;
}

.filter-chip:hover { color: var(--text); border-color: var(--text-muted); }
.filter-chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }

.work-grid {
    max-width: 1500px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: clamp(1.5rem, 4vw, 4rem);
    row-gap: clamp(3rem, 7vw, 7rem);
}

/* editorial vertical rhythm */
.work-item:nth-child(even) { margin-top: clamp(2rem, 8vw, 7rem); }

.work-item {
    cursor: pointer;
    display: block;
}

.work-item.is-hidden { display: none; }

.work-media {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 18px;
    overflow: hidden;
    background: var(--bg-alt);
    box-shadow: 0 20px 60px rgba(0,0,0,0.06);
}

.work-media::after {
    content: '';
    position: absolute; inset: 0;
    border-radius: 18px;
    border: 1px solid rgba(0,0,0,0.06);
    pointer-events: none;
    z-index: 3;
}

.work-media img {
    position: absolute;
    top: -7.5%;
    left: 0;
    width: 100%;
    height: 115%;
    object-fit: cover;
    object-position: center;
    transition: filter 0.6s ease;
    will-change: transform;
}

.work-item:hover .work-media img { filter: brightness(0.92); }

.work-view {
    position: absolute;
    left: 18px; bottom: 18px;
    z-index: 4;
    color: var(--cream);
    background: rgba(26, 26, 26, 0.55);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.15);
    padding: 0.55rem 1rem;
    border-radius: 100px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s var(--ease-out-expo), transform 0.5s var(--ease-out-expo);
}

.work-item:hover .work-view { opacity: 1; transform: translateY(0); }

.work-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-top: 1.4rem;
}

.work-title {
    font-size: clamp(1.4rem, 2vw, 1.9rem);
    font-weight: 600;
    letter-spacing: -0.025em;
    transition: color 0.3s ease;
}

.work-item:hover .work-title { color: var(--accent); }

.work-cat { white-space: nowrap; text-align: right; }

/* ==========================================
   Capabilities
   ========================================== */
.capabilities-section {
    padding: var(--section-pad) var(--side-pad);
    max-width: 1500px;
    margin: 0 auto;
}

.cap-header { margin-bottom: 4rem; }
.cap-header .mono-label { display: block; margin-bottom: 1.5rem; }

.cap-heading {
    font-size: clamp(2.6rem, 5vw, 5rem);
    font-weight: 600;
    letter-spacing: -0.04em;
}

.cap-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    background: var(--border);
    border-radius: 24px;
    overflow: hidden;
}

.cap-card {
    background: var(--bg);
    padding: clamp(2rem, 3vw, 3.5rem);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 320px;
    position: relative;
    overflow: hidden;
    transition: background 0.5s ease, transform 0.6s var(--ease-out-expo), box-shadow 0.6s ease;
    z-index: 1;
}

.cap-card:hover {
    background: var(--white);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 60px rgba(93, 82, 75, 0.15);
    z-index: 5;
}

/* The character image that lives behind the text */
.cap-card-character {
    position: absolute;
    bottom: -30%;
    right: -15%;
    width: 80%;
    max-width: 280px;
    height: auto;
    opacity: 0;
    transform: scale(0.6) translateY(40px);
    transition: opacity 0.6s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
    pointer-events: none;
    z-index: 0;
    filter: saturate(1.1);
}

.cap-card:hover .cap-card-character {
    opacity: 0.3;
    transform: scale(1) translateY(0);
    animation: characterRoam 5s ease-in-out infinite 0.5s;
}

/* Text content stays above character */
.cap-card-number,
.cap-card-content {
    position: relative;
    z-index: 2;
}

.cap-card-number {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    transition: color 0.5s ease;
}

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

.cap-card-title {
    font-size: 1.45rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

.cap-card-body { font-size: 0.95rem; color: var(--text-muted); line-height: 1.6; }

/* The roaming animation — character floats around gently */
@keyframes characterRoam {
    0%   { transform: scale(1) translate(0, 0) rotate(0deg); }
    20%  { transform: scale(1.03) translate(10px, -15px) rotate(2deg); }
    40%  { transform: scale(0.98) translate(-8px, -8px) rotate(-1.5deg); }
    60%  { transform: scale(1.02) translate(12px, 5px) rotate(1deg); }
    80%  { transform: scale(0.99) translate(-5px, -12px) rotate(-2deg); }
    100% { transform: scale(1) translate(0, 0) rotate(0deg); }
}

/* ==========================================
   Stats
   ========================================== */
.stats-section { padding: var(--section-pad) var(--side-pad); }

.stats-inner {
    max-width: 1500px;
    margin: 0 auto;
    background-color: var(--text);
    border-radius: 32px;
    padding: clamp(4rem, 7vw, 7rem) clamp(2rem, 5vw, 5rem);
    position: relative;
    overflow: hidden;
}

.stats-pixel-grid {
    position: absolute;
    inset: 0;
    display: grid;
    z-index: 0;
    pointer-events: none;
    overflow: visible;
    gap: 1px;
    perspective: 800px;
    transform-style: preserve-3d;
}

.stats-pixel {
    background-color: rgba(255, 255, 255, 0.02);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.5s ease,
                box-shadow 0.5s ease;
    transform-origin: center center;
    transform-style: preserve-3d;
}

.stats-pixel.pop {
    background-color: rgba(196, 85, 58, 0.75);
    transform: translateZ(18px) scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6),
                0 4px 8px rgba(0, 0, 0, 0.4),
                inset 0 1px 0 rgba(255, 200, 170, 0.25);
    transition: transform 0.05s ease-out,
                background-color 0.05s ease-out,
                box-shadow 0.05s ease-out;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    text-align: center;
    position: relative;
    z-index: 2;
}

.stat-item { padding: 2rem; }

.stat-number {
    font-family: var(--font-sans);
    font-size: clamp(3.5rem, 6vw, 5.5rem);
    font-weight: 600;
    letter-spacing: -0.04em;
    color: var(--bg);
    line-height: 1;
    margin-bottom: 1rem;
}

.stat-suffix { font-size: 0.6em; font-weight: 400; opacity: 0.7; }

.stat-label { color: var(--text-light); }

/* ==========================================
   Testimonials
   ========================================== */
.testimonials-section { padding: var(--section-pad) 0; overflow: hidden; }

.testi-header { padding: 0 var(--side-pad); max-width: 1500px; margin: 0 auto 4rem; }
.testi-header .mono-label { display: block; margin-bottom: 1.5rem; }

.testi-heading {
    font-size: clamp(2.4rem, 5vw, 4.5rem);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.testi-grid {
    max-width: 1500px;
    margin: 0 auto 5rem;
    padding: 0 var(--side-pad);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.testi-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2.5rem;
    transition: transform 0.5s var(--ease-out-expo), box-shadow 0.5s var(--ease-out-expo);
}

.testi-card:hover { transform: translateY(-6px); box-shadow: 0 30px 70px rgba(0, 0, 0, 0.07); }

.testi-card blockquote {
    font-size: 1.15rem;
    line-height: 1.55;
    color: var(--text);
    font-weight: 500;
    letter-spacing: -0.01em;
}

.testi-card figcaption { display: flex; flex-direction: column; gap: 0.35rem; }
.testi-name { font-weight: 600; color: var(--text); }

.clients-strip {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 2rem 0;
    overflow: hidden;
    /* Blur fade on both edges */
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 16%,
        black 84%,
        transparent 100%
    );
    mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 16%,
        black 84%,
        transparent 100%
    );
}

.clients-track {
    display: flex;
    width: max-content;
    align-items: center;
    gap: 4rem;
    animation: clientsScroll 28s linear infinite;
}

.client-item {
    font-family: var(--font-sans);
    font-size: clamp(1.3rem, 2vw, 1.8rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--text-light);
    white-space: nowrap;
    transition: color 0.3s ease;
}

.client-item:hover { color: var(--accent); }

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

/* ==========================================
   FAQ
   ========================================== */
.faq-section { padding: var(--section-pad) var(--side-pad); max-width: 1000px; margin: 0 auto; }
.faq-section > .mono-label { display: block; margin-bottom: 1.5rem; }

.faq-heading {
    font-size: clamp(2.2rem, 4vw, 3.6rem);
    font-weight: 600;
    margin-bottom: 3.5rem;
    letter-spacing: -0.035em;
}

.faq-list { display: flex; flex-direction: column; }

.faq-item { border-bottom: 1px solid var(--border); cursor: pointer; overflow: hidden; }
.faq-item:first-child { border-top: 1px solid var(--border); }

.faq-question {
    padding: 2rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: clamp(1.1rem, 1.7vw, 1.45rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--text);
    transition: color 0.3s ease;
}

.faq-item:hover .faq-question { color: var(--accent); }

.faq-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; font-weight: 300;
    flex-shrink: 0;
    transition: all 0.4s var(--ease-out-expo);
    color: var(--text);
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.5s var(--ease-out-expo); }
.faq-answer-inner { padding-bottom: 2rem; font-size: 1.02rem; color: var(--text-muted); line-height: 1.7; max-width: 700px; }
.faq-item.active .faq-answer { max-height: 400px; }

/* ==========================================
   Footer
   ========================================== */
.site-footer { padding: 6rem var(--side-pad) 3rem; border-top: 1px solid var(--border); }

.footer-top {
    max-width: 1500px;
    margin: 0 auto 6rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 4rem;
}

.footer-cta-text {
    font-size: clamp(2.4rem, 5vw, 4.5rem);
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1.05;
    max-width: 760px;
}

.footer-link-btn {
    background: var(--text);
    color: var(--bg);
    padding: 1.2rem 2.5rem;
    border-radius: 100px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.4s var(--ease-out-expo);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    margin-top: 1rem;
}

.footer-link-btn:hover { background: var(--accent); transform: scale(1.03); }

.footer-bottom {
    max-width: 1500px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.footer-logo { height: 26px; opacity: 0.6; }
.footer-copy { color: var(--text-light); }
.footer-links-row { display: flex; gap: 2rem; }
.footer-sm-link { color: var(--text-muted); transition: color 0.3s; }
.footer-sm-link:hover { color: var(--text); }

/* ==========================================
   Modal
   ========================================== */
.project-modal {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.project-modal.active { opacity: 1; pointer-events: auto; }

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(242, 237, 232, 0.6);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
}

.modal-container {
    position: relative;
    width: 95%;
    max-width: 1100px;
    max-height: 92vh;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: 0 50px 120px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    transform: scale(0.92) translateY(20px);
    transition: transform 0.6s var(--ease-out-expo);
}

.project-modal.active .modal-container { transform: scale(1) translateY(0); }

.modal-close {
    position: absolute;
    top: 24px; right: 24px;
    background: var(--text);
    color: var(--bg);
    border: none;
    width: 44px; height: 44px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: transform 0.4s var(--ease-out-expo);
    font-size: 1.1rem;
}

.modal-close:hover { transform: rotate(90deg) scale(1.1); }

.modal-content {
    display: grid;
    grid-template-columns: 1fr 380px;
    height: 90vh;
    max-height: 90vh;
}

.modal-gallery {
    overflow-y: auto;
    background: var(--bg);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: 100%;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.modal-gallery img,
.modal-gallery video {
    width: 100%;
    height: auto;
    border-radius: 16px;
    display: block;
    object-fit: cover;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    transition: transform 0.5s var(--ease-out-expo);
}

.modal-gallery img:hover, .modal-gallery video:hover { transform: scale(1.015); }

.modal-text {
    padding: 3.5rem 3rem;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border);
    background: var(--white);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.modal-category-label { display: block; margin-bottom: 1rem; }

.modal-title {
    font-size: 2.4rem;
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1.05;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.modal-description { font-size: 1.05rem; line-height: 1.7; color: var(--text-muted); margin-bottom: 2.5rem; }
.modal-footer { margin-top: auto; }

.locally-deployed-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(196, 85, 58, 0.08);
    color: var(--accent) !important;
    border: 1px solid rgba(196, 85, 58, 0.2);
    padding: 0.65rem 1.3rem;
    border-radius: 100px;
}

.btn-solid {
    background: var(--text);
    color: var(--bg);
    padding: 1rem 2rem;
    border-radius: 100px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.4s var(--ease-out-expo);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-solid:hover { background: var(--accent); transform: scale(1.03); }

/* ==========================================
   Reveal Animations
   ========================================== */
.reveal-up { opacity: 0; transform: translateY(50px); }

/* ==========================================
   Responsive — Real-World Device Fixes
   ========================================== */

/* ==========================================
   GLOBAL OVERFLOW GUARD
   Prevents any element from causing
   horizontal scroll on any screen size
   ========================================== */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* ==========================================
   SAFE AREA / NOTCH SUPPORT
   For iPhone notch, Dynamic Island,
   Android punch-hole cameras
   ========================================== */
:root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
}

/* ---- 1100px: wide tablet ---- */
@media (max-width: 1100px) {
    .cap-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .testi-grid { grid-template-columns: 1fr; max-width: 640px; }
    .work-grid { column-gap: clamp(1rem, 3vw, 2.5rem); }
}

/* ---- 900px: tablet portrait ---- */
@media (max-width: 900px) {
    /* Nav */
    .nav-menu { display: none; }
    .nav-burger { display: block; }
    .nav-pill {
        padding: 0.6rem 0.6rem 0.6rem 1.25rem;
        gap: 1rem;
    }
    /* Prevent nav from overflowing narrow tablets */
    .nav-pill { max-width: calc(100% - 2 * var(--side-pad)); }

    /* Hero */
    .hero-bottom { flex-direction: column; align-items: flex-start; gap: 1.5rem; }
    .hero-top .hero-loc { display: none; }

    /* Footer */
    .footer-top { flex-direction: column; gap: 2.5rem; }

    /* Modal */
    .modal-content { grid-template-columns: 1fr; height: auto; max-height: 100%; }
    .modal-gallery { max-height: 52vh; }
    .modal-text { padding: 2.5rem 2rem; border-left: none; border-top: 1px solid var(--border); }
    .modal-title { font-size: 1.9rem; }
    .modal-container { max-height: 95vh; overflow-y: auto; }
}

/* ---- 768px: mobile ---- */
@media (max-width: 768px) {
    :root {
        --section-pad: clamp(3.5rem, 9vh, 7rem);
        --side-pad: 1.1rem;
    }

    /* ---- NAV ---- */
    /* Ensure nav pill never overflows screen width */
    .nav {
        padding-left: max(var(--side-pad), var(--safe-left));
        padding-right: max(var(--side-pad), var(--safe-right));
        padding-top: max(clamp(0.7rem, 1.8vh, 1.2rem), var(--safe-top));
    }
    .nav-pill {
        width: 100%;
        max-width: 100%;
        gap: 0;
        border-radius: 16px;
    }
    /* Force logo + burger to be all that's shown */
    .nav-menu { display: none !important; }
    .nav-burger {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
    }

    /* ---- MOBILE MENU ---- */
    /* Account for notch/safe area inside menu */
    .mobile-menu {
        padding-top: max(5rem, calc(4rem + var(--safe-top)));
        padding-bottom: max(2rem, calc(1.5rem + var(--safe-bottom)));
        padding-left: max(var(--side-pad), var(--safe-left));
        padding-right: max(var(--side-pad), var(--safe-right));
    }
    /* Prevent menu links from overflowing */
    .mobile-menu-list a {
        font-size: clamp(1.8rem, 8vw, 3rem);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    .mobile-menu-footer {
        flex-wrap: wrap;
        gap: 0.5rem;
        font-size: 0.78rem;
    }

    /* ---- HERO ---- */
    /* Use dvh (dynamic viewport height) for true full-screen on mobile
       accounting for browser chrome showing/hiding */
    .hero {
        min-height: 100dvh;
        height: 100dvh;
        cursor: auto;
    }
    /* Fallback for browsers that don't support dvh */
    @supports not (height: 100dvh) {
        .hero { height: 100svh; min-height: 100svh; }
    }
    .hero-overlay {
        padding-top: max(5.5rem, calc(4.5rem + var(--safe-top)));
        padding-bottom: max(2rem, calc(1.5rem + var(--safe-bottom)));
        padding-left: var(--side-pad);
        padding-right: var(--side-pad);
    }
    .hero-center {
        margin-top: auto;
        margin-bottom: 1.5rem;
        /* Prevent any horizontal overflow on the title */
        overflow: hidden;
        width: 100%;
    }
    .hero-title {
        font-size: clamp(2.6rem, 13vw, 4.5rem);
        /* Allow title to wrap naturally */
        word-break: break-word;
        hyphens: none;
    }
    .hero-sub {
        font-size: clamp(0.88rem, 3.5vw, 1rem);
        max-width: 100%;
        line-height: 1.55;
    }
    .hero-controls {
        width: 100%;
        justify-content: flex-start;
        gap: 1rem;
    }
    .hero-progress { flex: 1; max-width: 120px; }
    /* Disable cursor effects entirely on touch */
    .hero { cursor: auto; }
    .hero-cursor { display: none !important; }
    /* Disable blur reveal on touch — costs perf & has no hover */
    .hero-blur { display: none; }
    .hero-top { flex-wrap: wrap; gap: 0.5rem; }

    /* ---- MARQUEE ---- */
    /* Slow down slightly on mobile for readability */
    .marquee-track { animation-duration: 22s; }
    .marquee-item {
        font-size: clamp(1rem, 4.5vw, 1.5rem);
        gap: 1.5rem;
        padding: 0 1.5rem;
    }
    .marquee-dot { width: 5px; height: 5px; }

    /* ---- WORK SECTION ---- */
    .work-section { overflow: hidden; }
    .work-grid {
        grid-template-columns: 1fr;
        row-gap: 2.5rem;
    }
    .work-item:nth-child(even) { margin-top: 0; }
    /* Letterbox ratio for images on mobile */
    .work-media { aspect-ratio: 3 / 2; border-radius: 14px; }
    .work-media img { top: 0; height: 100%; }
    .work-header { margin-bottom: 2rem; }
    .work-heading { font-size: clamp(2rem, 9vw, 3.2rem); }
    .filter-bar { gap: 0.4rem; margin-bottom: 2rem; }
    /* Work meta row: stack on mobile */
    .work-meta { flex-direction: column; gap: 0.2rem; margin-top: 1rem; }
    .work-cat { text-align: left; }
    .work-title { font-size: clamp(1.2rem, 5vw, 1.6rem); }

    /* ---- CAPABILITIES ---- */
    .capabilities-section { overflow: hidden; }
    .cap-grid {
        grid-template-columns: 1fr;
        gap: 2px;
        border-radius: 18px;
    }
    .cap-card { min-height: auto; padding: 1.75rem 1.5rem; }
    .cap-heading { font-size: clamp(1.8rem, 8vw, 2.8rem); }
    .cap-card-title { font-size: 1.2rem; }
    .cap-card-body { font-size: 0.88rem; }

    /* ---- STATS ---- */
    .stats-section { padding: var(--section-pad) var(--side-pad); overflow: hidden; }
    .stats-inner {
        border-radius: 20px;
        padding: clamp(2.5rem, 7vw, 4rem) clamp(1rem, 4vw, 2.5rem);
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0;
    }
    .stat-item {
        padding: 1.25rem 0.75rem;
        /* Add inner border between cells */
        border-bottom: 1px solid rgba(242, 237, 232, 0.1);
    }
    /* Remove bottom border on last row */
    .stat-item:nth-child(3),
    .stat-item:nth-child(4) { border-bottom: none; }
    /* Add right border between the 2 columns */
    .stat-item:nth-child(odd) { border-right: 1px solid rgba(242, 237, 232, 0.1); }
    .stat-number { font-size: clamp(2.4rem, 9vw, 3.5rem); }
    .stat-label { font-size: 0.72rem; }

    /* ---- TESTIMONIALS ---- */
    .testimonials-section { overflow: hidden; }
    .testi-grid {
        grid-template-columns: 1fr;
        padding: 0 var(--side-pad);
        gap: 1rem;
    }
    .testi-card {
        padding: 1.75rem;
        border-radius: 18px;
        gap: 1.75rem;
    }
    .testi-heading { font-size: clamp(1.8rem, 8vw, 2.8rem); }
    .testi-card blockquote { font-size: 1rem; line-height: 1.6; }
    /* Client strip */
    .clients-track { gap: 2rem; }
    .client-item { font-size: clamp(1.1rem, 3.5vw, 1.4rem); }

    /* ---- FAQ ---- */
    .faq-section {
        max-width: 100%;
        overflow: hidden;
    }
    .faq-heading { font-size: clamp(1.6rem, 7vw, 2.5rem); margin-bottom: 2rem; }
    .faq-question {
        font-size: clamp(0.95rem, 3.8vw, 1.15rem);
        padding: 1.25rem 0;
        gap: 1rem;
    }
    .faq-icon { width: 30px; height: 30px; font-size: 1rem; flex-shrink: 0; }
    .faq-answer-inner { font-size: 0.92rem; line-height: 1.65; }

    /* ---- FOOTER ---- */
    .site-footer {
        padding: 3.5rem var(--side-pad) max(2rem, calc(1.5rem + var(--safe-bottom)));
    }
    .footer-top { flex-direction: column; gap: 1.75rem; }
    .footer-cta-text { font-size: clamp(1.8rem, 7.5vw, 2.8rem); }
    .footer-link-btn {
        width: 100%;
        justify-content: center;
        padding: 1rem 2rem;
        font-size: 0.9rem;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding-top: 1.5rem;
    }
    .footer-links-row { justify-content: center; flex-wrap: wrap; gap: 1rem; }
    .footer-logo { height: 22px; margin: 0 auto; }

    /* ---- MODAL ---- */
    .project-modal { align-items: flex-end; padding: 0; }
    .modal-backdrop { backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
    .modal-container {
        border-radius: 24px 24px 0 0;
        max-height: calc(92dvh - var(--safe-top));
        height: auto;
        width: 100%;
        transform: translateY(0) !important;
        padding-bottom: var(--safe-bottom);
    }
    .modal-content { grid-template-columns: 1fr; height: auto; max-height: 100%; }
    .modal-gallery { max-height: 45vh; padding: 1.25rem; gap: 1rem; }
    .modal-text { padding: 1.75rem 1.25rem; border-left: none; border-top: 1px solid var(--border); }
    .modal-title { font-size: 1.5rem; }
    .modal-description { font-size: 0.92rem; }
    .modal-close { top: 14px; right: 14px; width: 38px; height: 38px; font-size: 0.95rem; }
}

/* ---- 480px: small phones (iPhone SE, Galaxy A-series) ---- */
@media (max-width: 480px) {
    :root {
        --side-pad: 1rem;
    }

    /* Nav */
    .nav-pill { border-radius: 14px; padding: 0.5rem 0.5rem 0.5rem 1rem; }
    .nav-logo { height: 26px; }
    .nav-burger { width: 40px; height: 40px; }

    /* Hero */
    .hero-title { font-size: clamp(2.2rem, 12.5vw, 3.5rem); }
    .hero-sub { font-size: 0.85rem; }
    .hero-progress { max-width: 90px; }

    /* Capabilities */
    .cap-card { padding: 1.5rem 1.25rem; }
    .cap-card-number { font-size: 0.85rem; margin-bottom: 1.5rem; }
    .cap-card-title { font-size: 1.1rem; }

    /* Stats — keep 2-col but tighter */
    .stat-number { font-size: clamp(2rem, 9vw, 2.8rem); }
    .stat-item { padding: 1rem 0.5rem; }
    .stat-suffix { font-size: 0.55em; }

    /* Work */
    .work-heading { font-size: clamp(1.8rem, 9vw, 2.8rem); }
    /* Scrollable filter chips row */
    .filter-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
        scrollbar-width: none;
        -ms-overflow-style: none;
        gap: 0.4rem;
    }
    .filter-bar::-webkit-scrollbar { display: none; }
    .filter-chip {
        flex-shrink: 0;
        font-size: 0.68rem;
        padding: 0.5rem 1rem;
    }

    /* Testimonials */
    .testi-card { padding: 1.5rem; gap: 1.25rem; border-radius: 16px; }
    .testi-card blockquote { font-size: 0.95rem; }
    .testi-name { font-size: 0.9rem; }

    /* FAQ */
    .faq-question { padding: 1rem 0; gap: 0.75rem; }
    .faq-icon { width: 28px; height: 28px; }

    /* Footer */
    .footer-cta-text { font-size: clamp(1.6rem, 7.5vw, 2.4rem); }
    .footer-link-btn { padding: 0.9rem 1.5rem; }
    .footer-copy { font-size: 0.72rem; }

    /* Modal */
    .modal-gallery { max-height: 40vh; }
    .modal-title { font-size: 1.35rem; }
}

/* ---- 360px: very small phones (Galaxy A03, older androids) ---- */
@media (max-width: 360px) {
    :root {
        --side-pad: 0.9rem;
    }
    html { font-size: 13.5px; }

    .nav-logo { height: 22px; }
    .hero-title { font-size: clamp(2rem, 13vw, 3rem); }
    .stat-number { font-size: clamp(1.8rem, 10vw, 2.5rem); }
    .mobile-menu-list a { font-size: clamp(1.6rem, 8vw, 2.5rem); }
    .work-title { font-size: 1.05rem; }
    .cap-card { padding: 1.25rem 1rem; }
    .testi-card { padding: 1.25rem; }
    .footer-cta-text { font-size: clamp(1.4rem, 8vw, 2rem); }
    /* Stats: full width stack for very narrow screens */
    .stats-grid { grid-template-columns: 1fr; }
    .stat-item { border-right: none !important; border-bottom: 1px solid rgba(242, 237, 232, 0.1) !important; }
    .stat-item:last-child { border-bottom: none !important; }
    .stat-number { font-size: clamp(2.8rem, 12vw, 4rem); }
}

/* ---- LANDSCAPE MOBILE: short screens (phones held sideways) ---- */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: 100dvh;
        height: 100dvh;
    }
    .hero-overlay { padding-top: max(4rem, calc(2.5rem + var(--safe-top))); padding-bottom: 1rem; }
    .hero-center { margin-bottom: 0.5rem; }
    .hero-title { font-size: clamp(2rem, 7vw, 3.5rem); }
    /* Show the nav in landscape as it fits */
    .mobile-menu { padding-top: max(3.5rem, calc(3rem + var(--safe-top))); }
    .mobile-menu-list a { font-size: clamp(1.4rem, 5vh, 2.2rem); padding: 0.2rem 0; }
    .mobile-menu-list { gap: 0; }
}

/* ---- WIDE LANDSCAPE PHONES: 667px–900px landscape ---- */
@media (min-width: 560px) and (max-width: 900px) and (orientation: landscape) {
    .hero-title { font-size: clamp(2.5rem, 8vw, 5rem); }
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
    .stat-item:nth-child(odd) { border-right: none; }
    .cap-grid { grid-template-columns: repeat(2, 1fr); }
    .testi-grid { grid-template-columns: repeat(2, 1fr); }
    .work-grid { grid-template-columns: repeat(2, 1fr); }
    .work-item:nth-child(even) { margin-top: clamp(1rem, 4vw, 3rem); }
}

/* ==========================================
   Modal View Toggle & Transitions
   ========================================== */
.view-toggle {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    padding: 4px;
    position: relative;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}
.view-btn {
    position: relative;
    z-index: 2;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-family: 'JetBrains Mono', monospace;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    border-radius: 100px;
    transition: color 0.4s ease;
    font-family: var(--font-sans);
    white-space: nowrap;
    letter-spacing: 0.02em;
}

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

.view-btn.active {
    color: var(--bg);
}

.view-toggle-indicator {
    position: absolute;
    top: 0.35rem;
    left: 0.35rem;
    height: calc(100% - 0.7rem);
    background: var(--text);
    border-radius: 100px;
    transition: transform 0.5s var(--ease-out-expo), width 0.5s var(--ease-out-expo);
    z-index: 1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.gallery-fade-out {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.gallery-fade-in {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease 0.1s, transform 0.4s ease 0.1s;
}
.modal-gallery {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ==========================================
   Custom Scrollbar
   ========================================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ==========================================
   Reduced Motion
   ========================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    .reveal-up { opacity: 1 !important; transform: none !important; }
    .hero-word { transform: none !important; }
    .hero-top, .hero-sub, .hero-controls { opacity: 1 !important; transform: none !important; }
    .marquee-track, .clients-track { animation: none !important; }
    .hero-slide.is-active { animation: none !important; }
}

/* ==========================================
   Hidden States
   ========================================== */
.is-hidden { display: none !important; }
.hidden-by-limit { display: none !important; }



