﻿  body.page--gallery .gallery-page,
  body.page--gallery .lightbox {
    --bg: #05060a;
    --bg-2: #0a0c14;
    --panel: #0f1220;
    --panel-2: #151829;
    --line: rgba(255,255,255,0.08);
    --line-2: rgba(255,255,255,0.14);
    --text: #f3f4f8;
    --text-dim: rgba(243,244,248,0.62);
    --text-mute: rgba(243,244,248,0.38);
    --neon: oklch(0.72 0.21 245);
    --neon-2: oklch(0.85 0.18 220);
    --neon-soft: oklch(0.72 0.21 245 / 0.18);
    --accent-warm: oklch(0.78 0.17 45);
    --radius: 18px;
    --radius-lg: 24px;
    --ff-display: 'Space Grotesk', system-ui, sans-serif;
    --ff-body: 'Inter', system-ui, sans-serif;
    --ff-mono: 'JetBrains Mono', ui-monospace, monospace;
    color: var(--text);
    font-family: var(--ff-body);
  }

  .gallery-page {
    background:
      radial-gradient(1200px 800px at 80% -10%, oklch(0.72 0.21 245 / 0.12), transparent 60%),
      radial-gradient(900px 600px at -10% 30%, oklch(0.85 0.18 220 / 0.08), transparent 60%),
      var(--bg);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
  }

  .gallery-page *,
  .gallery-page *::before,
  .gallery-page *::after,
  body.page--gallery .lightbox *,
  body.page--gallery .lightbox *::before,
  body.page--gallery .lightbox *::after {
    box-sizing: border-box;
  }

  /* ===== PAGE HEAD ===== */
  .gallery-page .page-head {
    position: relative;
    padding: 160px 40px 60px;
    overflow: hidden;
  }
  .gallery-page .page-head-bg {
    position: absolute; inset: 0;
    background-image:
      linear-gradient(var(--line) 1px, transparent 1px),
      linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 30%, transparent 80%);
    opacity: 0.4;
    pointer-events: none;
  }
  .gallery-page .page-head-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    top: -10%; right: -5%;
    width: 500px; height: 500px;
    background: oklch(0.55 0.22 250 / 0.35);
  }
  .gallery-page .page-head .container { position: relative; z-index: 2; }

  .gallery-page .container { max-width: 1440px; margin: 0 auto; }

  .gallery-page .eyebrow {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: var(--ff-display);
    font-weight: 600;
    font-size: 12px;
    color: var(--neon-2);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 9px 16px;
    border: 1px solid oklch(0.72 0.21 245 / 0.35);
    border-radius: 100px;
    background: oklch(0.72 0.21 245 / 0.08);
    margin-bottom: 28px;
  }
  .gallery-page .eyebrow .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--neon-2);
    box-shadow: 0 0 10px var(--neon-2);
  }

  .gallery-page h1.page-title {
    font-family: var(--ff-display);
    font-weight: 700;
    font-size: clamp(48px, 6vw, 96px);
    line-height: 0.98;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    margin-bottom: 24px;
  }
  .gallery-page h1.page-title .accent {
    background: linear-gradient(135deg, var(--neon-2), var(--neon));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  .gallery-page h1.page-title em {
    -webkit-text-stroke: 1.5px var(--neon);
    color: transparent;
    font-style: italic;
    font-weight: 500;
  }
  .gallery-page .page-desc {
    font-size: 17px;
    color: var(--text-dim);
    max-width: 620px;
    line-height: 1.55;
    margin-bottom: 36px;
  }
  .gallery-page .page-stats {
    display: flex; gap: 44px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    max-width: 720px;
  }
  .gallery-page .stat-num {
    font-family: var(--ff-display);
    font-weight: 600;
    font-size: 28px;
    line-height: 1;
    background: linear-gradient(135deg, var(--text), var(--neon-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  .gallery-page .stat-label {
    font-family: var(--ff-mono);
    font-size: 10px;
    color: var(--text-mute);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-top: 6px;
  }

  /* ===== FILTERS ===== */
  .gallery-page .filters-wrap {
    padding: 40px 40px 24px;
    position: sticky;
    top: 80px;
    z-index: 50;
    background: rgba(5,6,10,0.85);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }
  .gallery-page .filters {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
  }
  .gallery-page .filter-tabs-wrap {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .gallery-page .filter-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
  }
  .gallery-page .filter-label {
    font-family: var(--ff-mono);
    font-size: 10px;
    color: var(--text-mute);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    min-width: 110px;
  }
  .gallery-page .chip {
    font-family: var(--ff-display);
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 9px 16px;
    border-radius: 100px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.02);
    color: var(--text-dim);
    cursor: pointer;
    transition: all 200ms;
    white-space: nowrap;
    display: inline-flex; align-items: center; gap: 8px;
  }
  .gallery-page .chip:hover {
    border-color: var(--line-2);
    color: var(--text);
  }
  .gallery-page .chip.active {
    border-color: var(--neon);
    background: var(--neon-soft);
    color: var(--text);
    box-shadow: 0 0 20px var(--neon-soft);
  }
  .gallery-page .chip .count {
    font-family: var(--ff-mono);
    font-size: 10px;
    color: var(--text-mute);
    background: rgba(255,255,255,0.05);
    padding: 2px 6px;
    border-radius: 100px;
  }
  .gallery-page .chip.active .count { color: var(--neon-2); background: rgba(0,0,0,0.3); }

  .gallery-page .filter-actions {
    display: flex; align-items: center; gap: 12px;
    justify-self: end;
  }
  .gallery-page .view-toggle {
    display: flex;
    border: 1px solid var(--line);
    border-radius: 100px;
    overflow: hidden;
    padding: 3px;
    background: rgba(255,255,255,0.02);
  }
  .gallery-page .view-toggle button {
    background: transparent;
    border: none;
    padding: 8px 12px;
    color: var(--text-mute);
    cursor: pointer;
    border-radius: 100px;
    transition: all 200ms;
    display: flex; align-items: center; gap: 6px;
    font-family: var(--ff-mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }
  .gallery-page .view-toggle button.active {
    background: var(--neon-soft);
    color: var(--text);
  }
  .gallery-page .view-toggle button svg { width: 14px; height: 14px; }

  .gallery-page .results-bar {
    padding: 22px 40px;
    display: flex; align-items: center; justify-content: space-between;
    font-family: var(--ff-mono);
    font-size: 12px;
    color: var(--text-mute);
    letter-spacing: 0.1em;
  }
  .gallery-page .results-count strong {
    color: var(--neon-2);
    font-family: var(--ff-display);
    font-weight: 600;
    font-size: 14px;
    margin-right: 6px;
  }
  .gallery-page .clear-btn {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--text-dim);
    padding: 8px 14px;
    border-radius: 100px;
    font-family: var(--ff-mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 200ms;
    display: inline-flex; align-items: center; gap: 8px;
  }
  .gallery-page .clear-btn:hover { border-color: var(--neon); color: var(--neon-2); }
  .gallery-page .clear-btn[disabled] { opacity: 0.35; cursor: not-allowed; }

  /* ===== GALLERY GRID ===== */
  .gallery-page .gallery {
    padding: 0 40px 120px;
  }
  .gallery-page .grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
  .gallery-page .grid.compact {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }
  .gallery-page .item {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--panel);
    border: 1px solid var(--line);
    cursor: pointer;
    transition: transform 400ms cubic-bezier(0.2, 0.9, 0.3, 1), border-color 300ms, opacity 400ms;
    aspect-ratio: 4 / 5;
    display: flex;
    flex-direction: column;
  }
  .gallery-page .item:hover { border-color: var(--line-2); transform: translateY(-4px); }
  .gallery-page .item.hidden { display: none; }
  .gallery-page .item .media-wrap {
    position: relative;
    flex: 1 1 auto;
    overflow: hidden;
    min-height: 0;
  }
  .gallery-page .item .bg {
    position: absolute; inset: 0;
    transition: transform 800ms cubic-bezier(0.2, 0.9, 0.3, 1), filter 400ms;
  }
  .gallery-page .item:hover .bg { transform: scale(1.06); filter: brightness(1.1); }
  .gallery-page .item .overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(5,6,10,0) 50%, rgba(5,6,10,0.5) 100%);
    z-index: 2;
  }
  .gallery-page .item .placeholder-label {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--ff-mono);
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-align: center;
    padding: 6px 12px;
    border: 1px dashed rgba(255,255,255,0.2);
    border-radius: 6px;
    background: rgba(0,0,0,0.3);
    z-index: 3;
  }
  /* Top-left media-type pill */
  .gallery-page .item .media-type {
    position: absolute;
    top: 14px; left: 14px;
    z-index: 4;
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--ff-mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 6px 10px;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(10px);
    border: 1px solid var(--line-2);
    border-radius: 100px;
    color: var(--text);
  }
  .gallery-page .item .media-type.video { color: var(--neon-2); border-color: oklch(0.85 0.18 220 / 0.4); }
  .gallery-page .item .media-type svg { width: 11px; height: 11px; }
  /* Top-right media count pill */
  .gallery-page .item .count-pill {
    position: absolute;
    top: 14px; right: 14px;
    z-index: 4;
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--ff-mono);
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 6px 10px;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(10px);
    border: 1px solid var(--line-2);
    border-radius: 100px;
    color: var(--text);
  }
  .gallery-page .item .count-pill svg { width: 11px; height: 11px; }
  .gallery-page .item .play-icon {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 56px; height: 56px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    z-index: 3;
    opacity: 0;
    transition: all 300ms;
  }
  .gallery-page .item.is-video .play-icon { opacity: 1; }
  .gallery-page .item:hover .play-icon {
    background: var(--neon);
    border-color: var(--neon);
    transform: translate(-50%, -50%) scale(1.1);
  }
  .gallery-page .item.is-video .play-icon::before {
    content: '';
    width: 0; height: 0;
    border-left: 13px solid white;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    margin-left: 3px;
    transition: border-left-color 200ms;
  }
  .gallery-page .item:hover .play-icon::before { border-left-color: #05060a; }

  /* Card meta block — sits BELOW media, not on top */
  .gallery-page .item .meta {
    flex: 0 0 auto;
    padding: 18px 20px 20px;
    border-top: 1px solid var(--line);
    background: var(--panel);
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .gallery-page .item .meta-top {
    display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  }
  .gallery-page .item h3 {
    font-family: var(--ff-display);
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
    text-transform: uppercase;
    flex: 1 1 auto;
  }
  .gallery-page .item .date {
    font-family: var(--ff-mono);
    font-size: 10px;
    color: var(--text-mute);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .gallery-page .item .meta-row {
    display: flex; gap: 5px; flex-wrap: wrap;
  }
  .gallery-page .item .tag {
    font-family: var(--ff-mono);
    font-size: 9px;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    padding: 4px 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--line);
    border-radius: 100px;
    color: var(--text-dim);
    white-space: nowrap;
  }
  .gallery-page .item .tag.primary {
    color: var(--neon-2);
    border-color: oklch(0.85 0.18 220 / 0.35);
    background: oklch(0.85 0.18 220 / 0.08);
  }
  .gallery-page .item .tag.muted {
    opacity: 0.7;
  }

  /* Compact view — denser cards */
  .gallery-page .grid.compact .item { aspect-ratio: 4 / 4.6; }
  .gallery-page .grid.compact .item h3 { font-size: 14px; }
  .gallery-page .grid.compact .item .meta { padding: 14px 14px 16px; gap: 8px; }
  .gallery-page .grid.compact .item .tag { font-size: 8px; padding: 3px 7px; }

  /* Striped placeholder backgrounds */
  .gallery-page .bg-1 { background: repeating-linear-gradient(35deg, oklch(0.2 0.08 250), oklch(0.2 0.08 250) 22px, oklch(0.25 0.1 245) 22px, oklch(0.25 0.1 245) 44px); }
  .gallery-page .bg-2 { background: repeating-linear-gradient(-25deg, oklch(0.18 0.06 280), oklch(0.18 0.06 280) 18px, oklch(0.22 0.08 260) 18px, oklch(0.22 0.08 260) 36px); }
  .gallery-page .bg-3 { background: repeating-linear-gradient(70deg, oklch(0.22 0.1 240), oklch(0.22 0.1 240) 26px, oklch(0.28 0.14 230) 26px, oklch(0.28 0.14 230) 52px); }
  .gallery-page .bg-4 { background: repeating-linear-gradient(-60deg, oklch(0.15 0.05 270), oklch(0.15 0.05 270) 16px, oklch(0.2 0.08 250) 16px, oklch(0.2 0.08 250) 32px); }
  .gallery-page .bg-5 { background: repeating-linear-gradient(15deg, oklch(0.2 0.09 255), oklch(0.2 0.09 255) 20px, oklch(0.26 0.12 240) 20px, oklch(0.26 0.12 240) 40px); }
  .gallery-page .bg-6 { background: repeating-linear-gradient(-45deg, oklch(0.24 0.11 235), oklch(0.24 0.11 235) 24px, oklch(0.3 0.15 225) 24px, oklch(0.3 0.15 225) 48px); }
  .gallery-page .bg-7 { background: repeating-linear-gradient(90deg, oklch(0.17 0.06 275), oklch(0.17 0.06 275) 14px, oklch(0.21 0.08 260) 14px, oklch(0.21 0.08 260) 28px); }
  .gallery-page .bg-8 { background: repeating-linear-gradient(0deg, oklch(0.19 0.07 265), oklch(0.19 0.07 265) 30px, oklch(0.24 0.1 250) 30px, oklch(0.24 0.1 250) 60px); }
  .gallery-page .bg-9 { background: repeating-linear-gradient(45deg, oklch(0.18 0.08 290), oklch(0.18 0.08 290) 22px, oklch(0.23 0.11 270) 22px, oklch(0.23 0.11 270) 44px); }
  .gallery-page .bg-10 { background: repeating-linear-gradient(-15deg, oklch(0.22 0.1 220), oklch(0.22 0.1 220) 18px, oklch(0.27 0.13 235) 18px, oklch(0.27 0.13 235) 36px); }
  .gallery-page .bg-11 { background: repeating-linear-gradient(110deg, oklch(0.16 0.07 260), oklch(0.16 0.07 260) 26px, oklch(0.21 0.09 245) 26px, oklch(0.21 0.09 245) 52px); }
  .gallery-page .bg-12 { background: repeating-linear-gradient(-90deg, oklch(0.2 0.1 280), oklch(0.2 0.1 280) 14px, oklch(0.25 0.12 260) 14px, oklch(0.25 0.12 260) 28px); }
  .gallery-page .bg-feat {
    background:
      radial-gradient(circle at 70% 40%, oklch(0.65 0.22 250 / 0.6), transparent 60%),
      linear-gradient(135deg, oklch(0.25 0.15 260), oklch(0.15 0.1 280));
  }
  .gallery-page .bg-feat-2 {
    background:
      radial-gradient(ellipse at 30% 70%, oklch(0.7 0.2 320 / 0.4), transparent 55%),
      radial-gradient(ellipse at 70% 30%, oklch(0.75 0.22 250 / 0.5), transparent 55%),
      linear-gradient(135deg, oklch(0.22 0.13 290), oklch(0.12 0.08 270));
  }

  /* Empty state */
  .gallery-page .empty {
    padding: 80px 40px;
    text-align: center;
    grid-column: 1 / -1;
    border: 1px dashed var(--line-2);
    border-radius: var(--radius-lg);
    color: var(--text-dim);
    display: none;
  }
  .gallery-page .empty.show { display: block; }
  .gallery-page .empty h3 {
    font-family: var(--ff-display);
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: -0.01em;
  }
  .gallery-page .empty p { font-size: 14px; }

  /* ===== LIGHTBOX ===== */
  body.page--gallery .lightbox {
    position: fixed;
    inset: 0;
    background: rgba(5,6,10,0.92);
    backdrop-filter: blur(20px);
    z-index: 15030;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
  }
  body.page--gallery .lightbox.on { display: flex; }
  body.page--gallery .lightbox-inner {
    position: relative;
    width: min(1280px, 100%);
    max-height: 92vh;
    background: var(--panel);
    border: 1px solid var(--line-2);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  }
  body.page--gallery .lightbox-left {
    position: relative;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
  body.page--gallery .lightbox-media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #000;
  }
  body.page--gallery .lb-slide {
    position: absolute; inset: 0;
    opacity: 0;
    transition: opacity 350ms ease;
    pointer-events: none;
  }
  body.page--gallery .lb-slide.active { opacity: 1; pointer-events: auto; }
  body.page--gallery .lb-slide .bg-fill { position: absolute; inset: 0; }
  body.page--gallery .lb-slide .ph-label {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--ff-mono);
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    padding: 10px 16px;
    border: 1px dashed rgba(255,255,255,0.3);
    border-radius: 6px;
    background: rgba(0,0,0,0.45);
    text-align: center;
    z-index: 2;
  }
  body.page--gallery .lb-slide.is-video .ph-label::before {
    content: '▶ ';
    color: var(--neon-2);
    margin-right: 4px;
  }
  /* Carousel arrows */
  body.page--gallery .lb-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px; height: 48px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(10px);
    border: 1px solid var(--line-2);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: var(--text);
    z-index: 8;
    transition: all 200ms;
  }
  body.page--gallery .lb-arrow:hover { background: var(--neon); color: #05060a; border-color: var(--neon); }
  body.page--gallery .lb-arrow.prev { left: 16px; }
  body.page--gallery .lb-arrow.next { right: 16px; }
  body.page--gallery .lb-arrow svg { width: 18px; height: 18px; }
  body.page--gallery .lb-arrow[disabled] { opacity: 0.3; pointer-events: none; }
  /* Counter pill */
  body.page--gallery .lb-counter {
    position: absolute;
    bottom: 16px; left: 50%;
    transform: translateX(-50%);
    font-family: var(--ff-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 7px 14px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--line-2);
    border-radius: 100px;
    color: var(--text);
    z-index: 8;
  }
  body.page--gallery .lb-counter strong { color: var(--neon-2); font-family: var(--ff-display); margin-right: 2px; }
  /* Thumbnails strip */
  body.page--gallery .lb-thumbs-wrap {
    position: relative;
    border-top: 1px solid var(--line);
    background: var(--panel-2);
    padding: 14px 16px;
  }
  body.page--gallery .lb-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--line-2) transparent;
    padding-bottom: 4px;
  }
  body.page--gallery .lb-thumbs::-webkit-scrollbar { height: 6px; }
  body.page--gallery .lb-thumbs::-webkit-scrollbar-track { background: transparent; }
  body.page--gallery .lb-thumbs::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 100px; }
  body.page--gallery .lb-thumb {
    flex: 0 0 auto;
    width: 92px;
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    border: 2px solid transparent;
    transition: all 200ms;
    background: var(--panel);
  }
  body.page--gallery .lb-thumb .bg-fill { position: absolute; inset: 0; }
  body.page--gallery .lb-thumb .thumb-overlay {
    position: absolute; inset: 0;
    background: rgba(5,6,10,0.55);
    transition: background 200ms;
    z-index: 2;
  }
  body.page--gallery .lb-thumb:hover .thumb-overlay { background: rgba(5,6,10,0.2); }
  body.page--gallery .lb-thumb.active { border-color: var(--neon); box-shadow: 0 0 0 1px var(--neon), 0 0 16px var(--neon-soft); }
  body.page--gallery .lb-thumb.active .thumb-overlay { background: transparent; }
  body.page--gallery .lb-thumb .thumb-icon {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    font-family: var(--ff-mono);
    font-size: 9px;
    color: white;
    background: rgba(0,0,0,0.5);
    padding: 2px 5px;
    border-radius: 100px;
    letter-spacing: 0.1em;
  }
  body.page--gallery .lb-thumb .video-mark {
    position: absolute;
    top: 4px; right: 4px;
    z-index: 3;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--neon);
    color: #05060a;
    display: flex; align-items: center; justify-content: center;
    font-size: 8px;
  }

  body.page--gallery .lightbox-info {
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    overflow-y: auto;
    border-left: 1px solid var(--line);
  }
  body.page--gallery .lightbox-info h2 {
    font-family: var(--ff-display);
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.1;
    text-transform: uppercase;
  }
  body.page--gallery .lightbox-info .row {
    display: flex; gap: 8px; flex-wrap: wrap;
  }
  body.page--gallery .lightbox-info .label {
    font-family: var(--ff-mono);
    font-size: 10px;
    color: var(--text-mute);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 6px;
  }
  body.page--gallery .lightbox-info .desc {
    font-size: 14px;
    color: var(--text-dim);
    line-height: 1.6;
  }
  body.page--gallery .lightbox-close {
    position: absolute;
    top: 16px; right: 16px;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    border: 1px solid var(--line-2);
    color: var(--text);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 200ms;
  }
  body.page--gallery .lightbox-close:hover { background: var(--neon); color: #05060a; border-color: var(--neon); }

  /* ===== CTA Footer-ish ===== */
  .gallery-page .cta {
    padding: 80px 40px 120px;
  }
  .gallery-page .cta-box {
    position: relative;
    background:
      radial-gradient(circle at 20% 30%, oklch(0.55 0.22 250 / 0.3), transparent 50%),
      linear-gradient(135deg, oklch(0.35 0.2 250), oklch(0.25 0.15 265));
    border-radius: 32px;
    padding: 64px 56px;
    overflow: hidden;
    border: 1px solid oklch(0.72 0.21 245 / 0.4);
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 40px;
    align-items: center;
  }
  .gallery-page .cta-grid-bg {
    position: absolute; inset: 0;
    background-image:
      linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at 80% 50%, black 10%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at 80% 50%, black 10%, transparent 70%);
    pointer-events: none;
  }
  .gallery-page .cta-box > * { position: relative; z-index: 2; }
  .gallery-page .cta-box h2 {
    font-family: var(--ff-display);
    font-weight: 500;
    font-size: clamp(28px, 3.4vw, 48px);
    line-height: 1;
    letter-spacing: -0.025em;
    margin-bottom: 14px;
    text-transform: uppercase;
  }
  .gallery-page .cta-box h2 em { font-style: italic; color: var(--neon-2); -webkit-text-stroke: 0; }
  .gallery-page .cta-box p {
    font-size: 15px;
    color: rgba(255,255,255,0.8);
    max-width: 440px;
    margin-bottom: 24px;
  }
  .gallery-page .cta-actions { display: flex; gap: 14px; flex-wrap: wrap; }

  @media (max-width: 1100px) {
    .gallery-page .filters { grid-template-columns: 1fr; }
    .gallery-page .filter-actions { justify-self: start; }
    .gallery-page .grid { grid-template-columns: repeat(2, 1fr); }
    .gallery-page .grid.compact { grid-template-columns: repeat(3, 1fr); }
    body.page--gallery .lightbox-inner { grid-template-columns: 1fr; max-height: 92vh; overflow-y: auto; }
    body.page--gallery .lightbox-info { border-left: none; border-top: 1px solid var(--line); }
    .gallery-page .cta-box { grid-template-columns: 1fr; }
  }
  @media (max-width: 700px) {
    .gallery-page .grid,
    .gallery-page .grid.compact {
      grid-template-columns: 1fr;
    }
  }

  /* ======================================================
     ============ ANIMATIONS ==============================
     ====================================================== */

  /* keyframes */
  @keyframes float-orb {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    33%  { transform: translate3d(40px, -30px, 0) scale(1.08); }
    66%  { transform: translate3d(-30px, 20px, 0) scale(0.95); }
    100% { transform: translate3d(0, 0, 0) scale(1); }
  }
  @keyframes pulse-dot {
    0%,100% { box-shadow: 0 0 8px var(--neon-2), 0 0 0 0 oklch(0.85 0.18 220 / 0.5); }
    50%     { box-shadow: 0 0 14px var(--neon-2), 0 0 0 8px oklch(0.85 0.18 220 / 0); }
  }
  @keyframes shimmer-line {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
  }
  @keyframes rise-in {
    from { opacity: 0; transform: translateY(28px) scale(0.97); filter: blur(6px); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    filter: blur(0); }
  }
  @keyframes title-reveal {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  @keyframes accent-sweep {
    0%   { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
  }
  @keyframes count-pop {
    0%   { transform: scale(1); }
    35%  { transform: scale(1.4); color: var(--neon-2); }
    100% { transform: scale(1); }
  }
  @keyframes neon-bloom {
    0%,100% { box-shadow: 0 0 20px var(--neon-soft); }
    50%     { box-shadow: 0 0 30px oklch(0.72 0.21 245 / 0.45); }
  }
  @keyframes spin-slow {
    to { transform: rotate(360deg); }
  }

  /* ===== HERO ORBS — floating + animated gradient title ===== */
  .gallery-page .page-head-orb {
    animation: float-orb 18s ease-in-out infinite;
  }
  /* Add a second orb via ::after on page-head for richer motion */
  .gallery-page .page-head { position: relative; }
  .gallery-page .page-head::after {
    content: '';
    position: absolute;
    bottom: -10%; left: 10%;
    width: 380px; height: 380px;
    border-radius: 50%;
    filter: blur(90px);
    background: oklch(0.85 0.18 220 / 0.22);
    pointer-events: none;
    z-index: 0;
    animation: float-orb 22s ease-in-out -6s infinite reverse;
  }
  .gallery-page .eyebrow .dot { animation: pulse-dot 2.4s ease-in-out infinite; }

  /* Animated gradient on title accent */
  .gallery-page h1.page-title .accent {
    background: linear-gradient(110deg, var(--neon-2) 0%, var(--neon) 35%, oklch(0.78 0.17 45) 60%, var(--neon-2) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: accent-sweep 8s linear infinite;
  }

  /* Hero text entry */
  .gallery-page .page-head .eyebrow,
  .gallery-page .page-head h1.page-title,
  .gallery-page .page-head .page-desc,
  .gallery-page .page-head .page-stats {
    opacity: 0;
    animation: title-reveal 900ms cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
  }
  .gallery-page .page-head .eyebrow      { animation-delay: 100ms; }
  .gallery-page .page-head h1.page-title { animation-delay: 220ms; }
  .gallery-page .page-head .page-desc    { animation-delay: 380ms; }
  .gallery-page .page-head .page-stats   { animation-delay: 520ms; }

  /* ===== CHIPS — micro-interactions ===== */
  .gallery-page .chip {
    will-change: transform;
    transition: transform 220ms cubic-bezier(0.2, 0.9, 0.3, 1),
                background 220ms, color 220ms, border-color 220ms, box-shadow 300ms;
  }
  .gallery-page .chip:hover { transform: translateY(-1px); }
  .gallery-page .chip:active { transform: translateY(0) scale(0.96); transition-duration: 80ms; }
  .gallery-page .chip.active { animation: neon-bloom 3.6s ease-in-out infinite; }
  .gallery-page .chip .count {
    transition: color 200ms, background 200ms, transform 220ms cubic-bezier(0.2, 0.9, 0.3, 1);
  }
  .gallery-page .chip .count.pop { animation: count-pop 420ms cubic-bezier(0.2, 0.9, 0.3, 1); }

  /* ===== RESULTS COUNT — animate on change ===== */
  .gallery-page .results-count strong {
    display: inline-block;
    transition: transform 260ms cubic-bezier(0.2, 0.9, 0.3, 1);
  }
  .gallery-page .results-count strong.pop { animation: count-pop 380ms cubic-bezier(0.2, 0.9, 0.3, 1); }

  /* ===== STAT NUMBERS — subtle gradient sweep on hover ===== */
  .gallery-page .stat-num {
    background-size: 200% auto;
    transition: transform 280ms cubic-bezier(0.2, 0.9, 0.3, 1);
  }
  .gallery-page .page-stats > div:hover .stat-num { transform: translateY(-2px) scale(1.04); }

  /* ===== GRID ITEMS — scroll reveal + magnetic tilt ===== */
  .gallery-page .item {
    opacity: 0;
    transform: translateY(34px) scale(0.97);
    transition: opacity 700ms cubic-bezier(0.2, 0.9, 0.3, 1),
                transform 700ms cubic-bezier(0.2, 0.9, 0.3, 1),
                border-color 300ms, box-shadow 400ms;
  }
  .gallery-page .item.in {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  .gallery-page .item.tilt {
    transform-style: preserve-3d;
    will-change: transform;
  }
  .gallery-page .item .media-wrap {
    transition: transform 500ms cubic-bezier(0.2, 0.9, 0.3, 1);
  }
  .gallery-page .item:hover {
    border-color: var(--neon-soft);
    box-shadow: 0 24px 60px -20px rgba(0,0,0,0.6),
                0 0 0 1px var(--neon-soft),
                0 0 40px -10px var(--neon-soft);
  }

  /* Shine sweep on hover */
  .gallery-page .item::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 50%; height: 100%;
    background: linear-gradient(110deg,
      transparent 0%,
      rgba(255,255,255,0.06) 45%,
      rgba(255,255,255,0.16) 50%,
      rgba(255,255,255,0.06) 55%,
      transparent 100%);
    transform: translateX(-200%) skewX(-20deg);
    pointer-events: none;
    z-index: 4;
    transition: transform 900ms cubic-bezier(0.2, 0.9, 0.3, 1);
  }
  .gallery-page .item:hover::before { transform: translateX(280%) skewX(-20deg); }

  /* Tag entrance */
  .gallery-page .item .tag {
    transition: transform 220ms, background 220ms, color 220ms, border-color 220ms;
  }
  .gallery-page .item:hover .tag.primary {
    box-shadow: 0 0 0 1px var(--neon-soft);
  }

  /* Filter-out animation (FLIP-ish leaving state) */
  .gallery-page .item.leaving {
    opacity: 0 !important;
    transform: translateY(-12px) scale(0.94) !important;
    transition-duration: 350ms !important;
    pointer-events: none;
  }

  /* ===== EMPTY STATE ===== */
  .gallery-page .empty.show {
    animation: rise-in 600ms cubic-bezier(0.2, 0.9, 0.3, 1);
  }

  /* ===== LIGHTBOX — animated entry ===== */
  @keyframes lb-fade-in {
    from { opacity: 0; backdrop-filter: blur(0px); }
    to   { opacity: 1; backdrop-filter: blur(8px); }
  }
  @keyframes lb-zoom-in {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
  }
  body.page--gallery .lightbox {
    backdrop-filter: blur(0px);
  }
  body.page--gallery .lightbox.on {
    animation: lb-fade-in 320ms ease forwards;
  }
  body.page--gallery .lightbox.on .lightbox-inner {
    animation: lb-zoom-in 420ms cubic-bezier(0.2, 0.9, 0.3, 1);
  }
  body.page--gallery .lb-slide {
    transition: opacity 450ms cubic-bezier(0.2, 0.9, 0.3, 1),
                transform 700ms cubic-bezier(0.2, 0.9, 0.3, 1);
    transform: scale(1.04);
  }
  body.page--gallery .lb-slide.active {
    transform: scale(1);
  }
  /* slide direction hint */
  body.page--gallery .lb-slide.from-left  { transform: translateX(-3%) scale(1.04); }
  body.page--gallery .lb-slide.from-right { transform: translateX(3%) scale(1.04); }

  body.page--gallery .lb-thumb {
    transition: transform 220ms cubic-bezier(0.2, 0.9, 0.3, 1),
                border-color 220ms, box-shadow 300ms;
  }
  body.page--gallery .lb-thumb:hover { transform: translateY(-2px) scale(1.04); }
  body.page--gallery .lb-thumb.active { transform: scale(1.06); }

  body.page--gallery .lightbox-info > * {
    opacity: 0;
    animation: title-reveal 500ms cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
  }
  body.page--gallery .lightbox.on .lightbox-info > *:nth-child(1) { animation-delay: 220ms; }
  body.page--gallery .lightbox.on .lightbox-info > *:nth-child(2) { animation-delay: 280ms; }
  body.page--gallery .lightbox.on .lightbox-info > *:nth-child(3) { animation-delay: 340ms; }
  body.page--gallery .lightbox.on .lightbox-info > *:nth-child(4) { animation-delay: 400ms; }
  body.page--gallery .lightbox.on .lightbox-info > *:nth-child(5) { animation-delay: 460ms; }
  body.page--gallery .lightbox.on .lightbox-info > *:nth-child(6) { animation-delay: 520ms; }
  body.page--gallery .lightbox.on .lightbox-info > *:nth-child(n+7) { animation-delay: 580ms; }

  /* ===== VIEW TOGGLE — pop animation ===== */
  .gallery-page .view-toggle button {
    transition: all 200ms cubic-bezier(0.2, 0.9, 0.3, 1);
  }
  .gallery-page .view-toggle button:active { transform: scale(0.92); }

  /* ===== CLEAR BUTTON ===== */
  .gallery-page .clear-btn { transition: all 200ms; }
  .gallery-page .clear-btn:not([disabled]):hover { transform: translateY(-1px); }
  .gallery-page .clear-btn:not([disabled]):active { transform: scale(0.96); }

  /* ===== CTA — shimmer on the gradient border ===== */
  .gallery-page .cta-box::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 30%, oklch(0.72 0.21 245 / 0.18) 50%, transparent 70%);
    pointer-events: none;
    transform: translateX(-100%);
    animation: shimmer-line 5s ease-in-out infinite;
  }

  /* ===== FILTERS BAR — sticky-on-scroll subtle accent ===== */
  .gallery-page .filters-wrap.scrolled {
    border-bottom-color: var(--neon-soft);
    box-shadow: 0 4px 24px -8px rgba(0,0,0,0.5);
  }

  /* ===== Reduce motion ===== */
  @media (prefers-reduced-motion: reduce) {
    .gallery-page *,
    .gallery-page *::before,
    .gallery-page *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
    .gallery-page .item {
      opacity: 1;
      transform: none;
    }
  }

/* Uploaded gallery media */
  .gallery-page .item .bg-img,
  .gallery-page .item .bg-video,
  body.page--gallery .lb-slide .bg-img,
  body.page--gallery .lb-slide .bg-video,
  body.page--gallery .lb-thumb .bg-img,
  body.page--gallery .lb-thumb .bg-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  .gallery-page .item .media-wrap .bg-img,
  .gallery-page .item .media-wrap .bg-video {
    transition: transform 800ms cubic-bezier(0.2, 0.9, 0.3, 1), filter 400ms;
  }
  .gallery-page .item:hover .media-wrap .bg-img,
  .gallery-page .item:hover .media-wrap .bg-video {
    transform: scale(1.06);
    filter: brightness(1.1);
  }
  .gallery-page .item .bg-video,
  body.page--gallery .lb-slide .bg-video {
    pointer-events: none;
  }
  body.page--gallery .lb-slide.active .bg-video.lb-video--interactive {
    pointer-events: auto;
  }

  .gallery-page .page-head {
    padding-top: 48px;
    padding-bottom: 48px;
  }

/* --- Хедер как на страницах услуг: sticky + «капсула» при scroll (scroll-reveal.js) --- */
@keyframes svc-head-shimmer-gallery {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

body.page--gallery .wrapper {
  position: relative;
  z-index: 1;
  overflow: visible;
}

body.page--gallery main.main {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
}

body.page--gallery .footer.footer--editorial {
  position: relative;
  z-index: 0;
  flex-shrink: 0;
  margin-top: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: var(--fe-bg, #05060a);
}

body.page--gallery.lb-gallery-lightbox-open {
  overflow: hidden;
}

body.page--gallery .header {
  position: sticky;
  top: 0;
  z-index: 200;
  backdrop-filter: blur(18px) saturate(165%);
  -webkit-backdrop-filter: blur(18px) saturate(165%);
  background: linear-gradient(180deg, rgba(38, 42, 54, 0.82) 0%, rgba(28, 31, 40, 0.72) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

body.page--gallery .header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(11, 101, 252, 0.15) 20%,
    rgba(120, 185, 255, 0.65) 50%,
    rgba(11, 101, 252, 0.15) 80%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: svc-head-shimmer-gallery 10s linear infinite;
  opacity: 0.85;
}

body.page--gallery .header,
body.page--gallery .header .header__wrap {
  transition:
    top 0.32s ease,
    margin 0.32s ease,
    padding 0.32s ease,
    max-width 0.32s ease,
    border-radius 0.32s ease,
    background 0.32s ease,
    border-color 0.32s ease,
    box-shadow 0.32s ease,
    backdrop-filter 0.32s ease,
    -webkit-backdrop-filter 0.32s ease;
}

body.page--gallery .header:not(.header--compact) .header__wrap {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

body.page--gallery .header.header--compact {
  top: 10px;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: none;
  box-shadow: none;
}

body.page--gallery .header.header--compact::after {
  display: none;
}

body.page--gallery .header.header--compact .header__wrap {
  max-width: min(1180px, calc(100% - 32px));
  margin-left: auto;
  margin-right: auto;
  margin-top: 0;
  margin-bottom: 0;
  padding: 7px 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(38, 42, 54, 0.82) 0%, rgba(28, 31, 40, 0.72) 100%);
  backdrop-filter: blur(18px) saturate(165%);
  -webkit-backdrop-filter: blur(18px) saturate(165%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22), 0 2px 14px rgba(0, 0, 0, 0.18);
  position: relative;
}

body.page--gallery .header.header--compact .header__wrap::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 4px;
  height: 2px;
  pointer-events: none;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(11, 101, 252, 0.15) 20%,
    rgba(120, 185, 255, 0.65) 50%,
    rgba(11, 101, 252, 0.15) 80%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: svc-head-shimmer-gallery 10s linear infinite;
  opacity: 0.85;
}

@media (max-width: 640px) {
  body.page--gallery .header.header--compact {
    top: 6px;
  }

  body.page--gallery .header.header--compact .header__wrap {
    max-width: calc(100% - 16px);
    padding: 6px 12px;
  }

  body.page--gallery .header.header--compact .menu__list > li {
    margin-left: 10px;
  }

  body.page--gallery .header.header--compact .menu__link,
  body.page--gallery .header.header--compact .menu__link_btn {
    font-size: 18px;
  }
}
