/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { display: block; max-width: none; }
a, button { cursor: pointer; }

/* ─── Tokens ─── */
:root {
    --color-background: #0a0a0a;
    --color-background-secondary: #202020;
    --color-brass: #f1d9a8;
    --color-brass-deep: #b08d57;
    --color-dim: #6b6b6b;
    --color-foreground: #f4f1ea;
    --color-hermes-red: #b8332a;
    --border: rgba(244,241,234,0.2);
    --header-height: 104px;

    --inset-corner-y: 32px;
    --inset-corner-x: 40px;
    --mark-size-min: 24px;
    --mark-size-hero: 38px;

    --space-unit: 8px;
    --space-2x: 16px;
    --space-3x: 24px;
    --space-4x: 32px;
    --space-5x: 40px;
    --space-6x: 48px;
    --space-7x: 56px;
}

/* ─── Base ─── */
body {
    background: var(--color-background);
    color: var(--color-foreground);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    overflow-x: clip;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 200px 200px;
}

/* Simple bullet */
.bullet {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--color-brass);
    flex-shrink: 0;
}

/* Decorative center vertical line */
.v-line {
    position: relative;
    display: flex;
    justify-content: center;
    /*height: var(--vline-h, 35vh);*/
    overflow: hidden;
}
.v-line::after {
    content: '';
    display: block;
    width: 1px;
    height: 100%;
    background: var(--color-foreground);
    opacity: 0.2;
}
.v-line::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    width: 1px;
    height: 40px;
    transform: translateX(-50%);
    background: var(--color-brass);
    animation: vline-drop 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.v-line .bullet {
    position: absolute;
    left: 50%;
    transform: translate(-50%, 0);
}

@keyframes vline-drop {
    0%   {
        top: -20px;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        top: calc(100% - 40px);
        opacity: 0;
    }
}

/* ─── Lenis smooth scroll ─── */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* Scroll reveal  */
.js-reveal [data-reveal] {
    opacity: 0;
    will-change: opacity, transform, filter;
}
@media (prefers-reduced-motion: reduce) {
    .js-reveal [data-reveal] { opacity: 1; }
}

/* Primary button */
.btn-brass {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 18px 24px;
    background: var(--color-brass);
    color: var(--color-background);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 20px;
    text-transform: uppercase;
    text-decoration: none;
    border: none;
    white-space: nowrap;
    z-index: 2;
    cursor: pointer;
    transition: background 0.2s ease;
}
.btn-brass:hover { background: var(--color-brass-deep); }
.btn-brass img { width: 20px; height: 20px; }

/* Corner bracket decoration */
.corner-brackets {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.corner-brackets::before,
.corner-brackets::after,
.corner-brackets .br,
.corner-brackets .bl {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    opacity: 0.2;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}
.corner-brackets::before { top: 0; left: 0; border-top: 1px solid var(--color-foreground); border-left: 1px solid var(--color-foreground); }
.corner-brackets::after  { top: 0; right: 0; border-top: 1px solid var(--color-foreground); border-right: 1px solid var(--color-foreground); }
.corner-brackets .bl { bottom: 0; left: 0; border-bottom: 1px solid var(--color-foreground); border-left: 1px solid var(--color-foreground); }
.corner-brackets .br { bottom: 0; right: 0; border-bottom: 1px solid var(--color-foreground); border-right: 1px solid var(--color-foreground); }

/* Desktop Nav */
.nav-desktop {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    gap: var(--space-3x);
    padding: var(--space-4x) var(--space-7x);
    background: var(--color-background);
    z-index: 20;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-basis: 315px;
}

.nav-logo img {
    width: 40px;
    height: 40px;
}

.nav-links {
    flex-grow: 1;
    display: flex;
    gap: var(--space-4x);
}

.nav-links a {
    font-size: 14px;
    line-height: 20px;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--color-foreground);
    opacity: 0.48;
    white-space: nowrap;
    transition: color 0.2s ease, opacity 0.2s ease;
}
.nav-links a:hover {
    color: var(--color-brass);
    opacity: 1;
}
.nav-links a.active {
    color: var(--color-brass);
    opacity: 1;
}

.nav-coords {
    min-width: 250px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    line-height: 20px;
    white-space: nowrap;
}

.nav-coords span {
    opacity: 0.48;
}

/* Mobile Nav */
.nav-mobile {
    display: none;
    position: sticky;
    top: 0;
    align-items: center;
    gap: 36px;
    padding: var(--space-2x);
    z-index: 20;
    background: var(--color-background);
}
.nav-mobile-logo {
    display: flex;
    align-items: center;
    gap: var(--space-unit);
    flex: 1;
}
.nav-mobile-logo img { width: 40px; height: 40px; }
.logo-link { display: flex; }
.hamburger-btn {
    color: var(--color-brass);
    background: none;
    border: none;
    padding: 12px;
}

/* ═══════════════════════════════════════
   MOBILE MENU OVERLAY
════════════════════════════════════════ */
#mobile-menu {
    position: fixed;
    height: 100dvh;
    inset: 0;
    background: var(--color-background);
    z-index: 200;
    display: none;
    flex-direction: column;
}
#mobile-menu.open {
    display: flex;
}

.mm-header {
    display: flex;
    align-items: center;
    gap: 36px;
    padding: var(--space-2x);
}
.mm-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}
.mm-logo img { width: 40px; height: 40px; }
.mm-caption {
    font-size: 10px;
    line-height: 1;
    text-transform: uppercase;
    opacity: 0.48;
}
.mm-close {
    color: var(--color-brass);
    background: none;
    border: none;
    padding: 12px;
}

.mm-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-4x);
}
.mm-nav a {
    font-size: 24px;
    line-height: 32px;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--color-foreground);
    opacity: 0.48;
    transition: color 0.2s ease, opacity 0.2s ease;
}
.mm-nav a.active {
    color: var(--color-brass);
    opacity: 1;
}

.mm-coords {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 var(--space-2x) var(--space-4x);
    font-size: 14px;
    line-height: 20px;
}
.mm-coords span {
    opacity: 0.48;
}

/* ═══════════════════════════════════════
   HERO
════════════════════════════════════════ */
#hero {
    margin-bottom: 5px;
    position: relative;
    height: calc(100vh - var(--header-height, 0px));
    background: var(--color-background);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

#gl {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.vignette {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    z-index: 3;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 35%, rgba(10, 10, 10, 0.6) 100%);
}

/* Hero text */
.hero-text-container {
    /*position: relative;*/
    z-index: 10;
    padding: var(--space-7x);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: var(--space-3x);
}
.hero-text {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}
.hero-tagline {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    line-height: 20px;
    text-transform: uppercase;
}
.hero-tagline span {
    opacity: 0.48;
}
.hero-title {
    font-size: 88px;
    line-height: 96px;
    text-transform: uppercase;
    font-weight: 400;
}

.hero-email {
    font-family: inherit;
    font-size: 12px;
    line-height: 20px;
    color: var(--color-foreground);
    opacity: 0.48;
    text-decoration: none;
    white-space: nowrap;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    position: relative;
    transition: opacity 0.2s ease;
}
.hero-email:hover { opacity: 0.72; }

.copy-toast {
    position: fixed;
    right: var(--space-3x);
    bottom: var(--space-3x);
    z-index: 100;
    padding: 8px 12px;
    font-size: 12px;
    line-height: 1;
    color: var(--color-dim);
    background: rgba(20, 20, 20, 0.72);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(244, 241, 234, 0.08);
    border-radius: 2px;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.copy-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.hero-desktop-cta {
    display: flex;
    align-items: center;
    gap: var(--space-4x);
    /*margin-bottom: var(--space-2x);*/
}
.hero-mobile-cta {
    display: none;
}

/* ═══════════════════════════════════════
   SERVICES
════════════════════════════════════════ */
#services {
    position: relative;
    background: var(--color-background);
    min-height: calc(100vh - var(--header-height));
    display: flex;
    flex-direction: column;
}

#services .v-line {
    flex: 1;
    height: auto;
    min-height: 200px;
}
#services .v-line::after {
    height: auto;
    align-self: stretch;
}

.accordion-wrapper {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Accordion */
.accordion-content {
    overflow: hidden;
    transition: height 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 24px 56px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.section-marquee {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: var(--color-brass);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.section-header:hover .section-marquee {
    opacity: 1;
}

.section-marquee-track {
    display: flex;
    align-items: center;
    gap: 24px;
    white-space: nowrap;
    will-change: transform;
    /* duration set per-track in JS to equalize scroll speed across labels */
    animation: marquee-scroll 14s linear infinite;
}

.section-marquee-track span {
    font-size: 24px;
    line-height: 32px;
    text-transform: uppercase;
    color: var(--color-background);
    flex-shrink: 0;
}

.section-marquee-bullet {
    width: 6px;
    height: 6px;
    background: var(--color-background);
    flex-shrink: 0;
}

@keyframes marquee-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}
.section-header .label {
    flex: 1;
    font-size: 24px;
    line-height: 32px;
    text-transform: uppercase;
    opacity: 0.48;
}

.accordion-item:first-child .section-header {
    border-top: 1px solid var(--border);
}

.accordion-item.open .accordion-icon::after {
    transform: translate(-50%, -50%) rotate(90deg);
    opacity: 0;
}

/* Main 2-col panel */
.services-panel {
    display: flex;
    position: relative;
    border-bottom: 1px solid var(--border);
}
.services-left {
    width: 50%;
    flex-shrink: 0;
    padding: 56px 125px 56px 56px;
    display: flex;
    flex-direction: column;
    gap: 56px;
}
.services-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: -0.14px;
}
.services-body p { opacity: 0.48; }
.services-heading {
    opacity: 1;
    font-size: 18px;
    line-height: 24px;
    font-weight: 400;
    letter-spacing: normal;
    text-transform: uppercase;
}
.focus-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.services-body .focus-item-title {
    opacity: 1;
}

.services-tabs {
    display: flex;
    gap: 16px;
    align-items: center;
}
.tab {
    height: 56px;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-size: 14px;
    line-height: 20px;
    text-transform: uppercase;
    color: var(--color-foreground);
    background: none;
    border: 1px solid var(--border);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.35s ease;
}

.tab:hover {
    color: var(--color-foreground);
    border-color: var(--color-foreground);
}
.tab.active {
    border-color: var(--color-brass);
    color: var(--color-brass);
}

.paragraph-highlight {
    position: relative;
    padding: 24px;
}

.paragraph-highlight p {
    color: var(--color-brass);
    opacity: 1;
    font-size: 12px;
    font-style: normal;
    font-weight: 400;
    line-height: 16px; /* 133.333% */
    letter-spacing: -0.12px;
}

/* Panel divider */
.panel-divider {
    width: 1px;
    background: var(--border);
    flex-shrink: 0;
}

.services-right {
    flex: 1;
    padding: 56px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    transition: opacity 0.18s ease;
    gap: 24px;
    align-content: start;
}
.services-right.services-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 56px 125px 56px 56px;
}
.services-right:has(.active.text) {
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(50% + 1px);
    right: 0;
    overflow-y: auto;
    scrollbar-width: none;
}
.services-right:has(.active.text)::-webkit-scrollbar { display: none; }
/* Fades live on the panel (not the scroller) so they stay pinned to the visible
   edges instead of scrolling away with the content. Hidden by default and shown
   by JS (.fade-top / .fade-bottom) only when there's hidden content to reveal. */
.services-panel:has(.active.text)::before,
.services-panel:has(.active.text)::after {
    content: '';
    position: absolute;
    left: calc(50% + 1px);
    right: 0;
    height: 96px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1;
}
.services-panel:has(.active.text)::before {
    top: 0;
    background: linear-gradient(to bottom, var(--color-background), transparent);
}
.services-panel:has(.active.text)::after {
    bottom: 0;
    background: linear-gradient(to bottom, transparent, var(--color-background));
}
.services-panel.fade-top:has(.active.text)::before { opacity: 1; }
.services-panel.fade-bottom:has(.active.text)::after { opacity: 1; }

.tab-panel { display: none; }
.tab-panel.active { display: contents; }

.capabilities-placeholder {
    grid-column: 1 / -1;
    padding: 24px;
    border: 1px solid var(--border);
    font-size: 14px;
    line-height: 20px;
    text-transform: uppercase;
    opacity: 0.48;
}

/* Mini member card */
.mini-member {
    display: flex;
    gap: 8px;
    align-items: center;
    min-width: 0;
}
.mini-photo {
    width: 80px;
    height: 80px;
    border: 1px solid var(--color-brass);
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    background: linear-gradient(to bottom, #111 0%, #83765e 50%, #f1d9a8 100%);
}
.mini-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.mini-info {
    flex: 1;
    min-width: 0;
    padding: 0 16px;
    position: relative;
    height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}
.mini-name {
    font-size: 18px;
    line-height: 24px;
    letter-spacing: -0.18px;
}
.mini-role {
    font-size: 14px;
    line-height: 20px;
    letter-spacing: -0.14px;
    opacity: 0.48;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Services bottom CTA */
.services-cta {
    flex: 1;
    min-height: 0;
    display: flex;
    padding: 0 var(--space-2x);
    align-items: start;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.services-cta::before {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    left: 50%;
    width: 1px;
    transform: translateX(-50%);
    background: var(--color-foreground);
    opacity: 0.2;
}
.services-cta::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    width: 1px;
    height: 40px;
    transform: translateX(-50%);
    background: var(--color-brass);
    animation: vline-drop 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.services-cta .btn-brass {
    margin: var(--space-7x) auto;
}

/* ═══════════════════════════════════════
   TEAM
════════════════════════════════════════ */
/*#team {*/
/*    position: relative;*/
/*}*/

.team-container {
    width: 100%;
    position: relative;
}

.team-row {
    display: flex;
    align-items: flex-start;
    position: relative;
}

/* Left: terrain — sticks to the viewport (below the sticky header) while the
   taller right column scrolls. Pure CSS, fully fluid, no JS pin. */
.team-left {
    width: 50%;
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
}

img.team-terrain {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* Right: grid */
.team-right {
    width: 50%;
    padding: 58px 56px;
    position: relative;
}

.team-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: var(--space-5x);
}
.team-heading {
    font-size: 24px;
    line-height: 32px;
    font-weight: 400;
    text-transform: uppercase;
}
.team-header p {
    font-size: 14px;
    line-height: 20px;
    letter-spacing: -0.14px;
    opacity: 0.48;
}

/* Top / bottom fades */
.team-fade-top,
.team-fade-bottom {
    position: sticky;
    height: 150px;
    z-index: 9;
    pointer-events: none;
}
.team-fade-top {
    top: var(--header-height);
    margin-bottom: -150px;
    background: linear-gradient(180deg, var(--color-background) 0%, rgba(10, 10, 10, 0) 100%);
}
.team-fade-bottom {
    bottom: 0;
    height: 160px;
    margin-top: -160px;
    background: linear-gradient(0deg, var(--color-background) 0%, rgba(10, 10, 10, 0) 100%);
}

.team-slider {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.team-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.team-dots {
    display: none;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
}
.team-dot {
    width: 6px;
    height: 6px;
    background: var(--color-brass);
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.team-dot.active {
    transform: scale(2);
}
.team-photo {
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 1px solid var(--color-brass);
    overflow: hidden;
    position: relative;
    background: linear-gradient(to bottom, #111 0%, #83765e 50%, #f1d9a8 100%);
}
.team-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.team-details {
    height: 80px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    position: relative;
}
.team-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.team-name {
    font-size: 18px;
    line-height: 24px;
    letter-spacing: -0.18px;
}
.team-role {
    font-size: 14px;
    line-height: 20px;
    letter-spacing: -0.14px;
    opacity: 0.48;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.team-arrow {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--color-brass);
}

/* Bottom fade at the foot of the hero terrain */
.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 160px;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(10, 10, 10, 0.00) 0%, var(--color-background) 100%);
    z-index: 7;
}

/* Center divider — spans the team row, sits under the fades */
.team-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    background: var(--border);
    pointer-events: none;
    z-index: 5;
}

#team .services-cta {
    min-height: 300px;
}

/* ═══════════════════════════════════════
   OVERVIEW CTA (formerly blog)
════════════════════════════════════════ */
#blog {
    position: relative;
    min-height: calc(100vh - var(--header-height));
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#blog .v-line {
    flex: 1;
    height: auto;
    min-height: 0;
}
#blog .v-line::after {
    height: auto;
    align-self: stretch;
}
#blog .v-line::before {
    display: none;
}

.cta-panel {
    flex: 0 0 auto;
    margin: 0 var(--space-7x);
    padding: var(--space-7x);
    border: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-7x);
}
.cta-panel-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4x);
    max-width: 547px;
}
.cta-panel-heading {
    font-size: 24px;
    line-height: 32px;
    font-weight: 400;
    text-transform: uppercase;
}
.cta-panel-details {
    position: relative;
    width: 100%;
    max-width: 427px;
    padding: var(--space-3x);
}
.cta-panel-details p {
    font-size: 14px;
    line-height: 20px;
    letter-spacing: -0.14px;
}

#contact .v-line {
    height: calc((100vh - var(--header-height)) / 3);
}

/* ═══════════════════════════════════════
   FOOTER
════════════════════════════════════════ */
.footer-cta-container {
    padding: 0 var(--space-2x);
    display: flex;
    justify-content: center;
}
footer {
    padding: var(--space-7x);
}
.footer-bg {
    display: block;
    width: 100%;
    margin: 92px 0 0;
}
.footer-title {
    font-size: 105px;
    line-height: 120px;
    text-transform: uppercase;
    text-align: center;
    font-weight: 400;
    opacity: 0.2 !important;
    padding-bottom: var(--space-3x);
}
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    line-height: 20px;
    text-transform: uppercase;
}
.footer-bottom span {
    opacity: 0.48;
}
.footer-coords {
    display: flex;
    align-items: center;
    gap: 8px;
}
.footer-coords .bullet:first-child { display: none; }

/* ═══════════════════════════════════════
   MEDIUM  ≤ 1400px
════════════════════════════════════════ */
@media (max-width: 1400px) {
    .services-left {
        width: 50%;
        padding: 56px 56px 56px 56px;
    }
    .services-right {
        grid-template-columns: 1fr;
    }
    .services-right.services-body {
        padding: 56px;
    }
    .cta-panel {
        flex-wrap: wrap;
    }

    .footer-title {
        font-size: 76px;
        line-height: 90px;
    }
}

/* ═══════════════════════════════════════
   TEAM MEMBER POPUP
════════════════════════════════════════ */
#member-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
#member-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

#member-popup {
    position: fixed;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: var(--color-background);
    z-index: 101;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}
#member-popup.open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.popup-photo-wrap {
    /* --shrink (0..1) is driven by .popup-scroll's scrollTop in index.js */
    --photo-size: calc(160px - 80px * var(--shrink, 0));
    width: var(--photo-size);
    height: var(--photo-size);
    margin-bottom: 20px;
    border: 1px solid var(--color-brass);
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    background: linear-gradient(to bottom, #111 0%, #83765e 50%, #f1d9a8 100%);
    transition: width 0.2s ease-out, height 0.2s ease-out;
}
.popup-photo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.popup-close {
    position: absolute;
    top: 56px;
    right: 56px;
    z-index: 3;
    padding: 18px;
    flex-shrink: 0;
}

.popup-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0 56px 80px;
    scrollbar-width: none;
}
.popup-scroll::-webkit-scrollbar { display: none; }

.popup-identity {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--color-background);
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 56px 0 16px;
    /* Grow the margin by exactly what the photo loses, so total scroll
       height stays constant and short bios can't jitter at the clamp. */
    margin-bottom: calc(8px + 96px * var(--shrink, 0));
    transition: margin-bottom 0.2s ease-out;
}
/* Soften the edge where scrolling content slides under the sticky identity —
   mirrors .popup-bottom-fade at the foot of the popup. Shown by JS only once the
   content has actually scrolled (#member-popup.fade-top). */
.popup-identity::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 32px;
    background: linear-gradient(to bottom, var(--color-background), transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}
#member-popup.fade-top .popup-identity::after { opacity: 1; }
.popup-member-name {
    font-size: 24px;
    line-height: 32px;
    text-transform: uppercase;
}
.popup-member-titles {
    display: flex;
    flex-direction: column;
}
.popup-member-titles p {
    font-size: 14px;
    line-height: 20px;
    letter-spacing: -0.14px;
    opacity: 0.48;
}

.popup-cols {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    margin-bottom: 24px;
}
.popup-col {
    flex: 0 0 calc(50% - 16px);
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.popup-col-title {
    font-size: 18px;
    line-height: 24px;
    text-transform: uppercase;
}
.popup-col-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.popup-col-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 4px;
}
.popup-col-item span {
    font-size: 14px;
    line-height: 20px;
    letter-spacing: -0.14px;
    opacity: 0.48;
}

.popup-details {
    position: relative;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.popup-details p {
    font-size: 14px;
    line-height: 20px;
    letter-spacing: -0.14px;
    opacity: 0.48;
}

.popup-bottom-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to bottom, transparent, var(--color-background));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}
/* Shown by JS only while there's still content below the fold. */
#member-popup.fade-bottom .popup-bottom-fade,
#blog-popup.fade-bottom .popup-bottom-fade { opacity: 1; }

.team-card { cursor: pointer; }
.team-card:hover .corner-brackets::before,
.team-card:hover .corner-brackets::after,
.team-card:hover .corner-brackets .br,
.team-card:hover .corner-brackets .bl {
    opacity: 1;
    border-color: var(--color-brass);
}

/* ── Blog post popup ───────────────────────── */
#blog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
#blog-overlay.open {
    opacity: 1;
    pointer-events: auto;
}
#blog-popup {
    position: fixed;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: var(--color-background);
    z-index: 101;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}
#blog-popup.open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}
.blog-popup-header {
    display: flex;
    justify-content: flex-end;
    padding: 56px 56px 24px;
    flex-shrink: 0;
    position: relative;
}
.blog-popup-header .popup-close {
    position: static;
}
/* Top fade below the (non-scrolling) header — mirrors the team popup. Shown by
   JS only once the content has scrolled (#blog-popup.fade-top). */
.blog-popup-header::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 32px;
    background: linear-gradient(to bottom, var(--color-background), transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 2;
}
#blog-popup.fade-top .blog-popup-header::after { opacity: 1; }
.blog-popup-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0 56px 80px;
    scrollbar-width: none;
    display: flex;
    flex-direction: column;
    gap: 32px;
}
.blog-popup-scroll::-webkit-scrollbar { display: none; }
.blog-popup-image {
    height: 200px;
    overflow: hidden;
    flex-shrink: 0;
}
.blog-popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.blog-popup-meta {
    display: flex;
    gap: 16px;
    font-size: 14px;
    line-height: 20px;
    text-transform: uppercase;
    flex-shrink: 0;
}
.blog-popup-post-title {
    font-size: 24px;
    line-height: 32px;
    text-transform: uppercase;
    margin-bottom: 16px;
}

/* ═══════════════════════════════════════
   MOBILE  ≤ 1023px
════════════════════════════════════════ */
@media (max-width: 1023px) {
    .nav-desktop { display: none; }
    .nav-mobile  { display: flex; }

    /* Hero mobile */
    .hero-text-container {
        padding: var(--space-4x) var(--space-2x);
    }
    .hero-title { font-size: 48px; line-height: 56px; }
    /*.hero-contact-btn { display: none; }*/
    .hero-details {
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        margin: 0 calc(var(--space-2x) * -1);
        padding: 0 var(--space-2x);
    }
    .hero-details::-webkit-scrollbar { display: none; }
    .hero-detail-box { flex: 0 0 85%; max-width: none; scroll-snap-align: start; }
    .hero-mobile-cta {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: var(--space-4x);
        width: 100%;
        justify-content: center;
    }
    .hero-desktop-cta {
        display: none;
    }
    .hero-mobile-cta .btn-brass { width: 100%; justify-content: center; }

    /* Services mobile */
    .services-panel { flex-direction: column; }
    .services-left { width: 100%; padding: 32px 16px; }
    .services-right { padding: 0 16px 32px; }
    .services-right.services-body { padding: 0 16px 32px; }
    /* Stacked on mobile — drop the desktop height cap so text isn't clipped */
    .services-right:has(.active.text) {
        position: static;
        overflow: visible;
    }
    .services-panel:has(.active.text)::before,
    .services-panel:has(.active.text)::after { display: none; }
    .panel-divider { display: none; }
    .section-header { padding: 20px 16px; }
    .section-header .label { font-size: 16px; }
    .section-marquee-track span { font-size: 16px; }
    .services-cta .btn-brass {
        width: 100%;
        justify-content: center;
    }

    /* Team mobile/tablet — horizontal slider */
    .team-container {
        border-top: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
    }
    .team-row {
        flex-direction: column;
        align-items: stretch;
    }
    .team-left {
        position: static;
        width: 100%;
        height: auto;
    }
    img.team-terrain {
        height: auto;
    }
    .team-right {
        width: 100%;
        height: auto;
        padding: 32px 16px;
    }
    .team-header {
        margin-bottom: var(--space-4x);
    }
    .team-slider {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }
    .team-slider::-webkit-scrollbar { display: none; }
    .team-card { flex-shrink: 0; width: 100%; min-width: unset; scroll-snap-align: start; }
    .team-dots {
        display: flex;
        justify-content: center;
    }
    .team-cta { position: static; transform: none; margin: 32px auto 0; display: block; }
    .team-divider { display: none; }
    .team-left::after {
        content: '';
        display: block;
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 160px;
        pointer-events: none;
        background: linear-gradient(180deg, rgba(10, 10, 10, 0.00) 0%, var(--color-background) 100%);
    }

    /* Team popup mobile */
    #member-popup { width: 100%; }
    .popup-close { top: 24px; right: 16px; }
    .popup-identity { padding-top: 32px; margin-bottom: calc(8px + 64px * var(--shrink, 0)); }
    .popup-photo-wrap { --photo-size: calc(120px - 40px * var(--shrink, 0)); }
    .popup-scroll { padding: 0 16px 80px; }
    .popup-cols { flex-direction: column; gap: 16px; }
    .popup-col { flex-basis: auto; }
    #blog-popup { width: 100%; }
    .blog-popup-header { padding: 32px 16px 24px; }
    .blog-popup-scroll { padding: 0 16px 80px; }

    #member-overlay,
    #blog-overlay {
        right: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
    }

    /* CTA panel mobile */
    .cta-panel {
        flex-direction: column;
        align-items: stretch;
        margin: 0 var(--space-2x);
        padding: var(--space-2x);
        gap: var(--space-7x);
    }
    .cta-panel-main {
        max-width: none;
    }
    .cta-panel-main .btn-brass {
        width: 100%;
        justify-content: center;
    }
    .cta-panel-details {
        max-width: none;
    }

    /* Footer mobile */
    footer {
        padding: var(--space-2x);
    }

    .footer-cta-container a {
        width: 100%;
        display: flex;
        justify-content: center;
    }
    .footer-bg {
        margin: 56px 0 16px;
    }
    .footer-title {
        font-size: 28px;
        line-height: 32px;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    .footer-copyright {
        order: 1;
    }
    .footer-coords {
        order: 0;
    }
    .footer-coords .bullet:first-child { display: block; }
}