/* Interactive SVG runtime styles. Everything is scoped under .isvg (docs/webflow-embed.md §4). */
.isvg {
  --isvg-waters: #2b9abc;
  --isvg-species: #d68003;
  --isvg-diligence: #357256;
  --isvg-ink: #1f2a2e;
  --isvg-paper: #ffffff;
  --isvg-muted: #5b6a70;
  --isvg-ease: cubic-bezier(.2, .7, .2, 1);
  position: relative;
  color: var(--isvg-ink);
}
.isvg [data-topic="waters"], .isvg-panel[data-topic="waters"], .isvg-chip[data-topic="waters"] { --c: var(--isvg-waters); }
.isvg [data-topic="species"], .isvg-panel[data-topic="species"], .isvg-chip[data-topic="species"] { --c: var(--isvg-species); }
.isvg [data-topic="diligence"], .isvg-panel[data-topic="diligence"], .isvg-chip[data-topic="diligence"] { --c: var(--isvg-diligence); }

/* Topic chips: the touch-friendly way in, mirrored from the diagram's headings */
.isvg .isvg-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0 var(--isvg-gutter, 16px); }
.isvg .isvg-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px;
  border: 1.5px solid var(--c, var(--isvg-muted)); background: var(--isvg-paper); color: var(--isvg-ink);
  font: inherit; font-size: 13px; font-weight: 600; line-height: 1.2; letter-spacing: .02em; cursor: pointer;
  transition: background .25s var(--isvg-ease), color .25s var(--isvg-ease), opacity .25s;
}
.isvg .isvg-chip::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); transition: background .25s; }
.isvg .isvg-chip:hover, .isvg .isvg-chip.is-on { background: var(--c); color: #fff; }
.isvg .isvg-chip:hover::before, .isvg .isvg-chip.is-on::before { background: #fff; }
.isvg .isvg-chip.is-dim { opacity: .5; }
.isvg .isvg-chip:focus-visible { outline: 3px solid var(--c); outline-offset: 2px; }

/* Square edges by default so the artwork can run edge to edge; set --isvg-radius to round the corners. */
.isvg .isvg-stage { position: relative; background: var(--isvg-paper); border-radius: var(--isvg-radius, 0); overflow: hidden; }
.isvg .isvg-stage svg { display: block; width: 100%; height: auto; }
.isvg .isvg-fallback { display: block; width: 100%; height: auto; }

/* Tagged groups inside the SVG */
.isvg .isvg-item, .isvg .isvg-scene {
  transition: opacity .4s var(--isvg-ease), scale .4s var(--isvg-ease);
  transform-box: fill-box; transform-origin: center;
}
.isvg .isvg-item { cursor: pointer; outline: none; }
.isvg .isvg-scene { cursor: pointer; }
.isvg .isvg-hit { pointer-events: all; fill: transparent; stroke: transparent; stroke-width: 10; transition: stroke .3s, fill .3s; }
.isvg .is-dim { opacity: .16; }
.isvg .isvg-item.is-on .isvg-hit { fill: color-mix(in srgb, var(--c) 7%, transparent); }
.isvg .isvg-item.is-current { scale: 1.025; }
.isvg .isvg-item.is-current .isvg-hit,
.isvg .isvg-item:focus-visible .isvg-hit { stroke: var(--c); stroke-dasharray: 26 14; animation: isvg-march 1.2s linear infinite; }

/* Scene life while a topic is active */
.isvg .isvg-scene.is-related .isvg-bird { animation: isvg-bob 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.isvg .isvg-scene.is-related .isvg-bird:nth-child(2) { animation-delay: -.5s; }
.isvg .isvg-scene.is-related .isvg-bird:nth-child(3) { animation-delay: -1s; }
.isvg .isvg-scene.isvg-fish.is-related { animation: isvg-swim 2.4s ease-in-out infinite; }
.isvg .isvg-flight.is-related path { stroke-dasharray: 60 30; animation: isvg-march 2s linear infinite; }

@keyframes isvg-march { to { stroke-dashoffset: -80; } }
/* Individual translate/rotate properties compose with Illustrator's transform="" attributes instead of replacing them. */
@keyframes isvg-bob { 50% { translate: 0 -14%; rotate: -4deg; } }
@keyframes isvg-swim { 50% { translate: 10% 0; } }

/* Detail panel */
.isvg .isvg-panel {
  position: absolute; right: 12px; bottom: 12px; width: min(340px, calc(100% - 24px));
  max-height: calc(100% - 24px); overflow: auto; box-sizing: border-box;
  background: var(--isvg-paper); color: var(--isvg-ink);
  border-radius: 10px; border-top: 5px solid var(--c, var(--isvg-muted));
  box-shadow: 0 12px 32px rgba(15, 30, 35, .22);
  padding: 16px 18px 18px;
  opacity: 0; transform: translateY(10px); pointer-events: none; visibility: hidden;
  transition: opacity .3s var(--isvg-ease), transform .3s var(--isvg-ease), visibility 0s .3s;
}
.isvg .isvg-panel.is-open { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition-delay: 0s; }
.isvg .isvg-panel-eyebrow { margin: 0 0 4px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--c); }
.isvg .isvg-panel-title { margin: 0 0 10px; font-size: 18px; line-height: 1.25; font-weight: 700; text-wrap: balance; }
.isvg .isvg-panel-body { margin: 0; padding: 0; list-style: none; font-size: 13.5px; line-height: 1.45; display: grid; gap: 5px; }
.isvg .isvg-panel-body .isvg-sub { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--isvg-muted); margin-top: 6px; }
.isvg .isvg-panel-body button { all: unset; cursor: pointer; color: var(--c); font-weight: 600; }
.isvg .isvg-panel-body button:hover { text-decoration: underline; }
.isvg .isvg-panel-body button:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.isvg .isvg-panel-actions { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.isvg .isvg-panel-cta { display: inline-block; padding: 8px 14px; border-radius: 6px; background: var(--c); color: #fff; text-decoration: none; font-weight: 600; font-size: 13px; }
.isvg .isvg-panel-close { all: unset; cursor: pointer; margin-left: auto; font-size: 13px; color: var(--isvg-muted); padding: 4px 6px; border-radius: 4px; }
.isvg .isvg-panel-close:focus-visible, .isvg .isvg-panel-cta:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }

/* Hidden Webflow Link Blocks that carry each topic's destination */
.isvg-links { display: none; }

@media (max-width: 640px) {
  .isvg .isvg-panel { position: static; width: auto; max-height: none; margin-top: 10px; box-shadow: 0 4px 14px rgba(15, 30, 35, .14); display: none; }
  .isvg .isvg-panel.is-open { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .isvg *, .isvg *::before { animation: none !important; transition: none !important; }
}

/* Scroll-in intro. tools/add-intro.js marks elements with .isvg-in, data-in="<kind>", --d (delay) and --t (duration).
   isvg.js adds .isvg-intro on mount (everything waits hidden) and .isvg-intro-play when the diagram scrolls into view,
   then removes both when the intro ends, so hover and highlight styles take over again. */
.isvg.isvg-intro:not(.isvg-intro-play) .isvg-in { opacity: 0; }
.isvg.isvg-intro:not(.isvg-intro-play) .isvg-drawmask { stroke-dashoffset: var(--len); }
.isvg .isvg-drawmask { stroke-dasharray: var(--len) var(--len); stroke-dashoffset: 0; }
.isvg.isvg-intro-play .isvg-in { animation: isvg-fade var(--t, 300ms) ease-out var(--d, 0ms) both; transform-box: fill-box; }
.isvg.isvg-intro-play [data-in="wipe"] { animation-name: isvg-wipe; animation-timing-function: cubic-bezier(.6, .05, .25, 1); }
.isvg.isvg-intro-play [data-in="rise"] { animation-name: isvg-rise; animation-timing-function: cubic-bezier(.3, .6, .3, 1); }
.isvg.isvg-intro-play [data-in="box"] { animation-name: isvg-wipe; animation-timing-function: cubic-bezier(.5, 0, .2, 1); }
.isvg.isvg-intro-play [data-in="pop"] { animation-name: isvg-pop; animation-timing-function: cubic-bezier(.3, .7, .4, 1); transform-origin: 50% 100%; }
.isvg.isvg-intro-play [data-in="swim"] { animation-name: isvg-swim-in; animation-timing-function: cubic-bezier(.2, .7, .3, 1); transform-origin: 50% 50%; }
.isvg.isvg-intro-play [data-in="type"] { animation-name: isvg-type; animation-timing-function: steps(2, jump-none); }
.isvg.isvg-intro-play [data-in="fly"] {
  animation: isvg-fly var(--t) cubic-bezier(.25, .6, .3, 1) var(--d) both,
             isvg-flap 90ms ease-in-out var(--d) 4 alternate;
  transform-origin: 50% 50%;
}
.isvg.isvg-intro-play .isvg-drawmask { animation: isvg-draw var(--t) cubic-bezier(.45, .05, .25, 1) var(--d) both; }

@keyframes isvg-fade { from { opacity: 0; } }
@keyframes isvg-type { from { opacity: 0; } }
@keyframes isvg-wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes isvg-rise { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes isvg-pop { from { opacity: 0; scale: 0; } 55% { scale: 1.15; } 80% { scale: .96; } to { scale: 1; } }
@keyframes isvg-swim-in { from { opacity: 0; scale: .4; translate: -60% 0; } to { scale: 1; translate: 0 0; } }
@keyframes isvg-draw { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }
/* Birds glide in along a gentle arc while the wings beat a few times (the bird is one shape, so a beat is a vertical squash). */
@keyframes isvg-fly {
  from { opacity: 0; translate: -420px 160px; rotate: -12deg; }
  60% { translate: -90px 20px; rotate: 4deg; }
  to { translate: 0 0; rotate: 0deg; }
}
@keyframes isvg-flap { from { scale: 1 1; } to { scale: 1.06 .55; } }
