/* ============================================================
   The Invisible Made Visible — instrument panel stylesheet
   ============================================================ */

/* --- tokens ------------------------------------------------ */

:root {
  --ink: #07080B;
  --ink-2: #0C0E14;
  --line: rgba(226, 232, 240, 0.10);
  --fog: rgba(226, 232, 240, 0.55);
  --bright: #ECEFF4;
  --role-primary: #7FD4C1;
  --role-accent: #F2A65A;
  --role-ghost: #93A1B5;
  --role-warm: #E4635A;
  --role-cool: #6E8FE8;

  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --rail: clamp(288px, 24vw, 336px);
  --pad: clamp(1.1rem, 2.4vw, 2rem);
  --micro: 0.68rem;
  --track-micro: 0.18em;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* --- reset -------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body,
h1,
h2,
p,
ul,
figure {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(127, 212, 193, 0.22);
  color: var(--bright);
}

/* --- page ground -------------------------------------------- */

body {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  background-color: var(--ink);
  color: var(--bright);
  font-family: var(--mono);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* a very soft highlight so the black has depth behind the stage */
body::before {
  content: '';
  position: fixed;
  inset: -20vh -10vw auto;
  height: 130vh;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(58% 46% at 42% 34%, rgba(126, 168, 190, 0.10), transparent 68%),
    radial-gradient(38% 34% at 78% 12%, rgba(127, 212, 193, 0.055), transparent 70%),
    radial-gradient(70% 50% at 50% 96%, rgba(110, 143, 232, 0.045), transparent 72%);
}

/* --- grain -------------------------------------------------- */

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.038;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* content sits above ground + grain */
.masthead,
.stage-wrap,
.console,
.suggestions,
.error {
  position: relative;
  z-index: 2;
}

/* --- masthead ----------------------------------------------- */

.masthead {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1.5rem;
  padding: clamp(1rem, 2vw, 1.5rem) var(--pad);
  border-bottom: 1px solid var(--line);
}

.mark {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mark__glyph {
  position: relative;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--role-primary);
  box-shadow:
    0 0 14px rgba(127, 212, 193, 0.30),
    inset 0 0 7px rgba(127, 212, 193, 0.18);
  opacity: 0.9;
}

.mark__glyph::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--role-primary);
  transform: translate(3.5px, -3.5px);
  box-shadow: 0 0 9px var(--role-primary);
}

.mark__word {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  color: var(--fog);
  white-space: nowrap;
}

.mark__word em {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.35rem;
  letter-spacing: 0;
  color: var(--bright);
  margin-left: 0.45rem;
  vertical-align: -0.06em;
}

/* --- stage / panel split ------------------------------------ */

.stage-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail);
  min-height: 0;
}

.stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid var(--line);
}

#canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* --- readout ------------------------------------------------ */
/* Stays inside the lower-left of the stage — the renderer reserves the
   remaining area for SVG annotations placed in stage coordinates. */

.readout {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 2;
  max-width: min(42%, 30rem);
  /* anchored to bottom:0 with no height cap, so a long title grows upward
     into the stage instead of spilling past its lower edge; the type scale
     below keeps the usual case inside the bottom third */
  padding: clamp(1rem, 1.6vw, 1.5rem) clamp(1.4rem, 2.4vw, 2.25rem) clamp(1.3rem, 2.2vw, 2rem);
  pointer-events: none;
}

/* soft scrim, wide and fully faded at the edges so annotation leader
   lines passing nearby never meet a hard rectangle */
.readout::before {
  content: '';
  position: absolute;
  inset: -60% -120% -70% -70%;
  z-index: -1;
  background: radial-gradient(
    52% 58% at 30% 74%,
    rgba(7, 8, 11, 0.94) 0%,
    rgba(7, 8, 11, 0.66) 40%,
    rgba(7, 8, 11, 0.22) 62%,
    rgba(7, 8, 11, 0) 80%
  );
}

.readout__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.2rem, 3.1vw, 3.1rem);
  line-height: 1.02;
  letter-spacing: -0.012em;
  text-transform: lowercase;
  color: var(--bright);
  text-wrap: balance;
}

.readout__standfirst {
  margin-top: 0.8rem;
  max-width: 46ch;
  font-size: 0.78rem;
  font-weight: 300;
  line-height: 1.75;
  letter-spacing: 0.012em;
  color: var(--fog);
}

/* --- veil (loading) ----------------------------------------- */

/* Covers the viewport rather than the stage. Generation takes long enough that
   a partial scrim reads as "nothing happened" — and on a phone the stage is
   scrolled well out of view at the moment you tap reveal. */
.veil {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background: rgba(7, 8, 11, 0.9);
  backdrop-filter: blur(24px) saturate(0.6);
  -webkit-backdrop-filter: blur(24px) saturate(0.6);
  animation: veilIn 320ms var(--ease) both;
}

/* The page must not scroll behind a fixed overlay. Both elements: below the
   desktop breakpoint the document element is what scrolls, so body alone
   does not hold it. */
html.is-busy,
body.is-busy {
  overflow: hidden;
}

.veil[hidden] {
  display: none;
}

@keyframes veilIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.veil__pulse {
  display: flex;
  gap: 0.6rem;
}

.veil__pulse i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--role-primary);
  box-shadow: 0 0 12px rgba(127, 212, 193, 0.55);
  animation: dotBreathe 1.25s var(--ease) infinite both;
}

.veil__pulse i:nth-child(2) { animation-delay: 160ms; }
.veil__pulse i:nth-child(3) { animation-delay: 320ms; }

@keyframes dotBreathe {
  0%, 100% { opacity: 0.2; transform: translateY(0) scale(0.72); }
  40% { opacity: 1; transform: translateY(-4px) scale(1); }
}

.veil__text {
  font-size: var(--micro);
  letter-spacing: 0.24em;
  text-transform: lowercase;
  color: var(--fog);
}

/* --- right rail --------------------------------------------- */

.panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: linear-gradient(180deg, var(--ink-2), rgba(12, 14, 20, 0.35));
  overflow-y: auto;
}

.panel__block {
  padding: clamp(1.15rem, 2.2vw, 1.6rem) clamp(1.15rem, 2vw, 1.5rem);
  border-bottom: 1px solid var(--line);
}

.panel__block:last-child {
  border-bottom: 0;
}

/* The legend must never clip — a three-layer scene has to show all three.
   The revelation absorbs the overflow instead, since it can scroll gracefully. */
.panel__block--legend {
  flex: 0 0 auto;
}

.panel__block:first-child {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}

.panel__block:first-child::-webkit-scrollbar {
  display: none;
}

/* Set by the renderer when the revelation is taller than its box. */
.panel__block.is-scrollable {
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 2.2rem), transparent);
  mask-image: linear-gradient(180deg, #000 calc(100% - 2.2rem), transparent);
}

.panel__label {
  font-family: var(--mono);
  font-weight: 400;
  font-size: var(--micro);
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--fog);
  margin-bottom: 0.85rem;
}

.panel__revelation {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.15rem, 1.5vw, 1.3rem);
  line-height: 1.52;
  letter-spacing: 0.004em;
  color: var(--bright);
  text-wrap: pretty;
}

.panel__scale {
  font-size: 0.76rem;
  font-weight: 300;
  line-height: 1.72;
  color: var(--fog);
}

/* --- legend -------------------------------------------------- */

.legend {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.legend li {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  column-gap: 0.7rem;
  row-gap: 0.15rem;
  align-items: start;
}

.legend__dot {
  grid-column: 1;
  grid-row: 1;
  width: 7px;
  height: 7px;
  margin-top: 0.42em;
  border-radius: 50%;
  background: var(--c, var(--role-ghost));
  box-shadow:
    0 0 0 1px rgba(7, 8, 11, 0.6),
    0 0 9px var(--c, var(--role-ghost));
}

.legend b {
  grid-column: 2;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  color: var(--bright);
}

.legend span {
  grid-column: 2;
  font-family: var(--mono);
  font-weight: 300;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--fog);
}

/* --- console ------------------------------------------------- */

.console {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(0.9rem, 2vw, 1.6rem);
  padding: clamp(0.9rem, 1.8vw, 1.35rem) var(--pad);
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(12, 14, 20, 0.5), rgba(7, 8, 11, 0.9));
}

.console__label {
  font-size: var(--micro);
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--fog);
  white-space: nowrap;
}

.console__input {
  width: 100%;
  min-width: 0;
  padding: 0.55rem 0.1rem 0.6rem;
  font-family: var(--mono);
  font-weight: 300;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  color: var(--bright);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  transition: border-color 260ms var(--ease), box-shadow 260ms var(--ease);
}

.console__input::placeholder {
  color: var(--fog);
  opacity: 0.72;
  font-weight: 300;
}

.console__input:focus,
.console__input:focus-visible {
  outline: none;
  border-bottom-color: rgba(127, 212, 193, 0.7);
  box-shadow: 0 10px 24px -22px var(--role-primary), 0 1px 0 rgba(127, 212, 193, 0.25);
}

.console__go {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.62rem 1rem;
  font-size: var(--micro);
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--fog);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 220ms var(--ease), border-color 220ms var(--ease),
    background-color 220ms var(--ease);
}

.console__go svg {
  width: 1em;
  height: 1em;
  overflow: visible;
  transition: transform 220ms var(--ease);
}

.console__go:hover,
.console__go:focus-visible {
  color: var(--bright);
  border-color: rgba(226, 232, 240, 0.34);
  background: rgba(226, 232, 240, 0.03);
  outline: none;
}

.console__go:hover svg,
.console__go:focus-visible svg {
  transform: translateX(3px);
}

.console__go:focus-visible {
  box-shadow: 0 0 0 1px rgba(127, 212, 193, 0.45);
}

.console__go:disabled {
  opacity: 0.4;
  cursor: default;
}

/* --- suggestions --------------------------------------------- */

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 var(--pad) clamp(1rem, 2vw, 1.5rem);
}

.suggestions button {
  padding: 0.36rem 0.72rem;
  font-family: var(--mono);
  font-weight: 300;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--fog);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: color 200ms var(--ease), border-color 200ms var(--ease),
    background-color 200ms var(--ease);
}

.suggestions button:hover,
.suggestions button:focus-visible {
  color: var(--bright);
  border-color: rgba(226, 232, 240, 0.3);
  background: rgba(226, 232, 240, 0.035);
  outline: none;
}

.suggestions button:focus-visible {
  box-shadow: 0 0 0 1px rgba(127, 212, 193, 0.4);
}

/* --- error ---------------------------------------------------- */

.error {
  padding: 0 var(--pad) clamp(1rem, 2vw, 1.4rem);
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--role-warm);
}

.error[hidden] {
  display: none;
}

/* --- SVG scene primitives ------------------------------------- */

#layers,
#annotations {
  transition: opacity 420ms var(--ease);
}

.ly {
  fill: none;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  filter:
    drop-shadow(0 0 2px rgba(200, 226, 240, 0.22))
    drop-shadow(0 0 9px rgba(140, 200, 220, 0.12));
}

.ly * {
  vector-effect: non-scaling-stroke;
}

.ann {
  animation: annIn 620ms var(--ease) both;
  animation-delay: calc(var(--i, 0) * 90ms);
}

@keyframes annIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.ann__line {
  fill: none;
  stroke: rgba(226, 232, 240, 0.26);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

/* fill comes from the renderer as a presentation attribute (the layer colour),
   so no fill is declared here — a CSS fill would win and flatten them all */
.ann__dot {
  fill-opacity: 0.22;
  stroke: var(--bright);
  stroke-opacity: 0.75;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

/* Frosted instrument glass behind each label block: dark enough to hold mono
   type over moving line-art, sheer enough that the art still shows through.
   Sized by the renderer from the measured text box. */
.ann__plate {
  fill: rgba(7, 8, 11, 0.52);
  stroke: rgba(226, 232, 240, 0.06);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.ann__label {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.05em;
  fill: var(--bright);
}

/* Colour rule under the label, echoing .legend__dot. The fill is the layer
   colour, set inline, so the lit halo is the same neutral bloom .ly carries
   rather than a tint CSS would have to guess at. */
.ann__tick {
  rx: 0.75px;
  filter:
    drop-shadow(0 0 2px rgba(200, 226, 240, 0.30))
    drop-shadow(0 0 6px rgba(140, 200, 220, 0.20));
}

.ann__detail {
  font-family: var(--mono);
  font-weight: 300;
  font-size: 11px;
  letter-spacing: 0.03em;
  fill: var(--fog);
}

/* Ring drawn around the exact feature an annotation names, so the label points
   at a findable part rather than a coordinate. Stroke is the layer colour, set
   inline by the renderer — declaring one here would flatten them all. */
.ann__feature {
  fill: none;
  stroke-width: 1;
  stroke-opacity: 0.5;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 5px rgba(140, 200, 220, 0.18));
  transform-box: fill-box;
  transform-origin: center;
  animation: iv-halo 4.4s var(--ease) infinite both;
}

@keyframes iv-halo {
  0%, 100% { stroke-opacity: 0.34; transform: scale(0.97); }
  50% { stroke-opacity: 0.62; transform: scale(1.03); }
}

/* --- causal links --------------------------------------------- */
/* One connector per adjacent pair of layers: cause on the left, effect on the
   right. Colours arrive inline from the renderer, so only geometry, opacity
   and bloom are set here — matching the lit treatment .ly carries. */

.link {
  filter:
    drop-shadow(0 0 2px rgba(200, 226, 240, 0.20))
    drop-shadow(0 0 8px rgba(140, 200, 220, 0.11));
}

.link__path {
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-opacity: 0.7;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 5 7;
  animation: iv-march 1.9s linear infinite;
}

/* negative offset marches the dashes in the path's drawn direction —
   upstream to downstream — so the energy reads as travelling to the effect */
@keyframes iv-march {
  to { stroke-dashoffset: -12; }
}

.link__head {
  fill-opacity: 0.82;
  filter:
    drop-shadow(0 0 2px rgba(200, 226, 240, 0.30))
    drop-shadow(0 0 6px rgba(140, 200, 220, 0.18));
}

/* the relation word, sitting on the connector — an engineering annotation
   rather than a caption, so it stays quieter than .ann__label */
.link__label {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.16em;
  fill: var(--fog);
}

/* lighter cousin of .ann__plate: enough ground to keep the word legible where
   the connector crosses artwork, without reading as a second label block */
.link__plate {
  fill: rgba(7, 8, 11, 0.5);
  stroke: none;
}

/* scene swap */
.stage.is-entering #layers,
.stage.is-entering #annotations {
  opacity: 0;
  transition: opacity 140ms var(--ease);
}

/* --- page load orchestration ---------------------------------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.masthead,
.stage,
.panel,
.console,
.suggestions {
  animation: rise 540ms var(--ease) both;
}

.masthead { animation-delay: 0ms; }
.stage { animation-delay: 90ms; }
.panel { animation-delay: 180ms; }
.console { animation-delay: 260ms; }
.suggestions { animation-delay: 340ms; }

/* --- callouts (narrow screens) --------------------------------- */
/* The keyed list under the diagram. Each number matches a ring drawn on the
   canvas, so a label still points at a named part — the pointing is just done
   by a shared number instead of a leader line too small to follow. */

.callouts {
  display: none;
  list-style: none;
  margin: 0;
  padding: clamp(1rem, 4vw, 1.4rem) var(--pad);
  border-bottom: 1px solid var(--line);
  gap: 0.85rem;
}

.callouts li {
  display: grid;
  grid-template-columns: 1.55rem minmax(0, 1fr);
  align-items: baseline;
  column-gap: 0.7rem;
  row-gap: 0.15rem;
}

.callouts__n {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  background: var(--c, var(--role-primary));
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.72rem;
  font-style: normal;
  line-height: 1;
}

.callouts b {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--bright);
}

.callouts span {
  font-family: var(--mono);
  font-weight: 300;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--fog);
}

/* number badge drawn on the canvas, in stage coordinates */
.ann__badge {
  opacity: 0.95;
}

.ann__num {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 24px;
  fill: var(--ink);
}

/* --- responsive ----------------------------------------------- */

/* desktop: a fixed-height console — the rail scrolls, the page does not */
@media (min-width: 901px) {
  body {
    height: 100dvh;
  }
}

@media (max-width: 900px) {
  .stage-wrap {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Stacked, the stage is only as tall as the drawing plus its caption. The
     readout leaves the artwork entirely: at this width it covered most of the
     canvas and collided with the leader lines. */
  .stage {
    aspect-ratio: auto;
    height: auto;
    display: flex;
    flex-direction: column;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  #canvas {
    aspect-ratio: 1000 / 620;
    height: auto;
  }

  .readout {
    position: static;
    max-width: none;
    padding: clamp(1rem, 4vw, 1.5rem) var(--pad) 0;
  }

  /* the scrim exists to lift type off the artwork; off-canvas it is noise */
  .readout::before {
    display: none;
  }

  .readout__title {
    font-size: clamp(2rem, 9vw, 2.8rem);
  }

  .readout__standfirst {
    font-size: 0.82rem;
    max-width: 60ch;
  }

  .panel {
    overflow-y: visible;
  }

  .console {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 0.5rem;
  }

  .console__label {
    grid-column: 1 / -1;
  }
}

/* --- phones ---------------------------------------------------- */

@media (max-width: 700px) {
  .callouts {
    display: grid;
  }

  /* the relation word renders around 3.5px at this scale; the arrow still
     carries the direction, and the legend names the relation in full */
  .link__label {
    display: none;
  }

  /* the overlay is the whole screen here, so give it room to breathe */
  .veil {
    gap: 1.9rem;
  }

  .veil__pulse {
    gap: 0.75rem;
  }

  .veil__pulse i {
    width: 9px;
    height: 9px;
  }

  .veil__text {
    font-size: 0.78rem;
    letter-spacing: 0.2em;
    max-width: 20ch;
    text-align: center;
    line-height: 1.6;
  }

  /* the panel is the long tail on a phone — let the diagram and its keyed
     list come first, and keep the prose from filling the whole screen */
  .panel__revelation {
    font-size: 1.12rem;
    line-height: 1.5;
  }

  .panel__block {
    padding: 1.15rem var(--pad);
  }

  /* every control at least a finger wide */
  .suggestions {
    gap: 0.45rem;
  }

  .suggestions button {
    min-height: 44px;
    padding: 0.5rem 0.95rem;
    font-size: 0.74rem;
  }

  .console {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0.65rem;
  }

  .console__input {
    min-height: 44px;
    font-size: 16px; /* below 16px iOS zooms the page on focus */
  }

  .console__go {
    justify-content: center;
    min-height: 44px;
    width: 100%;
  }
}

@media (max-width: 560px) {
  .mark__word {
    font-size: 0.7rem;
  }

  .mark__word em {
    font-size: 1.15rem;
  }

  .masthead {
    flex-wrap: wrap;
    gap: 0.7rem;
  }
}

/* --- reduced motion -------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .masthead,
  .stage,
  .panel,
  .console,
  .suggestions,
  .ann,
  .veil {
    opacity: 1;
    transform: none;
  }

  .veil__pulse i {
    opacity: 1;
    transform: none;
  }

  .link__path {
    animation: none;
    stroke-dashoffset: 0;
  }

  .ann__feature {
    animation: none;
    stroke-opacity: 0.5;
    transform: none;
  }
}
