  :root {
    --bg: #fafaf8;
    --ink: #1a1a1a;
    --muted: #767670;
    --line: rgba(0,0,0,0.08);
    --bar-height: 64px;
  }
 
  * { box-sizing: border-box; }
 
  body {
    margin: 0;
    font-family: -apple-system, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    /* Push content down so the fixed bar doesn't cover it on load */
    padding-top: var(--bar-height);
  }
 
  /* ---- THE TOP BAR ---- */
  .topbar {
    position: fixed;      /* stays put relative to the viewport */
    top: 0;
    left: 0;
    width: 100%;
    height: var(--bar-height);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 840px;
    padding: 0 32px;
    background: rgba(250, 250, 248, 0.85);
    backdrop-filter: blur(8px);          /* frosted-glass look as content scrolls under it */
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    z-index: 1000;        /* sits above everything else */
  }
 
  .logo {
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
    color: var(--ink);
    font-size: 15px;
  }
 
  .tabs {
    display: flex;
    gap: 28px;
    list-style: none;
    margin: 0;
    padding: 0;
  }
 
  .tabs a {
    text-decoration: none;
    color: var(--ink);
    font-size: 14px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    position: relative;
    padding-bottom: 4px;
  }
 
  .tabs a::after {
    content: "";
    position: absolute;
    left: 0; bottom: 0;
    width: 0%;
    height: 1px;
    background: var(--ink);
    transition: width 0.25s ease;
  }
 
  .tabs a:hover::after { width: 100%; }
 
  .socials {
    display: flex;
    gap: 18px;
  }
 
  .socials a {
    color: var(--muted);
    display: flex;
    align-items: center;
    transition: color 0.2s ease;
  }
 
  .socials a:hover { color: var(--ink); }
 
  .socials svg { width: 18px; height: 18px; }
 
  /* ---- DEMO PAGE CONTENT (just to prove scrolling works) ---- */
  .section {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--line);
    padding: 40px;
    text-align: center;
  }
 
  .section h1 { font-size: 32px; font-weight: 500; max-width: 600px; }
  .section p { color: var(--muted); }

  /* ---- WORK GRID ---- */
  .work-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    width: 100%;
    max-width: 720px;
  }

  .work-tile {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 4px;
    text-decoration: none;
    background: #ddd;        /* shows through until real images are added */
    cursor: pointer;         /* finger cursor since it's a div, not an <a> */
  }

  .work-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
  }

  .work-tile:hover img {
    transform: scale(1.06);  /* subtle zoom on hover */
  }

  .work-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: rgba(20, 20, 20, 0.55);
    backdrop-filter: blur(6px);    /* the "gloss" — same frosted treatment as the rest of the site */
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .work-tile:hover .work-overlay {
    opacity: 1;
  }

  .work-overlay h3 {
    color: #fff;
    font-size: 18px;
    font-weight: 500;
    margin: 0 0 4px;
    letter-spacing: 0.02em;
  }

  .work-overlay p {
    color: rgba(255,255,255,0.75);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
  }

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




/* ---- SECTION HEADERS ---- */
  .section-header {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 28px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    width: 100%;
    max-width: 900px;
  }

/* ---- HORIZONTAL PROJECT BANNERS ---- */
  .banner-section, .work-section {
    flex-direction: column;
    align-items: center;
    padding: 60px 48px;
    min-height: auto;
  }

  .banner-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
  }

  .banner-tile {
    position: relative;
    display: block;
    width: 100%;
    height: 180px;
    overflow: hidden;
    border-radius: 4px;
    text-decoration: none;
    background: #2a2a2a;   /* fallback until real images are in place */
  }

  .banner-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
  }

  .banner-tile:hover img {
    transform: scale(1.04);
  }

  /* overlay slides in from the left on hover */
  .banner-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 36px;
    background: rgba(15, 15, 15, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transform: translateX(-100%);   /* starts fully off-screen to the left */
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }

  .banner-tile:hover .banner-overlay {
    transform: translateX(0);       /* slides into view on hover */
  }

  .banner-label {
    position: absolute;
    top: 14px;
    right: 16px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 1;
    transition: opacity 0.3s ease;
    pointer-events: none;           /* so it doesn't interfere with the tile click */
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);  /* keeps it legible over any image */
  }

  .banner-tile:hover .banner-label {
    opacity: 0;
  }

  .banner-overlay h3 {
    color: #fff;
    font-size: 22px;
    font-weight: 500;
    margin: 0 0 8px;
    letter-spacing: 0.02em;
  }

  .banner-overlay p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    margin: 0;
    max-width: 520px;
    line-height: 1.5;
  }





/* ---- UNDER CONSTRUCTION BANNER ---- */
  .construction {
    flex-direction: column;
    gap: 24px;
    padding: 0;
    min-height: auto;
    padding: 60px 0;
  }
 
  .caution-strip {
    width: 75%;
    display: block;
    object-fit: cover;
    height: 120px;
  }
 
  .construction-text h1 { font-size: 26px; margin-bottom: 8px; }
  .construction-text p { margin: 0; }


 /* ---- STICKY HERO ----
     .hero-pin is the tall "track" that gives the hero room to stay pinned.
     .hero itself is sticky and stays in the viewport while you scroll
     through .hero-pin's extra height. .content-wrap is pulled up with a
     negative margin so it visually slides up and over the pinned hero,
     covering it — same frosted-glass treatment as the top bar. */
  .hero-pin {
    position: relative;
    height: 190vh;   /* total scroll distance before the hero lets go */
  }
 
  .hero {
    position: sticky;
    top: 0;
    height: calc(100vh - var(--bar-height));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 1;
    background: linear-gradient(160deg, #2b2b2b, #161616);
    color: #f5f5f0;
  }
 
  .hero h1 {
    font-size: 44px;
    font-weight: 500;
    margin: 0 0 12px;
  }
 
  .hero p {
    font-size: 15px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(245, 245, 240, 0.6);
  }


  .hero-dino {
    width: 170px;
    margin-bottom: 28px;
    filter: drop-shadow(0 10px 14px rgba(0,0,0,0.35));
  }
 
  .hero-dino svg {
    width: 100%;
    height: auto;
    display: block;
  }


/* ---- SCROLL HINT ARROW ---- */
  .scroll-hint {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: rgba(245, 245, 240, 0.55);
  }

  .scroll-hint small {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .scroll-hint svg {
    width: 18px;
    height: 18px;
    animation: scrollBounce 1.6s ease-in-out infinite;
  }

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


 
  .content-wrap {
    position: relative;
    z-index: 2;
    margin-top: calc(-1 * (100vh - var(--bar-height)));  /* pulls this up over the hero */
    background: rgba(250, 250, 248, 0.82);
    backdrop-filter: blur(20px);          /* the "glossy" pane sliding over the hero */
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -20px 40px rgba(0,0,0,0.08);
  }



  /* ---- BACK TO TOP BUTTON ---- */
  .back-to-top {
    position: fixed;
    right: 28px;
    bottom: 28px;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(250, 250, 248, 0.85);
    backdrop-filter: blur(8px);          /* same frosted-glass treatment as the top bar */
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--line);
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
    cursor: pointer;
    z-index: 900;        /* above page content, below the topbar */
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  }
 
  .back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
 
  .back-to-top:hover {
    background: rgba(250, 250, 248, 1);
  }
 
  .back-to-top svg {
    width: 18px;
    height: 18px;
    color: var(--ink);
  }

  /* ---- PROJECT MODAL ---- */
  .modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    transition: background 0.35s ease,
                backdrop-filter 0.35s ease,
                -webkit-backdrop-filter 0.35s ease;
  }

  .modal-backdrop.open {
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .modal-card {
    position: relative;
    width: 92vw;
    max-width: 1200px;
    max-height: 92vh;
    overflow-y: auto;
    background: rgba(28, 28, 28, 0.45);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 24px 64px rgba(0,0,0,0.4);
    color: #f0f0ee;
    transform: scale(0.08);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity   0.35s ease;
  }

  .modal-backdrop.open .modal-card {
    transform: scale(1);
    opacity: 1;
  }

  .modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.08);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #f0f0ee;
    transition: background 0.2s ease;
    z-index: 10;
  }

  .modal-close:hover { background: rgba(255,255,255,0.16); }
  .modal-close svg { width: 16px; height: 16px; }

  .modal-body {
    display: flex;
    gap: 36px;
    padding: 48px;
  }

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

  .modal-category {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(240,240,238,0.5);
    margin: 0 0 10px;
  }

  .modal-text h2 {
    font-size: 28px;
    font-weight: 500;
    margin: 0 0 16px;
    color: #fff;
  }

  .modal-text p {
    font-size: 15px;
    line-height: 1.7;
    color: rgba(240,240,238,0.75);
    margin: 0;
  }

  .modal-images {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
  }

  .modal-images img {
    width: 100%;
    border-radius: 4px;
    object-fit: cover;
    aspect-ratio: 4 / 3;
    background: #333;    /* placeholder colour until real images exist */
    display: block;
  }

  @media (max-width: 640px) {
    .modal-body { flex-direction: column; padding: 32px 24px; }
  }


/* ================================================================
   TECH PAGES (baja.html, moog.html, capstone.html)
   ================================================================ */

  body.tech-body {
    background: #111;      /* dark fallback — matches the image overlay tone,
                              never shows white even if image doesn't reach */
    padding-top: 0;
  }

  /* Fixed bg extended to 400vh so the parallax translateY never exposes
     the bottom edge within a reasonably long page (gallery + all sections) */
  .tech-parallax-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 400vh;
    z-index: 0;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    will-change: transform;
  }

  .tech-parallax-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.48);
  }

  .tech-page-header {
    position: relative;
    z-index: 1;
    padding: calc(var(--bar-height) + 80px) 0 56px;
    text-align: center;
    color: #fff;
  }

  .tech-page-header h1 {
    font-size: 56px;
    font-weight: 700;        /* bolded */
    margin: 0 0 12px;
    letter-spacing: 0.02em;
  }

  .tech-page-header p {
    font-size: 14px;
    font-weight: 600;        /* bolded */
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
    margin: 0;
  }

  .tech-page {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 36px;
    padding: 0 16px 60vh;   /* 60vh bottom padding gives the last section
                                room to scroll to the viewport centre     */
  }

  /* Inactive: noticeably smaller so the active one really pops */
  .tech-section {
    width: 96vw;             /* much wider — nearly full viewport width */
    max-width: none;
    background: rgba(245, 245, 243, 0.62);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transform: scale(0.88);  /* more dramatic shrink when inactive */
    opacity: 0.72;
    transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity   0.55s ease,
                box-shadow 0.55s ease;
  }

  .tech-section.active {
    transform: scale(1);
    opacity: 1;
    box-shadow: 0 28px 64px rgba(0, 0, 0, 0.28);
  }

  .tech-inner {
    display: flex;
    gap: 56px;
    padding: 60px;
    align-items: center;
  }

  .tech-section:nth-child(even) .tech-inner {
    flex-direction: row-reverse;
  }

  .tech-image {
    flex: 1;
    min-width: 0;
  }

  .tech-image img {
    width: 100%;
    border-radius: 6px;
    display: block;
    object-fit: cover;
    aspect-ratio: 4 / 3;
    background: rgba(0, 0, 0, 0.12);
  }

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

  .tech-text h2 {
    font-size: 26px;
    font-weight: 600;
    margin: 0 0 16px;
    color: #111;             /* near-black for strong contrast */
  }

  .tech-text p {
    font-size: 15px;
    line-height: 1.8;
    color: #3a3a3a;          /* darker than --muted for legibility over blurred bg */
    margin: 0;
  }

  .tech-text a {
    color: #111;
    text-underline-offset: 3px;
    transition: opacity 0.2s ease;
  }

  .tech-text a:hover { opacity: 0.6; }

  @media (max-width: 720px) {
    .tech-inner {
      flex-direction: column !important;
      padding: 32px 24px;
      gap: 28px;
    }
    .tech-section {
      transform: scale(1) !important;
      opacity: 1 !important;
    }
    .tech-page { padding: 0 12px 60vh; gap: 20px; }
    .tech-page-header h1 { font-size: 36px; }
  }




/* ================================================================
   MOOG PAGE — bubble layout
   ================================================================ */

  /* Blur the background image slightly for depth */
  body.moog-body .tech-parallax-bg {
    height: 100vh;              /* override 200vh — no parallax on this page */
    background-size: contain;   /* show the full image without cropping */
    background-position: center center;
    background-color: #111;     /* dark fill for letterbox areas around the image */
    filter: blur(5px);
    transform: scale(1.04);     /* hides blurry edges produced by blur() */
  }

  body.moog-body .tech-parallax-bg::after {
    background: rgba(0, 0, 0, 0.28);
  }

  /* 700vh = 100vh pinned + 6 steps × 100vh */
  .moog-scroll-track {
    height: 700vh;
    position: relative;
  }

  .moog-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
  }

  .moog-web {
    position: absolute;
    inset: 0;
  }

  .moog-svg-lines { display: none; }

  /* ---- Bubbles ----
     --disp-x / --disp-y set by JS for push/pull crowding effect.
     cubic-bezier(0.34, 1.56, 0.64, 1) is a spring curve that
     naturally overshoots — no separate keyframe jiggle needed.   */
  .moog-bubble {
    position: absolute;
    border-radius: 50%;
    background: rgba(10, 10, 10, 0.72);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    --disp-x: 0px;
    --disp-y: 0px;
    transform: translate(calc(-50% + var(--disp-x)), calc(-50% + var(--disp-y))) scale(0.66);
    opacity: 0.58;
    transition: transform  0.78s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity    0.5s  ease,
                box-shadow 0.5s  ease;
    z-index: 2;
    overflow: hidden;
    cursor: default;
  }

  @keyframes bubblePulse {
    0%, 100% { box-shadow: 0 0 0  0px rgba(255,255,255,0.10); }
    50%       { box-shadow: 0 0 0  8px rgba(255,255,255,0.04); }
  }
  .moog-bubble:not(.active) {
    animation: bubblePulse 3s ease-in-out infinite;
    animation-delay: var(--pulse-delay, 0s);
  }

  /* Active — big zoom, full opacity, raised z so it sits above siblings */
  .moog-bubble.active {
    transform: translate(calc(-50% + var(--disp-x)), calc(-50% + var(--disp-y))) scale(1.82);
    opacity: 1;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.32);
    animation: none;
    z-index: 4;
  }

  /* Gentle ripple rings — small expansion, low opacity, slow period */
  .moog-bubble.active::before,
  .moog-bubble.active::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.20);
    animation: rippleRing 2.8s ease-out infinite;
    pointer-events: none;
  }
  .moog-bubble.active::after {
    animation-delay: 1.4s;
    border-color: rgba(255, 255, 255, 0.10);
  }
  @keyframes rippleRing {
    0%   { transform: scale(1.00); opacity: 0.7; }
    100% { transform: scale(1.18); opacity: 0;   }
  }

  /* ---- Sizes and positions (pentagon, 1 centre + 5 outer) ----
     Outer bubble positions calculated from a pentagon with:
       rx = 27vw, ry = 23vh, centred at (50%, 55%)
     Clockwise from top: top, upper-right, lower-right, lower-left, upper-left */
  .bubble-center { width: 480px; height: 480px; left: 50%; top: 55%; }
  .bubble-top    { width: 330px; height: 330px; left: 50%; top: 32%; }
  .bubble-tr     { width: 330px; height: 330px; left: 77%; top: 48%; }
  .bubble-br     { width: 330px; height: 330px; left: 67%; top: 74%; }
  .bubble-bl     { width: 330px; height: 330px; left: 33%; top: 74%; }
  .bubble-tl     { width: 330px; height: 330px; left: 23%; top: 48%; }

  .bubble-tag {
    font-size: 10px;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.48);
    margin: 0 0 7px;
  }
  .moog-bubble h3 {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 7px;
    line-height: 1.3;
  }
  .moog-bubble p {
    font-size: 11.5px;
    line-height: 1.6;
    color: rgba(230, 228, 224, 0.85);
    margin: 0;
  }

  /* Progress dots */
  .moog-progress {
    position: absolute;
    right: 26px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .moog-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.55);
    transition: background 0.35s ease, transform 0.35s ease;
  }
  .moog-dot.active { background: rgba(255, 255, 255, 0.92); transform: scale(1.4); }

  /* Scroll cue */
  .moog-scroll-cue {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    color: rgba(255, 255, 255, 0.6);
    font-size: 10.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: opacity 0.4s ease;
    pointer-events: none;
  }
  .moog-scroll-cue svg { width: 16px; height: 16px; animation: scrollBounce 1.6s ease-in-out infinite; }
  .moog-scroll-cue.hidden { opacity: 0; }
  /* ── SUB-BUBBLES (moons orbiting the active main bubble) ──────────────
     These are positioned absolutely within .moog-web (siblings of main
     bubbles, not children) so the circular overflow:hidden on main bubbles
     never clips them.  JS sets left/top every animation frame.           */

  .sub-group {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 6;
  }

  .sub-bubble {
    position: absolute;
    width: 262px;
    height: 262px;
    border-radius: 50%;
    /* Image shown via CSS variable set inline on each element */
    background-image: var(--sub-img, none);
    background-size: cover;
    background-position: center;
    background-color: rgba(18, 18, 18, 0.80);   /* visible while image loads */
    border: 2px solid rgba(255, 255, 255, 0.38);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.50);
    /* translate(-50%,-50%) keeps the JS-set left/top as the bubble centre */
    transform: translate(-50%, -50%) scale(0.3);
    opacity: 0;
    transition: opacity  0.4s ease,
                transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
  }

  /* JS adds .visible when the parent bubble becomes active */
  .sub-bubble.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

/* ================================================================
   BAJA — TREASURE MAP GALLERY (overlay on parallax background)
   No background on the section itself — images have a photo-frame
   border and each caption carries its own dark-glass backdrop.
   ================================================================ */

  .gallery-section {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 48px 48px 120px;
    background: transparent;   /* sits directly on the parallax image */
  }

  .gallery-section-label {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.70);
    margin: 0 0 48px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
    text-align: center;
  }

  .gallery-track {
    position: relative;
  }

  /* SVG winding path replaces the old straight CSS ::before line */
  .gallery-track::before { display: none; }

  .gallery-path-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: visible;
  }

  .gallery-svg-path {
    fill: none;
    stroke: rgba(255, 255, 255, 0.42);
    stroke-width: 2.5;
    stroke-dasharray: 9 6;
    stroke-linecap: round;
  }

  .gallery-item {
    display: flex;
    align-items: center;
    gap: 36px;            /* clear air around the pin: path visible on both sides */
    margin-bottom: 80px;
    position: relative;
    opacity: 0;
    transition: opacity 0.7s ease, transform 0.7s ease;
  }

  .gallery-item:nth-child(odd)  { flex-direction: row;         transform: translateX(-55px); }
  .gallery-item:nth-child(even) { flex-direction: row-reverse; transform: translateX(55px);  }

  .gallery-item.visible {
    opacity: 1;
    transform: translateX(0);
  }

  /* Waypoint marker — sits on the dashed winding path, absolutely
     positioned at the x where the path passes through each item.
     Image fills the space to one side; caption fills the other.    */
  .gallery-pin {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    border: 2px solid #fff;
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.18),
                0 2px 10px rgba(0, 0, 0, 0.40);
    z-index: 2;
  }

  /* Pin sits at 40% on odd rows, 60% on even rows — matching path waypoints */
  .gallery-item:nth-child(odd)  .gallery-pin { left: 40%; }
  .gallery-item:nth-child(even) .gallery-pin { left: 60%; }

  /* ── Image: 40% minus half the gap so its edge ends just before the pin ── */
  .gallery-img-wrap {
    flex: 0 0 calc(40% - 18px);
    max-width: calc(40% - 18px);
    padding: 0 8px;        /* small symmetric inset, no pin-spacing needed */
  }

  /* Even rows are row-reverse — no extra rule needed; gap works symmetrically */

  .gallery-img-wrap img {
    width: 100%;
    display: block;
    border-radius: 3px;
    object-fit: cover;
    aspect-ratio: 4 / 3;
    background: rgba(255,255,255,0.08);
    border: 6px solid rgba(255, 255, 255, 0.90);
    box-shadow: 4px 8px 32px rgba(0, 0, 0, 0.55),
                inset 0 0 0 1px rgba(0, 0, 0, 0.08);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
  }

  /* Slight alternating tilt */
  .gallery-item:nth-child(odd)  .gallery-img-wrap img { transform: rotate(-1.8deg); }
  .gallery-item:nth-child(even) .gallery-img-wrap img { transform: rotate( 1.8deg); }
  .gallery-item:nth-child(odd)  .gallery-img-wrap img:hover,
  .gallery-item:nth-child(even) .gallery-img-wrap img:hover {
    transform: rotate(0deg) scale(1.02);
    box-shadow: 6px 14px 40px rgba(0, 0, 0, 0.65);
  }

  /* ── Caption: fills remaining space; gap already provides pin-side clearance ── */
  .gallery-caption {
    flex: 1;
    padding: 24px 28px;
    background: rgba(10, 10, 10, 0.65);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  }

  .gallery-caption h4 {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 12px;
    line-height: 1.3;
  }

  .gallery-caption p {
    font-size: 14px;
    line-height: 1.78;
    color: rgba(225, 222, 218, 0.85);
    margin: 0;
  }

  @media (max-width: 700px) {
    .gallery-item,
    .gallery-item:nth-child(odd),
    .gallery-item:nth-child(even) {
      flex-direction: column;
      transform: translateY(30px);
    }
    .gallery-item.visible { transform: translateY(0); }
    .gallery-track::before { display: none; }
    .gallery-path-svg { display: none; }
    .gallery-img-wrap { padding: 0 0 16px; }
    .gallery-caption { margin: 0; }
    .gallery-section { padding: 32px 20px 80px; }
  }
