/* =========================================================================
   Slingshot v5 · figures.css: the six Home figures (js/figures.js).
   Canvas fills the figure; every label is DOM (mono), positioned by JS
   (translate) inside its figure. Heat per tools/heat.py: amber and peach
   text only on dark, rust text only on light.
   ========================================================================= */
.v5fig {
  position: relative;
  margin: 0;
  width: 100%;
}
.v5fig .gcanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.v5fig.f1 {
  height: clamp(520px, 86vh, 900px);
}
.v5fig.f3 {
  aspect-ratio: 16 / 8.6;
}
.v5fig.f6 {
  aspect-ratio: 16 / 5.4;
}
.f5-plot {
  position: relative;
  aspect-ratio: 16 / 11;
}
.v5fig.f5 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 372px);
  gap: 40px;
  align-items: center;
}
@media (max-width: 860px) {
  .v5fig.f5 {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
}
@media (min-width: 640px) and (max-width: 899px) {
  .v5fig.f6 {
    aspect-ratio: 4 / 4.2;
  }
}
@media (max-width: 639px) {
  .v5fig.f1 {
    height: clamp(460px, 78svh, 720px);
  }
  .v5fig.f3 {
    aspect-ratio: 4 / 4.6;
  }
  .v5fig.f6 {
    aspect-ratio: 4 / 5.9;
  }
  .f5-plot {
    aspect-ratio: 4 / 4;
  }
}

/* ------------------------------------------------------------- labels -- */
.v5l {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  margin: 0;
  pointer-events: none;
  white-space: nowrap;
  font-family: var(--f-mono);
  font-variant-ligatures: none;
  font-variant-numeric: tabular-nums;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.35;
  color: var(--on-d-82);
}
.js.motion .v5l {
  transition: opacity 320ms var(--ease-out);
}
.js .v5l:not(.is-on) {
  opacity: 0;
}
/* without JS the stills carry the labels */
html:not(.js) .v5l,
html:not(.js) .f5-key,
html:not(.js) .v5fig .gcanvas {
  display: none;
}
.v5still {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.v5l.glabel {
  padding: 2px 6px;
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  background: rgba(18, 18, 20, 0.86);
  border-radius: 2px;
}
.v5l.tag {
  padding: 5px 8px;
}


/* F3 · the hub: node labels are buttons (hover or focus lights the node's
   connector); the core carries its tag */
.f3-node {
  z-index: 3;
  min-height: 32px;
  padding: 6px 10px;
  pointer-events: auto;
  cursor: default;
  font-size: 0.6875rem;
  color: var(--on-d-82);
  background: rgba(18, 18, 20, 0.88);
  border: 1px solid rgba(245, 240, 235, 0.3);
  border-radius: 2px;
  transition:
    color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    opacity 320ms var(--ease-out);
}
.f3-node:hover,
.f3-node.is-hot {
  color: var(--stone);
  border-color: var(--heat-amber-d);
}
.f3-node:focus-visible {
  outline: 2px solid var(--heat-amber-d);
  outline-offset: 2px;
}

/* F3 (v5.2): the stack's header and layer names */
.f3-head {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font: 500 0.75rem / 1.3 var(--f-mono);
  letter-spacing: 0.1em;
  color: var(--on-d-60);
}
.f3-head s {
  text-decoration: line-through;
  text-decoration-color: currentColor;
}
.f3-head [data-f3-h="to"] {
  color: var(--heat-amber-d);
}
.f3-head svg,
.f8 .f8-going svg {
  flex: none;
}
.f3-head svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}
.f3 .f3-layer {
  color: var(--on-d-82);
  font-size: clamp(0.625rem, 0.58rem + 0.2vw, 0.6875rem);
  transition: color var(--dur-fast) var(--ease-out);
}
.f3 .f3-layer.f3-top,
.f3 .f3-layer.is-hot {
  color: var(--heat-amber-d);
}
/* F5 (v5.2): the header over plot and card, TANGLED HISTORY -> ONE RECORD */
.f5-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font: 500 0.75rem / 1.3 var(--f-mono);
  letter-spacing: 0.1em;
  color: var(--on-d-60);
}
.f5-head [data-f5-h="to"] {
  color: var(--heat-amber-d);
}
.f5-head svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}
/* F5 · the record card */
.f5-col {
  font-size: 0.625rem;
}
.f5-col.is-hot {
  color: var(--heat-amber-d);
}
.f5-key {
  /* v5.3: a 44px target round each strand's key (it draws nothing) */
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 2px;
}
.f5-key:focus-visible {
  outline: 2px solid var(--heat-amber-d);
  outline-offset: -11px;
}
.f5-card {
  font-family: var(--f-mono);
  font-variant-ligatures: none;
  font-variant-numeric: tabular-nums;
  color: var(--on-d-82);
  background: #18181a;
  border: 1px solid rgba(245, 240, 235, 0.2);
  border-radius: 2px;
  padding: 16px 18px 14px;
}
.f5-card-h {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding-bottom: 10px;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--on-d-60);
  border-bottom: 1px solid var(--rule-d);
}
.f5-card-h .f5-ex {
  color: var(--heat-peach);
}
.f5-get {
  margin: 0;
  padding: 12px 0;
  font-size: 0.75rem;
  color: var(--stone);
  overflow-wrap: anywhere;
}
.f5-card ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.f5-card li {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 0 8px;
  align-items: baseline;
  padding: 8px 0;
  border-top: 1px solid var(--rule-d);
  font-size: 0.71875rem;
  color: rgba(245, 240, 235, 0.42);
  transition: color 250ms var(--ease-out);
}
.f5-card li b {
  font-weight: 500;
  letter-spacing: 0.06em;
  justify-self: start;
  padding: 2px 6px;
  margin-left: -6px;
  border-radius: 2px;
  transition:
    background 250ms var(--ease-out),
    color 250ms var(--ease-out);
}
.f5-card li.on {
  color: var(--on-d-82);
}
.f5-card li.last.on b {
  background: var(--heat-amber-d);
  color: var(--carbon);
}
.f5-note {
  margin: 10px 0 0;
  font-family: var(--f-body);
  font-size: 0.75rem;
  color: var(--on-d-60);
}

/* F6 (v5.2, Ethan): each graph's title, larger and brighter; TODAY in
   Stone, the one ledger in heat */
.f6 .f6-row {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--stone);
}
.f6 .f6-row.f6-slingshot {
  color: var(--heat-amber-d);
}
/* F6 · versions and their change cards */
.f6 .f6-big {
  font-size: 0.8125rem;
  color: var(--stone);
}
.f6 .f6-slingshot {
  color: var(--heat-amber-d);
}
.f6 .f6-delta {
  padding: 2px 6px;
  color: var(--heat-peach);
  background: rgba(18, 18, 20, 0.86);
  border: 1px solid rgba(247, 207, 178, 0.6);
  border-radius: 2px;
}
.f6 .f6-key {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.625rem;
}
.f6 .f6-key::before {
  content: "";
  width: 22px;
  border-top: 2px solid var(--stone);
}
.f6 .f6-key-b {
  color: var(--heat-peach);
}
.f6 .f6-key-b::before {
  border-top: 2px dashed var(--heat-peach);
}
/* v5.3: a 44px target; the tag you see is its middle 28px (::before) */
.f6-v {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  isolation: isolate;
  min-width: 44px;
  min-height: 44px;
  padding: 4px 8px;
  font: 500 0.6875rem / 1 var(--f-mono);
  letter-spacing: 0.06em;
  color: var(--on-d-82);
  background: none;
  border: 0;
  --tag-edge: rgba(245, 240, 235, 0.35);
  cursor: default;
  transition:
    color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}
.js .f6-v:not(.is-on) {
  opacity: 0;
}
.f6-v.is-hot,
.f6-v:hover {
  color: var(--stone);
  --tag-edge: var(--heat-amber-d);
}
.f6-v::before {
  content: "";
  position: absolute;
  inset: 8px 0;
  z-index: -1;
  background: rgba(18, 18, 20, 0.88);
  border: 1px solid var(--tag-edge);
  border-radius: 2px;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.f6-v:focus-visible {
  outline: 2px solid var(--heat-amber-d);
  outline-offset: -6px;
}
.f6-card {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 4;
  width: 248px;
  padding: 12px 14px;
  pointer-events: none;
  font-family: var(--f-mono);
  font-size: 0.6875rem;
  color: var(--on-d-82);
  background: rgba(18, 18, 20, 0.96);
  border: 1px solid var(--heat-amber-d);
  border-radius: 2px;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.f6-card.is-on {
  opacity: 1;
}
.f6-card small {
  display: block;
  margin-bottom: 6px;
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  color: var(--heat-amber-d);
}
.f6-card strong {
  display: block;
  margin-bottom: 8px;
  font: 600 1rem / 1.2 var(--f-display);
  letter-spacing: -0.01em;
  color: var(--stone);
}
.f6-card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  margin: 0;
}
.f6-card dt {
  letter-spacing: 0.08em;
  color: var(--on-d-60);
}
.f6-card dd {
  margin: 0;
  font-family: var(--f-body);
  font-size: 0.8125rem;
  color: var(--on-d-82);
}
/* without JS the current version's card sits in the card column, where
   the still's leader points */
html:not(.js) .f6-card:last-of-type {
  opacity: 1;
  left: auto;
  right: 1.5%;
  top: auto;
  bottom: 14%;
}
@media (max-width: 639px) {
  html:not(.js) .f6-card:last-of-type {
    left: 12px;
    right: auto;
    bottom: 4%;
  }
}

@media (max-width: 359px) {
  .v5fig.f6 {
    aspect-ratio: 4 / 6.8;
  }
}

/* ===================================================== v5.1 figures */
.v5fig.f7 {
  aspect-ratio: 16 / 8;
}
.v5fig.f8 {
  aspect-ratio: 16 / 7;
}
.v5fig.f9 {
  aspect-ratio: 16 / 9;
  touch-action: pan-y;
}
@media (max-width: 639px) {
  .v5fig.f7 {
    aspect-ratio: 4 / 4.6;
  }
  .v5fig.f8 {
    aspect-ratio: 4 / 4;
  }
  .v5fig.f9 {
    aspect-ratio: 4 / 3.4;
  }
}
/* F7 (v5.2): full bleed, scroll-pinned. With motion the stage sticks under
   the bar for the pin's run (desktop 170vh, phones 120vh) and the scroll
   drives the pull-back; reduced motion and no JS keep the plain figure */
.f7-pin {
  position: relative;
  margin-top: clamp(8px, 2vw, 24px);
}
.motion .f7-pin {
  height: calc(100svh - var(--bar-h) + 170vh);
}
.motion .f7-stick {
  position: sticky;
  top: var(--bar-h);
  height: calc(100svh - var(--bar-h));
}
.motion .v5fig.f7 {
  aspect-ratio: auto;
  height: 100%;
}
@media (max-width: 639px) {
  .motion .f7-pin {
    height: calc(100svh - var(--bar-h) + 120vh);
  }
}
/* F7: the galaxy and its core glow fade out before the figure's edge, so
   no straight canvas edge shows on a narrow screen */
.v5fig.f7 .gcanvas {
  -webkit-mask-image: radial-gradient(ellipse 72% 70% at 50% 50%, #000 72%, transparent 100%);
  mask-image: radial-gradient(ellipse 72% 70% at 50% 50%, #000 72%, transparent 100%);
}
.f7 .v5l,
.f8 .v5l {
  color: var(--on-d-60);
}
/* F8 (v5.2): the marker's two lines; the second in heat, with its arrow */
.f8 .f8-stop {
  color: var(--on-d-82);
}
.f8 .f8-going {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--heat-amber-d);
}
.f8 .f8-going svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}
