/* =============================================================================
   MARSAPIEN SQUAD — Operations Hub
   ============================================================================= */

body[data-page-id="marsapien-squad"] {
    overflow-x: hidden;
    overflow-y: auto;
    background: #030610;
    --color-squad: #00c8ff;
    --color-squad-dim: rgba(0, 200, 255, 0.4);
}

body[data-page-id="marsapien-squad"] .scanline-layer {
    display: block;
    opacity: 0.04;
}

/* ---- Squad background — slideshow-ready layers ---- */
#squad-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

/* CSS space canvas — visible when no image layers are active */
#squad-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        /* distant star cluster shimmer */
        radial-gradient(ellipse 120% 80% at 70% 20%, rgba(0, 80, 160, 0.28) 0%, transparent 60%),
        /* warm nebula blush — upper left */
        radial-gradient(ellipse 90% 60% at 15% 30%, rgba(80, 0, 160, 0.18) 0%, transparent 55%),
        /* cyan arc — colony beacon */
        radial-gradient(ellipse 60% 100% at 90% 60%, rgba(0, 180, 255, 0.12) 0%, transparent 50%),
        /* deep rust horizon — Mars tint */
        radial-gradient(ellipse 140% 40% at 50% 100%, rgba(160, 40, 10, 0.22) 0%, transparent 55%),
        /* base void */
        linear-gradient(160deg, #04071a 0%, #02040e 45%, #06030f 100%);
    animation: squad-nebula-drift 28s ease-in-out infinite alternate;
}

/* Subtle star-points layer */
#squad-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 12% 8%, rgba(255, 255, 255, 0.55) 0%, transparent 100%),
        radial-gradient(1px 1px at 88% 14%, rgba(255, 255, 255, 0.40) 0%, transparent 100%),
        radial-gradient(1px 1px at 34% 22%, rgba(255, 255, 255, 0.30) 0%, transparent 100%),
        radial-gradient(1px 1px at 60% 5%, rgba(255, 255, 255, 0.50) 0%, transparent 100%),
        radial-gradient(1px 1px at 75% 35%, rgba(255, 255, 255, 0.35) 0%, transparent 100%),
        radial-gradient(1px 1px at 22% 50%, rgba(255, 255, 255, 0.25) 0%, transparent 100%),
        radial-gradient(1px 1px at 92% 52%, rgba(255, 255, 255, 0.40) 0%, transparent 100%),
        radial-gradient(1px 1px at 48% 65%, rgba(255, 255, 255, 0.30) 0%, transparent 100%),
        radial-gradient(1px 1px at 5% 78%, rgba(255, 255, 255, 0.35) 0%, transparent 100%),
        radial-gradient(1px 1px at 67% 82%, rgba(255, 255, 255, 0.45) 0%, transparent 100%),
        radial-gradient(1px 1px at 38% 90%, rgba(255, 255, 255, 0.28) 0%, transparent 100%),
        radial-gradient(1px 1px at 82% 95%, rgba(200, 220, 255, 0.35) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 55% 44%, rgba(180, 220, 255, 0.50) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 20% 18%, rgba(255, 255, 255, 0.60) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 78% 70%, rgba(255, 255, 255, 0.45) 0%, transparent 100%);
    animation: squad-stars-twinkle 6s ease-in-out infinite alternate;
}

@keyframes squad-nebula-drift {
    0% {
        transform: scale(1) translate(0, 0);
    }

    50% {
        transform: scale(1.04) translate(-8px, 12px);
    }

    100% {
        transform: scale(1.02) translate(10px, -6px);
    }
}

@keyframes squad-stars-twinkle {
    0% {
        opacity: 0.55;
    }

    50% {
        opacity: 0.85;
    }

    100% {
        opacity: 0.65;
    }
}

/* Crossfade-ready image slide layers */
.squad-bg-layer {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.4s ease;
}

.squad-bg-layer.active {
    opacity: 1;
}

/* Darkening vignette so text/cards stay readable */
#squad-bg-vignette {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(to bottom,
            rgba(3, 6, 16, 0.55) 0%,
            rgba(3, 6, 16, 0.15) 30%,
            rgba(3, 6, 16, 0.25) 65%,
            rgba(3, 6, 16, 0.75) 100%);
}

/* Header */
.squad-header {
    border-bottom: 1px solid rgba(0, 200, 255, 0.15);
    background: rgba(2, 3, 10, 0.88);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.squad-header .logo span,
.squad-header .logo-link {
    color: var(--color-squad);
    text-shadow: 0 0 8px rgba(0, 200, 255, 0.4);
}

.squad-header .bar {
    background-color: var(--color-squad);
}

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

/* Hero */
.squad-main {
    position: relative;
    z-index: var(--z-ui);
    min-height: calc(100vh - var(--header-height));
    padding: 0 24px 60px;
}

.squad-hero {
    position: sticky;
    top: var(--header-height);
    z-index: calc(var(--z-ui) - 1);
    text-align: center;
    padding: 22px 16px 16px;
    /* glass backing so cards don't bleed through */
    background: rgba(3, 6, 16, 0.7);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

/* Boundary line below the tag */
.squad-hero::after {
    content: '';
    display: block;
    margin-top: 16px;
    height: 1px;
    background: linear-gradient(to right,
            transparent 0%,
            rgba(255, 255, 255, 0.12) 20%,
            rgba(0, 200, 255, 0.30) 50%,
            rgba(255, 255, 255, 0.12) 80%,
            transparent 100%);
}

.squad-hero-tag {
    font-family: var(--font-mono);
    font-size: clamp(0.62rem, 1.3vw, 0.76rem);
    letter-spacing: 5px;
    color: rgba(255, 255, 255, 0.72);
    text-transform: uppercase;
}

/* Department grid — cinematic cards */
.squad-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    max-width: 1100px;
    margin: 0 auto;
    padding-top: 32px;
}

.squad-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 22px 20px 18px;
    background: rgba(8, 14, 32, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-top: 3px solid var(--card-accent, rgba(0, 200, 255, 0.5));
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s, transform 0.2s;
}

/* Subtle glow wash behind the icon */
.squad-card::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -20px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--card-accent-glow, rgba(0, 200, 255, 0.12)) 0%, transparent 70%);
    pointer-events: none;
}

.squad-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    border-top-color: var(--card-accent, rgba(0, 200, 255, 0.9));
    background: rgba(12, 20, 44, 0.82);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.04);
    transform: translateY(-2px);
}

/* Per-department color themes */
.squad-card[data-dept="farming"] {
    --card-accent: #3ddc84;
    --card-accent-glow: rgba(61, 220, 132, 0.14);
    --card-icon-color: #3ddc84;
}

.squad-card[data-dept="engine-labs"] {
    --card-accent: #ff8c42;
    --card-accent-glow: rgba(255, 140, 66, 0.14);
    --card-icon-color: #ff8c42;
}

.squad-card[data-dept="security"] {
    --card-accent: #ff4d6d;
    --card-accent-glow: rgba(255, 77, 109, 0.14);
    --card-icon-color: #ff4d6d;
}

.squad-card[data-dept="genetics"] {
    --card-accent: #c77dff;
    --card-accent-glow: rgba(199, 125, 255, 0.14);
    --card-icon-color: #c77dff;
}

.squad-card[data-dept="administration"] {
    --card-accent: #00c8ff;
    --card-accent-glow: rgba(0, 200, 255, 0.14);
    --card-icon-color: #00c8ff;
}

.squad-card[data-dept="intel"] {
    --card-accent: #f5c842;
    --card-accent-glow: rgba(245, 200, 66, 0.12);
    --card-icon-color: #f5c842;
}

/* Card icon */
.squad-card-icon {
    width: 36px;
    height: 36px;
    color: var(--card-icon-color, rgba(0, 200, 255, 0.8));
    opacity: 0.85;
    flex-shrink: 0;
    transition: opacity 0.2s, transform 0.2s;
}

.squad-card:hover .squad-card-icon {
    opacity: 1;
    transform: scale(1.08);
}

.squad-card-id {
    font-family: var(--font-mono);
    font-size: 0.5rem;
    letter-spacing: 2.5px;
    color: var(--card-accent, rgba(0, 200, 255, 0.5));
    opacity: 0.7;
}

.squad-card-title {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.92);
    margin-top: 2px;
}

.squad-card-detail {
    font-family: var(--font-sans);
    font-size: 0.69rem;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.5;
    flex: 1;
}

.squad-card-arrow {
    font-size: 0.8rem;
    color: var(--card-accent, rgba(0, 200, 255, 0.3));
    opacity: 0.4;
    align-self: flex-end;
    transition: opacity 0.2s, transform 0.2s;
}

.squad-card:hover .squad-card-arrow {
    opacity: 1;
    transform: translateX(4px);
}

@media (max-width: 600px) {
    .squad-hero {
        padding: 40px 0 32px;
    }

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

@media (max-width: 400px) {
    .squad-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   DEPARTMENT PAGES — Martian surface aesthetic
   ============================================================ */

/* Shared body base */
body[data-page-id^="dept-"] {
    overflow-x: hidden;
    overflow-y: auto;
    background: #1a0a04;
}

/* ---- Shared background canvas ---- */
.dept-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

/* Martian surface base — iron-oxide rust, dust haze */
.dept-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        /* bright rust horizon glow */
        radial-gradient(ellipse 160% 55% at 50% 105%, rgba(210, 80, 20, 0.65) 0%, transparent 55%),
        /* left flank iron dust */
        radial-gradient(ellipse 70% 80% at 0% 70%, rgba(180, 55, 10, 0.40) 0%, transparent 60%),
        /* right upper haze */
        radial-gradient(ellipse 80% 50% at 95% 25%, rgba(160, 45, 8, 0.30) 0%, transparent 55%),
        /* mid-sky amber */
        radial-gradient(ellipse 120% 40% at 50% 45%, rgba(140, 60, 15, 0.18) 0%, transparent 60%),
        /* base: warm dark rust, not pure black */
        linear-gradient(175deg, #2a0d04 0%, #1a0805 35%, #160604 70%, #100402 100%);
    animation: dept-surface-drift 32s ease-in-out infinite alternate;
}

/* Dust particulate layer */
.dept-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 10% 12%, rgba(200, 120, 60, 0.45) 0%, transparent 100%),
        radial-gradient(1px 1px at 85% 8%, rgba(200, 120, 60, 0.30) 0%, transparent 100%),
        radial-gradient(1px 1px at 30% 25%, rgba(255, 180, 100, 0.25) 0%, transparent 100%),
        radial-gradient(1px 1px at 65% 18%, rgba(200, 120, 60, 0.35) 0%, transparent 100%),
        radial-gradient(1px 1px at 50% 45%, rgba(255, 200, 120, 0.20) 0%, transparent 100%),
        radial-gradient(1px 1px at 20% 55%, rgba(200, 100, 50, 0.30) 0%, transparent 100%),
        radial-gradient(1px 1px at 90% 50%, rgba(220, 130, 70, 0.25) 0%, transparent 100%),
        radial-gradient(1px 1px at 75% 72%, rgba(200, 120, 60, 0.35) 0%, transparent 100%),
        radial-gradient(1px 1px at 8% 80%, rgba(255, 180, 100, 0.28) 0%, transparent 100%),
        radial-gradient(1px 1px at 42% 85%, rgba(200, 120, 60, 0.22) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 55% 35%, rgba(255, 200, 140, 0.40) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 22% 90%, rgba(220, 140, 80, 0.35) 0%, transparent 100%);
    animation: dept-dust-shimmer 8s ease-in-out infinite alternate;
}

@keyframes dept-surface-drift {
    0% {
        transform: scale(1) translate(0, 0);
    }

    50% {
        transform: scale(1.03) translate(-6px, 10px);
    }

    100% {
        transform: scale(1.02) translate(8px, -5px);
    }
}

@keyframes dept-dust-shimmer {
    0% {
        opacity: 0.5;
    }

    100% {
        opacity: 0.8;
    }
}

/* Per-dept: keep the Martian rust base, add a dept-tinted upper sky */
.dept-bg--farming::before {
    background:
        radial-gradient(ellipse 160% 55% at 50% 105%, rgba(210, 80, 20, 0.65) 0%, transparent 55%),
        radial-gradient(ellipse 70% 80% at 0% 70%, rgba(61, 160, 80, 0.20) 0%, transparent 60%),
        radial-gradient(ellipse 80% 50% at 95% 25%, rgba(40, 120, 40, 0.18) 0%, transparent 55%),
        linear-gradient(175deg, #1c1004 0%, #180804 35%, #160604 70%, #100402 100%);
}

.dept-bg--engine-labs::before {
    background:
        radial-gradient(ellipse 160% 55% at 50% 105%, rgba(220, 90, 15, 0.70) 0%, transparent 55%),
        radial-gradient(ellipse 70% 80% at 0% 70%, rgba(200, 80, 10, 0.35) 0%, transparent 60%),
        radial-gradient(ellipse 80% 50% at 95% 25%, rgba(255, 100, 20, 0.22) 0%, transparent 55%),
        linear-gradient(175deg, #2e0d02 0%, #1e0804 35%, #180604 70%, #100402 100%);
}

.dept-bg--security::before {
    background:
        radial-gradient(ellipse 160% 55% at 50% 105%, rgba(200, 30, 30, 0.55) 0%, transparent 55%),
        radial-gradient(ellipse 70% 80% at 0% 70%, rgba(160, 20, 20, 0.35) 0%, transparent 60%),
        radial-gradient(ellipse 80% 50% at 95% 25%, rgba(180, 50, 10, 0.25) 0%, transparent 55%),
        linear-gradient(175deg, #260604 0%, #180404 35%, #140304 70%, #0e0202 100%);
}

.dept-bg--genetics::before {
    background:
        radial-gradient(ellipse 160% 55% at 50% 105%, rgba(200, 70, 20, 0.60) 0%, transparent 55%),
        radial-gradient(ellipse 70% 80% at 0% 70%, rgba(100, 20, 140, 0.25) 0%, transparent 60%),
        radial-gradient(ellipse 80% 50% at 95% 25%, rgba(80, 10, 100, 0.20) 0%, transparent 55%),
        linear-gradient(175deg, #1e0610 0%, #160408 35%, #120304 70%, #0e0202 100%);
}

.dept-bg--administration::before {
    background:
        radial-gradient(ellipse 160% 55% at 50% 105%, rgba(190, 70, 18, 0.58) 0%, transparent 55%),
        radial-gradient(ellipse 70% 80% at 0% 70%, rgba(0, 80, 140, 0.22) 0%, transparent 60%),
        radial-gradient(ellipse 80% 50% at 95% 25%, rgba(0, 60, 120, 0.18) 0%, transparent 55%),
        linear-gradient(175deg, #060e16 0%, #0a0608 35%, #100404 70%, #0e0302 100%);
}

/* Shared vignette — light touch, let the rust breathe */
.dept-bg-vignette {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(to bottom,
            rgba(10, 3, 2, 0.45) 0%,
            rgba(10, 3, 2, 0.05) 25%,
            rgba(10, 3, 2, 0.05) 65%,
            rgba(10, 3, 2, 0.55) 100%);
}

/* ---- Header — fully opaque so no content bleeds through ---- */
.dept-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(14, 4, 2, 0.92) !important;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.dept-header--farming {
    border-bottom-color: rgba(61, 220, 132, 0.2);
}

.dept-header--farming .logo-link,
.dept-header--farming .logo span {
    color: #3ddc84;
}

.dept-header--farming .bar {
    background-color: #3ddc84;
}

.dept-header--engine-labs {
    border-bottom-color: rgba(255, 140, 66, 0.2);
}

.dept-header--engine-labs .logo-link,
.dept-header--engine-labs .logo span {
    color: #ff8c42;
}

.dept-header--engine-labs .bar {
    background-color: #ff8c42;
}

.dept-header--security {
    border-bottom-color: rgba(255, 77, 109, 0.2);
}

.dept-header--security .logo-link,
.dept-header--security .logo span {
    color: #ff4d6d;
}

.dept-header--security .bar {
    background-color: #ff4d6d;
}

.dept-header--genetics {
    border-bottom-color: rgba(199, 125, 255, 0.2);
}

.dept-header--genetics .logo-link,
.dept-header--genetics .logo span {
    color: #c77dff;
}

.dept-header--genetics .bar {
    background-color: #c77dff;
}

.dept-header--administration {
    border-bottom-color: rgba(0, 200, 255, 0.2);
}

.dept-header--administration .logo-link,
.dept-header--administration .logo span {
    color: #00c8ff;
}

.dept-header--administration .bar {
    background-color: #00c8ff;
}

/* ---- Main layout — independent scroll container below the header ---- */
.dept-main {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-ui);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 24px 80px;
}

/* Breadcrumb — sticky within the scroll container, not the viewport */
.dept-breadcrumb {
    position: sticky;
    top: 0;
    z-index: 5;
    margin-left: -24px;
    margin-right: -24px;
    padding: 16px 24px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(16, 4, 2, 0.92);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    font-family: var(--font-mono);
    text-transform: uppercase;
}

/* Separator slash */
.dept-breadcrumb span:not(:first-child):not(:last-child) {
    color: rgba(255, 255, 255, 0.20);
    font-size: 0.7rem;
}

/* Current page label */
.dept-breadcrumb span:last-child {
    font-size: 0.58rem;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.40);
}

/* Back link — large, prominent */
.dept-breadcrumb a {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.dept-breadcrumb a:hover {
    color: #fff;
}

/* Boundary line under breadcrumb */
.dept-breadcrumb::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right,
            transparent 0%,
            rgba(200, 80, 20, 0.30) 20%,
            rgba(255, 140, 60, 0.45) 50%,
            rgba(200, 80, 20, 0.30) 80%,
            transparent 100%);
}

/* Content area — starts below the sticky breadcrumb (breadcrumb ~50px) */
.dept-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 48px 0 0;
}

/* ---- Section ---- */
.dept-section {
    margin-bottom: 64px;
}

.dept-section-label {
    font-family: var(--font-mono);
    font-size: 0.60rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
    margin-bottom: 16px;
}

.dept-title {
    font-family: var(--font-mono);
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 700;
    letter-spacing: 4px;
    line-height: 1.0;
    color: rgba(255, 255, 255, 0.95);
    margin: 0 0 40px;
}

.dept-title-sub {
    display: block;
    font-size: 0.45em;
    font-weight: 400;
    letter-spacing: 8px;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 6px;
}

/* Nav card — same style as status card, sits beside it in the grid */
.dept-nav-card {
    background: rgba(10, 6, 4, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 2px solid rgba(255, 120, 50, 0.35);
    padding: 20px;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.dept-nav-card-header {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.70);
    text-transform: uppercase;
    margin-bottom: 14px;
}

.dept-nav-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dept-section-title {
    font-family: var(--font-mono);
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    font-weight: 700;
    letter-spacing: 4px;
    color: rgba(255, 255, 255, 0.80);
    margin: 0 0 28px;
}

/* ---- About card ---- */
.dept-about-card {
    background: rgba(10, 6, 4, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 2px solid rgba(255, 120, 50, 0.35);
    padding: 28px 32px 32px;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

/* Top row: text left, stats right */
.dept-about-top {
    display: flex;
    align-items: flex-start;
    gap: 32px;
}

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

.dept-about-text p {
    font-family: var(--font-sans);
    font-size: 0.88rem;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.60);
    margin: 0 0 14px;
}

.dept-about-text p:last-child {
    margin-bottom: 0;
}

/* Stats — top right */
.dept-stats-row {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex-shrink: 0;
    padding-left: 32px;
    border-left: 1px solid rgba(255, 255, 255, 0.07);
    text-align: right;
}

.dept-stat {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.dept-stat-val {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.90);
    letter-spacing: 1px;
    white-space: nowrap;
}

.dept-stat-lbl {
    font-family: var(--font-mono);
    font-size: 0.48rem;
    letter-spacing: 2.5px;
    color: rgba(255, 255, 255, 0.28);
    text-transform: uppercase;
}

/* Nav strip — below the text, inside card */
.dept-about-nav {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.dept-about-nav .dept-nav-card-header {
    margin-bottom: 10px;
}

.dept-about-nav .dept-nav-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dept-nav-btn {
    font-family: var(--font-mono);
    font-size: 0.54rem;
    font-weight: 700;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    text-decoration: none;
    padding: 5px 10px;
    border: 1px solid currentColor;
    color: var(--dept-nav-color, rgba(255, 255, 255, 0.35));
    background: transparent;
    opacity: 0.55;
    transition: opacity 0.18s, background 0.18s;
    white-space: nowrap;
}

.dept-nav-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.06);
}

.dept-nav-btn.current {
    opacity: 1;
    background: rgba(255, 255, 255, 0.06);
    cursor: default;
    pointer-events: none;
}

/* Per-dept accent colours for the nav buttons */
[data-page-id="dept-farming"] .dept-nav-btn {
    --dept-nav-color: #3ddc84;
}

[data-page-id="dept-engine-labs"] .dept-nav-btn {
    --dept-nav-color: #ff8c42;
}

[data-page-id="dept-security"] .dept-nav-btn {
    --dept-nav-color: #ff4d6d;
}

[data-page-id="dept-genetics"] .dept-nav-btn {
    --dept-nav-color: #c77dff;
}

[data-page-id="dept-administration"] .dept-nav-btn {
    --dept-nav-color: #00c8ff;
}

/* Status dots — still used in division ops cards */
.dept-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dept-status-dot.active {
    background: #3ddc84;
    box-shadow: 0 0 6px rgba(61, 220, 132, 0.6);
}

.dept-status-dot.warn {
    background: #ffb340;
    box-shadow: 0 0 6px rgba(255, 179, 64, 0.6);
}

/* ---- Divider ---- */
.dept-divider {
    height: 1px;
    margin: 0 0 64px;
    background: linear-gradient(to right,
            transparent 0%,
            rgba(255, 120, 50, 0.20) 25%,
            rgba(255, 180, 100, 0.30) 50%,
            rgba(255, 120, 50, 0.20) 75%,
            transparent 100%);
}

/* ---- Gallery ---- */
.dept-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto auto;
    gap: 12px;
}

.dept-gallery-item--wide {
    grid-column: span 2;
}

/* placeholder (no content yet) */
.dept-gallery-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    aspect-ratio: 16 / 10;
    background: rgba(10, 6, 4, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.25);
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-align: center;
    padding: 16px;
    transition: border-color 0.2s, background 0.2s;
}

.dept-gallery-placeholder svg {
    width: 48px;
    height: auto;
}

.dept-gallery-item:hover .dept-gallery-placeholder {
    border-color: rgba(255, 120, 50, 0.25);
    background: rgba(16, 10, 6, 0.75);
}

/* real image slot */
.dept-gallery-img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: border-color 0.2s, filter 0.2s;
    filter: brightness(0.88) saturate(0.9);
}

.dept-gallery-item:hover .dept-gallery-img {
    border-color: rgba(255, 120, 50, 0.35);
    filter: brightness(1) saturate(1.05);
}

/* lore / report text card */
.dept-gallery-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    aspect-ratio: 16 / 10;
    background: rgba(10, 6, 4, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.07);
    padding: 18px 20px;
    transition: border-color 0.2s, background 0.2s;
    overflow: hidden;
}

.dept-gallery-item:hover .dept-gallery-card {
    border-color: rgba(255, 120, 50, 0.3);
    background: rgba(18, 10, 6, 0.8);
}

.dept-gallery-card-tag {
    font-family: var(--font-mono);
    font-size: 0.5rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 160, 80, 0.7);
}

.dept-gallery-card-title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.3;
}

.dept-gallery-card-body {
    font-size: 0.68rem;
    line-height: 1.6;
    color: rgba(220, 200, 185, 0.65);
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

.dept-gallery-card-footer {
    font-family: var(--font-mono);
    font-size: 0.48rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.2);
    margin-top: auto;
}

/* ---- Dept image slideshow ---- */
/* Crossfading background images loaded from S3 per department.
   JS adds .dept-slide divs inside #dept-slideshow and cycles opacity. */
#dept-slideshow {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.dept-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.6s ease-in-out;
}

.dept-slide.active {
    opacity: 0.22;
}

/* subtle, Martian bg still bleeds through */

/* ---- Division section ---- */
.dept-division-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.dept-division-card {
    background: rgba(10, 6, 4, 0.60);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-top: 2px solid rgba(255, 120, 50, 0.25);
    padding: 16px 18px;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.dept-division-card-title {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 12px;
}

.dept-division-card-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dept-division-card-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.82);
}

.dept-division-card-item .dept-status-dot {
    flex-shrink: 0;
}

/* ---- Data section ---- */
.dept-data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.dept-metric {
    background: rgba(8, 5, 3, 0.70);
    border: 1px solid rgba(255, 255, 255, 0.07);
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.dept-metric::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, rgba(255, 120, 50, 0.4), transparent);
}

.dept-metric-lbl {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.80);
    margin-bottom: 10px;
}

.dept-metric-val {
    font-family: var(--font-mono);
    font-size: clamp(1.3rem, 3vw, 1.9rem);
    font-weight: 700;
    letter-spacing: 1px;
    color: #ffffff;
    line-height: 1;
}

.dept-metric-unit {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.60);
    margin-top: 6px;
    text-transform: uppercase;
}

.dept-metric-tag {
    font-family: var(--font-mono);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(61, 220, 132, 0.95);
    margin-top: 8px;
}

.dept-metric-tag.warn {
    color: rgba(255, 179, 64, 1.0);
}

.dept-metric-tag.err {
    color: rgba(255, 80, 80, 1.0);
}

/* Inline stats row — used on genetics page without the about card wrapper */
.dept-stats-row--inline {
    display: flex;
    flex-direction: row;
    gap: 40px;
    padding: 0;
    border-left: none;
    text-align: left;
    flex-wrap: wrap;
}

.dept-stats-row--inline .dept-stat-val {
    font-size: 2rem;
}

.dept-metric-tag--warn {
    color: rgba(255, 179, 64, 1.0);
}

/* ── Dept console shell (farming, engine-labs, security, admin) ── */
.dept-console {
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    font-family: var(--font-mono);
    overflow: hidden;
}

.dept-console-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.dept-console-title {
    flex: 1;
    font-size: 0.6rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
}

.dept-console-status {
    font-size: 0.58rem;
    letter-spacing: 1.5px;
    color: rgba(80, 220, 140, 0.85);
}

.dept-console-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dept-console-panel {
    background: rgba(0, 0, 0, 0.4);
    padding: 16px 20px;
}

.dept-console-panel-title {
    font-size: 0.58rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 10px;
}

@media (max-width: 600px) {
    .dept-console-grid {
        grid-template-columns: 1fr;
    }
}

.dept-data-note {
    font-family: var(--font-mono);
    font-size: 0.52rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.28);
    margin-top: 14px;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .dept-about-top {
        flex-direction: column;
    }

    .dept-stats-row {
        flex-direction: row;
        border-left: none;
        padding-left: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.07);
        padding-top: 16px;
        text-align: left;
    }
}

@media (max-width: 760px) {
    .dept-about-top {
        flex-direction: column;
    }

    .dept-division-grid {
        grid-template-columns: 1fr;
    }

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

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

    .dept-stats-row {
        gap: 20px;
    }
}

/* ── Inline CTA button in breadcrumb ─────────────────────── */
.breadcrumb-cta-btn {
    margin-left: auto;
    padding: 0.3rem 0.85rem;
    background: transparent;
    border: 1px solid rgba(245, 200, 66, 0.5);
    color: #f5c842;
    font-family: var(--font-mono, monospace);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 2px;
    transition: background 0.2s, border-color 0.2s;
    animation: breadcrumb-cta-pulse 2s ease-in-out infinite;
    white-space: nowrap;
}

.breadcrumb-cta-btn:hover {
    background: rgba(245, 200, 66, 0.12);
    border-color: #f5c842;
}

@keyframes breadcrumb-cta-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 200, 66, 0); }
    50%      { box-shadow: 0 0 12px 2px rgba(245, 200, 66, 0.25); }
}

/* Squad breadcrumb (main page) */
.squad-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono, monospace);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    padding: 16px 0 14px;
    margin-bottom: 1rem;
    position: relative;
    z-index: 5;
}

.squad-breadcrumb a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: color 0.2s;
}

.squad-breadcrumb a:hover {
    color: #f5c842;
}

.squad-breadcrumb span:nth-child(2) {
    color: rgba(255, 255, 255, 0.2);
}

.squad-breadcrumb span:last-child {
    color: rgba(255, 255, 255, 0.4);
}

@media (max-width: 600px) {
    .breadcrumb-cta-btn {
        font-size: 0.5rem;
        padding: 0.25rem 0.6rem;
        letter-spacing: 0.08em;
    }
    .squad-breadcrumb {
        font-size: 0.65rem;
        letter-spacing: 1.5px;
    }
}

