/**
 * KB Portfolio — Content Animation Library
 *
 * Modular animation classes for portfolio content presentation.
 * All animations respect prefers-reduced-motion and use existing
 * brand tokens (--ease-*, --duration-*, --reveal-*).
 *
 * Categories:
 *   1. Scroll-Driven Reveals (extended)
 *   2. Staggered Grid Reveals
 *   3. Parallax Depth Layers
 *   4. Curtain / Split Reveals
 *   5. Typewriter Text
 *   6. 3D Perspective Tilt (CSS base)
 *   7. Horizontal Scroll Container
 *   8. Card Stack / Deck
 *   9. View Transitions API (MPA)
 *  10. Flipbook (StPageFlip) container
 */

/* ═══════════════════════════════════════════════
   0. REDUCED MOTION — disable all animation
   ═══════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .anim-reveal,
  .anim-stagger > *,
  .anim-parallax,
  .curtain-reveal,
  .curtain-reveal::before,
  .curtain-reveal::after,
  .blinds-reveal > *,
  .typewriter,
  .tilt-card,
  .hscroll__track,
  .deck__card {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .curtain-reveal::before,
  .curtain-reveal::after {
    display: none !important;
  }

  .typewriter .typewriter__cursor {
    display: none;
  }
}

/* ── Low-performance: keep simple transitions but skip expensive effects ── */
[data-perf="low"] .tilt-card {
  transform: none !important; /* skip 3D perspective transforms */
  transition: none !important;
}
[data-perf="low"] .tilt-card__glare { display: none; }
[data-perf="low"] .tilt-card__inner { transform: none !important; }
[data-perf="low"] .curtain-reveal::before,
[data-perf="low"] .curtain-reveal::after {
  transition-duration: 300ms !important;
}
[data-perf="low"] .anim-reveal {
  opacity: 1 !important; /* show content immediately, no scroll animation */
  transform: none !important;
  animation: none !important;
}
[data-perf="low"] .anim-stagger > * {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}
[data-perf="low"] .deck__card {
  transition-duration: 300ms !important;
}
[data-perf="low"] .hscroll__track {
  will-change: auto;
}


/* ═══════════════════════════════════════════════
   1. SCROLL-DRIVEN REVEALS (extended)
   Uses animation-timeline: view() — Chrome 115+,
   Edge 115+, Firefox 124+, Safari 18+.
   Falls back to static visible state on older browsers.
   ═══════════════════════════════════════════════ */

/* --- Base reveal (fade + slide up) --- */
.anim-reveal {
  opacity: 1; /* fallback: visible by default */
}

@supports (animation-timeline: view()) {
  .anim-reveal {
    animation: aRevealUp linear both;
    animation-timeline: view();
    animation-range: entry 10% entry 50%;
  }

  /* Slide from left */
  .anim-reveal--left {
    animation-name: aRevealLeft;
  }

  /* Slide from right */
  .anim-reveal--right {
    animation-name: aRevealRight;
  }

  /* Scale up from small */
  .anim-reveal--scale {
    animation-name: aRevealScale;
  }

  /* Clip reveal (wipe from left) */
  .anim-reveal--clip {
    animation-name: aRevealClip;
  }

  /* Slower range for hero-level reveals */
  .anim-reveal--slow {
    animation-range: entry 0% entry 70%;
  }

  @keyframes aRevealUp {
    from { opacity: 0; transform: translateY(var(--reveal-distance, 24px)); }
    to   { opacity: 1; transform: translateY(0); }
  }

  @keyframes aRevealLeft {
    from { opacity: 0; transform: translateX(calc(-1 * var(--reveal-distance, 24px))); }
    to   { opacity: 1; transform: translateX(0); }
  }

  @keyframes aRevealRight {
    from { opacity: 0; transform: translateX(var(--reveal-distance, 24px)); }
    to   { opacity: 1; transform: translateX(0); }
  }

  @keyframes aRevealScale {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
  }

  @keyframes aRevealClip {
    from { clip-path: inset(0 100% 0 0); }
    to   { clip-path: inset(0 0 0 0); }
  }
}


/* ═══════════════════════════════════════════════
   2. STAGGERED GRID REVEALS
   Children fade in sequentially as parent enters
   viewport. Apply .anim-stagger to the grid parent.
   ═══════════════════════════════════════════════ */

.anim-stagger > * {
  opacity: 1; /* fallback */
}

@supports (animation-timeline: view()) {
  .anim-stagger > * {
    animation: aRevealUp linear both;
    animation-timeline: view();
    animation-range: entry 5% entry 45%;
  }

  /* Stagger delay via nth-child */
  .anim-stagger > *:nth-child(1)  { animation-delay: 0ms; }
  .anim-stagger > *:nth-child(2)  { animation-delay: var(--reveal-stagger, 80ms); }
  .anim-stagger > *:nth-child(3)  { animation-delay: calc(2 * var(--reveal-stagger, 80ms)); }
  .anim-stagger > *:nth-child(4)  { animation-delay: calc(3 * var(--reveal-stagger, 80ms)); }
  .anim-stagger > *:nth-child(5)  { animation-delay: calc(4 * var(--reveal-stagger, 80ms)); }
  .anim-stagger > *:nth-child(6)  { animation-delay: calc(5 * var(--reveal-stagger, 80ms)); }
  .anim-stagger > *:nth-child(7)  { animation-delay: calc(6 * var(--reveal-stagger, 80ms)); }
  .anim-stagger > *:nth-child(8)  { animation-delay: calc(7 * var(--reveal-stagger, 80ms)); }
  .anim-stagger > *:nth-child(9)  { animation-delay: calc(8 * var(--reveal-stagger, 80ms)); }
  .anim-stagger > *:nth-child(n+10) { animation-delay: calc(9 * var(--reveal-stagger, 80ms)); }
}


/* ═══════════════════════════════════════════════
   3. PARALLAX DEPTH LAYERS
   Different scroll speeds for foreground/background.
   Apply to elements within a scroll context.
   ═══════════════════════════════════════════════ */

@supports (animation-timeline: view()) {
  .anim-parallax--slow {
    animation: aParallaxSlow linear both;
    animation-timeline: view();
    animation-range: contain 0% contain 100%;
  }

  .anim-parallax--fast {
    animation: aParallaxFast linear both;
    animation-timeline: view();
    animation-range: contain 0% contain 100%;
  }

  @keyframes aParallaxSlow {
    from { transform: translateY(30px); }
    to   { transform: translateY(-30px); }
  }

  @keyframes aParallaxFast {
    from { transform: translateY(60px); }
    to   { transform: translateY(-60px); }
  }
}


/* ═══════════════════════════════════════════════
   4. CURTAIN / SPLIT REVEALS
   Two pseudo-element panels slide apart to reveal
   content underneath. Trigger with .is-revealed class
   (added via IntersectionObserver or scroll).
   ═══════════════════════════════════════════════ */

/* --- Horizontal curtain (panels slide left/right) --- */
.curtain-reveal {
  position: relative;
  overflow: hidden;
}

.curtain-reveal::before,
.curtain-reveal::after {
  content: '';
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  z-index: 2;
  background: var(--curtain-color, var(--color-bg));
  transition: transform var(--duration-reveal, 1200ms) var(--ease-out);
}

.curtain-reveal::before {
  left: 0;
  transform: translateX(0);
}

.curtain-reveal::after {
  right: 0;
  transform: translateX(0);
}

.curtain-reveal.is-revealed::before {
  transform: translateX(-101%);
}

.curtain-reveal.is-revealed::after {
  transform: translateX(101%);
}

/* --- Vertical curtain (panels slide up/down) --- */
.curtain-reveal--vertical::before,
.curtain-reveal--vertical::after {
  width: 100%;
  height: 50%;
}

.curtain-reveal--vertical::before {
  top: 0;
  left: 0;
  transform: translateY(0);
}

.curtain-reveal--vertical::after {
  bottom: 0;
  top: auto;
  right: auto;
  left: 0;
  transform: translateY(0);
}

.curtain-reveal--vertical.is-revealed::before {
  transform: translateY(-101%);
}

.curtain-reveal--vertical.is-revealed::after {
  transform: translateY(101%);
}

/* --- Venetian blinds (multi-strip reveal) --- */
.blinds-reveal {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(var(--blinds-count, 5), 1fr);
}

.blinds-reveal > .blind {
  background: var(--curtain-color, var(--color-bg));
  height: 100%;
  transform: scaleY(1);
  transform-origin: top;
  transition: transform var(--duration-reveal, 1200ms) var(--ease-out);
  position: absolute;
  top: 0;
  z-index: 2;
}

.blinds-reveal.is-revealed > .blind {
  transform: scaleY(0);
}

/* Stagger each blind strip */
.blinds-reveal > .blind:nth-child(1) { transition-delay: 0ms; }
.blinds-reveal > .blind:nth-child(2) { transition-delay: 80ms; }
.blinds-reveal > .blind:nth-child(3) { transition-delay: 160ms; }
.blinds-reveal > .blind:nth-child(4) { transition-delay: 240ms; }
.blinds-reveal > .blind:nth-child(5) { transition-delay: 320ms; }

/* --- Accent-colored curtain variant --- */
.curtain-reveal--accent::before,
.curtain-reveal--accent::after {
  background: var(--color-accent);
}


/* ═══════════════════════════════════════════════
   5. TYPEWRITER TEXT
   CSS-driven typing animation with blinking cursor.
   Set --tw-chars to the character count of the text.
   ═══════════════════════════════════════════════ */

.typewriter {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--color-accent);
  width: 0;
  animation:
    twType var(--tw-duration, 2s) steps(var(--tw-chars, 20)) 0.5s forwards,
    twBlink 600ms step-end infinite;
}

/* Freeze cursor after typing completes */
.typewriter--freeze {
  animation:
    twType var(--tw-duration, 2s) steps(var(--tw-chars, 20)) 0.5s forwards,
    twBlink 600ms step-end 6;
}

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

@keyframes twBlink {
  50% { border-color: transparent; }
}


/* ═══════════════════════════════════════════════
   6. 3D PERSPECTIVE TILT (CSS base)
   JS adds --tilt-x / --tilt-y custom props on hover.
   CSS applies the transform.
   ═══════════════════════════════════════════════ */

.tilt-card {
  transform-style: preserve-3d;
  perspective: 800px;
  transition: transform var(--duration-med, 400ms) var(--ease-spring);
}

.tilt-card:hover,
.tilt-card.is-tilting {
  transform:
    rotateX(var(--tilt-x, 0deg))
    rotateY(var(--tilt-y, 0deg))
    scale3d(1.02, 1.02, 1.02);
}

/* Inner layer for parallax depth effect */
.tilt-card__inner {
  transition: transform var(--duration-med) var(--ease-spring);
}

.tilt-card:hover .tilt-card__inner {
  transform: translateZ(20px);
}

/* Glare overlay */
.tilt-card__glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    circle at var(--glare-x, 50%) var(--glare-y, 50%),
    rgba(255, 255, 255, 0.12) 0%,
    transparent 60%
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--duration-fast) ease;
}

.tilt-card:hover .tilt-card__glare {
  opacity: 1;
}


/* ═══════════════════════════════════════════════
   7. HORIZONTAL SCROLL CONTAINER
   Vertical scroll → horizontal translateX.
   Height of .hscroll controls scroll "length."
   ═══════════════════════════════════════════════ */

.hscroll {
  position: relative;
  height: var(--hscroll-height, 300vh);
}

.hscroll__sticky {
  position: sticky;
  top: 0;
  height: 100vh; height: 100dvh;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.hscroll__track {
  display: flex;
  gap: var(--space-lg, 2rem);
  padding: 0 var(--space-page, 5vw);
  will-change: transform;
  /* JS sets --hscroll-x via scroll listener */
  transform: translateX(var(--hscroll-x, 0px));
}

.hscroll__slide {
  flex: 0 0 auto;
  width: var(--hscroll-slide-width, 80vw);
  max-width: 1000px;
}

/* Progress indicator */
.hscroll__progress {
  position: absolute;
  bottom: var(--space-lg, 2rem);
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 3px;
  background: var(--color-border, rgba(0,0,0,0.1));
  border-radius: 2px;
  overflow: hidden;
}

.hscroll__progress-bar {
  height: 100%;
  width: 0%;
  background: var(--color-accent);
  border-radius: 2px;
  transition: width 60ms linear;
}


/* ═══════════════════════════════════════════════
   8. CARD STACK / DECK
   Stacked cards with depth offsets. JS handles
   swipe/click to cycle. Cards use --deck-index
   for z-index and scale.
   ═══════════════════════════════════════════════ */

.deck {
  position: relative;
  width: 100%;
  max-width: var(--deck-max-width, 600px);
  aspect-ratio: var(--deck-ratio, 4/3);
  margin: 0 auto;
  perspective: 1200px;
}

.deck__card {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
  background: var(--color-surface, #fff);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  transition:
    transform var(--duration-slow, 800ms) var(--ease-spring),
    opacity var(--duration-med, 400ms) ease;
  transform-origin: center bottom;

  /* Stack positioning — JS sets --deck-offset (0, 1, 2, ...) */
  transform:
    translateY(calc(var(--deck-offset, 0) * -8px))
    scale(calc(1 - var(--deck-offset, 0) * 0.04));
  z-index: calc(10 - var(--deck-offset, 0));
  opacity: calc(1 - var(--deck-offset, 0) * 0.15);
}

/* Active (top) card */
.deck__card.is-active {
  cursor: grab;
}

.deck__card.is-active:active {
  cursor: grabbing;
}

/* Swiped out */
.deck__card.is-swiped-left {
  transform: translateX(-120%) rotate(-15deg);
  opacity: 0;
  pointer-events: none;
}

.deck__card.is-swiped-right {
  transform: translateX(120%) rotate(15deg);
  opacity: 0;
  pointer-events: none;
}

/* Deck navigation dots */
.deck__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: var(--space-md, 1rem);
}

.deck__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-border, rgba(0,0,0,0.15));
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background var(--duration-fast) ease;
}

.deck__dot.is-active {
  background: var(--color-accent);
}


/* ═══════════════════════════════════════════════
   9. VIEW TRANSITIONS API (MPA)
   Cross-document morphing for 11ty multi-page app.
   Assign view-transition-name to elements that
   should morph between pages.
   ═══════════════════════════════════════════════ */

/* Only enable MPA view transitions when motion is OK */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}

/* Default cross-fade for all page transitions */
::view-transition-old(root) {
  animation: vtFadeOut 250ms ease both;
}

::view-transition-new(root) {
  animation: vtFadeIn 250ms ease both;
}

@keyframes vtFadeOut {
  to { opacity: 0; }
}

@keyframes vtFadeIn {
  from { opacity: 0; }
}

/* Named transition: gallery card → project hero */
::view-transition-old(project-hero) {
  animation: vtShrink 400ms var(--ease-in-out) both;
}

::view-transition-new(project-hero) {
  animation: vtExpand 400ms var(--ease-in-out) both;
}

@keyframes vtShrink {
  to { transform: scale(0.9); opacity: 0; }
}

@keyframes vtExpand {
  from { transform: scale(0.9); opacity: 0; }
}

/* Utility: assign transition names inline */
.vt-project-hero {
  view-transition-name: project-hero;
}

.vt-project-title {
  view-transition-name: project-title;
}

.vt-nav {
  view-transition-name: main-nav;
}


/* ═══════════════════════════════════════════════
   10. FLIPBOOK CONTAINER (StPageFlip)
   Wrapper styles for the page-flip module.
   Pages accept images or rich text/HTML.
   ═══════════════════════════════════════════════ */

.flipbook {
  margin: var(--space-2xl, 3rem) auto;
  max-width: 100%;
}

.flipbook__container {
  position: relative;
  width: 100%;
  max-width: var(--flipbook-width, 900px);
  margin: 0 auto;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
}

/* Individual page styles */
.flipbook__page {
  background: var(--color-surface, #fff);
  padding: var(--space-xl, 2rem);
  overflow: hidden;
}

/* Image page (full bleed) */
.flipbook__page--image {
  padding: 0;
}

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

/* Text page */
.flipbook__page--text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size: var(--text-body, 1rem);
  line-height: 1.65;
}

.flipbook__page--text h2,
.flipbook__page--text h3 {
  margin-bottom: var(--space-sm, 0.5rem);
}

/* Dark page variant */
.flipbook__page--dark {
  background: var(--color-bg-dark, #1a1a1a);
  color: var(--color-text-on-dark, #f0f0f0);
}

/* Page number */
.flipbook__page-num {
  position: absolute;
  bottom: var(--space-sm, 0.5rem);
  font-size: var(--text-xs, 0.75rem);
  color: var(--color-text-muted, #999);
  font-family: var(--font-mono, monospace);
}

.flipbook__page-num--left {
  left: var(--space-md, 1rem);
}

.flipbook__page-num--right {
  right: var(--space-md, 1rem);
}

/* Navigation controls */
.flipbook__nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-md, 1rem);
  margin-top: var(--space-md, 1rem);
}

.flipbook__btn {
  background: none;
  border: 1px solid var(--color-border, rgba(0,0,0,0.15));
  border-radius: var(--radius-sm, 4px);
  padding: var(--space-xs, 0.25rem) var(--space-sm, 0.5rem);
  cursor: pointer;
  font-family: var(--font-body, sans-serif);
  font-size: var(--text-sm, 0.875rem);
  color: var(--color-text-primary);
  transition: background var(--duration-fast) ease, border-color var(--duration-fast) ease;
}

.flipbook__btn:hover {
  background: var(--color-surface-hover, rgba(0,0,0,0.04));
  border-color: var(--color-accent);
}

.flipbook__counter {
  font-family: var(--font-mono, monospace);
  font-size: var(--text-sm, 0.875rem);
  color: var(--color-text-muted, #999);
  min-width: 60px;
  text-align: center;
}


/* ═══════════════════════════════════════════════
   11. COMPARISON SLIDER (Before/After)
   Two overlapping images with a draggable divider.
   JS updates --split custom property on drag.
   ═══════════════════════════════════════════════ */

.compare {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md, 8px);
  cursor: col-resize;
  user-select: none;
  -webkit-user-select: none;
}

.compare__before {
  display: block;
  width: 100%;
  height: auto;
}

.compare__after {
  position: absolute;
  inset: 0;
  clip-path: inset(0 calc(100% - var(--split, 50%)) 0 0);
  overflow: hidden;
}

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

.compare__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split, 50%);
  width: 3px;
  background: white;
  box-shadow: 0 0 6px rgba(0,0,0,0.3);
  cursor: ew-resize;
  z-index: 3;
  transform: translateX(-50%);
}

.compare__handle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.compare__handle::after {
  content: '\2194'; /* ↔ */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 16px;
  color: var(--color-text-primary, #333);
  z-index: 1;
}


/* ═══════════════════════════════════════════════
   12. METRIC / KPI CALLOUT
   Highlighted stat with animated counter and label.
   ═══════════════════════════════════════════════ */

.metric {
  text-align: center;
  padding: var(--space-lg, 2rem) var(--space-md, 1rem);
}

.metric__value {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-family: var(--font-display, monospace);
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-text-primary);
}

.metric__label {
  font-size: var(--text-sm, 0.875rem);
  color: var(--color-text-muted, rgba(0,0,0,0.4));
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: var(--space-xs, 0.25rem);
}

/* Metric grid — for multiple KPIs side by side */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-lg, 2rem);
}


/* ═══════════════════════════════════════════════
   13. TIMELINE / PROCESS STRIP
   Vertical timeline with connected nodes and content.
   ═══════════════════════════════════════════════ */

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: 52px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--color-border, rgba(0,0,0,0.1));
}

.timeline__node {
  position: relative;
  padding-bottom: var(--space-xl, 2rem);
}

.timeline__dot {
  position: absolute;
  left: -40px;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--color-accent, #6FCDCD);
  background: var(--color-bg, #fff);
  z-index: 1;
  transition: background var(--duration-fast, 200ms) ease, transform var(--duration-fast, 200ms) var(--ease-spring, ease);
}

.timeline__node.is-active .timeline__dot {
  background: var(--color-accent, #6FCDCD);
  transform: scale(1.2);
}

.timeline__date {
  font-family: var(--font-meta, monospace);
  font-size: var(--text-xs, 0.75rem);
  color: var(--color-text-muted, rgba(0,0,0,0.4));
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-xs, 0.25rem);
}

.timeline__title {
  font-size: var(--text-lg, 1.125rem);
  font-weight: 600;
  margin-bottom: var(--space-xs, 0.25rem);
}

.timeline__content {
  font-size: var(--text-body, 1rem);
  color: var(--color-text-secondary, rgba(0,0,0,0.65));
  line-height: 1.6;
}


/* ═══════════════════════════════════════════════
   14. ANNOTATED IMAGE
   Image with numbered hotspot markers.
   ═══════════════════════════════════════════════ */

.annotated {
  position: relative;
  display: inline-block;
}

.annotated__pin {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-accent, #6FCDCD);
  color: white;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: transform var(--duration-fast, 200ms) var(--ease-spring, ease);
  z-index: 2;
}

.annotated__pin:hover {
  transform: scale(1.15);
}

.annotated__tooltip {
  position: absolute;
  background: var(--color-surface, #fff);
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  max-width: 240px;
  font-size: var(--text-sm, 0.875rem);
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-fast, 200ms) ease;
  z-index: 3;
}

.annotated__pin:hover + .annotated__tooltip,
.annotated__pin:focus + .annotated__tooltip {
  opacity: 1;
  pointer-events: auto;
}
