/* ═══════════════════════════════════════════════
     SECTION: GALLERY — Cinematic Horizontal Exhibition
     Horizontal scrolling showcase with snap points,
     mouse parallax, annotation overlays, expandable details,
     numbered navigation, and scroll-driven progress
     ═══════════════════════════════════════════════ */

  .gallery {
    position: relative;
    padding: clamp(5rem, 10vw, 8rem) 0;
    background: var(--bg-tertiary);
    overflow: hidden;
  }

  /* Gallery room atmosphere — warm ambient wash like entering a curated space */
  .gallery::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
      radial-gradient(ellipse 80% 70% at 30% 20%, rgba(142,153,164,0.06) 0%, transparent 55%),
      radial-gradient(ellipse 50% 50% at 80% 70%, rgba(142,153,164,0.04) 0%, transparent 50%),
      radial-gradient(ellipse 60% 40% at 50% 90%, rgba(142,153,164,0.03) 0%, transparent 50%);
    pointer-events: none;
  }

  /* Subtle horizontal grain — gallery wall texture */
  .gallery::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
      0deg,
      transparent,
      transparent 80px,
      rgba(142,153,164,0.012) 80px,
      rgba(142,153,164,0.012) 81px
    );
    pointer-events: none;
  }

  /* ─── Section Header ─── */
  .gallery__header {
    text-align: center;
    margin-bottom: clamp(3rem, 6vw, 5rem);
    position: relative;
    z-index: 10;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding: 0 var(--container-padding);
  }

  .gallery__eyebrow {
    font-family: var(--font-body);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 1rem;
  }

  .gallery__eyebrow::before,
  .gallery__eyebrow::after {
    content: '';
    display: block;
    width: 30px;
    height: 1px;
    background: var(--accent-dim);
  }

  .gallery__title {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 900;
    color: var(--fg-primary);
    line-height: 1.15;
  }

  .gallery__title em {
    font-style: italic;
    font-weight: 400;
    color: var(--accent);
  }

  .gallery__subtitle {
    font-family: var(--font-accent);
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    font-weight: 300;
    font-style: italic;
    color: var(--fg-muted);
    max-width: 500px;
    margin: 1.5rem auto 0;
    line-height: 1.7;
  }

  /* ─── Scroll Hint ─── */
  .gallery__scroll-hint {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding: 0 var(--container-padding);
  }

  .gallery__scroll-hint-line {
    width: 40px;
    height: 1px;
    background: var(--accent-dim);
    opacity: 0.4;
  }

  .gallery__scroll-hint-text {
    font-family: var(--font-body);
    font-size: 0.5rem;
    font-weight: 400;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--fg-dim);
  }

  .gallery__scroll-hint-arrow {
    width: 20px;
    height: 8px;
    position: relative;
    animation: galleryHintPulse 2s var(--ease-in-out) infinite;
  }

  .gallery__scroll-hint-arrow::before,
  .gallery__scroll-hint-arrow::after {
    content: '';
    position: absolute;
    right: 0;
    width: 10px;
    height: 1px;
    background: var(--accent-dim);
  }

  .gallery__scroll-hint-arrow::before { top: 0; transform: rotate(25deg); }
  .gallery__scroll-hint-arrow::after { bottom: 0; transform: rotate(-25deg); }

  @keyframes galleryHintPulse {
    0%, 100% { opacity: 0.4; transform: translateX(0); }
    50% { opacity: 1; transform: translateX(6px); }
  }

  /* ─── Showcase Container — Horizontal Scrolling ─── */
  .gallery__showcase {
    position: relative;
    z-index: 5;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 2rem calc(50vw - 37vw) 3rem;
    cursor: grab;
    gap: clamp(2rem, 4vw, 4rem);
  }

  .gallery__showcase::-webkit-scrollbar { display: none; }
  .gallery__showcase.grabbing { cursor: grabbing; }

  /* ─── Individual Work Panel ─── */
  .gallery__work {
    flex: 0 0 75vw;
    max-width: 1100px;
    scroll-snap-align: center;
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: clamp(2rem, 4vw, 4.5rem);
    align-items: center;
    padding: clamp(1rem, 2vw, 2rem);
    position: relative;
    /* Scroll-triggered reveal: starts hidden */
    opacity: 0;
    transform: translateY(50px) scale(0.96);
    transition: opacity 1s var(--ease-out-expo), transform 1s var(--ease-out-expo);
  }

  .gallery__work.in-view {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  /* Staggered reveals */
  .gallery__work:nth-child(2) { transition-delay: 0.08s; }
  .gallery__work:nth-child(3) { transition-delay: 0.12s; }
  .gallery__work:nth-child(4) { transition-delay: 0.16s; }
  .gallery__work:nth-child(5) { transition-delay: 0.20s; }
  .gallery__work:nth-child(6) { transition-delay: 0.24s; }

  /* ─── Work Image ─── */
  .gallery__work-image {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--bg-tertiary);
    box-shadow:
      0 2px 4px rgba(10,10,10,0.06),
      0 8px 16px rgba(10,10,10,0.08),
      0 24px 48px rgba(10,10,10,0.10),
      0 48px 80px rgba(10,10,10,0.06);
    transition: box-shadow 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
  }

  /* Premium: Top-corner light highlight */
  .gallery__work-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, transparent 100%);
    pointer-events: none;
    z-index: 4;
    transition: opacity 0.5s var(--ease-out-expo);
    opacity: 0;
  }

  .gallery__work:hover .gallery__work-image {
    box-shadow:
      0 4px 8px rgba(10,10,10,0.08),
      0 16px 32px rgba(10,10,10,0.10),
      0 40px 80px rgba(10,10,10,0.12),
      0 64px 120px rgba(10,10,10,0.08);
    transform: translateY(-8px);
  }

  .gallery__work:hover .gallery__work-image::after {
    opacity: 1;
  }

  .gallery__work-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s var(--ease-out-expo);
    will-change: transform;
  }

  .gallery__work:hover .gallery__work-image img {
    transform: scale(1.04);
    filter: contrast(1.02) saturate(1.05);
  }

  /* Copper accent line on left edge of image */
  .gallery__work-image::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10%;
    bottom: 10%;
    width: 3px;
    background: linear-gradient(180deg, transparent, var(--accent) 30%, var(--accent) 70%, transparent);
    opacity: 0;
    z-index: 3;
    transition: opacity 0.5s var(--ease-out-expo);
  }

  .gallery__work:hover .gallery__work-image::before { opacity: 0.7; }

  /* Image bottom vignette */
  .gallery__work-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
      linear-gradient(180deg, transparent 50%, rgba(10,10,10,0.25) 100%),
      linear-gradient(135deg, transparent 60%, rgba(142,153,164,0.04) 100%);
    pointer-events: none;
    z-index: 1;
  }

  /* ─── Annotation Dots ─── */
  .gallery__annotations {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
  }

  .gallery__annotation {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.5s var(--ease-out-expo), transform 0.5s var(--ease-out-expo);
    pointer-events: none;
  }

  .gallery__annotation:nth-child(2) { transition-delay: 0.1s; }
  .gallery__annotation:nth-child(3) { transition-delay: 0.2s; }

  .gallery__work:hover .gallery__annotation {
    opacity: 1;
    transform: translateX(0);
  }

  .gallery__annotation-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid rgba(242,242,247,0.9);
    box-shadow: 0 0 0 3px rgba(142,153,164,0.2);
    flex-shrink: 0;
  }

  .gallery__annotation-label {
    font-family: var(--font-body);
    font-size: 0.5rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #FFFFFF;
    background: rgba(10,10,10,0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 0.25rem 0.55rem;
    white-space: nowrap;
  }

  /* ─── Work Info (Text Side) ─── */
  .gallery__work-info {
    position: relative;
    padding: clamp(1rem, 2vw, 2rem) 0;
  }

  .gallery__work-number {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(4rem, 8vw, 7rem);
    font-weight: 900;
    color: var(--accent);
    opacity: 0.06;
    line-height: 1;
    margin-bottom: -1.2rem;
    position: relative;
    user-select: none;
  }

  .gallery__work-category {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.5rem;
    font-weight: 500;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--accent);
    padding: 0.3rem 0.9rem;
    border: 1px solid rgba(142,153,164,0.25);
    margin-bottom: 1.2rem;
  }

  .gallery__work-title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-weight: 900;
    color: var(--fg-primary);
    line-height: 1.1;
    margin-bottom: 1rem;
  }

  .gallery__work-title em {
    font-style: italic;
    font-weight: 400;
    color: var(--accent);
  }

  .gallery__work-technique {
    font-family: var(--font-accent);
    font-size: clamp(0.9rem, 1.15vw, 1.05rem);
    font-weight: 300;
    font-style: italic;
    color: var(--fg-muted);
    line-height: 1.7;
    margin-bottom: 2rem;
    max-width: 340px;
  }

  /* ─── Expand Button ─── */
  .gallery__work-expand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-body);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--fg-muted);
    padding-bottom: 0.5rem;
    border: none;
    border-bottom: 1px solid var(--border);
    background: none;
    cursor: pointer;
    transition: color 0.4s var(--ease-out-expo), border-color 0.4s var(--ease-out-expo);
  }

  .gallery__work-expand:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
  }

  .gallery__work-expand svg {
    width: 14px;
    height: 14px;
    transition: transform 0.3s var(--ease-out-expo);
  }

  .gallery__work-expand:hover svg {
    transform: translateX(4px);
  }

  /* ─── Numbered Navigation Rail ─── */
  .gallery__nav {
    position: relative;
    z-index: 10;
    max-width: var(--container-max);
    margin: clamp(1.5rem, 3vw, 2.5rem) auto 0;
    padding: 0 var(--container-padding);
    display: flex;
    justify-content: center;
    gap: 0;
  }

  .gallery__nav-item {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    color: var(--fg-dim);
    padding: 0.7rem 1.2rem;
    cursor: pointer;
    position: relative;
    border: none;
    background: none;
    transition: color 0.4s var(--ease-out-expo);
  }

  .gallery__nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.5s var(--ease-out-expo), left 0.5s var(--ease-out-expo);
  }

  .gallery__nav-item.active {
    color: var(--fg-primary);
    font-weight: 700;
  }

  .gallery__nav-item.active::after {
    width: 100%;
    left: 0;
  }

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

  /* Thin separator between nav items */
  .gallery__nav-item + .gallery__nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 30%;
    bottom: 30%;
    width: 1px;
    background: var(--border-light);
    pointer-events: none;
  }

  /* ─── Scroll Progress Bar ─── */
  .gallery__progress {
    position: relative;
    z-index: 10;
    max-width: 200px;
    margin: clamp(1rem, 2vw, 1.5rem) auto 0;
    height: 2px;
    background: var(--border);
    border-radius: 1px;
    overflow: hidden;
  }

  .gallery__progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-dim), var(--accent));
    transition: width 0.2s ease-out;
    border-radius: 1px;
  }

  /* ─── Gallery Footer ─── */
  .gallery__footer {
    position: relative;
    z-index: 10;
    max-width: var(--container-max);
    margin: clamp(3rem, 5vw, 4rem) auto 0;
    padding: 0 var(--container-padding);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
  }

  .gallery__count {
    position: relative;
  }

  .gallery__count-number {
    font-family: var(--font-display);
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 900;
    color: var(--accent);
    opacity: 0.07;
    line-height: 1;
  }

  .gallery__count-label {
    display: block;
    font-family: var(--font-body);
    font-size: 0.55rem;
    font-weight: 500;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--fg-dim);
    margin-top: 0.3rem;
  }

  .gallery__note {
    font-family: var(--font-accent);
    font-size: 0.85rem;
    font-weight: 300;
    font-style: italic;
    color: var(--fg-muted);
    max-width: 280px;
    text-align: right;
    line-height: 1.6;
  }

  /* ─── Detail Modal Overlay ─── */
  .gallery__detail-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(242,242,247,0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s var(--ease-out-expo);
    overflow-y: auto;
  }

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

  .gallery__detail-content {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: clamp(2rem, 5vw, 5rem);
    align-items: center;
    max-width: 1100px;
    width: 90%;
    padding: 4rem 0;
    transform: translateY(30px) scale(0.97);
    transition: transform 0.6s var(--ease-out-expo);
  }

  .gallery__detail-overlay.active .gallery__detail-content {
    transform: translateY(0) scale(1);
  }

  .gallery__detail-image {
    aspect-ratio: 3/4;
    overflow: hidden;
    border-radius: 2px;
    box-shadow: 0 30px 80px rgba(10,10,10,0.14);
  }

  .gallery__detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .gallery__detail-info {
    padding: 2rem 0;
  }

  .gallery__detail-number {
    font-family: var(--font-display);
    font-size: clamp(3.5rem, 6vw, 5rem);
    font-weight: 900;
    color: var(--accent);
    opacity: 0.08;
    line-height: 1;
    margin-bottom: -1rem;
    user-select: none;
  }

  .gallery__detail-category {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.55rem;
    font-weight: 500;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--accent);
    padding: 0.3rem 0.9rem;
    border: 1px solid rgba(142,153,164,0.25);
    margin-bottom: 1.2rem;
  }

  .gallery__detail-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 3vw, 2.8rem);
    font-weight: 900;
    color: var(--fg-primary);
    line-height: 1.1;
    margin-bottom: 1.2rem;
  }

  .gallery__detail-title em {
    font-style: italic;
    font-weight: 400;
    color: var(--accent);
  }

  .gallery__detail-desc {
    font-family: var(--font-accent);
    font-size: 1rem;
    font-weight: 300;
    font-style: italic;
    color: var(--fg-secondary);
    line-height: 1.8;
    margin-bottom: 2rem;
    max-width: 400px;
  }

  .gallery__detail-techniques {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
  }

  .gallery__detail-tag {
    font-family: var(--font-body);
    font-size: 0.5rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--fg-muted);
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--border);
    transition: color 0.3s ease, border-color 0.3s ease;
  }

  .gallery__detail-tag:hover {
    color: var(--accent);
    border-color: var(--accent-dim);
  }

  /* Close button */
  .gallery__detail-close {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--fg-muted);
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    z-index: 201;
    transition: all 0.35s ease;
  }

  .gallery__detail-close:hover {
    color: var(--fg-primary);
    border-color: var(--accent);
    transform: rotate(90deg);
  }

  /* ─── Decorative Elements ─── */
  .gallery__deco {
    position: absolute;
    pointer-events: none;
    z-index: 1;
  }

  .gallery__deco--line-h {
    width: 140px;
    height: 1px;
    left: 3%;
    top: 38%;
    background: linear-gradient(90deg, var(--accent-dim), transparent);
    opacity: 0.1;
    animation: galleryDecoFloatH 10s var(--ease-in-out) infinite alternate;
  }

  @keyframes galleryDecoFloatH {
    0% { transform: translateX(0); opacity: 0.1; }
    100% { transform: translateX(30px); opacity: 0.05; }
  }

  .gallery__deco--line-v {
    width: 1px;
    height: 100px;
    right: 5%;
    top: 10%;
    background: linear-gradient(180deg, transparent, var(--accent-dim), transparent);
    opacity: 0.1;
    animation: galleryDecoFloatV 8s var(--ease-in-out) infinite alternate;
  }

  @keyframes galleryDecoFloatV {
    0% { transform: translateY(0); opacity: 0.1; }
    100% { transform: translateY(25px); opacity: 0.05; }
  }

  .gallery__deco--ring {
    width: 160px;
    height: 160px;
    border: 1px solid rgba(142,153,164,0.04);
    border-radius: 50%;
    bottom: 8%;
    left: 6%;
    animation: galleryDecoRing 20s var(--ease-in-out) infinite alternate;
  }

  @keyframes galleryDecoRing {
    0% { transform: rotate(0deg) scale(1); opacity: 0.5; }
    100% { transform: rotate(20deg) scale(1.05); opacity: 0.3; }
  }

  .gallery__deco--dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent-dim);
    opacity: 0.15;
  }

  .gallery__deco--dot-1 { top: 30%; right: 12%; }
  .gallery__deco--dot-2 { bottom: 25%; left: 15%; }

  /* ─── Ambient floating orbs ─── */
  .gallery__ambient-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.03;
  }

  .gallery__ambient-orb--1 {
    width: 300px;
    height: 300px;
    top: 15%;
    right: 10%;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    animation: galleryOrbDrift1 18s var(--ease-in-out) infinite alternate;
  }

  .gallery__ambient-orb--2 {
    width: 200px;
    height: 200px;
    bottom: 20%;
    left: 8%;
    background: radial-gradient(circle, var(--accent-dim) 0%, transparent 70%);
    animation: galleryOrbDrift2 14s var(--ease-in-out) infinite alternate;
  }

  @keyframes galleryOrbDrift1 {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-20px, 30px); }
  }

  @keyframes galleryOrbDrift2 {
    0% { transform: translate(0, 0); }
    100% { transform: translate(25px, -15px); }
  }

  /* ═══════════════════════════════════════════════
     GALLERY IMMERSIVE UPGRADES
     Ken Burns · Cinematic Reveals · Dot Pulse · Shimmer
     Sliding Nav · Choreographed Detail · Snap Feedback
     ═══════════════════════════════════════════════ */

  /* ─── 1. Ken Burns Effect on Active Image ─── */
  @keyframes galleryKenBurns {
    0%   { transform: scale(1) translateX(0); }
    50%  { transform: scale(1.05) translateX(8px); }
    100% { transform: scale(1.08) translateX(-4px); }
  }

  .gallery__work-image img {
    transition: transform 0s !important; /* override hover parallax — JS handles blend */
  }

  .gallery__work.is-active .gallery__work-image img {
    animation: galleryKenBurns 20s var(--ease-in-out) infinite alternate;
  }

  .gallery__work:not(.is-active) .gallery__work-image img {
    animation: none;
    transform: scale(1) translateX(0);
    transition: transform 0.8s var(--ease-out-expo);
  }

  /* ─── 2. Cinematic Title Reveal via clip-path wipe ─── */
  .gallery__work-title,
  .gallery__work-category,
  .gallery__work-technique {
    clip-path: inset(100% 0 0 0);
    opacity: 0;
    transition: clip-path 0s, opacity 0s;
  }

  .gallery__work.is-active .gallery__work-title {
    animation: galleryClipWipe 0.8s var(--ease-out-expo) 0.05s forwards;
  }
  .gallery__work.is-active .gallery__work-category {
    animation: galleryClipWipe 0.7s var(--ease-out-expo) 0.25s forwards;
  }
  .gallery__work.is-active .gallery__work-technique {
    animation: galleryClipWipe 0.7s var(--ease-out-expo) 0.45s forwards;
  }

  @keyframes galleryClipWipe {
    0%   { clip-path: inset(100% 0 0 0); opacity: 0; }
    100% { clip-path: inset(0 0 0 0); opacity: 1; }
  }

  .gallery__work:not(.is-active) .gallery__work-title,
  .gallery__work:not(.is-active) .gallery__work-category,
  .gallery__work:not(.is-active) .gallery__work-technique {
    clip-path: inset(100% 0 0 0);
    opacity: 0;
    animation: none;
  }

  /* ─── 3. Annotation Dot Pulse on Active Panel ─── */
  @keyframes galleryDotPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.3); opacity: 0.7; }
  }

  .gallery__work.is-active .gallery__annotation-dot {
    animation: galleryDotPulse 2.5s var(--ease-in-out) infinite;
  }

  .gallery__work.is-active .gallery__annotation {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
  }

  .gallery__annotation {
    transition: opacity 0.4s var(--ease-out-expo),
                transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); /* spring-ish */
  }

  .gallery__annotation:hover .gallery__annotation-label {
    transform: scaleX(1);
    opacity: 1;
  }

  .gallery__annotation-label {
    transform: scaleX(0);
    opacity: 0;
    transform-origin: left center;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.3s ease;
  }

  .gallery__work.is-active .gallery__annotation .gallery__annotation-label {
    transform: scaleX(0);
    opacity: 0;
  }

  /* ─── 4. Progress Bar Shimmer ─── */
  .gallery__progress-bar {
    position: relative;
    overflow: hidden;
  }

  .gallery__progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -40%;
    width: 40%;
    height: 100%;
    background: linear-gradient(
      90deg,
      transparent 0%,
      rgba(250, 248, 245, 0.6) 50%,
      transparent 100%
    );
    animation: galleryShimmer 2.5s ease-in-out infinite;
  }

  @keyframes galleryShimmer {
    0%   { left: -40%; }
    100% { left: 140%; }
  }

  /* ─── 5. Sliding Nav Indicator ─── */
  .gallery__nav {
    position: relative;
  }

  .gallery__nav-indicator {
    position: absolute;
    bottom: 0;
    height: 2px;
    background: var(--accent);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform, width;
    pointer-events: none;
    border-radius: 1px;
    box-shadow: 0 0 8px rgba(142, 153, 164, 0.3);
  }

  /* Remove the old ::after underline from nav items */
  .gallery__nav-item::after {
    display: none !important;
  }

  /* ─── 8. Snap Feedback Pulse ─── */
  @keyframes gallerySnapPulse {
    0%   { transform: scale(1); opacity: 1; }
    50%  { transform: scale(1.35); opacity: 0.6; }
    100% { transform: scale(1); opacity: 1; }
  }

  .gallery__nav-item.snap-pulse {
    animation: gallerySnapPulse 0.4s var(--ease-out-expo);
  }

  /* ─── 7. Choreographed Detail View Transitions ─── */
  .gallery__detail-overlay {
    transition: opacity 0.4s var(--ease-out-expo);
  }

  .gallery__detail-overlay .gallery__detail-content {
    transition: none;
    transform: translateY(0) scale(1);
  }

  /* Staged entrance classes */
  .gallery__detail-overlay.active {
    opacity: 1;
    pointer-events: all;
  }

  .gallery__detail-image {
    transform: scale(0.85);
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s,
                opacity 0.4s ease 0.15s;
  }

  .gallery__detail-overlay.active .gallery__detail-image {
    transform: scale(1);
    opacity: 1;
  }

  .gallery__detail-info {
    transform: translateY(40px);
    opacity: 0;
    transition: transform 0.6s var(--ease-out-expo) 0.3s,
                opacity 0.5s ease 0.3s;
  }

  .gallery__detail-overlay.active .gallery__detail-info {
    transform: translateY(0);
    opacity: 1;
  }

  /* Staged exit — reverse order (info first, then image, then bg) */
  .gallery__detail-overlay.closing .gallery__detail-info {
    transform: translateY(30px);
    opacity: 0;
    transition: transform 0.3s var(--ease-out-expo),
                opacity 0.2s ease;
  }

  .gallery__detail-overlay.closing .gallery__detail-image {
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.35s var(--ease-out-expo) 0.1s,
                opacity 0.2s ease 0.1s;
  }

  .gallery__detail-overlay.closing {
    opacity: 0;
    transition: opacity 0.35s ease 0.2s;
    pointer-events: none;
  }

  /* ─── GALLERY Responsive ─── */
  @media (max-width: 1024px) {
    .gallery__showcase {
      padding: 1.5rem 1rem 2.5rem;
      gap: 2rem;
    }

    .gallery__work {
      flex: 0 0 88vw;
      grid-template-columns: 1.15fr 1fr;
      gap: clamp(1.5rem, 3vw, 2rem);
    }

    .gallery__work-image { aspect-ratio: 4/5; }

    .gallery__work-number {
      font-size: clamp(3rem, 6vw, 5rem);
    }

    .gallery__work-title {
      font-size: clamp(1.5rem, 2.5vw, 2rem);
    }
  }

  @media (max-width: 700px) {
    .gallery {
      padding: clamp(3rem, 8vw, 4rem) 0;
    }

    .gallery__showcase {
      padding: 1rem 0.5rem 2rem;
    }

    .gallery__work {
      flex: 0 0 92vw;
      grid-template-columns: 1fr;
      gap: 1.5rem;
      padding: 1rem;
    }

    .gallery__work-image { aspect-ratio: 3/4; }

    .gallery__work-info { padding: 0; }

    .gallery__work-number {
      font-size: 3rem;
      margin-bottom: -0.8rem;
    }

    .gallery__work-category {
      font-size: 0.5rem;
    }

    .gallery__work-title {
      font-size: 1.6rem;
    }

    .gallery__annotation {
      opacity: 0.7;
      transform: translateX(0);
    }

    .gallery__detail-content {
      grid-template-columns: 1fr;
      width: 95%;
      padding: 5rem 0 3rem;
    }

    .gallery__detail-image { aspect-ratio: 4/3; max-height: 40vh; }

    .gallery__detail-close {
      top: 1rem;
      right: 1rem;
      width: 44px;
      height: 44px;
    }

    .gallery__footer {
      flex-direction: column;
      align-items: center;
      text-align: center;
      gap: 1.5rem;
    }

    .gallery__note { text-align: center; }

    .gallery__scroll-hint { display: none; }

    .gallery__nav-item {
      padding: 0.6rem 0.8rem;
      font-size: 0.65rem;
    }
  }
