/* ============ tools — the Settings controls, tour captions, toast ============
   The controls live in the nav's Settings drip and in the poured menu (css/navglass.css lays
   out their rows — icon · name · control): colour (seven tinted glass beads), guided tour,
   animations, and the rocket — its key under a hinged hairline safety cover. */

/* ---------- colour: seven glass beads in a radiogroup ---------- */
.seed { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
.seed__bead {
  position: relative;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 46%),
    var(--chip);
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  transition: transform var(--d-ui) var(--ease-out), box-shadow var(--d-ui) var(--ease-ui);
}
.seed__bead::before { content: ""; position: absolute; inset: -5px -3.5px; border-radius: 50%; } /* 28px hit area */
.seed__bead:hover { transform: scale(1.14); }
.seed__bead[aria-checked="true"] {
  box-shadow:
    inset 0 -2px 3px rgba(0, 0, 0, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    0 0 0 2px var(--n-tint-deep, #111),
    0 0 0 3px var(--n-ink, #ece8e1);
}
.seed__bead:focus-visible { outline-offset: 5px; border-radius: 50%; }
.seed__name {
  min-width: 6ch;
  margin-left: 5px;
  font-size: 9.5px;
  color: var(--n-ink-2, rgba(236, 232, 225, 0.8));
}
/* touch: 44px targets */
.menu .seed { justify-content: space-between; gap: 0; }
.menu .seed__bead { width: 24px; height: 24px; margin: 10px; }
.menu .seed__bead::before { inset: -10px; }
.menu .seed__name { flex-basis: 100%; margin: 2px 0 0; }

/* ---------- rocket: the key under a hinged glass cover ("please don't press") ----------
   The whole Settings row is one button: a press flips the cover open, the key goes down and the
   show starts (js/core/controls.js → js/core/rocket.js). Hovering lets the cover peek open. */
.arm {
  position: relative;
  display: block;
  justify-self: start;
  width: 76px;
  height: 32px;
  perspective: 220px;
}
.arm__key {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--n-well, rgba(0, 0, 0, 0.26));
  box-shadow: inset 0 1px 0 var(--n-well-top, rgba(0, 0, 0, 0.5)), inset 0 -1px 0 var(--n-well-lip, rgba(255, 255, 255, 0.08));
}
.arm__core {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 36% 30%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 50%),
    var(--signal);
  box-shadow: inset 0 -2px 2px rgba(0, 0, 0, 0.3);
  transition: transform 160ms var(--ease-ui), box-shadow 220ms var(--ease-ui), background-color 400ms var(--ease-ui);
}
.opt--arm:hover .arm:not(.is-armed) .arm__core { transform: scale(1.1); }
/* pressed: the key sinks and the light under it comes on */
.arm.is-fired .arm__core {
  transform: scale(0.8);
  box-shadow: inset 0 -1px 1px rgba(0, 0, 0, 0.3), 0 0 0 3px var(--signal-soft), 0 0 14px 1px var(--signal);
  animation: armfire 1.1s var(--ease-out) 0.2s infinite;
}
@keyframes armfire { 50% { box-shadow: inset 0 -1px 1px rgba(0, 0, 0, 0.3), 0 0 0 5px var(--signal-soft), 0 0 22px 3px var(--signal); } }

/* the cover: a pane of tinted glass with a hatch, a specular sheen and a hairline hinge */
.arm__cover {
  position: absolute;
  inset: -3px;
  border: 1px solid var(--n-ink-3, rgba(236, 232, 225, 0.74));
  border-radius: 9px;
  background:
    linear-gradient(162deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.04) 42%, rgba(255, 255, 255, 0) 60%, rgba(255, 255, 255, 0.07)),
    rgba(127, 127, 127, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transform-origin: 50% 0;
  transition: transform 520ms var(--ease-out), border-color var(--d-ui) var(--ease-ui);
}
.arm__hatch {
  position: absolute;
  inset: 3px;
  border-radius: 6px;
  background: repeating-linear-gradient(-45deg, #0000 0 5px, var(--n-line, rgba(236, 232, 225, 0.12)) 5px 6px);
}
.arm__cover::after { /* the hinge */
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: -1px;
  height: 1px;
  background: var(--n-ink-2, rgba(236, 232, 225, 0.8));
}
.opt--arm:hover .arm__cover { border-color: var(--n-ink, #ece8e1); transform: rotateX(-26deg); }
/* one press: the cover snaps all the way open, with a little overshoot */
.arm.is-armed .arm__cover,
.opt--arm:hover .arm.is-armed .arm__cover {
  transform: rotateX(-122deg);
  transition: transform 300ms cubic-bezier(0.3, 1.45, 0.55, 1), border-color var(--d-ui) var(--ease-ui);
}
html.is-reduced .arm__cover { transition: none; }
html.is-reduced .opt--arm:hover .arm__cover { transform: none; }
html.is-reduced .arm.is-armed .arm__cover { transform: translateY(-120%) scaleY(0.25); }
html.is-reduced .arm.is-fired .arm__core { animation: none; }

/* ---------- the rocket show (js/core/rocket.js) ----------
   The page dims under a scrim; the particle field and the grain are lifted above it for the flight.
   Scroll is stopped meanwhile (lenis.stop() plus wheel / touch / key guards), but the root keeps its
   own overflow: Lenis's overflow:hidden would drop a classic scrollbar, reflow the page and make
   every ScrollTrigger re-measure at the start and end of the show. */
html.is-launching.lenis-stopped { overflow: visible; overflow-x: clip; }
html.rocket-front canvas.field { z-index: 9991; }
html.rocket-dark .grain { z-index: 9992; mix-blend-mode: normal; filter: none; opacity: 0.07; }

.liftoff-scrim {
  position: fixed;
  inset: 0;
  z-index: 9989;
  opacity: 0;
  touch-action: none;
  background: radial-gradient(120% 90% at 50% 56%, rgba(10, 10, 11, 0.8) 0%, rgba(7, 7, 8, 0.92) 55%, rgba(4, 4, 5, 0.985) 100%);
  -webkit-backdrop-filter: blur(9px) saturate(0.55) brightness(0.6);
  backdrop-filter: blur(9px) saturate(0.55) brightness(0.6);
}
/* over paper the same scrim would leave a grey stage: go denser, so it is as dark as the hero's */
.liftoff-scrim.is-paper {
  background: radial-gradient(120% 90% at 50% 56%, rgba(10, 10, 11, 0.9) 0%, rgba(7, 7, 8, 0.955) 55%, rgba(4, 4, 5, 0.99) 100%);
  -webkit-backdrop-filter: blur(9px) saturate(0.5) brightness(0.42);
  backdrop-filter: blur(9px) saturate(0.5) brightness(0.42);
}
/* phones: no live blur over the page, a deeper scrim instead */
html.is-touch .liftoff-scrim {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: radial-gradient(120% 90% at 50% 56%, rgba(10, 10, 11, 0.9) 0%, rgba(7, 7, 8, 0.96) 55%, rgba(4, 4, 5, 0.99) 100%);
}
html.is-touch .liftoff-scrim.is-paper {
  background: radial-gradient(120% 90% at 50% 56%, rgba(10, 10, 11, 0.95) 0%, rgba(7, 7, 8, 0.98) 55%, rgba(4, 4, 5, 0.995) 100%);
}

/* the pad: the exhaust lights the ground under the nozzle, in the accent */
.liftoff-pad {
  position: fixed;
  z-index: 9990;
  width: min(120vw, 1100px);
  height: min(56vh, 520px);
  translate: -50% -42%;
  opacity: 0;
  pointer-events: none;
  background:
    radial-gradient(closest-side, color-mix(in srgb, var(--signal) 46%, transparent), color-mix(in srgb, var(--signal) 14%, transparent) 46%, transparent 100%);
  mix-blend-mode: screen;
}

/* the readout: mission control in the corner the nav usually holds */
.liftoff-hud {
  position: fixed;
  z-index: 9993;
  top: max(1.1rem, env(safe-area-inset-top));
  left: var(--gutter);
  right: var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  color: rgba(236, 232, 225, 0.62);
  opacity: 0;
  pointer-events: none;
}
.liftoff-hud__read { display: grid; gap: 0.5rem; }
.liftoff-hud__k {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--signal);
  transition: color 300ms var(--ease-ui);
}
.liftoff-hud__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 10px 1px var(--signal);
  animation: tourdot 1s ease-in-out infinite;
}
.liftoff-hud__row { display: flex; flex-wrap: wrap; gap: 0.35rem 1.2rem; }
.liftoff-hud b { color: #ece8e1; font-weight: 450; font-variant-numeric: tabular-nums; }
.liftoff-hud sub { font-size: 0.75em; line-height: 0; }
.liftoff-hud__abort {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 36px;
  padding: 0 0.45rem 0 0.95rem;
  border: 1px solid rgba(236, 232, 225, 0.22);
  border-radius: 999px;
  background: rgba(14, 14, 16, 0.55);
  color: #ece8e1;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  pointer-events: auto;
  transition: background-color var(--d-ui) var(--ease-ui), color var(--d-ui) var(--ease-ui);
}
.liftoff-hud__abort kbd {
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: rgba(236, 232, 225, 0.1);
  color: rgba(236, 232, 225, 0.7);
  font: inherit;
}
.liftoff-hud__abort:hover { background: #ece8e1; color: #0b0b0c; }
.liftoff-hud__abort:hover kbd { background: rgba(11, 11, 12, 0.1); color: rgba(11, 11, 12, 0.7); }
.liftoff-hud__abort:focus-visible { outline-color: #ece8e1; outline-offset: 3px; border-radius: 999px; }
html.is-touch .liftoff-hud__abort { min-height: 44px; padding-right: 0.95rem; }
html.is-touch .liftoff-hud__abort kbd { display: none; }

/* reduced motion / no particle field: the rocket drawn once, still */
.liftoff-still { display: none; }
html.rocket-still .liftoff-still {
  position: fixed;
  z-index: 9991;
  left: 50%;
  top: 50%;
  display: block;
  width: clamp(88px, 22vmin, 180px);
  translate: -50% -50%;
  opacity: 0;
  pointer-events: none;
  color: #ece8e1;
}
.liftoff-still svg { width: 100%; height: auto; fill: none; stroke: currentColor; stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.liftoff-still__flame { stroke: var(--signal); fill: color-mix(in srgb, var(--signal) 35%, transparent); filter: drop-shadow(0 0 6px var(--signal)); }

@media (max-width: 760px) {
  .liftoff-hud { gap: 0.75rem; }
  .liftoff-hud__row { max-width: 15rem; }
}

/* ---------- tour captions ---------- */
.tour {
  position: fixed;
  left: 50%;
  bottom: clamp(1rem, 4vh, 2rem);
  z-index: 150;
  width: min(44rem, calc(100vw - 2 * var(--gutter)));
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem 1.2rem;
  align-items: end;
  padding: 1rem 1.2rem;
  border: 1px solid rgba(236, 232, 225, 0.16);
  border-radius: 10px;
  background: rgba(14, 14, 16, 0.9);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: #ece8e1;
  translate: -50% 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms var(--ease-out), translate 600ms var(--ease-out);
}
.tour.is-on { opacity: 1; translate: -50% 0; pointer-events: auto; }
.tour__meta { grid-column: 1; display: inline-flex; align-items: center; gap: 0.6rem; color: rgba(236, 232, 225, 0.55); }
.tour__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); animation: tourdot 1.4s ease-in-out infinite; }
@keyframes tourdot { 50% { opacity: 0.25; } }
.tour__text { grid-column: 1; font-size: var(--fs-body); line-height: 1.45; text-wrap: pretty; }
.tour__stop {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-height: 40px;
  padding: 0 0.9rem;
  border: 1px solid rgba(236, 232, 225, 0.24);
  border-radius: 999px;
  color: inherit;
}
.tour__stop:hover { background: #ece8e1; color: #0b0b0c; }

/* ---------- toast ---------- */
.tool-toast {
  position: fixed;
  left: 50%;
  top: calc(var(--nav-h) + 0.75rem);
  z-index: 160;
  translate: -50% -8px;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: #ece8e1;
  color: #0b0b0c;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms var(--ease-ui), translate 400ms var(--ease-out);
}
.tool-toast.is-on { opacity: 1; translate: -50% 0; }

html.is-reduced .tour__dot { animation: none; }
