/* hold-morph.css v8 — image-only, header stays, curtain (ratio-correct, hero tint matched) */
.links-tile[data-morph="ready"] {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-drag: none;
}
.links-tile.is-holding {
  transform: scale(0.98) !important;
  box-shadow: 0 10px 28px rgba(15,95,111,.22) !important;
}
.links-tile.is-holding .links-tile__img { transform: scale(1.03); }

.morph-ring {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  transition: opacity .14s ease;
}
.links-tile.is-holding .morph-ring { opacity: 1; }
.morph-ring__svg { width: 60px; height: 60px; transform: rotate(-90deg); filter: drop-shadow(0 3px 10px rgba(0,0,0,.40)); }
.morph-ring__bg { fill: none; stroke: rgba(255,255,255,.28); stroke-width: 3.2; }
.morph-ring__fg { fill: none; stroke: var(--orange,#f97316); stroke-width: 3.4; stroke-linecap: round; stroke-dasharray: 100.53; stroke-dashoffset: 100.53; }
.morph-ring__label { position: absolute; font-size: 10px; font-weight: 800; letter-spacing: .06em; color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.55); }
.morph-hint {
  position: absolute; left: 50%; bottom: 50px; transform: translateX(-50%);
  font-size: 11px; font-weight: 700; color: #fff;
  background: rgba(9,28,35,.62); border: 1px solid rgba(255,255,255,.18);
  padding: 4px 10px; border-radius: 999px; white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .14s ease;
}
.links-tile.is-holding .morph-hint { opacity: 1; }
@media (max-width: 480px){ .morph-hint{ display:none; } }

/* header stays on top: header z-index is 200, so keep morph below it */
.morph-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
  opacity: 0;
  /* Not solid #0b1e24 — that was the "black snap" you felt. Keep it light, hero-matched. */
  background: rgba(9,28,35,0.16);
  transition: opacity .32s ease;
}
.morph-overlay.is-active { opacity: 1; }
.morph-overlay.is-hero-tint {
  /* Match hero/tile scrim so page dim behind clone doesn't read as flash */
  background:
    linear-gradient(to top, rgba(9,28,35,.72) 0%, rgba(9,28,35,.32) 42%, rgba(9,28,35,.10) 72%, transparent 100%),
    rgba(9,28,35,0.08);
  opacity: 1;
}

.morph-clone {
  position: fixed;
  z-index: 151;
  overflow: hidden;
  border-radius: 16px;
  background: #0c2b33;
  box-shadow: 0 16px 44px rgba(0,0,0,.32);
  will-change: left, top, width, height;
  pointer-events: none;
  max-width: 100vw;
  max-height: 100vh;
}
.morph-clone__img { width: 100%; height: 100%; object-fit: cover; object-position: center center; display: block; }
/* Exact copy of .hero__overlay — tint is ON the image itself, not behind it.
   Starts at tile's lighter scrim and fades to hero's stronger overlay as it scales,
   so you literally see the tint strengthen during the morph. */
.morph-clone__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to top,
    rgba(9,28,35,.88) 0%,
    rgba(9,28,35,.5) 38%,
    rgba(9,28,35,.16) 70%,
    rgba(9,28,35,.05) 100%
  );
  pointer-events: none;
  opacity: 0.72;
  will-change: opacity;
}

/* Reserve scrollbar gutter globally so hiding the scrollbar during morph doesn't
   shift layout (the ~15px jump you reported on desktop). Supported in all
   modern Chromium/Firefox; JS fallback below compensates older browsers. */
html { scrollbar-gutter: stable; }
body.morph-lock { overflow: hidden !important; overscroll-behavior: none; scrollbar-gutter: stable; }

/* Destination curtain — measured from real .hero, not estimate; bg matches hero gradient
   so before the image paints you see teal rather than black. */
.morph-curtain {
  position: fixed;
  z-index: 190;
  overflow: hidden;
  background: linear-gradient(135deg, #094956 0%, #0f5f6f 45%, #0e7490 100%);
  pointer-events: none;
  max-width: 100vw;
}
.morph-curtain__img { width: 100%; height: 100%; object-fit: cover; object-position: center center; display: block; }
.morph-curtain__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(
    to top,
    rgba(9,28,35,.88) 0%,
    rgba(9,28,35,.5) 38%,
    rgba(9,28,35,.16) 70%,
    rgba(9,28,35,.05) 100%
  );
}
.morph-curtain.is-fading { opacity: 0; transition: opacity .58s ease; }

@media (prefers-reduced-motion: reduce) {
  .morph-ring__fg, .morph-clone { transition: none !important; }
  .morph-overlay { transition: opacity .06s linear; }
  .morph-curtain.is-fading { transition: opacity .2s linear; }
}
