@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;600;700&display=swap');

:root {
    /* Primary Foundation */
    --bg-primary: #1E1F2B;
    --bg-window: #2B2D3D;
    --color-shadow: rgba(10, 10, 15, 0.6);
    /* Shadow Grey */
    --accent-glow: #FBE063;
    /* Royal Gold - Bugs/glow only */
    --system-line: #6474B3;
    /* Glaucous - structural lines, dividers */
    --text-main: #FFFFFF;
    --text-muted: #BFC3D0;

    /* Supporting Palette */
    --color-lilac: #734997;
    --color-chocolate: #D47542;
    --color-sage: #699F64;
    --color-lobster: #DD5658;
    --color-plum: #C35A9B;
    --color-teal: #6EBEB2;

    /* Typography */
    --font-primary: 'Arista', 'Nunito', sans-serif;

    /* Spacing & Grid */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 32px;
    --spacing-xl: 64px;
    --spacing-xxl: 120px;

    --border-radius: 4px;
    --transition-speed: 0.3s;
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    font-family: var(--font-primary);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: clip; /* clip ≠ hidden — doesn't create a scroll container, so position:sticky works */
}

/* Grid overlay removed based on new design aesthetic */

/* Typography Hierarchy */
h1 {
    font-size: 3.5rem;
    font-weight: 300;
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
}

.brand-mark,
.loading-title {
    color: var(--accent-glow);
}

.brand-mark-inline {
    color: var(--accent-glow);
}

h2 {
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: var(--spacing-xl);
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

p {
    color: var(--text-muted);
    font-size: 1rem;
}

a {
    color: var(--text-main);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

a:hover {
    color: var(--accent-glow);
}

/* Layout Utilities */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-xxl) var(--spacing-lg);
}

/* ── 12-Column Grid System ────────────────────────── */
.grid-12 {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: 24px;
}

[class*="col-"] { min-width: 0; }
.col-1  { grid-column: span 1;  }
.col-2  { grid-column: span 2;  }
.col-3  { grid-column: span 3;  }
.col-4  { grid-column: span 4;  }
.col-5  { grid-column: span 5;  }
.col-6  { grid-column: span 6;  }
.col-7  { grid-column: span 7;  }
.col-8  { grid-column: span 8;  }
.col-9  { grid-column: span 9;  }
.col-10 { grid-column: span 10; }
.col-11 { grid-column: span 11; }
.col-12 { grid-column: span 12; }

@media (max-width: 768px) {
    [class*="col-"] { grid-column: span 12; }
}
@media (min-width: 769px) and (max-width: 1024px) {
    .col-7, .col-8, .col-9 { grid-column: span 6; }
    .col-10, .col-11       { grid-column: span 8; }
}

/* Navigation */
.site-header {
    position: sticky;
    top: 0;
    z-index: 9000;  /* above .launch-gate (8000) so nav stays accessible */
    background-color: #1E1F2B;
    border-bottom: 1px solid rgba(100, 116, 179, 0.2);
    padding: var(--spacing-lg) 0;
    margin-bottom: var(--spacing-xxl);
}

.nav-list {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xl);
    list-style: none;
}

.nav-link {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-main);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--system-line);
}

/* Homepage Hero */
.hero-section {
    text-align: center;
    margin-bottom: var(--spacing-xxl);
    position: relative;
}

.gallery-page-shell {
    padding-top: calc(var(--spacing-md) + 8px);
}

.gallery-hero {
    min-height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
    transform: none;
    padding: 0 0 var(--spacing-lg);
}

.gallery-hero h2 {
    margin-bottom: var(--spacing-sm);
}

.gallery-hero .brand-mark {
    margin-bottom: 14px;
}

.index-page-shell {
    min-height: 100vh;
    position: relative;
}

.index-lockup-section {
    min-height: 100svh;
    padding: clamp(56px, 8vw, 100px) 24px clamp(40px, 7vw, 84px);
}

.index-lockup-shell {
    width: min(100%, 980px);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 14px;
}

.index-lockup-kicker,
.show-info-kicker,
.countdown-label {
    font-family: monospace;
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--system-line);
}

.index-lockup-wordmark {
    font-size: clamp(1.8rem, 9.5vw, 8rem);
    letter-spacing: 0.08em;
    margin: 0;
    line-height: 0.94;
    text-shadow: 0 0 28px rgba(251, 224, 99, 0.08);
}

.index-lockup-subtitle {
    margin: 0;
    font-size: clamp(0.95rem, 1.8vw, 1.25rem);
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.82);
}

.index-lockup-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.index-detail-line {
    color: var(--text-muted);
    font-size: clamp(0.94rem, 1.5vw, 1.05rem);
    letter-spacing: 0.04em;
}

.index-countdown-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    padding: 16px 22px;
    border-radius: 18px;
    border: 1px solid rgba(100, 116, 179, 0.22);
    background: rgba(43, 45, 61, 0.38);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.02),
        0 16px 40px rgba(8, 10, 18, 0.22);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 72px;
    gap: 2px;
}

.countdown-num {
    font-family: monospace;
    font-size: clamp(1.8rem, 3.8vw, 2.8rem);
    line-height: 1;
    color: var(--accent-glow);
    letter-spacing: 0.08em;
}

.countdown-sep {
    font-family: monospace;
    color: rgba(255, 255, 255, 0.5);
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    transform: translateY(-8px);
}

.index-page.show-live .index-countdown-wrap {
    opacity: 0.42;
    transform: scale(0.985);
}

/* Scroll cue — appears below countdown when the show has launched */
.index-scroll-cue {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 28px;
    color: rgba(255, 255, 255, 0.42);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    animation: scroll-cue-bob 2.2s ease-in-out infinite;
}

.index-page.show-live .index-scroll-cue {
    display: flex;
}

.scroll-cue-arrow {
    font-size: 1rem;
    line-height: 1;
}

@keyframes scroll-cue-bob {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(5px); }
}

.show-info-section {
    width: min(100%, 980px);
    margin: 0 auto;
    padding: 0 24px 56px;
}

.show-info-shell {
    max-width: 760px;
    margin: 0 auto;
    padding: 26px 28px 0;
    text-align: center;
}

.show-info-copy {
    font-size: 1.06rem;
    line-height: 1.9;
    color: var(--text-muted);
    margin-top: 10px;
}

.student-grid-section {
    width: min(100%, 1400px);
    margin: 0 auto;
    padding: 24px var(--spacing-lg) var(--spacing-xxl);
}

.index-page:not(.show-live) .student-grid-section {
    display: none;
}

.index-free-bug {
    position: fixed;
    top: 0;
    left: 0;
    width: 124px;
    height: 124px;
    pointer-events: none;
    z-index: 7600;
    will-change: transform;
    transform-origin: center center;
    opacity: 0.85;
    transition: opacity 0.18s linear;
}

.index-free-bug .bug-container {
    display: block; /* override generic .bug-container display:flex — prevents flex-shrink on assembly */
    position: relative;
    width: 124px;
    height: 124px;
    margin: 0;
    overflow: visible;
}

.index-free-bug .index-butterfly-assembly {
    position: relative;
    width: 72px;
    height: 108px;
    transform-origin: center center;
    filter: var(--gallery-bug-shadow, drop-shadow(0 24px 34px rgba(0, 0, 0, 0.26)) drop-shadow(0 12px 18px rgba(0, 0, 0, 0.18)));
}

.index-free-bug .index-butterfly-body {
    position: relative;
    z-index: 2;
    display: block;
    width: 72px;
    height: auto;
    animation: indexButterflyBodyBob var(--index-flap-speed, 0.72s) ease-in-out infinite;
}

.index-free-bug .index-butterfly-wing-left,
.index-free-bug .index-butterfly-wing-right {
    position: absolute;
    top: 42%;
    width: 76px;
    height: auto;
    z-index: 3;
}

.index-free-bug .index-butterfly-wing-left {
    right: 63%;
    transform-origin: 100% 38%;
    animation: indexWingFlapLeft var(--index-flap-speed, 0.72s) ease-in-out infinite;
}

.index-free-bug .index-butterfly-wing-right {
    left: 63%;
    transform-origin: 0% 38%;
    animation: indexWingFlapRight var(--index-flap-speed, 0.72s) ease-in-out infinite;
}

.index-free-bug .jeff-thumb-layer,
.index-free-bug .svg-thumb-layer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.index-free-bug .svg-bug-thumb,
.index-free-bug .jeff-bug-thumb {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
    object-position: center;
    animation: thumbFlap var(--thumb-flap-speed, 1.1s) ease-in-out infinite;
    transform-origin: center 38%;
    filter: var(--gallery-bug-shadow, drop-shadow(0 26px 34px rgba(0, 0, 0, 0.42)) drop-shadow(0 14px 22px rgba(0, 0, 0, 0.24)));
}

.index-free-bug.is-jeff .svg-thumb-layer,
.index-free-bug.is-jeff .jeff-thumb-layer,
.index-free-bug.is-jeff .svg-bug-thumb,
.index-free-bug.is-jeff .jeff-bug-thumb {
    animation: none !important;
}

/* Split-bug wings inside index-free-bug use the index wing keyframes (CSS variable driven) */
.index-free-bug .split-bug-assembly {
    position: relative;
    width: 300px;
    height: 389px;
    margin-left: -88px;
    margin-top: -70px;
    transform: scale(var(--bug-scale, 0.55));
    transform-origin: center center;
    filter: drop-shadow(0 24px 34px rgba(0, 0, 0, 0.26)) drop-shadow(0 12px 18px rgba(0, 0, 0, 0.18));
}

.index-free-bug .split-bug-wing-left {
    animation: indexWingFlapLeft var(--index-flap-speed, 0.72s) linear infinite;
    transform-origin: 50% 30%;
    scale: var(--wing-scale, 1);
    translate: var(--lwx, 0%) var(--lwy, 0%);
}

.index-free-bug .split-bug-wing-right {
    animation: indexWingFlapRight var(--index-flap-speed, 0.72s) linear infinite;
    transform-origin: 50% 30%;
    scale: var(--wing-scale, 1);
    translate: var(--rwx, 0%) var(--rwy, 0%);
}

.index-free-bug .split-bug-body {
    animation: indexButterflyBodyBob var(--index-flap-speed, 0.72s) linear infinite;
    scale: var(--body-scale, 1);
}

/* Per-student wing hinge + scale — calibrated live 2026-04-03 via Bug Scale Tuner */
.index-free-bug.student-jeff-paine .split-bug-assembly    { --bug-scale: 0.82; --wing-scale: 1.2; --body-scale: 0.85; }
.index-free-bug.student-jeff-paine .split-bug-wing-left   { transform-origin: 47% 43%; }
.index-free-bug.student-jeff-paine .split-bug-wing-right  { transform-origin: 53% 43%; }

.index-free-bug.student-abby-harris .split-bug-assembly   { --bug-scale: 0.89; --wing-scale: 1; --body-scale: 1; }
.index-free-bug.student-abby-harris .split-bug-wing-left  { transform-origin: 48.5% 39%; }
.index-free-bug.student-abby-harris .split-bug-wing-right { transform-origin: 51% 39%; }

.index-free-bug.student-cass-corona .split-bug-assembly   { --bug-scale: 0.89; --wing-scale: 1; --body-scale: 0.8; }
.index-free-bug.student-cass-corona .split-bug-wing-left  { transform-origin: 48% 45.5%; }
.index-free-bug.student-cass-corona .split-bug-wing-right { transform-origin: 52% 45.5%; }

.index-free-bug.student-chloe-payton .split-bug-assembly  { --bug-scale: 0.83; --wing-scale: 1.2; --body-scale: 1; }
.index-free-bug.student-chloe-payton .split-bug-wing-left  { transform-origin: 48% 32.5%; }
.index-free-bug.student-chloe-payton .split-bug-wing-right { transform-origin: 50% 32.5%; }

.index-free-bug.student-gabby-melendez .split-bug-assembly  { --bug-scale: 0.45; --wing-scale: 1.3; --body-scale: 1; }
.index-free-bug.student-gabby-melendez .split-bug-wing-left  { transform-origin: 51.5% 36%; --lwx: -3%; --lwy: 0%; }
.index-free-bug.student-gabby-melendez .split-bug-wing-right { transform-origin: 48% 36%; --rwx: 3%; --rwy: 0%; }

.index-free-bug.student-hannah-kim .split-bug-assembly   { --bug-scale: 0.60; --wing-scale: 1.3; --body-scale: 1; }
.index-free-bug.student-hannah-kim .split-bug-wing-left  { transform-origin: 49% 35%; }
.index-free-bug.student-hannah-kim .split-bug-wing-right { transform-origin: 51% 35%; }

.index-free-bug.student-jay-jones .split-bug-assembly   { --bug-scale: 0.60; --wing-scale: 1.35; --body-scale: 1; }
.index-free-bug.student-jay-jones .split-bug-wing-left  { transform-origin: 51% 41.5%; --lwx: -0.5%; --lwy: 0%; }
.index-free-bug.student-jay-jones .split-bug-wing-right { transform-origin: 51% 41.5%; --rwx: 0.5%; --rwy: 0%; }

.index-free-bug.student-lee-miller .split-bug-assembly   { --bug-scale: 0.56; --wing-scale: 1.2; --body-scale: 1; }
.index-free-bug.student-lee-miller .split-bug-wing-left  { transform-origin: 46% 31%; }
.index-free-bug.student-lee-miller .split-bug-wing-right { transform-origin: 54% 31%; }

/* Mobile: single decorative bug, CSS-only float */
.mobile-ambient-bug {
    position: fixed;
    top: 18%;
    left: auto;   /* clear the left:0 inherited from .index-free-bug */
    right: 6%;
    width: 96px;
    height: 96px;
    opacity: 0.82;
    pointer-events: none;
    z-index: 50;
    animation: mobileBugFloat 6s ease-in-out infinite;
    --index-flap-speed: 1.4s;
    --index-wing-open: 0.78;
    --index-wing-tight: 0.48;
    --index-wing-clap: 0.38;
}

@keyframes mobileBugFloat {
    0%, 100% { transform: translate(0, 0) rotate(-3deg); }
    25% { transform: translate(-12px, -8px) rotate(2deg); }
    50% { transform: translate(6px, -14px) rotate(-1deg); }
    75% { transform: translate(-4px, -4px) rotate(4deg); }
}

/* Scroll-triggered card reveal */
.scroll-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.45s ease var(--reveal-delay, 0ms),
                transform 0.45s ease var(--reveal-delay, 0ms);
}
.scroll-reveal.scroll-revealed {
    opacity: 1;
    transform: translateY(0);
}

.thesis-line {
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.25rem;
    color: var(--system-line);
    font-weight: 400;
}

/* Filters */
.filters-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--system-line);
    border-bottom: 1px solid var(--system-line);
    padding: var(--spacing-md) 0;
    margin-bottom: var(--spacing-xl);
}

.filters-group {
    display: flex;
    gap: var(--spacing-md);
}

.filter-btn {
    background: transparent;
    border: 1px solid rgba(100, 116, 179, 0.3);
    color: var(--text-muted);
    padding: 6px 16px;
    border-radius: 20px;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.filter-btn:hover,
.filter-btn.active {
    border-color: var(--system-line);
    color: var(--text-main);
}

.results-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: monospace;
}

/* Species Grid */
.species-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    column-gap: calc(var(--spacing-lg) + 10px);
    row-gap: calc(var(--spacing-lg) + 6px);
    overflow: visible;
}

/* Window Components */
.window-box {
    background-color: var(--bg-window);
    border-radius: 24px;
    box-shadow: 10px 10px 20px var(--color-shadow);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.window-header {
    background-color: var(--bg-window);
    border-radius: 12px;
    padding: var(--spacing-sm) var(--spacing-lg);
    box-shadow: 8px 8px 16px var(--color-shadow);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.window-toolbar {
    background-color: var(--bg-window);
    border-radius: 12px;
    padding: var(--spacing-sm) var(--spacing-md);
    box-shadow: 8px 8px 16px var(--color-shadow);
    display: inline-flex;
    gap: var(--spacing-sm);
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.window-emphasis {
    background-color: var(--bg-window);
    border-radius: 8px;
    padding: var(--spacing-xs) var(--spacing-md);
    box-shadow: 6px 6px 12px var(--color-shadow);
    font-size: 0.9rem;
    color: var(--accent-glow);
    text-align: center;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Specimen Card */
.specimen-card {
    position: relative;
    padding: var(--spacing-lg);
    /* box-shadow is owned by JS (updateCardShadows) — direction tracks scroll */
    transition: transform 0.4s ease, border-color 0.4s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    overflow: visible;
    --gallery-thumb-scale: 1.12;
    --gallery-thumb-shift-y: 0px;
    /* Phase 4: lock 3:4 aspect ratio, override any inline height */
    aspect-ratio: 3 / 4;
    height: auto !important;
}

/* Specimen Card Hover */
.specimen-card:hover {
    transform: translateY(-4px);
}

/* Phase 4: species italic at the top of the card, above the bug */
.gallery-species-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 14px 18px 0;
    z-index: 6;
    text-align: center;
    pointer-events: none;
}
.gallery-species-top .common-name {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-shadow: 0 2px 10px rgba(8, 8, 14, 0.85);
}
/* Hide the old .common-name inside .gallery-floating-copy — it's now at top */
.gallery-floating-copy .common-name { display: none; }

/* Phase 4: yellow tap-flash on click → load */
.specimen-card.is-tap-flash {
    border-color: var(--accent-glow) !important;
    box-shadow: 0 0 0 2px rgba(251, 224, 99, 0.45),
                0 12px 42px rgba(251, 224, 99, 0.25) !important;
    transform: translateY(-2px);
    transition: border-color 0.08s ease, box-shadow 0.08s ease, transform 0.08s ease;
}

@media (max-width: 480px) {
    .specimen-card {
        padding: var(--spacing-md);
        aspect-ratio: 3 / 4;
    }
    .gallery-species-top {
        padding: 10px 12px 0;
    }
    .gallery-species-top .common-name {
        font-size: 0.78rem;
    }
    .gallery-floating-copy {
        padding: 40px 12px 14px;
    }
    .gallery-floating-copy .species-name {
        font-size: 1rem;
    }
    .gallery-floating-copy .species-genus {
        font-size: 0.58rem;
    }
}

.bug-container {
    width: 160px;
    height: 160px;
    margin-bottom: 0;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Glow is reserved for hover */
}

.gallery-floating-copy {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 64px 20px 20px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: linear-gradient(to bottom, transparent 0%, rgba(6, 8, 18, 0.82) 100%);
    border-radius: 0 0 var(--radius-card, 18px) var(--radius-card, 18px);
    pointer-events: none;
}

.gallery-floating-copy .species-genus,
.gallery-floating-copy .species-name,
.gallery-floating-copy .common-name {
    text-shadow: 0 2px 10px rgba(8, 8, 14, 0.7);
}

.gallery-home-window {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    overflow: hidden;
    z-index: 1;
}

.gallery-headshot-panel {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    overflow: hidden;
    z-index: 1;
    opacity: 0.62;
    background:
        radial-gradient(circle at 50% 16%, rgba(255,255,255,0.06), transparent 42%),
        linear-gradient(180deg, rgba(255,255,255,0.04), rgba(9, 11, 18, 0.28));
}

.gallery-headshot-panel.is-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-headshot-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    filter: grayscale(0.08) saturate(0.8) contrast(1.04);
}

.gallery-headshot-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(2.8rem, 6vw, 4.8rem);
    letter-spacing: 0.08em;
    font-weight: 300;
    color: rgba(244, 246, 255, 0.5);
    background:
        radial-gradient(circle at 50% 20%, rgba(255,255,255,0.10), transparent 34%),
        linear-gradient(180deg, rgba(255,255,255,0.03), rgba(9, 11, 18, 0.34));
}

.gallery-bug-stage {
    position: absolute;
    left: 8px;
    right: 8px;
    top: -42px;
    bottom: 40px;
    width: auto;
    height: auto;
    margin-bottom: 0;
    overflow: visible;
    pointer-events: none;
    z-index: 3;
    transform-origin: center center;
}

/* Free-floating bugs that escape their card windows */
.gallery-free-bug {
    position: fixed;
    top: 0;
    left: 0;
    width: 124px;
    height: 124px;
    pointer-events: none;
    z-index: 7500;
    will-change: transform;
    transform-origin: center center;
    transition: opacity 0.14s linear;
}

.gallery-free-bug .bug-container {
    position: relative;
    width: 124px;
    height: 124px;
    margin: 0;
    overflow: visible;
}

.gallery-free-bug .jeff-bug-thumb,
.gallery-free-bug .svg-bug-thumb {
    animation: thumbFlap var(--thumb-flap-speed, 1.1s) ease-in-out infinite;
    transform-origin: center 38%;
    filter: var(--gallery-bug-shadow, drop-shadow(0 26px 34px rgba(0, 0, 0, 0.42)) drop-shadow(0 14px 22px rgba(0, 0, 0, 0.24)));
}

.gallery-page-transition {
    position: fixed;
    inset: 0;
    z-index: 9800;
    pointer-events: none;
    --gallery-transition-alpha: 0;
    background: rgba(8, 8, 18, var(--gallery-transition-alpha));
}

.gallery-transition-bug {
    position: fixed;
    top: 0;
    left: 0;
    width: 124px;
    height: 124px;
    z-index: 2;
    will-change: transform;
    transform-origin: center center;
}

.gallery-transition-bug .bug-container {
    width: 124px;
    height: 124px;
    margin: 0;
    overflow: visible;
}

.gallery-transition-bug .jeff-bug-thumb,
.gallery-transition-bug .svg-bug-thumb {
    animation: thumbFlap var(--thumb-flap-speed, 0.42s) ease-in-out infinite;
    transform-origin: center 38%;
    filter: var(--gallery-bug-shadow, drop-shadow(0 24px 42px rgba(8, 8, 18, 0.34)));
}

.bug-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 0 transparent);
    transition: filter 0.5s ease, transform 0.5s ease;
}

.specimen-card:hover .bug-icon {
    filter: drop-shadow(0 0 15px rgba(251, 224, 99, 0.4));
    /* Royal Gold glow */
    transform: translateY(-2px);
}

/* Existing Species info */
.species-info {
    width: 100%;
    border-top: 1px dashed rgba(100, 116, 179, 0.3);
    padding-top: var(--spacing-md);
}

.species-genus {
    font-family: monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}

.species-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 2px;
}

.common-name {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* =========================================
   PROFILE PAGE — 12-COLUMN GRID LAYOUT
   ========================================= */

.profile-container {
    max-width: 1100px;
    padding-top: var(--spacing-xl);
    padding-bottom: var(--spacing-xl);
}

.profile-page .site-header {
    margin-bottom: 0;
}

/*
 * 12-col grid. Two zones:
 *   Cols 1–2  → outer rail  (back btn / photo)
 *   Cols 3–12 → content     (portfolio / meta+bio)
 */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: 24px;
    row-gap: var(--spacing-xxl);
    align-items: start;
}

/* Back button — outer rail, row 1 */
.profile-back {
    grid-column: 1 / 3;
    grid-row: 1;
    padding-top: 6px; /* align optically with section-label */
}

/* Portfolio section — content zone, row 1 */
.portfolio-section {
    grid-column: 3 / 13;
    grid-row: 1;
}

/* About section — full 12 cols, row 2 */
.about-condensed {
    grid-column: 1 / 13;
    grid-row: 2;
    border-top: 1px solid rgba(100, 116, 179, 0.15);
    padding-top: var(--spacing-xl);
}

/*
 * About sub-grid: 2 | 3 | 7  (mirrors the outer 12-col proportions)
 *   photo(2)  aligns with outer-rail above
 *   name+genus(3fr) aligns with left edge of portfolio above
 *   bio(7fr)        fills remaining content zone, 2-col text
 *
 * Mobile: photo top-right (~140px), name+genus left,
 *         tools under photo, bio spans left below name.
 */

/* Desktop: photo | name+genus+tools | bio (3-col grid-area layout) */
.about-grid {
    display: grid;
    grid-template-columns: 2fr 3fr 7fr;
    grid-template-areas:
        "photo name  bio"
        "photo genus bio"
        "photo tools bio";
    column-gap: 24px;
    row-gap: 8px;
    align-items: start;
}

.about-photo-wrap {
    grid-area: photo;
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(100, 116, 179, 0.15);
    background: rgba(30, 30, 43, 0.5);
    min-width: 0;
}

.about-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.about-name {
    grid-area: name;
    margin: 0;
    min-width: 0;
}

.about-genus-tag {
    grid-area: genus;
}

.about-tools {
    grid-area: tools;
    margin-top: 12px;
    min-width: 0;
}

/* Bio column — 2-column text for readability */
.about-bio {
    grid-area: bio;
    columns: 2;
    column-gap: var(--spacing-xl);
    color: var(--text-secondary);
    line-height: 1.75;
    font-size: 0.88rem;
    margin: 0;
    min-width: 0;
}

@media (max-width: 900px) {
    .profile-grid {
        row-gap: var(--spacing-xl);
    }
    .profile-back {
        grid-column: 1 / 13;
        grid-row: 1;
    }
    .portfolio-section {
        grid-column: 1 / 13;
        grid-row: 2;
    }
    .about-condensed {
        grid-column: 1 / 13;
        grid-row: 3;
    }
    /* Tablet: keep 2-col but collapse bio to single column */
    .about-grid {
        grid-template-columns: 140px 1fr;
        grid-template-areas:
            "photo name"
            "photo genus"
            "photo tools"
            "bio   bio";
        row-gap: 8px;
    }
    .about-bio {
        columns: 1;
    }
}

@media (max-width: 600px) {
    /* Phase 1 + 2: side padding on about/tools, tighter name/genus, bio higher,
       photo pulled from edge; spacing above back btn + section-label reduced */
    .profile-container {
        padding-left: 16px;
        padding-right: 16px;
        padding-top: var(--spacing-md);
        padding-bottom: 80px;   /* room for floating prev/next */
    }
    /* Projects get to go almost to edge, about section gets padding */
    .portfolio-section {
        margin-left: -8px;
        margin-right: -8px;
    }
    .profile-grid {
        row-gap: var(--spacing-lg);   /* was --spacing-xxl (desktop) / --spacing-xl (tablet) */
    }
    .portfolio-section .section-label {
        margin-bottom: var(--spacing-sm);
    }
    /* Mobile about grid: photo top-right (124px), name+genus left, bio+tools span full width */
    .about-grid {
        grid-template-columns: 1fr 124px;
        grid-template-areas:
            "name  photo"
            "genus photo"
            "bio   bio"
            "tools tools";
        column-gap: 14px;
        row-gap: 6px;       /* was 10px — tighter name-to-genus */
        padding: 0 4px;
    }
    .about-name {
        margin-bottom: 0;
    }
    .about-genus-tag {
        margin-bottom: 0;
    }
    .about-photo-wrap {
        max-width: 124px;   /* was 140px — pull from edge */
        width: 100%;
        margin-left: auto;
        margin-right: 4px;  /* breathing room from container edge */
    }
    .about-bio {
        columns: 1;
        margin-top: 8px;
    }
    .about-tools {
        margin-top: 10px;
        padding: 0 2px;
    }
    /* Phase 3: sticky back button — floats near top, shrinks to content width */
    .profile-back {
        position: sticky;
        top: var(--site-header-h, 12px);
        z-index: 600;
        width: max-content;
        margin-bottom: var(--spacing-md);
        background: rgba(14, 14, 20, 0.88);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
}

/* Profile Header */
.profile-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--system-line);
    padding-bottom: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.profile-meta {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.profile-meta.right-align {
    text-align: right;
}

.meta-block {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--system-line);
    margin-bottom: 2px;
}

.meta-value {
    font-size: 1.1rem;
    color: var(--text-main);
    font-weight: 400;
}

.meta-value.genus-highlight {
    font-family: monospace;
    color: var(--accent-glow);
}

.meta-block h1.meta-value {
    font-size: 2.5rem;
    margin: 0;
    line-height: 1.2;
}

/* Center Display */
.specimen-display {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    position: relative;
    margin-bottom: var(--spacing-xxl);
}

.large-bug-container {
    width: min(100%, 560px);
    min-height: 520px;
    position: relative;
}

.profile-page .specimen-display {
    isolation: isolate;
}

.profile-header-stack {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    position: relative;
    z-index: 3;
}

.profile-display-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    box-shadow: none;
    position: relative;
    z-index: 2;
}

.profile-layer-ui {
    position: relative;
    z-index: 3;
    flex: 0 0 auto;
    align-self: center;
}

.large-bug-icon {
    width: 100%;
    height: auto;
    display: block;
}

/* Ancillary Callouts */
.ancillary-callout {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--system-line);
}

.callout-top-left {
    top: 10%;
    left: 0;
}

.callout-bottom-right {
    bottom: 0%;
    right: 0;
    flex-direction: row-reverse;
}

.callout-line {
    width: 40px;
    height: 1px;
    background-color: var(--system-line);
    opacity: 0.5;
}

.ui-icon {
    opacity: 0.8;
}

/* Scale Indicator */
.scale-indicator {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
}

.scale-line {
    width: 100px;
    height: 1px;
    background-color: var(--system-line);
    position: relative;
}

.scale-line::before,
.scale-line::after {
    content: '';
    position: absolute;
    height: 6px;
    width: 1px;
    background-color: var(--system-line);
    top: -3px;
}

.scale-line::before {
    left: 0;
}

.scale-line::after {
    right: 0;
}

.scale-text {
    font-family: monospace;
    font-size: 0.7rem;
    color: var(--system-line);
}

/* Condensed Field Guide */
.field-guide {
    margin-bottom: var(--spacing-xl);
}

.guide-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg) var(--spacing-xl);
}

.guide-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--system-line);
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}

.guide-desc {
    font-size: 1.1rem;
    color: var(--text-main);
    line-height: 1.5;
}

/* System Divider */
.system-divider {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(100, 116, 179, 0.4), transparent);
    margin-bottom: var(--spacing-xl);
}

/* Expanded Guide */
.expanded-guide {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-xxl);
}

.expanded-content p {
    margin-bottom: var(--spacing-md);
    font-size: 1.05rem;
    line-height: 1.8;
}

.expanded-content p:last-child {
    margin-bottom: 0;
}

/* Student portrait photo in profile sidebar */
.student-portrait {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center top;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    filter: grayscale(12%) contrast(1.04);
    display: block;
}

.sidebar-photo-block {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 8px 8px 16px var(--color-shadow);
}

.guide-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    border-left: 1px dashed rgba(100, 116, 179, 0.3);
    padding-left: var(--spacing-lg);
}

.tools-list {
    list-style: none;
}

.tools-list li {
    color: var(--text-main);
    font-size: 0.95rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.tools-list li::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    background-color: var(--system-line);
    margin-right: 12px;
}

.portfolio-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid var(--system-line);
    border-radius: 4px;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    transition: all var(--transition-speed);
}

.portfolio-link:hover {
    background-color: rgba(100, 116, 179, 0.1);
    border-color: var(--accent-glow);
    color: var(--accent-glow);
}

/* =========================================
   MUSEUM GRADE ANIMATIONS
   ========================================= */

/* Subtle Breathing Glow for Main Bug */
@keyframes breathingGlow {
    0% {
        filter: drop-shadow(0 0 10px rgba(251, 224, 99, 0.1));
    }

    50% {
        filter: drop-shadow(0 0 25px rgba(251, 224, 99, 0.25));
    }

    100% {
        filter: drop-shadow(0 0 10px rgba(251, 224, 99, 0.1));
    }
}

.breathing-glow {
    animation: breathingGlow 6s infinite ease-in-out;
}

/* Eye Micro Movement */
@keyframes eyeTwitch {

    0%,
    90% {
        transform: translate(0, 0);
    }

    92% {
        transform: translate(1px, -1px);
    }

    94% {
        transform: translate(-1px, 0.5px);
    }

    96% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(0, 0);
    }
}

.eye-movement {
    animation: eyeTwitch 8s infinite;
}

/* Subtle Wing Gradient Shift */
@keyframes wingShift {
    0% {
        opacity: 0.85;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.85;
    }
}

.wing-pulse {
    animation: wingShift 4s infinite ease-in-out;
}

/* Diagram Line Draw (On Load) */
@keyframes drawLine {
    from {
        stroke-dashoffset: 100;
        stroke-dasharray: 100;
    }

    to {
        stroke-dashoffset: 0;
        stroke-dasharray: 100;
    }
}

.draw-line {
    animation: drawLine 2s ease-out forwards;
}

/* =========================================
   V2: GEOMETRIC PARALLAX & TECH ANATOMY
   ========================================= */

/* Complex Gradients */
.grad-plum-teal {
    background: linear-gradient(135deg, var(--color-plum), var(--color-teal));
}

.grad-lobster-gold {
    background: linear-gradient(135deg, var(--color-lobster), var(--accent-glow));
}

.grad-lilac-sage {
    background: linear-gradient(135deg, var(--color-lilac), var(--color-sage));
}

.grad-glass-primary {
    background: linear-gradient(135deg, rgba(100, 116, 179, 0.4), rgba(30, 30, 43, 0.8));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(100, 116, 179, 0.4);
}

.grad-glass-gold {
    background: linear-gradient(135deg, rgba(251, 224, 99, 0.6), rgba(212, 117, 66, 0.6));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(251, 224, 99, 0.5);
    box-shadow: 0 0 20px rgba(251, 224, 99, 0.3);
}

.grad-teal-plum {
    background: linear-gradient(135deg, var(--color-teal), var(--color-plum));
}

.grad-sage-teal {
    background: linear-gradient(135deg, var(--color-sage), var(--color-teal));
}

/* 3D Scene Container */
.scene-3d {
    perspective: 1000px;
    transform-style: preserve-3d;
    width: 100%;
    height: 100%;
    position: relative;
}

/* Parallax Layers */
.layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
    /* Smooth tracking */
    will-change: transform;
}

.profile-layer-ui {
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
    will-change: transform;
}

/* Base Pill Shape for Bug Anatomy */
.anatomy-pill {
    border-radius: 999px;
    position: absolute;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.2), 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Glowing Nodes */
.tech-node {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-glow);
    box-shadow: 0 0 15px var(--accent-glow), 0 0 30px var(--color-chocolate);
    position: absolute;
    z-index: 10;
}

/* Background Floating Particles */
.floating-particles {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    filter: blur(4px);
    opacity: 0.15;
    animation: drift 20s infinite linear;
}

@keyframes drift {
    0% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-50px) rotate(180deg);
    }

    100% {
        transform: translateY(0) rotate(360deg);
    }
}

/* Floating UI Panels */
.floating-ui {
    position: absolute;
    padding: 8px 16px;
    border-radius: 20px;
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 20;
    animation: floatUI 6s infinite ease-in-out;
}

@keyframes floatUI {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Leader Line SVG for Floating UI */
.ui-connection-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 15;
}

.ui-connection-line path {
    stroke: var(--system-line);
    stroke-width: 1.5;
    fill: none;
    stroke-dasharray: 4 4;
    opacity: 0.6;
}

/* =========================================
   INTERACTION STATES & DYNAMIC WING FLAP
   ========================================= */

/* The base transform is dynamically extracted by script.js on render */
.flapping .layer-wing,
.specimen-display:hover .layer-wing,
.specimen-card:hover .layer-wing {
    animation: fastFlap var(--layer-flap-speed, 0.08s) infinite alternate ease-in-out;
    /* Ensure the wing pivot aligns with the visual connection point (typical insect anatomy) */
    transform-origin: center center;
}

@keyframes fastFlap {
    0% {
        transform: var(--base-transform, none) scaleX(1);
    }

    100% {
        transform: var(--base-transform, none) scaleX(var(--layer-flap-squeeze, 0.2)) scaleY(var(--layer-flap-stretch, 1.06));
    }
}

/* =========================================
   GENUS COLOR SYSTEM
   ========================================= */

:root {
    --genus-motion: #FBE063;
    --genus-design: #8B9FD4;
    --genus-art-direction: #DD5658;
}

/* Discipline-specific card hover glow */
.specimen-card.filter-motion:hover {
    border-color: rgba(251, 224, 99, 0.35);
    box-shadow: 14px 14px 24px var(--color-shadow), 0 0 40px rgba(251, 224, 99, 0.1), 0 0 80px rgba(251, 224, 99, 0.04);
}

.specimen-card.filter-design:hover {
    border-color: rgba(139, 159, 212, 0.4);
    box-shadow: 14px 14px 24px var(--color-shadow), 0 0 40px rgba(139, 159, 212, 0.12), 0 0 80px rgba(139, 159, 212, 0.05);
}

.specimen-card.filter-art-direction:hover {
    border-color: rgba(221, 86, 88, 0.35);
    box-shadow: 14px 14px 24px var(--color-shadow), 0 0 40px rgba(221, 86, 88, 0.1), 0 0 80px rgba(221, 86, 88, 0.04);
}

/* Discipline label colors */
.species-genus[data-genus="Motion Design"] { color: var(--genus-motion); }
.species-genus[data-genus="Graphic Design"] { color: var(--genus-design); }
.species-genus[data-genus="Motion"] { color: var(--genus-motion); }
.species-genus[data-genus="Design"] { color: var(--genus-design); }
.species-genus[data-genus="Art Direction"] { color: var(--genus-art-direction); }

/* Filter button discipline active states */
.filter-btn[data-genus="Motion"].active,
.filter-btn[data-genus="Motion"]:hover {
    border-color: var(--genus-motion);
    color: var(--genus-motion);
}

.filter-btn[data-genus="Design"].active,
.filter-btn[data-genus="Design"]:hover {
    border-color: var(--genus-design);
    color: var(--genus-design);
}

.filter-btn[data-genus="Art Direction"].active,
.filter-btn[data-genus="Art Direction"]:hover {
    border-color: var(--genus-art-direction);
    color: var(--genus-art-direction);
}

/* =========================================
   BACK BUTTON (Profile Page)
   ========================================= */

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: monospace;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    border: 1px dashed rgba(100, 116, 179, 0.3);
    border-radius: 999px;
    padding: 7px 18px;
    transition: all var(--transition-speed);
    margin-bottom: var(--spacing-xl);
    position: relative;
}

.back-btn:hover {
    color: var(--text-main);
    border-color: rgba(100, 116, 179, 0.6);
    border-style: solid;
}

/* =========================================
   PREV / NEXT SPECIMEN NAVIGATION
   ========================================= */

.specimen-nav {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: var(--spacing-md);
    /* Sticky to bottom of viewport — lifts above admin bar when present */
    position: sticky;
    bottom: var(--admin-bar-h, 0px);
    z-index: 400;
    background: rgba(14, 14, 20, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(100, 116, 179, 0.15);
    padding: 0 var(--spacing-lg);
}

.specimen-nav-btn {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: var(--spacing-md) var(--spacing-lg);
    border: none;
    border-left: 1px solid transparent;
    color: var(--text-muted);
    transition: all var(--transition-speed);
    min-width: 200px;
    position: relative;
    text-decoration: none;
}

.specimen-nav-btn.prev { text-align: left; border-right: 1px solid rgba(100, 116, 179, 0.12); }
.specimen-nav-btn.next { text-align: right; margin-left: auto; border-left: 1px solid rgba(100, 116, 179, 0.12); }

/* Chevron icons: hidden on desktop, shown on mobile via @media override */
.nav-chevron { display: none; }

.specimen-nav-btn:hover {
    background: rgba(100, 116, 179, 0.07);
    color: var(--text-main);
}

.nav-direction {
    font-family: monospace;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
}

.nav-species-name {
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 600;
}

.nav-genus-label {
    font-family: monospace;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.nav-genus-label[data-genus="Motion Design"] { color: var(--genus-motion); }
.nav-genus-label[data-genus="Graphic Design"] { color: var(--genus-design); }
.nav-genus-label[data-genus="Motion"] { color: var(--genus-motion); }
.nav-genus-label[data-genus="Design"] { color: var(--genus-design); }
.nav-genus-label[data-genus="Art Direction"] { color: var(--genus-art-direction); }

/* =========================================
   SEARCH BAR
   ========================================= */

.search-container {
    margin-bottom: var(--spacing-xl);
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(100, 116, 179, 0.2);
    background: rgba(30, 30, 43, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 12px 20px;
    transition: border-color var(--transition-speed);
    position: relative;
}

.search-input-wrapper::before,
.search-input-wrapper::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    border: 1px solid rgba(100, 116, 179, 0.3);
}

.search-input-wrapper::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.search-input-wrapper::after  { bottom: -1px; right: -1px; border-left: none; border-top: none; }

.search-input-wrapper:focus-within {
    border-color: rgba(100, 116, 179, 0.5);
}

.search-prompt {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--system-line);
    white-space: nowrap;
    user-select: none;
}

.search-input {
    background: transparent;
    border: none;
    outline: none;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-main);
    width: 100%;
    caret-color: var(--accent-glow);
}

.search-input::placeholder {
    color: rgba(160, 165, 181, 0.35);
}

.search-clear {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-family: monospace;
    font-size: 0.72rem;
    padding: 0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-speed), color var(--transition-speed);
    white-space: nowrap;
}

.search-container.has-query .search-clear {
    opacity: 1;
    pointer-events: auto;
}

.search-clear:hover {
    color: var(--text-main);
}

.search-no-results {
    display: none;
    text-align: center;
    padding: var(--spacing-xxl) 0;
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--system-line);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.search-no-results.visible {
    display: block;
}

/* =========================================
   SPECIMEN COUNTER (Nav)
   ========================================= */

.specimen-counter {
    font-family: monospace;
    font-size: 0.72rem;
    color: rgba(100, 116, 179, 0.5);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    pointer-events: none;
    user-select: none;
}

/* =========================================
   LOADING OVERLAY
   ========================================= */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    transition: opacity 0.6s ease;
}

.loading-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-title {
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-glow);
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: 0.1s;
}

.loading-text {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--system-line);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: 0.3s;
}

.loading-bar-track {
    width: 220px;
    height: 1px;
    background: rgba(100, 116, 179, 0.15);
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: fadeInUp 0.4s ease forwards;
    animation-delay: 0.4s;
}

.loading-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--system-line), var(--accent-glow));
    animation: loadFill 0.9s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: 0.5s;
}

@keyframes loadFill {
    to { width: 100%; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}



/* =========================================
   FIELD NOTES EASTER EGG
   ========================================= */

.field-note {
    display: none;
    position: absolute;
    background: rgba(251, 224, 99, 0.04);
    border: 1px dashed rgba(251, 224, 99, 0.25);
    padding: 10px 14px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.78rem;
    font-style: italic;
    color: rgba(251, 224, 99, 0.7);
    max-width: 220px;
    line-height: 1.6;
    transform: rotate(-1.5deg);
    z-index: 50;
    pointer-events: none;
}

body.field-notes-active .field-note {
    display: block;
    animation: noteAppear 0.3s ease forwards;
}

@keyframes noteAppear {
    from { opacity: 0; transform: rotate(-1.5deg) translateY(4px); }
    to   { opacity: 1; transform: rotate(-1.5deg) translateY(0); }
}

/* =========================================
   WING FLAP RIPPLE
   ========================================= */

.wingbeat-ripple {
    position: fixed;
    border-radius: 50%;
    border: 1px solid rgba(251, 224, 99, 0.3);
    pointer-events: none;
    z-index: 500;
    animation: rippleExpand 1.2s ease-out forwards;
    transform: translate(-50%, -50%);
}

@keyframes rippleExpand {
    0%   { width: 0px; height: 0px; opacity: 0.7; }
    100% { width: 400px; height: 400px; opacity: 0; }
}

/* =========================================
   MOBILE RESPONSIVE
   ========================================= */

@media (max-width: 768px) {

    h1 { font-size: 2.5rem; }
    h2 { margin-bottom: var(--spacing-lg); }

    .container {
        padding: var(--spacing-xl) var(--spacing-md);
    }

    .site-header {
        margin-bottom: var(--spacing-xl);
    }

    .nav-list {
        gap: var(--spacing-lg);
        flex-wrap: wrap;
    }

    .species-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: var(--spacing-md);
    }

    .specimen-display {
        height: 420px !important;
    }

    .large-bug-container {
        width: 280px !important;
        height: 280px !important;
    }

    .profile-header {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .profile-meta.right-align {
        text-align: left;
    }

    .guide-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .expanded-guide {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }

    .guide-sidebar {
        border-left: none;
        border-top: 1px dashed rgba(100, 116, 179, 0.3);
        padding-left: 0;
        padding-top: var(--spacing-lg);
    }

    /* Mobile specimen nav: floating corner buttons matching .back-btn dashed aesthetic */
    .specimen-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: calc(var(--admin-bar-h, 0px) + 14px);
        padding: 0 14px;
        pointer-events: none;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-top: none;
        z-index: 500;
    }

    .specimen-nav-btn {
        pointer-events: auto;
        position: relative;
        width: 44px;
        height: 44px;
        min-width: unset;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;   /* circular chevron buttons, matching rounded site */
        background: rgba(14, 14, 20, 0.88);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px dashed rgba(100, 116, 179, 0.35);
        flex-direction: row;
    }

    .specimen-nav-btn.next {
        margin-left: 0;
        text-align: left;
    }

    /* Hide text labels on mobile, show chevron only */
    .specimen-nav-btn .nav-direction,
    .specimen-nav-btn .nav-species-name,
    .specimen-nav-btn .nav-genus-label {
        display: none;
    }

    .specimen-nav-btn .nav-chevron {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .floating-ui {
        display: none;
    }
}

@media (max-width: 480px) {

    h1 { font-size: 1.9rem; }

    .container {
        padding: var(--spacing-lg) var(--spacing-sm);
    }

    .nav-list {
        gap: var(--spacing-md);
        justify-content: center;
    }

    .specimen-counter {
        display: none;
    }

    .species-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .filters-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    .filters-group {
        flex-wrap: wrap;
    }

    .specimen-display {
        height: 340px !important;
    }

    .large-bug-container {
        width: 220px !important;
        height: 220px !important;
    }

    .search-input-wrapper {
        padding: 10px 14px;
    }
}

/* =========================================
   INDEX PAGE — Mobile hero adjustments
   Keeps title readable, removes forced full-screen height
   ========================================= */
@media (max-width: 600px) {
    /* Remove the min-height: 100svh that forces a blank void below the countdown.
       Let content determine height naturally — the page flows better on mobile. */
    .index-lockup-section {
        min-height: 0;
        justify-content: flex-start;
        padding-top: max(64px, 13vh);
        padding-bottom: clamp(40px, 9vh, 72px);
    }

    /* .gallery-hero also has min-height: calc(100vh - 140px) — override it on index */
    .index-page .gallery-hero {
        min-height: 0;
    }

    .index-countdown-wrap {
        gap: 8px;
        padding: 12px 14px;
    }

    .countdown-unit {
        min-width: 52px;
    }

    /* Phase 7C: ETAMU kicker — 2 lines, no dot on mobile */
    .index-lockup-kicker {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }
    .index-lockup-kicker .kicker-sep {
        display: none;
    }
}

/* =========================================
   AUCTION PAGE
   ========================================= */

.auction-intro {
    max-width: 620px;
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text-muted);
    margin-bottom: var(--spacing-xl);
}

.auction-status-bar {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-family: monospace;
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--system-line);
    margin-bottom: var(--spacing-xxl);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px dashed rgba(100, 116, 179, 0.2);
}

.auction-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-glow);
    box-shadow: 0 0 8px rgba(251, 224, 99, 0.5);
    animation: breathingGlow 3s ease-in-out infinite;
    flex-shrink: 0;
}

.auction-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xxl);
}

.acquisition-record {
    border: 1px solid rgba(100, 116, 179, 0.15);
    border-radius: 4px;
    background: rgba(30, 30, 43, 0.5);
    padding: var(--spacing-lg);
    position: relative;
    overflow: hidden;
    transition: border-color 0.35s ease, background 0.35s ease;
}

.acquisition-record::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(to right, rgba(251, 224, 99, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.acquisition-record:hover {
    border-color: rgba(100, 116, 179, 0.3);
    background: rgba(30, 30, 43, 0.7);
}

.acquisition-record:hover::before {
    opacity: 1;
}

.acquisition-record.featured {
    border-color: rgba(251, 224, 99, 0.15);
    grid-column: span 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    align-items: start;
}

.acquisition-record.featured::before {
    background: linear-gradient(to right, rgba(251, 224, 99, 0.4), transparent);
}

.acq-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-md);
}

.acq-num {
    font-family: monospace;
    font-size: 0.58rem;
    letter-spacing: 0.18em;
    color: rgba(100, 116, 179, 0.4);
    text-transform: uppercase;
}

.acq-status {
    font-family: monospace;
    font-size: 0.55rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 2px;
    border: 1px solid;
    flex-shrink: 0;
}

.acq-status.pending {
    color: rgba(100, 116, 179, 0.5);
    border-color: rgba(100, 116, 179, 0.2);
}

.acq-status.open {
    color: rgba(251, 224, 99, 0.7);
    border-color: rgba(251, 224, 99, 0.25);
}

.acq-title {
    font-size: 1.25rem;
    font-weight: 300;
    letter-spacing: 0.04em;
    margin-bottom: var(--spacing-sm);
    color: var(--text-main);
}

.acq-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.acq-row {
    display: flex;
    gap: var(--spacing-md);
    align-items: baseline;
}

.acq-label {
    font-family: monospace;
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(100, 116, 179, 0.5);
    min-width: 80px;
    flex-shrink: 0;
}

.acq-value {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.acq-value.tbd {
    font-family: monospace;
    font-size: 0.75rem;
    color: rgba(160, 165, 181, 0.3);
    letter-spacing: 0.1em;
}

.acq-desc {
    font-size: 0.88rem;
    line-height: 1.7;
    color: rgba(160, 165, 181, 0.6);
    margin-top: var(--spacing-sm);
    padding-top: var(--spacing-sm);
    border-top: 1px dashed rgba(100, 116, 179, 0.1);
}

.auction-note {
    font-family: monospace;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    color: rgba(100, 116, 179, 0.35);
    text-align: center;
    padding: var(--spacing-xl) 0;
    border-top: 1px dashed rgba(100, 116, 179, 0.1);
    line-height: 1.9;
}

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

    .acquisition-record.featured {
        grid-column: span 1;
        grid-template-columns: 1fr;
    }
}

/* =========================================
   VISIT PAGE
   ========================================= */

.visit-hero-label {
    font-family: monospace;
    font-size: 0.65rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--accent-glow);
    opacity: 0.7;
    margin-bottom: var(--spacing-md);
}

.visit-coord-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xxl);
}

.visit-card {
    background: rgba(43, 44, 58, 0.4);
    padding: var(--spacing-lg);
    border-radius: 6px;
    border: 1px solid rgba(100, 116, 179, 0.15);
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.visit-card::after {
    content: "";
    position: absolute;
    top: 0; right: 0;
    width: 40px; height: 40px;
    border-top: 1px solid rgba(100, 116, 179, 0.2);
    border-right: 1px solid rgba(100, 116, 179, 0.2);
}

.visit-card:hover {
    border-color: rgba(100, 116, 179, 0.3);
}

.visit-card-label {
    font-family: monospace;
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--system-line);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: 8px;
}

.visit-card-label::before {
    content: "";
    display: inline-block;
    width: 18px;
    height: 1px;
    background: var(--system-line);
    opacity: 0.4;
}

.visit-card p {
    font-size: 1rem;
    line-height: 1.9;
    color: var(--text-muted);
}

.visit-card strong {
    color: var(--text-main);
    font-weight: 400;
}

.visit-card .visit-free-tag {
    display: inline-block;
    margin-top: var(--spacing-sm);
    font-family: monospace;
    font-size: 0.6rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(251, 224, 99, 0.6);
    border: 1px solid rgba(251, 224, 99, 0.2);
    padding: 3px 9px;
    border-radius: 2px;
}

.visit-access-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xxl);
}

.visit-access-item {
    padding: var(--spacing-md) var(--spacing-lg);
    border-left: 1px dashed rgba(100, 116, 179, 0.25);
}

.visit-access-label {
    font-family: monospace;
    font-size: 0.58rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(100, 116, 179, 0.5);
    margin-bottom: 8px;
}

.visit-access-text {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-muted);
}

.visit-map-placeholder {
    border: 1px dashed rgba(100, 116, 179, 0.2);
    border-radius: 6px;
    padding: var(--spacing-xxl) var(--spacing-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    background: rgba(30, 30, 43, 0.3);
    margin-bottom: var(--spacing-xxl);
    position: relative;
    overflow: hidden;
}

.visit-map-crosshair {
    position: relative;
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.visit-map-crosshair::before,
.visit-map-crosshair::after {
    content: "";
    position: absolute;
    background: rgba(100, 116, 179, 0.3);
}

.visit-map-crosshair::before {
    width: 1px; height: 100%;
    left: 50%; top: 0;
}

.visit-map-crosshair::after {
    height: 1px; width: 100%;
    top: 50%; left: 0;
}

.visit-map-dot {
    position: absolute;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--accent-glow);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 12px rgba(251, 224, 99, 0.5);
    animation: breathingGlow 3s ease-in-out infinite;
}

.visit-map-label {
    font-family: monospace;
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(100, 116, 179, 0.4);
    text-align: center;
}

.visit-map-address {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
}

@media (max-width: 768px) {
    .visit-coord-grid,
    .visit-access-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   ABOUT PAGE — Taxonomy Overview
   ========================================= */

.about-section-label {
    font-family: monospace;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--system-line);
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px dashed rgba(100, 116, 179, 0.3);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.about-section-label::before {
    content: "//";
    color: var(--accent-glow);
    opacity: 0.6;
}

.about-section {
    margin-bottom: var(--spacing-xxl);
}

.about-hero-tag {
    font-family: monospace;
    font-size: 0.65rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--accent-glow);
    opacity: 0.7;
    margin-bottom: var(--spacing-md);
}

.about-lead {
    font-size: 1.3rem;
    color: var(--text-muted);
    font-weight: 300;
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-xl);
    max-width: 700px;
}

.about-concept {
    max-width: 680px;
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text-muted);
    margin-bottom: var(--spacing-lg);
}

.about-divider {
    width: 80px;
    height: 1px;
    background: linear-gradient(to right, var(--accent-glow), transparent);
    margin: var(--spacing-xl) 0;
    opacity: 0.4;
}

/* Genera Classification Cards */
.genera-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
}

.genus-card {
    padding: var(--spacing-lg);
    border: 1px solid rgba(100, 116, 179, 0.15);
    border-radius: 6px;
    background: rgba(30, 30, 43, 0.6);
    position: relative;
    overflow: hidden;
    /* Shadow Y driven by JS scroll tracker, same light-source logic as specimen cards */
    transition: border-color 0.4s ease, box-shadow 0.3s ease;
}

.genus-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    opacity: 0.6;
    transition: opacity 0.4s ease;
}

.genus-card[data-genus="Motion"]::before {
    background: linear-gradient(to right, var(--genus-motion), transparent);
}

.genus-card[data-genus="Design"]::before {
    background: linear-gradient(to right, var(--genus-design), transparent);
}

.genus-card[data-genus="Art Direction"]::before {
    background: linear-gradient(to right, var(--genus-art-direction), transparent);
}

.genus-card:hover {
    border-color: rgba(100, 116, 179, 0.3);
}

.genus-card[data-genus="Motion"]:hover {
    box-shadow: 0 0 30px rgba(251, 224, 99, 0.06);
}

.genus-card[data-genus="Design"]:hover {
    box-shadow: 0 0 30px rgba(139, 159, 212, 0.06);
}

.genus-card[data-genus="Art Direction"]:hover {
    box-shadow: 0 0 30px rgba(221, 86, 88, 0.06);
}

.genus-card-badge {
    font-family: monospace;
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 2px;
    display: inline-block;
    margin-bottom: var(--spacing-md);
}

.genus-card[data-genus="Motion"] .genus-card-badge {
    color: var(--genus-motion);
    background: rgba(251, 224, 99, 0.08);
    border: 1px solid rgba(251, 224, 99, 0.2);
}

.genus-card[data-genus="Design"] .genus-card-badge {
    color: var(--genus-design);
    background: rgba(139, 159, 212, 0.08);
    border: 1px solid rgba(139, 159, 212, 0.2);
}

.genus-card[data-genus="Art Direction"] .genus-card-badge {
    color: var(--genus-art-direction);
    background: rgba(221, 86, 88, 0.08);
    border: 1px solid rgba(221, 86, 88, 0.2);
}

.genus-card-title {
    font-size: 1.6rem;
    font-weight: 300;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: var(--spacing-sm);
}

.genus-card-desc {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-muted);
}

.genus-card-trait {
    margin-top: var(--spacing-md);
    font-family: monospace;
    font-size: 0.65rem;
    color: rgba(160, 165, 181, 0.5);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Specimen Plate */
.specimen-plate-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
}

.plate-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-lg) var(--spacing-md);
    border: 1px dashed rgba(100, 116, 179, 0.2);
    border-radius: 4px;
    background: rgba(30, 30, 43, 0.4);
    position: relative;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.plate-cell:hover {
    border-color: rgba(100, 116, 179, 0.4);
    background: rgba(30, 30, 43, 0.7);
}

.plate-cell-num {
    position: absolute;
    top: 8px;
    left: 10px;
    font-family: monospace;
    font-size: 0.55rem;
    color: rgba(100, 116, 179, 0.35);
    letter-spacing: 0.1em;
}

.plate-bug-wrap {
    width: 100px;
    height: 100px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.plate-species-name {
    font-family: monospace;
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
    margin-bottom: 4px;
}

.plate-common-name {
    font-family: monospace;
    font-size: 0.55rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(160, 165, 181, 0.4);
    text-align: center;
}

.plate-genus-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-top: 8px;
    flex-shrink: 0;
}

.plate-cell[data-genus="Motion"] .plate-genus-dot { background: var(--genus-motion); }
.plate-cell[data-genus="Design"] .plate-genus-dot { background: var(--genus-design); }
.plate-cell[data-genus="Art Direction"] .plate-genus-dot { background: var(--genus-art-direction); }

/* Credits */
.about-credits-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--spacing-xl);
}

.credit-group-label {
    font-family: monospace;
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--system-line);
    margin-bottom: var(--spacing-md);
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(100, 116, 179, 0.15);
}

.credit-entry {
    font-size: 0.9rem;
    color: var(--text-muted);
    padding: 6px 0;
    border-bottom: 1px solid rgba(100, 116, 179, 0.06);
    display: flex;
    align-items: center;
    gap: 8px;
}

.credit-entry::before {
    content: "·";
    color: var(--accent-glow);
    opacity: 0.4;
    flex-shrink: 0;
}

.credit-entry.highlight {
    color: var(--text-main);
}

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

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

    .about-credits-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
}

@media (max-width: 480px) {
    .specimen-plate-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
}

/* ================================================
   SCROLL & DEPTH SYSTEM
   ================================================ */

/* Nav elevates on scroll — casts shadow over content below */
.site-header {
    transition: box-shadow 0.4s ease, background-color 0.4s ease;
}

.site-header.scrolled {
    background-color: rgba(8, 8, 18, 0.97);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow:
        0 1px 0 rgba(100, 116, 179, 0.14),
        0 2px 14px rgba(0, 0, 0, 0.4);
}

/* Section entrance reveal — fade up from below */
.animate-in {
    opacity: 0;
    transform: translateY(22px);
    transition:
        opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hero parallax container */
.hero-parallax {
    position: relative;
}
/* =========================================
   JEFF PAINE — SVG BUG CARD ANIMATIONS
   Float = slow vertical bob on wrapper div
   Wings = scaleX flutter on the img itself
   Shadow = CSS drop-shadow traces SVG shape
   ========================================= */

/* Profile page — inline SVG card. Floats gently, drop-shadow traces the real card shape. */
.jeff-bug-inline,
.inline-svg-bug {
    display: block;
    width: min(100%, 441px);
    height: auto;
    max-width: 100%;
    overflow: visible;
    user-select: none;
    cursor: default;
    position: relative;
    z-index: 2;
}

.jeff-inline-stage,
.inline-svg-stage {
    width: 100%;
    max-width: 441px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

/* Gallery card thumbnail — bug only, fills the card area */
.jeff-thumb-layer,
.svg-thumb-layer {
    position: absolute;
    inset: -12% -10% 0 -10%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: visible;
    z-index: 3;
}

.jeff-bug-thumb,
.svg-bug-thumb {
    display: block;
    width: calc(100% * var(--gallery-thumb-scale));
    height: calc(100% * var(--gallery-thumb-scale));
    max-width: none;
    max-height: none;
    object-fit: contain;
    object-position: center;
    user-select: none;
    margin-top: var(--gallery-thumb-shift-y);
    transition: transform 0.15s ease;
    filter:
        drop-shadow(0 26px 34px rgba(0, 0, 0, 0.42))
        drop-shadow(0 14px 22px rgba(0, 0, 0, 0.24));
}


.specimen-card.student-jeff-paine {
    --gallery-thumb-scale: 1.18;
    --gallery-thumb-shift-y: 2px;
}

.specimen-card.student-abby-harris {
    --gallery-thumb-scale: 1.15;
    --gallery-thumb-shift-y: 6px;
}

.specimen-card.student-cass-corona {
    --gallery-thumb-scale: 1.18;
    --gallery-thumb-shift-y: 8px;
}

.specimen-card.student-chloe-payton {
    --gallery-thumb-scale: 1.22;
    --gallery-thumb-shift-y: 12px;
}

.specimen-card.student-gabby-melendez {
    --gallery-thumb-scale: 0.94;
    --gallery-thumb-shift-y: 4px;
}

.specimen-card.student-hannah-kim {
    --gallery-thumb-scale: 1.14;
    --gallery-thumb-shift-y: 6px;
}

.specimen-card.student-jay-jones {
    --gallery-thumb-scale: 1.16;
    --gallery-thumb-shift-y: 8px;
}

.specimen-card.student-lee-miller {
    --gallery-thumb-scale: 1.18;
    --gallery-thumb-shift-y: 8px;
}


/* Card hover — gentle lift instead of squish */
.specimen-card:hover .jeff-bug-thumb,
.specimen-card:hover .svg-bug-thumb {
    transform: scale(1.04) translateY(-3px);
    transition: transform 0.3s ease;
}

/* Split-bug assembly — full-canvas stacking (all layers same canvas size) */
.split-bug-assembly {
    position: relative;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.35s ease;
}
.split-bug-assembly.bug-loaded {
    opacity: 1;
}
.be-stage .split-bug-assembly {
    opacity: 1;
    transition: none;
}

.split-bug-assembly img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    user-select: none;
    pointer-events: none;
    display: block;
}

.split-bug-body {
    z-index: 2;
    animation: splitBodyBob var(--split-flap-speed, var(--thumb-flap-speed, 1.1s)) ease-in-out infinite;
}

.split-bug-wing {
    z-index: 3;
}

.split-bug-wing-left {
    transform-origin: 50% 30%;
    animation: splitWingFlapLeft var(--split-flap-speed, var(--thumb-flap-speed, 1.1s)) ease-in-out infinite;
}

.split-bug-wing-right {
    transform-origin: 50% 30%;
    animation: splitWingFlapRight var(--split-flap-speed, var(--thumb-flap-speed, 1.1s)) ease-in-out infinite;
}

/* Card hover on split-bug — faster flap */
.specimen-card:hover .split-bug-wing-left,
.specimen-card:hover .split-bug-wing-right {
    animation-duration: 0.32s;
}

.specimen-card:hover .split-bug-body {
    animation-duration: 0.32s;
}

@keyframes splitWingFlapLeft {
    0%   { transform: scaleX(1); }
    38%  { transform: scaleX(0.12); }
    46%  { transform: scaleX(0.06); }
    100% { transform: scaleX(1); }
}

@keyframes splitWingFlapRight {
    0%   { transform: scaleX(1); }
    38%  { transform: scaleX(0.12); }
    46%  { transform: scaleX(0.06); }
    100% { transform: scaleX(1); }
}

@keyframes splitBodyBob {
    0%   { transform: translateY(0px); }
    38%  { transform: translateY(-2px); }
    46%  { transform: translateY(-3px); }
    100% { transform: translateY(0px); }
}


@keyframes thumbFlap {
    0%, 100% { transform: translateY(0) scaleX(1) scaleY(1); }
    40%      { transform: translateY(calc(var(--thumb-bob, 3px) * -1)) scaleX(var(--thumb-flap-squeeze, 0.82)) scaleY(var(--thumb-flap-stretch, 1.07)); }
    80%      { transform: translateY(calc(var(--thumb-bob, 3px) * -0.55)) scaleX(calc((1 + var(--thumb-flap-squeeze, 0.82)) * 0.5)) scaleY(calc(1 + (var(--thumb-flap-stretch, 1.07) - 1) * 0.7)); }
}


/*
  Wing flap: left wing hinges at right edge (transform-origin: ~50% 30–45%).
  Downstroke is fast (cubic-bezier eases in), upstroke is slower (ease-out).
  rotateZ adds arc: +degrees = clockwise = tip sweeps downward during fold.
  Body lifts on downstroke (negative Y), settles back on upstroke.
*/
@keyframes indexWingFlapLeft {
    0%   {
        transform: scaleX(var(--index-wing-open, 1)) rotateZ(0deg);
        animation-timing-function: cubic-bezier(0.42, 0, 0.9, 0.55);
    }
    38%  {
        transform: scaleX(var(--index-wing-tight, 0.08)) rotateZ(8deg);
        animation-timing-function: ease;
    }
    46%  {
        transform: scaleX(var(--index-wing-clap, 0.04)) rotateZ(10deg);
        animation-timing-function: cubic-bezier(0.1, 0.6, 0.4, 1);
    }
    74%  {
        transform: scaleX(calc(var(--index-wing-open, 1) * 0.9)) rotateZ(-2deg);
        animation-timing-function: ease-out;
    }
    100% {
        transform: scaleX(var(--index-wing-open, 1)) rotateZ(0deg);
    }
}

/* Right wing mirrors rotation direction (- angles = counterclockwise = tip sweeps down) */
@keyframes indexWingFlapRight {
    0%   {
        transform: scaleX(var(--index-wing-open, 1)) rotateZ(0deg);
        animation-timing-function: cubic-bezier(0.42, 0, 0.9, 0.55);
    }
    38%  {
        transform: scaleX(var(--index-wing-tight, 0.08)) rotateZ(-8deg);
        animation-timing-function: ease;
    }
    46%  {
        transform: scaleX(var(--index-wing-clap, 0.04)) rotateZ(-10deg);
        animation-timing-function: cubic-bezier(0.1, 0.6, 0.4, 1);
    }
    74%  {
        transform: scaleX(calc(var(--index-wing-open, 1) * 0.9)) rotateZ(2deg);
        animation-timing-function: ease-out;
    }
    100% {
        transform: scaleX(var(--index-wing-open, 1)) rotateZ(0deg);
    }
}

@keyframes indexButterflyBodyBob {
    0%   { transform: translateY(0px) rotateZ(0deg); }
    38%  { transform: translateY(calc(var(--index-bob-y, 3) * -1px)) rotateZ(0.6deg); }
    46%  { transform: translateY(calc(var(--index-bob-peak, 4) * -1px)) rotateZ(0.9deg); }
    74%  { transform: translateY(calc(var(--index-bob-y, 3) * -0.25px)) rotateZ(-0.2deg); }
    100% { transform: translateY(0px) rotateZ(0deg); }
}

/* =========================================
   PORTFOLIO SECTION — Masonry grid
   ========================================= */

.portfolio-section {
    /* spacing handled by profile-grid row-gap */
}

.section-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.12em;
    margin-bottom: var(--spacing-md);
}

.portfolio-masonry {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

/* Phase 3: 2-col portfolio grid on mobile */
@media (max-width: 600px) {
    .portfolio-masonry {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}
@media (max-width: 380px) {
    .portfolio-masonry { gap: 8px; }
    .portfolio-card-info { padding: 8px 10px 10px; }
    .portfolio-card-title { font-size: 0.78rem; }
}

.portfolio-card {
    margin-bottom: 0;
    background: var(--bg-window);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.portfolio-card:hover {
    border-color: var(--accent-glow);
    box-shadow: 0 8px 32px rgba(251,224,99,0.12);
    transform: translateY(-2px);
}

.portfolio-card-thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: linear-gradient(110deg, rgba(20,22,35,1) 30%, rgba(40,44,65,0.5) 50%, rgba(20,22,35,1) 70%);
    background-size: 200% 100%;
    animation: lightbox-shimmer 1.6s ease-in-out infinite;
}
.portfolio-card-thumb-wrap.loaded {
    background: rgba(255,255,255,0.03);
    animation: none;
}

.portfolio-card-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.portfolio-card-thumb-wrap.loaded .portfolio-card-img {
    opacity: 1;
}

.portfolio-card:hover .portfolio-card-img {
    transform: scale(1.03);
}

/* SVG play badge — shown on motion projects with an external link */
.portfolio-card-play-badge {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.9);
    background: rgba(0,0,0,0.32);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.portfolio-card:hover .portfolio-card-play-badge {
    opacity: 1;
}

.thumb-missing-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    padding: 3px 7px;
    background: rgba(220, 50, 50, 0.85);
    color: #fff;
    font-family: var(--font-mono, monospace);
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 2px;
    pointer-events: none;
    z-index: 4;
}

.portfolio-card-info {
    padding: 12px 14px 14px;
}

.portfolio-card-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
    letter-spacing: 0.02em;
    line-height: 1.35;
}

.portfolio-card-hint,
.project-external-link {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.portfolio-card-hint {
    color: rgba(160, 165, 181, 0.38);
}

.project-external-link {
    color: rgba(251, 224, 99, 0.82);
    text-decoration: none;
    border-bottom: 1px solid rgba(251, 224, 99, 0.26);
    padding-bottom: 2px;
    transition: color 0.18s ease, border-color 0.18s ease;
}

.project-external-link:hover {
    color: rgba(251, 224, 99, 1);
    border-color: rgba(251, 224, 99, 0.5);
}

.portfolio-empty {
    padding: var(--spacing-lg) 0;
    opacity: 0.5;
}

/* =========================================
   LIGHTBOX
   ========================================= */

.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 9500;  /* above site-header (9000) so nav doesn't cover the spotlight */
    background: rgba(6, 6, 14, 0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox-inner {
    position: relative;
    display: flex;
    width: 100%;
    max-width: 1100px;
    height: 88vh;         /* fixed height — lets flex children scroll inside */
    background: rgba(14, 14, 24, 0.75);
    backdrop-filter: blur(32px) saturate(1.5);
    -webkit-backdrop-filter: blur(32px) saturate(1.5);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(100, 116, 179, 0.06),
        0 40px 100px rgba(0, 0, 0, 0.7);
}

/* Close button */
.lightbox-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 10;
    background: rgba(14, 14, 24, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(160, 165, 181, 0.6);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    line-height: 0; /* prevent extra height from SVG inline-block */
}

.lightbox-close:hover {
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.35);
}

/* Image pane — scrollable stack */
.lightbox-image-pane {
    flex: 1;
    min-width: 0;          /* allow flex shrink */
    position: relative;
    background: #06060e;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    /* Custom slim scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 179, 0.42) transparent;
}

.lightbox-image-pane::-webkit-scrollbar        { width: 6px; }
.lightbox-image-pane::-webkit-scrollbar-track  { background: transparent; }
.lightbox-image-pane::-webkit-scrollbar-thumb  { background: rgba(100, 116, 179, 0.45); border-radius: 999px; }

.lightbox-image-pane.show-scroll-affordance::after {
    content: "";
    position: sticky;
    left: 0;
    bottom: 0;
    display: block;
    width: 100%;
    height: 112px;
    margin-top: -112px;
    background: linear-gradient(to bottom, rgba(6, 6, 14, 0), rgba(6, 6, 14, 0.78) 72%, rgba(6, 6, 14, 0.96));
    pointer-events: none;
    z-index: 2;
}

/* Each image block in the scroll stack */
.lightbox-img-item {
    position: relative;
    display: block;
    width: 100%;
    min-height: 200px;
    background: linear-gradient(110deg, rgba(20,22,35,1) 30%, rgba(40,44,65,0.5) 50%, rgba(20,22,35,1) 70%);
    background-size: 200% 100%;
    animation: lightbox-shimmer 1.6s ease-in-out infinite;
}
.lightbox-img-item.loaded {
    min-height: 0;
    background: none;
    animation: none;
}
@keyframes lightbox-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Main image and supporting images — full width, natural height */
.lightbox-stack-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

/* Caption below supporting images */
.lightbox-img-caption {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    line-height: 1.5;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(242, 245, 255, 0.86);
    padding: 12px 16px 14px;
    background: rgba(7, 8, 15, 0.96);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.lightbox-scroll-hint {
    position: sticky;
    bottom: 18px;
    margin: -72px auto 0;
    width: fit-content;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 9px 14px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 999px;
    background: rgba(12, 12, 22, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 3;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.lightbox-scroll-hint.is-hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
}

.lightbox-scroll-hint-text {
    font-family: var(--font-mono);
    font-size: 0.56rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}

.lightbox-scroll-hint-arrow {
    font-size: 0.72rem;
    color: rgba(251, 224, 99, 0.82);
    animation: scrollHintBounce 1.15s ease-in-out infinite;
}

@keyframes scrollHintBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}

/* Detail pane */
.lightbox-detail-pane {
    width: 300px;
    flex-shrink: 0;
    padding: 32px 26px 28px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    scrollbar-width: none;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.lightbox-detail-pane::-webkit-scrollbar { display: none; }

/* Phase 5: lightbox-genus-badge REMOVED — no yellow MOTION DESIGN box */

.lightbox-project-title {
    font-size: 1.2rem;
    font-weight: 300;
    letter-spacing: 0.03em;
    color: rgba(255, 255, 255, 0.92);
    margin-bottom: 6px;
    line-height: 1.3;
}

.lightbox-author-line {
    font-family: monospace;
    font-size: 0.58rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(160, 165, 181, 0.4);
    margin-bottom: 20px;
}

/* Phase 5: lightbox-project-meta + lightbox-meta-chip REMOVED — category+term now in tags row */

.lightbox-rule {
    height: 1px;
    background: linear-gradient(to right, rgba(100, 116, 179, 0.25), transparent);
    margin-bottom: 18px;
    flex-shrink: 0;
}

/* Phase 5: description block — 3-line clamp, click to expand */
.lightbox-desc-block {
    position: relative;
    margin-bottom: 18px;
}

.lightbox-description {
    font-size: 0.83rem;
    line-height: 1.75;
    color: var(--text-muted);
    margin: 0;
    /* Desktop: full description always visible, no clamp */
    display: block;
    overflow: visible;
}

.lightbox-desc-block.is-expanded .lightbox-description {
    display: block;
    overflow: visible;
}

.lightbox-desc-toggle {
    display: none; /* hidden on desktop — full description fits without clamping */
    width: 100%;
    background: none;
    border: none;
    padding: 6px 0 0;
    font-family: var(--font-mono);
    font-size: 0.58rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(100, 116, 179, 0.6);
    cursor: pointer;
    text-align: left;
    transition: color 0.15s ease;
}
.lightbox-desc-toggle:hover { color: rgba(100, 116, 179, 1); }

.lightbox-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

/* Text bookmark nav — highlights as user scrolls images */
.lightbox-bookmarks {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 20px;
}

.lightbox-bookmark {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    border-left: 2px solid rgba(100, 116, 179, 0.12);
    padding: 5px 10px;
    font-family: var(--font-mono);
    font-size: 0.64rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(191, 195, 208, 0.6);
    cursor: pointer;
    transition: color 0.18s ease, border-color 0.18s ease;
}

.lightbox-bookmark:hover {
    color: rgba(160, 165, 181, 0.7);
    border-left-color: rgba(100, 116, 179, 0.35);
}

.lightbox-bookmark.active {
    color: var(--text-main);
    border-left-color: rgba(251, 224, 99, 0.7);
}

.caption-missing {
    color: rgba(220, 80, 80, 0.9);
    font-size: 0.5rem;
    letter-spacing: 0.06em;
    margin-left: 6px;
}

.lightbox-tools-label {
    font-family: monospace;
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(100, 116, 179, 0.7);
    margin-bottom: 8px;
}

/* Play button — prominent CTA for motion projects in the lightbox */
.lightbox-play-wrap {
    margin-bottom: 24px;
}

.lightbox-play-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 18px;
    background: rgba(251, 224, 99, 0.08);
    border: 1px solid rgba(251, 224, 99, 0.3);
    color: rgba(251, 224, 99, 0.9);
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.lightbox-play-btn:hover {
    background: rgba(251, 224, 99, 0.14);
    border-color: rgba(251, 224, 99, 0.55);
}

.lightbox-play-icon {
    font-size: 1.1rem;
    line-height: 1;
}

/* Awards section */
.lightbox-awards-wrap {
    margin-bottom: 20px;
}

.lightbox-award-item {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.lightbox-support-wrap,
.lightbox-credits-wrap {
    margin-bottom: 20px;
}

.lightbox-support-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.lightbox-support-card {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 10px;
    align-items: center;
    width: 100%;
    background: rgba(100, 116, 179, 0.06);
    border: 1px solid rgba(100, 116, 179, 0.14);
    border-radius: 10px;
    padding: 8px;
    color: inherit;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.lightbox-support-card:hover {
    border-color: rgba(251, 224, 99, 0.35);
    background: rgba(100, 116, 179, 0.1);
    transform: translateY(-1px);
}

.lightbox-support-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.lightbox-support-caption,
.lightbox-credits {
    font-size: 0.75rem;
    line-height: 1.55;
    color: rgba(160, 165, 181, 0.72);
}

.lightbox-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 20px;
}

.lightbox-tag {
    font-family: monospace;
    font-size: 0.52rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(251, 224, 99, 0.8);
    background: rgba(251, 224, 99, 0.07);
    border: 1px solid rgba(251, 224, 99, 0.2);
    padding: 3px 8px;
    border-radius: 3px;
}

/* Phase 5: mobile spotlight overhaul — image as big as possible, compact detail pane */
@media (max-width: 768px) {
    .lightbox-overlay { padding: 0; }

    .lightbox-inner {
        flex-direction: column;
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        max-width: 100vw;
        border-radius: 0;
        border: none;
    }

    /* Image pane grows to fill — "see the image as big as possible" */
    .lightbox-image-pane {
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
        position: relative; /* for floating bookmarks */
    }

    /* Hide author on mobile */
    .lightbox-author-line { display: none; }

    /* Compact bottom sheet for metadata */
    .lightbox-detail-pane {
        width: 100%;
        max-height: 42vh;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        padding: 16px 18px 20px;
        overflow-y: auto;
    }

    .lightbox-project-title {
        font-size: 1rem;
        margin-bottom: 10px;
    }

    .lightbox-rule { display: none; }

    /* Clamp description tight on mobile */
    .lightbox-description {
        font-size: 0.8rem;
        line-height: 1.6;
        /* Mobile: clamp to 3 lines; toggle button re-enabled in mobile block below */
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .lightbox-desc-block.is-expanded .lightbox-description {
        display: block;
        -webkit-line-clamp: unset;
        overflow: visible;
    }
    .lightbox-desc-toggle {
        display: block; /* re-enable toggle on mobile */
    }

    /* Floating bookmarks overlay — right edge of image pane, slides in after scroll */
    .lightbox-bookmarks.is-floating {
        position: absolute;
        top: 50%;
        right: 10px;
        transform: translateY(-50%) translateX(8px);
        opacity: 0;
        pointer-events: none;
        flex-direction: column;
        gap: 4px;
        padding: 10px 8px;
        background: rgba(8, 8, 14, 0.82);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        max-width: 42vw;
        z-index: 8;
        transition: opacity 0.25s ease, transform 0.25s ease;
    }

    .lightbox-bookmarks.is-floating.is-revealed {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(-50%) translateX(0);
    }

    .lightbox-bookmarks.is-floating .lightbox-bookmark {
        font-size: 0.52rem;
        padding: 4px 8px;
    }

    /* Awards / play / tags / credits stack */
    .lightbox-meta-stack {
        display: flex;
        flex-direction: column;
    }
}

/* about-name / about-genus-tag shared styles */
.about-name {
    font-size: 1.35rem;
    font-weight: 300;
    color: var(--text-main);
    letter-spacing: 0.03em;
    margin-bottom: 6px;
}

.about-genus-tag {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 4px;
}

.about-genus-tag[data-genus="Motion Design"]   { color: var(--genus-motion, #FBE063); }
.about-genus-tag[data-genus="Graphic Design"]  { color: var(--genus-design, #6474B3); }
.about-genus-tag[data-genus="Motion"]         { color: var(--genus-motion, #FBE063); }
.about-genus-tag[data-genus="Design"]         { color: var(--genus-design, #6474B3); }
.about-genus-tag[data-genus="Art Direction"]  { color: var(--genus-art-direction, #DD5658); }

/* =========================================
   LAUNCH GATE
   ========================================= */

.launch-gate {
    position: fixed;
    inset: 0;
    z-index: 8000;
    background: var(--bg-deep, #0E0E1A);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gate-inner {
    position: relative;
    z-index: 8001;
    text-align: center;
    pointer-events: none;
    user-select: none;
}

.gate-eyebrow {
    font-family: var(--font-mono, monospace);
    font-size: 0.55rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(100, 116, 179, 0.35);
    margin-bottom: 36px;
}

.gate-title {
    font-size: clamp(3.2rem, 9vw, 6.5rem);
    font-weight: 200;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-main, #F0EDE8);
    line-height: 1;
    margin-bottom: 18px;
}

.gate-rule {
    width: 140px;
    height: 1px;
    background: rgba(100, 116, 179, 0.18);
    margin: 0 auto 18px;
}

.gate-subtitle {
    font-family: var(--font-mono, monospace);
    font-size: 0.62rem;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: rgba(240, 237, 232, 0.28);
    margin-bottom: 60px;
}

.gate-countdown {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    margin-bottom: 36px;
}

.gate-count-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 clamp(14px, 3.5vw, 36px);
    border-right: 1px solid rgba(100, 116, 179, 0.12);
}

.gate-count-unit:last-child {
    border-right: none;
}

.gate-count-num {
    font-family: var(--font-mono, monospace);
    font-size: clamp(3.8rem, 9vw, 6rem);
    font-weight: 300;
    color: var(--text-main, #F0EDE8);
    line-height: 1;
    letter-spacing: -0.02em;
    display: block;
}

.gate-count-sep {
    font-family: var(--font-mono, monospace);
    font-size: clamp(3.8rem, 9vw, 6rem);
    font-weight: 200;
    color: rgba(100, 116, 179, 0.18);
    line-height: 1;
    align-self: flex-start;
}

.gate-count-label {
    font-family: var(--font-mono, monospace);
    font-size: 0.46rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(240, 237, 232, 0.2);
    margin-top: 10px;
    display: block;
}

.gate-date-line {
    font-family: var(--font-mono, monospace);
    font-size: 0.56rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(240, 237, 232, 0.18);
}

/* Admin trigger — very subtle, bottom-right */
.gate-admin-btn {
    position: fixed;
    bottom: 24px;
    right: 28px;
    z-index: 8002;
    background: none;
    border: none;
    font-family: var(--font-mono, monospace);
    font-size: 0.46rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(240, 237, 232, 0.1);
    cursor: pointer;
    padding: 8px;
    transition: color 0.3s;
}

.gate-admin-btn:hover {
    color: rgba(100, 116, 179, 0.5);
}

/* Admin login modal (on top of gate) */
.gate-admin-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(14, 14, 26, 0.96);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
}

.gate-admin-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: 280px;
}

.gate-admin-label {
    font-family: var(--font-mono, monospace);
    font-size: 0.54rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(100, 116, 179, 0.5);
    margin-bottom: 6px;
}

.gate-admin-input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(30, 30, 43, 0.8);
    border: 1px solid rgba(100, 116, 179, 0.25);
    color: var(--text-main, #F0EDE8);
    font-family: var(--font-mono, monospace);
    font-size: 0.88rem;
    letter-spacing: 0.06em;
    padding: 12px 16px;
    border-radius: 6px;
    outline: none;
    text-align: center;
}

.gate-admin-input:focus {
    border-color: rgba(100, 116, 179, 0.5);
}

.gate-admin-error {
    font-family: var(--font-mono, monospace);
    font-size: 0.54rem;
    letter-spacing: 0.1em;
    color: rgba(221, 86, 88, 0.7);
    min-height: 16px;
}

.gate-admin-actions {
    display: flex;
    gap: 10px;
    width: 100%;
}

.gate-admin-submit,
.gate-admin-cancel {
    flex: 1;
    padding: 10px;
    border-radius: 5px;
    font-family: var(--font-mono, monospace);
    font-size: 0.56rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    border: 1px solid rgba(100, 116, 179, 0.25);
    transition: all 0.2s;
}

.gate-admin-submit {
    background: rgba(100, 116, 179, 0.15);
    color: var(--text-main, #F0EDE8);
}

.gate-admin-submit:hover {
    background: rgba(100, 116, 179, 0.3);
}

.gate-admin-cancel {
    background: none;
    color: rgba(240, 237, 232, 0.35);
}

.gate-admin-cancel:hover {
    color: rgba(240, 237, 232, 0.65);
}

/* Butterflies that land on the countdown */
.gate-butterfly {
    position: fixed;
    pointer-events: none;
    z-index: 8500;
    will-change: transform;
}

/* =========================================
   PERSISTENT NAV BAR — viewer + admin tiers
   ========================================= */

.nb-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9000;
    background: rgba(43, 45, 61, 0.96);
    border-top: 1px solid rgba(100, 116, 179, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font-family: var(--font-primary, 'Nunito', sans-serif);
}

.nb-inner {
    display: flex;
    align-items: center;
    gap: 4px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 48px;
}

.nb-brand {
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: var(--accent-glow, #FBE063);
    text-transform: uppercase;
    margin-right: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

.nb-links {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
}

.nb-link {
    color: var(--text-muted, #BFC3D0);
    text-decoration: none;
    font-size: 0.82rem;
    padding: 6px 12px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.nb-link:hover {
    color: var(--text-main, #fff);
    background: rgba(100, 116, 179, 0.12);
}

.nb-link--active {
    color: var(--text-main, #fff);
    font-weight: 600;
}

.nb-gate {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    padding: 4px 10px;
    border-radius: 20px;
    margin-right: 8px;
    white-space: nowrap;
}

.nb-gate--open {
    color: var(--accent-glow, #FBE063);
    background: rgba(251, 224, 99, 0.08);
    border: 1px solid rgba(251, 224, 99, 0.2);
}

.nb-gate--locked {
    color: var(--color-lobster, #DD5658);
    background: rgba(221, 86, 88, 0.08);
    border: 1px solid rgba(221, 86, 88, 0.2);
}

.nb-gate-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.nb-gate--open  .nb-gate-dot { background: var(--accent-glow, #FBE063); }
.nb-gate--locked .nb-gate-dot { background: var(--color-lobster, #DD5658); }

.nb-logout {
    background: none;
    border: 1px solid rgba(100, 116, 179, 0.2);
    color: rgba(160, 165, 181, 0.6);
    font-family: var(--font-primary, 'Nunito', sans-serif);
    font-size: 0.78rem;
    padding: 5px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 8px;
    flex-shrink: 0;
}

.nb-logout:hover {
    color: var(--text-main, #fff);
    border-color: rgba(100, 116, 179, 0.45);
    background: rgba(100, 116, 179, 0.1);
}

@media (max-width: 500px) {
    .nb-brand { display: none; }
    .nb-link  { font-size: 0.76rem; padding: 6px 8px; }
}

/* =========================================
   ADMIN DASHBOARD — dash-* classes
   ========================================= */

.dash-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary, #1E1F2B);
}

.dash-container {
    flex: 1;
    max-width: 860px;
    margin: 0 auto;
    padding: 28px var(--spacing-lg) var(--spacing-xl);
    width: 100%;
}

/* Login */
.dash-login {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    padding: var(--spacing-xl) var(--spacing-lg);
    max-width: 420px;
    margin: 0 auto;
}

.dash-eyebrow {
    font-family: monospace;
    font-size: 0.72rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(100, 116, 179, 0.5);
    margin-bottom: 12px;
}

.dash-title {
    font-size: 2.4rem;
    font-weight: 200;
    letter-spacing: 0.04em;
    color: var(--text-main, #fff);
    margin-bottom: 0;
}

.dash-login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 28px;
}

.dash-input {
    background: rgba(43, 45, 61, 0.8);
    border: 1px solid rgba(100, 116, 179, 0.22);
    color: var(--text-main, #fff);
    font-family: var(--font-primary, 'Nunito', sans-serif);
    font-size: 1rem;
    padding: 12px 16px;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.dash-input:focus {
    border-color: rgba(100, 116, 179, 0.55);
}

.dash-input--center { text-align: center; }

/* Login password field — wider, left-aligned, clearly a text input */
.dash-input--login {
    font-size: 1.05rem;
    padding: 16px 20px;
    background: rgba(20, 22, 35, 0.9);
    border-color: rgba(100, 116, 179, 0.4);
    border-radius: 6px;
    letter-spacing: 0.04em;
    max-width: 100%;
}

.dash-btn {
    background: rgba(100, 116, 179, 0.18);
    border: 1px solid rgba(100, 116, 179, 0.32);
    color: var(--text-main, #fff);
    font-family: var(--font-primary, 'Nunito', sans-serif);
    font-size: 0.82rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 11px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.dash-btn:hover {
    background: rgba(100, 116, 179, 0.32);
    border-color: rgba(100, 116, 179, 0.55);
}

.dash-btn--outline {
    background: none;
    color: rgba(240, 237, 232, 0.55);
    border-color: rgba(100, 116, 179, 0.18);
}

.dash-btn--outline:hover {
    background: rgba(100, 116, 179, 0.1);
    color: var(--text-main, #fff);
    border-color: rgba(100, 116, 179, 0.4);
}

.dash-error {
    font-family: monospace;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: rgba(221, 86, 88, 0.8);
    min-height: 18px;
    text-align: center;
}

/* Dashboard header */
.dash-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(100, 116, 179, 0.1);
}

/* Sections */
.dash-section {
    margin-bottom: 24px;
}

.dash-section-title {
    font-size: 0.72rem;
    font-family: monospace;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(100, 116, 179, 0.6);
    margin-bottom: var(--spacing-md);
}

.dash-desc {
    font-size: 0.92rem;
    color: var(--text-muted, #BFC3D0);
    line-height: 1.65;
    margin-bottom: var(--spacing-md);
    max-width: 58ch;
}

.dash-note {
    font-family: monospace;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: rgba(100, 116, 179, 0.5);
    margin-top: 10px;
}

.dash-divider {
    border: none;
    border-top: 1px solid rgba(100, 116, 179, 0.1);
    margin: 20px 0;
}

/* Status grid */
.dash-status-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(100, 116, 179, 0.1);
}

.dash-stat-cell {
    background: var(--bg-window, #2B2D3D);
    padding: 14px 16px;
}

.dash-stat-label {
    font-family: monospace;
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(160, 165, 181, 0.5);
    margin-bottom: 8px;
}

.dash-stat-value {
    font-family: monospace;
    font-size: 0.95rem;
    color: var(--text-main, #fff);
    line-height: 1.4;
}

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

/* Date override — single inline row */
.dash-override-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.dash-override-label {
    font-family: monospace;
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(100, 116, 179, 0.6);
    white-space: nowrap;
    flex-shrink: 0;
}

.dash-date-input {
    flex: 1;
    min-width: 160px;
    font-size: 0.88rem;
    padding: 8px 12px;
}

@media (max-width: 600px) {
    .dash-override-row { flex-wrap: wrap; }
}

/* Nav cards (Home / Gallery / About) */
.dash-nav-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.dash-nav-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--bg-window, #2B2D3D);
    border: 1px solid rgba(100, 116, 179, 0.12);
    border-radius: 12px;
    padding: 28px 16px;
    text-decoration: none;
    transition: all 0.25s;
}

.dash-nav-card:hover {
    border-color: rgba(100, 116, 179, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(10, 10, 15, 0.4);
}

.dash-nav-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main, #fff);
}

.dash-nav-sub {
    font-size: 0.72rem;
    color: var(--text-muted, #BFC3D0);
    letter-spacing: 0.04em;
}

@media (max-width: 540px) {
    .dash-nav-grid { grid-template-columns: 1fr; }
}

/* Student cards */
.dash-student-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.dash-student-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--bg-window, #2B2D3D);
    border: 1px solid rgba(100, 116, 179, 0.12);
    border-radius: 10px;
    padding: 16px;
    text-decoration: none;
    transition: all 0.22s;
}

.dash-student-card:hover {
    border-color: rgba(100, 116, 179, 0.38);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(10, 10, 15, 0.35);
}

.dash-student-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-main, #fff);
    line-height: 1.3;
}

.dash-student-emphasis {
    font-size: 0.68rem;
    color: var(--text-muted, #BFC3D0);
    letter-spacing: 0.06em;
}

@media (max-width: 700px) {
    .dash-student-grid { grid-template-columns: repeat(2, 1fr); }
}

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


/* =========================================
   BUG EDITOR — Admin grid overlay
   ========================================= */

#be-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(10, 10, 18, 0.95);
    backdrop-filter: blur(14px);
    display: none;
    overflow-y: auto;
}
#be-overlay.active { display: block; }

.be-panel {
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px 24px 32px;
}

.be-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(100, 116, 179, 0.2);
    margin-bottom: 20px;
}

.be-title {
    font-family: var(--font-primary, 'Nunito', sans-serif);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-main, #fff);
    margin: 0;
}

.be-close-btn {
    background: none;
    border: none;
    color: var(--text-muted, #BFC3D0);
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: color 0.15s;
}
.be-close-btn:hover { color: var(--text-main, #fff); }

/* Grid — 2 columns so bugs are large enough to work with */
.be-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
@media (max-width: 700px)  { .be-grid { grid-template-columns: 1fr; } }

/* Individual bug card */
.be-cell {
    background: var(--bg-primary, #1E1F2B);
    border: 1px solid rgba(100, 116, 179, 0.18);
    border-radius: 10px;
    overflow: hidden;
}

.be-cell-name {
    font-family: var(--font-primary, 'Nunito', sans-serif);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted, #BFC3D0);
    text-align: center;
    padding: 14px 8px 10px;
}

/* Stage — bug preview with guide lines */
.be-stage {
    position: relative;
    background: #08080f;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 6px;
}

.be-zoom {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    transform: translate(var(--pan-x, 0px), var(--pan-y, 0px)) scale(var(--zoom-s, 5));
    transform-origin: var(--zoom-cx, 50%) var(--zoom-cy, 50%);
}

.be-stage { cursor: grab; }
.be-stage.be-dragging { cursor: grabbing; user-select: none; }

.be-stage .index-free-bug {
    pointer-events: none;
    position: absolute !important;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    z-index: auto !important;
}

/* Assembly at true live-site size (300x389) centered in stage — scale is now 1:1 with live */
.be-stage .split-bug-assembly {
    position: absolute !important;
    width: 300px !important;
    height: 389px !important;
    left: 50% !important;
    top: 50% !important;
    margin-left: -150px !important;
    margin-top: -194.5px !important;
    transform: scale(var(--bug-scale, 0.55)) !important;
    transform-origin: center center;
    filter: none !important;
}

.be-stage .split-bug-wing,
.be-stage .split-bug-body {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: contain;
}

.be-stage .split-bug-wing-left {
    animation: indexWingFlapLeft var(--index-flap-speed, 0.72s) ease-in-out infinite;
}
.be-stage .split-bug-wing-right {
    animation: indexWingFlapRight var(--index-flap-speed, 0.72s) ease-in-out infinite;
}
.be-stage .split-bug-body {
    animation: indexButterflyBodyBob var(--index-flap-speed, 0.72s) ease-in-out infinite;
}
.be-paused .split-bug-wing-left,
.be-paused .split-bug-wing-right,
.be-paused .split-bug-body {
    animation-play-state: paused !important;
}

/* Guide lines — vertical dashed for LX/RX, horizontal for Y */
.be-guide {
    position: absolute;
    pointer-events: none;
    z-index: 2;
}
.be-guide-lx,
.be-guide-rx {
    top: 0;
    bottom: 0;
    width: 0;
    border-left: 1px dashed rgba(251, 224, 99, 0.45);
}
.be-guide-y {
    left: 0;
    right: 0;
    height: 0;
    border-top: 1px dashed rgba(251, 224, 99, 0.45);
}

/* Hinge point dots — show exactly where the wing fold is */
.be-hinge {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-glow, #FBE063);
    box-shadow: 0 0 6px rgba(251, 224, 99, 0.7);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 3;
}

/* Controls below stage — toolbar + 3-column layout */
.be-controls {
    padding: 8px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Top toolbar: view zoom, pause, speed, reset */
.be-toolbar {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap;
}
.be-toolbar-sep {
    flex: 1;
}

/* 3-column layout: Size | Left Wing | Right Wing */
.be-cols {
    display: grid;
    grid-template-columns: auto 1px 1fr 16px 1fr;
    gap: 0 10px;
    align-items: start;
    border-top: 1px solid rgba(100, 116, 179, 0.12);
    padding-top: 8px;
}
.be-vsep {
    background: rgba(100, 116, 179, 0.15);
    align-self: stretch;
}
.be-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.be-col-hd {
    font-family: var(--font-primary, 'Nunito', sans-serif);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(160, 165, 181, 0.4);
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(100, 116, 179, 0.1);
    margin-bottom: 1px;
    white-space: nowrap;
}
.be-field {
    display: flex;
    align-items: center;
    gap: 3px;
}
.be-col-div {
    border-top: 1px solid rgba(100, 116, 179, 0.1);
    margin: 3px 0;
}
.be-chain-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 24px; /* align roughly with Y rows */
    gap: 0;
}
.be-chain-btn {
    background: none;
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    opacity: 0.35;
    transition: opacity 0.15s, transform 0.15s;
    padding: 2px;
    line-height: 1;
    user-select: none;
}
.be-chain-btn.active { opacity: 1; }
.be-chain-btn:hover { opacity: 0.7; transform: scale(1.15); }

/* Legacy row (used for toolbar) */
.be-row {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.be-lbl {
    font-family: var(--font-primary, 'Nunito', sans-serif);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(160, 165, 181, 0.55);
    min-width: 20px;
    flex-shrink: 0;
    white-space: nowrap;
}

.be-num {
    width: 52px;
    background: rgba(100, 116, 179, 0.1);
    color: var(--accent-glow, #FBE063);
    border: 1px solid rgba(100, 116, 179, 0.2);
    border-radius: 4px;
    padding: 5px 4px;
    font-family: 'SF Mono', 'Menlo', monospace;
    font-size: 0.8rem;
    text-align: center;
    -moz-appearance: textfield;
}
.be-num::-webkit-outer-spin-button,
.be-num::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.be-num:focus {
    outline: none;
    border-color: var(--accent-glow, #FBE063);
}

.be-inc {
    background: rgba(100, 116, 179, 0.12);
    color: var(--text-muted, #BFC3D0);
    border: 1px solid rgba(100, 116, 179, 0.2);
    border-radius: 4px;
    width: 26px;
    height: 26px;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    transition: background 0.12s, color 0.12s;
}
.be-inc:hover {
    background: rgba(251, 224, 99, 0.2);
    color: var(--accent-glow, #FBE063);
    border-color: rgba(251, 224, 99, 0.3);
}
.be-inc:active { background: rgba(251, 224, 99, 0.35); }

.be-spacer { width: 6px; flex-shrink: 0; }

.be-pause-btn {
    background: rgba(100, 116, 179, 0.12);
    color: var(--text-muted, #BFC3D0);
    border: 1px solid rgba(100, 116, 179, 0.2);
    border-radius: 4px;
    width: 26px;
    height: 26px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    transition: background 0.12s, color 0.12s;
}
.be-pause-btn:hover {
    background: rgba(251, 224, 99, 0.2);
    color: var(--accent-glow, #FBE063);
}
.be-pause-btn.active {
    background: rgba(251, 224, 99, 0.25);
    color: var(--accent-glow, #FBE063);
    border-color: rgba(251, 224, 99, 0.4);
}

.be-mirror-lbl {
    font-family: var(--font-primary, 'Nunito', sans-serif);
    font-size: 0.65rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(160, 165, 181, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}
.be-mirror-lbl input[type="checkbox"] {
    width: 14px;
    height: 14px;
}

.be-divider {
    border-top: 1px solid rgba(100, 116, 179, 0.1);
    margin: 2px 0;
}

.be-vzoom-val {
    font-family: 'SF Mono', 'Menlo', monospace;
    font-size: 0.9rem;
    color: var(--accent-glow, #FBE063);
    min-width: 48px;
    text-align: center;
}

.be-vreset {
    background: rgba(100, 116, 179, 0.1);
    color: var(--text-muted, #BFC3D0);
    border: 1px solid rgba(100, 116, 179, 0.2);
    border-radius: 5px;
    padding: 6px 14px;
    font-family: var(--font-primary, 'Nunito', sans-serif);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    margin-left: auto;
    transition: background 0.12s, color 0.12s;
}
.be-vreset:hover {
    background: rgba(251, 224, 99, 0.15);
    color: var(--accent-glow, #FBE063);
}

/* Footer — copy button */
.be-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid rgba(100, 116, 179, 0.2);
    margin-top: 20px;
}

.be-copy-btn {
    background: rgba(251, 224, 99, 0.15);
    color: var(--accent-glow, #FBE063);
    border: 1px solid rgba(251, 224, 99, 0.35);
    border-radius: 6px;
    padding: 14px 44px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: background 0.15s, color 0.15s;
    font-family: var(--font-primary, 'Nunito', sans-serif);
}
.be-copy-btn:hover {
    background: rgba(251, 224, 99, 0.28);
    color: #fff;
}

.be-copy-status {
    font-size: 0.72rem;
    color: var(--accent-glow, #FBE063);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.25s;
}
.be-copy-status.show { opacity: 1; }


/* =========================================
   ADMIN/VIEWER — MISSING CONTENT INDICATORS
   ========================================= */

/* Portfolio card: overlay on temp thumbnail when no real thumbnail submitted */
.portfolio-thumb-missing {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(20, 10, 10, 0.55);
    border: 2px dashed rgba(210, 55, 55, 0.5);
    border-radius: inherit;
    z-index: 2;
}
.portfolio-thumb-missing svg {
    stroke: rgba(210, 65, 65, 0.85);
}
.portfolio-thumb-missing span {
    font-family: var(--font-mono, monospace);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(210, 65, 65, 0.85);
    font-weight: 600;
}

/* Lightbox: banner across bottom of images lacking a description */
.lightbox-needs-description {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(180, 40, 40, 0.88);
    backdrop-filter: blur(4px);
    font-family: var(--font-mono, monospace);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #fff;
    font-weight: 600;
    z-index: 5;
    pointer-events: none;
}
.lightbox-needs-description .warn-triangle {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    stroke: #fff;
}
/* Gallery grid: compact content badge on student cards */
.gallery-content-issues {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    align-items: flex-start;
    gap: 5px;
    padding: 6px 9px;
    background: rgba(10, 11, 18, 0.92);
    backdrop-filter: blur(6px);
    border-radius: 6px;
    border: 1px solid rgba(195, 55, 55, 0.5);
    z-index: 8;
    pointer-events: none;
}
.gallery-content-issues .warn-triangle {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}
.gallery-content-issues span {
    font-family: var(--font-mono, monospace);
    font-size: 0.52rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: rgba(195, 55, 55, 0.95);
    line-height: 1.5;
}

/* Shared progress bar components (gallery + dashboard) */
.cpb-wrap {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.cpb-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.cpb-track {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
}
.cpb-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}
.cpb-label {
    font-family: var(--font-mono, monospace);
    font-size: 0.54rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    line-height: 1;
}
.cpb-odd {
    font-family: var(--font-mono, monospace);
    font-size: 0.54rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: rgba(195, 55, 55, 0.95);
    margin-top: 2px;
}

/* Dashboard progress bars (slightly larger) */
.dash-student-card .cpb-wrap { margin-top: 6px; gap: 6px; }
.dash-student-card .cpb-track { height: 5px; }
.dash-student-card .cpb-label { font-size: 0.6rem; }

/* Main image caption — same style as supporting captions (no special treatment) */

/* Admin dashboard: content status on student profile cards */
.dash-content-issues {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 5px;
    font-family: var(--font-mono, monospace);
    font-size: 0.58rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(210, 70, 70, 0.9);
    line-height: 1.3;
}
.dash-content-issues svg {
    flex-shrink: 0;
    stroke: rgba(210, 70, 70, 0.9);
}
.dash-content-ok {
    display: block;
    margin-top: 5px;
    font-family: var(--font-mono, monospace);
    font-size: 0.58rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(80, 190, 110, 0.85);
}

/* Odd-project-count ghost card */
.portfolio-card--odd-ghost { pointer-events: none; opacity: 0.7; }
.portfolio-card-title--warn {
    color: rgba(210, 65, 65, 0.85);
    font-size: 0.65rem;
    letter-spacing: 0.05em;
}

/* =========================================
   GLOBAL SEARCH MODAL (⌘K)
   ========================================= */

/* Prevent body scroll while search is open */
body.search-is-open { overflow: hidden; }

/* ── Backdrop ── */
.search-modal {
    position: fixed;
    inset: 0;
    z-index: 9900;   /* above everything including lightbox (9800) */
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: clamp(48px, 10vh, 120px);
    padding-left: 16px;
    padding-right: 16px;
}

/* Must win over .search-modal's display:flex so the closed modal
   doesn't sit invisible over the page and swallow every click. */
.search-modal[hidden] { display: none !important; }

.search-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(14, 14, 22, 0.82);
    opacity: 0;
    transition: opacity 0.18s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.search-modal.is-open .search-modal-backdrop {
    opacity: 1;
}

/* ── Panel ── */
.search-modal-panel {
    position: relative;
    width: 100%;
    max-width: 620px;
    background: var(--bg-window);
    border: 1px solid rgba(100, 116, 179, 0.28);
    border-radius: 14px;
    transform: translateY(-12px) scale(0.98);
    opacity: 0;
    transition: transform 0.18s ease, opacity 0.18s ease;
    overflow: hidden;
}

.search-modal.is-open .search-modal-panel {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* ── Input row ── */
.search-modal-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(100, 116, 179, 0.15);
}

.search-modal-icon {
    flex-shrink: 0;
    color: var(--system-line);
}

.search-modal-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: monospace;
    font-size: 0.88rem;
    color: var(--text-main);
    caret-color: var(--accent-glow);
    /* Remove browser default search decorations */
    -webkit-appearance: none;
    appearance: none;
}
.search-modal-input::-webkit-search-cancel-button,
.search-modal-input::-webkit-search-decoration { display: none; }

.search-modal-input::placeholder {
    color: rgba(160, 165, 181, 0.35);
}

.search-modal-esc {
    flex-shrink: 0;
    font-family: monospace;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    color: rgba(100, 116, 179, 0.55);
    background: rgba(100, 116, 179, 0.1);
    border: 1px solid rgba(100, 116, 179, 0.2);
    border-radius: 6px;
    padding: 2px 6px;
    cursor: pointer;
    user-select: none;
    display: none; /* hidden on mobile; keyboard users know Escape */
}
@media (min-width: 600px) { .search-modal-esc { display: block; } }

/* ── Results list ── */
.search-results-list {
    list-style: none;
    margin: 0;
    padding: 6px 0;
    max-height: min(50vh, 400px);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

.search-results-list:empty { padding: 0; }

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    cursor: pointer;
    transition: background 0.1s ease;
    border-left: 2px solid transparent;
}

.search-result-item:hover,
.search-result-item.is-active {
    background: rgba(100, 116, 179, 0.1);
    border-left-color: var(--accent-glow);
}

/* Thumbnail */
.search-result-thumb {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(100, 116, 179, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
}
.search-result-thumb--sm {
    width: 28px;
    height: 28px;
    opacity: 0.65;
}
.search-result-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}
.search-thumb-initials {
    font-family: monospace;
    font-size: 0.7rem;
    color: var(--system-line);
    letter-spacing: 0.06em;
}

/* Body */
.search-result-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.search-result-name {
    font-size: 0.82rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.02em;
}
.search-result-sub {
    font-family: monospace;
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Project items: slightly indented to distinguish from students */
.search-result--project .search-result-name {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.search-result--project.is-active .search-result-name,
.search-result--project:hover .search-result-name {
    color: var(--text-main);
}

/* Badge */
.search-result-badge {
    flex-shrink: 0;
    font-family: monospace;
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-glow);
    opacity: 0.7;
}
.search-result-badge--dim {
    color: var(--system-line);
    opacity: 0.55;
}

/* ── Empty state ── */
.search-no-results-msg {
    padding: 24px 18px;
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--system-line);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: center;
    margin: 0;
}

/* ── Footer hints ── */
.search-modal-footer {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 8px 18px;
    border-top: 1px solid rgba(100, 116, 179, 0.12);
}

.search-footer-hint {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: monospace;
    font-size: 0.62rem;
    color: rgba(100, 116, 179, 0.5);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.search-footer-hint kbd {
    font-family: monospace;
    font-size: 0.62rem;
    background: rgba(100, 116, 179, 0.12);
    border: 1px solid rgba(100, 116, 179, 0.2);
    border-radius: 6px;
    padding: 1px 5px;
    color: rgba(100, 116, 179, 0.7);
}

@media (max-width: 480px) {
    .search-modal-footer { display: none; }
    .search-result-badge { display: none; }
}

/* ── Search trigger button (gallery page) ── */
.search-trigger-wrap {
    display: flex;
    justify-content: flex-end;
    padding: 0 0 var(--spacing-md);
}

.search-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid rgba(100, 116, 179, 0.22);
    border-radius: 999px;
    color: var(--system-line);
    font-family: monospace;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 7px 16px;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
    position: relative;
}

.search-trigger-btn:hover {
    border-color: rgba(100, 116, 179, 0.5);
    color: var(--text-main);
}

.search-trigger-btn svg { flex-shrink: 0; }

.search-trigger-kbd {
    font-family: monospace;
    font-size: 0.6rem;
    background: rgba(100, 116, 179, 0.1);
    border: 1px solid rgba(100, 116, 179, 0.2);
    border-radius: 6px;
    padding: 1px 5px;
    color: rgba(100, 116, 179, 0.6);
    margin-left: 2px;
}

@media (max-width: 600px) {
    /* On mobile hide the ⌘K hint — tap the button instead */
    .search-trigger-kbd { display: none; }
}

/* ============================================================
   IMAGE DOWNLOAD PROTECTION
   Not a hard lock — anyone with DevTools can still grab the
   bytes — but blocks the casual right-click-save / drag-to-
   desktop / screenshot-text-selection attempts. Deters 95% of
   attempts without hurting legitimate use.
   ============================================================ */

img {
    -webkit-user-drag: none;
    user-drag: none;
    -webkit-touch-callout: none; /* iOS long-press save prompt */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* ============================================================
   SITE FOOTER — copyright notice
   ============================================================ */

.site-footer {
    margin-top: 80px;
    padding: 28px 24px 36px;
    text-align: center;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.64rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(100, 116, 179, 0.55);
    border-top: 1px solid rgba(100, 116, 179, 0.12);
    line-height: 1.8;
}

.site-footer .footer-mark {
    color: rgba(230, 214, 167, 0.7); /* soft gold accent */
    letter-spacing: 0.22em;
}

.site-footer .footer-sep {
    margin: 0 10px;
    color: rgba(100, 116, 179, 0.3);
}

.site-footer .footer-notice {
    display: block;
    margin-top: 10px;
    font-size: 0.58rem;
    letter-spacing: 0.1em;
    text-transform: none;
    color: rgba(100, 116, 179, 0.45);
}

@media (max-width: 600px) {
    .site-footer {
        font-size: 0.58rem;
        letter-spacing: 0.1em;
        padding: 24px 16px 32px;
    }
    .site-footer .footer-sep { margin: 0 6px; }
    .site-footer .footer-notice { font-size: 0.56rem; }
}

/* ============================================================
   PREVIEW MODE BANNER
   Fixed top bar shown to recipients of a ?preview=<token> link.
   Hidden when admin or viewer is logged in (they have their
   own admin-bar at the bottom).
   ============================================================ */

.preview-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9950; /* above lightbox (9800) and search modal (9900) */
    background: linear-gradient(90deg, rgba(232, 197, 90, 0.97) 0%, rgba(212, 165, 50, 0.97) 100%);
    color: #1a1a1a;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 8px 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
    user-select: none;
}

.preview-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.preview-banner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1a1a1a;
    animation: preview-banner-pulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes preview-banner-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.3; }
}

.preview-banner-text {
    flex: 1;
    text-align: center;
    min-width: 0;
}

.preview-banner-exit {
    flex-shrink: 0;
    background: rgba(26, 26, 26, 0.15);
    border: 1px solid rgba(26, 26, 26, 0.35);
    border-radius: 999px;
    color: #1a1a1a;
    font-family: inherit;
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 4px 14px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.preview-banner-exit:hover {
    background: rgba(26, 26, 26, 0.3);
    border-color: rgba(26, 26, 26, 0.6);
}

/* Push the rest of the page down so the banner doesn't overlap content */
body.has-preview-banner {
    padding-top: 38px;
}

@media (max-width: 600px) {
    .preview-banner {
        font-size: 0.58rem;
        padding: 7px 10px;
        letter-spacing: 0.08em;
    }
    .preview-banner-inner { gap: 10px; }
    .preview-banner-text  { font-size: 0.55rem; line-height: 1.3; }
    .preview-banner-exit  { font-size: 0.52rem; padding: 3px 10px; }
    body.has-preview-banner { padding-top: 44px; }
}


