/* Dijkstra — Shortest Path Visualizer */

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

:root {
  --bg: #06070d;
  --bg-2: #080a14;
  --panel: #0a0c16;
  --ink: #e6ebff;
  --muted: #a8b1d6;
  --dim: #7f89b0;
  --accent: #00f0ff;
  --accent-soft: rgba(0, 240, 255, 0.12);
  --line: rgba(0, 240, 255, 0.14);
  --display: 'Chakra Petch', system-ui, sans-serif;
  --body: 'Sora', system-ui, sans-serif;
  /* Canvas "blueprint" surface */
  --canvas-bg: #eef3fb;
}

html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

a {
  color: var(--accent);
}
/* Links inside running text must not rely on color alone (WCAG). Standalone
   links (nav, buttons, export, legend) opt out via text-decoration:none. */
footer a,
.guide-lede a,
.subhead a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(0, 240, 255, 0.5);
}

.skip {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--bg);
  z-index: 100;
  border-radius: 2px;
}

/* ---------- Header ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem clamp(1.25rem, 4vw, 3rem);
  background: linear-gradient(
    to bottom,
    rgba(6, 7, 13, 0.92),
    rgba(6, 7, 13, 0.6)
  );
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.18em;
  font-size: 0.95rem;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
}
.logo-mark {
  width: 26px;
  height: 26px;
  color: var(--accent);
  filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.5));
}
nav {
  display: flex;
  gap: clamp(1rem, 2.5vw, 2rem);
  align-items: center;
}
nav a {
  font-family: var(--display);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding: 0.5rem 0.25rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
nav a:hover {
  color: var(--accent);
}
nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(1.5rem, 4vh, 2.5rem) clamp(1.25rem, 5vw, 5rem)
    clamp(1.25rem, 3vh, 2rem);
  background:
    radial-gradient(
      ellipse at 50% -10%,
      rgba(0, 240, 255, 0.1) 0%,
      transparent 55%
    ),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  border-bottom: 1px solid var(--line);
}
.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  background-position: center;
  mask-image: radial-gradient(ellipse at center, #000 15%, transparent 72%);
  -webkit-mask-image: radial-gradient(
    ellipse at center,
    #000 15%,
    transparent 72%
  );
  pointer-events: none;
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--display);
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 2px;
  background: var(--accent-soft);
  width: max-content;
}
.eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent);
}
h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.1rem, 3vw, 2.25rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: #fff;
  text-transform: uppercase;
  max-width: none;
  white-space: nowrap;
  margin-bottom: 0.75rem;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.5);
}
h1 .accent {
  color: var(--accent);
  text-shadow:
    0 0 30px rgba(0, 240, 255, 0.4),
    0 0 60px rgba(0, 240, 255, 0.2);
}
.subhead {
  font-size: clamp(0.95rem, 1.4vw, 1.15rem);
  color: var(--muted);
  max-width: 58ch;
  font-weight: 300;
  line-height: 1.6;
}

/* ---------- Stage (canvas + deck) ---------- */
.stage {
  position: relative;
  padding: clamp(1.25rem, 3vh, 2rem) clamp(1.25rem, 5vw, 5rem)
    clamp(1.5rem, 4vh, 2.5rem);
  background: var(--bg);
}
.section-eyebrow {
  display: block;
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}
/* Control bar above the canvas: two groups — preset/run/clear on the left,
   export + info on the right — split by space-between. Each group wraps as a
   unit, so when the bar runs out of room both groups stay left-aligned instead
   of one hugging each edge. The "// Live Canvas" heading sits below this bar. */
.stage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem 1.25rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.stage-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem 0.85rem;
}
/* Compact toolbar buttons (smaller than the panel defaults). */
.stage-toolbar .btn {
  min-height: 38px;
  padding: 0.5rem 0.9rem;
  font-size: 0.72rem;
}
.toolbar-preset {
  display: block;
}
.toolbar-preset .select {
  width: auto;
  min-width: 8.5rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
}
/* Right-hand toolbar group: export buttons + info. */
.stage-tools {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.stage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: start;
  max-width: 1300px;
  margin: 0 auto;
}
@media (max-width: 980px) {
  .stage-grid {
    grid-template-columns: 1fr;
  }
}
/* Left column: canvas with the distance/path panels stacked directly below,
   so the trace is visible without scrolling. */
.stage-main {
  display: grid;
  gap: 1.25rem;
  min-width: 0;
}

/* Canvas frame — bright blueprint readout inside dark chrome */
.canvas-frame {
  position: relative;
  padding: 14px;
  background: linear-gradient(180deg, var(--panel), #070812);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow:
    0 0 40px rgba(0, 240, 255, 0.06),
    inset 0 0 0 1px rgba(0, 240, 255, 0.04);
}
#canvas {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  background: var(--canvas-bg);
  background-image:
    linear-gradient(rgba(28, 71, 119, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 71, 119, 0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  border-radius: 2px;
  border: 1px solid rgba(0, 240, 255, 0.18);
}
.frame-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid var(--accent);
  z-index: 2;
  pointer-events: none;
  opacity: 0.7;
}
.frame-corner.tl {
  top: 4px;
  left: 4px;
  border-right: none;
  border-bottom: none;
}
.frame-corner.tr {
  top: 4px;
  right: 4px;
  border-left: none;
  border-bottom: none;
}
.frame-corner.bl {
  bottom: 4px;
  left: 4px;
  border-right: none;
  border-top: none;
}
.frame-corner.br {
  bottom: 4px;
  right: 4px;
  border-left: none;
  border-top: none;
}
.frame-tag {
  position: absolute;
  top: 20px;
  right: 22px;
  z-index: 2;
  font-family: var(--display);
  font-size: 0.6rem;
  letter-spacing: 0.28em;
  color: rgba(28, 71, 119, 0.75);
  pointer-events: none;
}

/* ---------- Deck / panels ---------- */
.deck {
  display: grid;
  gap: 1.25rem;
}
/* When the deck sits full-width below the canvas (stage-grid is single-column
   at <=980px) but there's still ample width, lay Graph Editor and Playback out
   as two side-by-side columns instead of stacking them full-width. */
@media (min-width: 700px) and (max-width: 980px) {
  .deck {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}
.panel {
  background: linear-gradient(180deg, var(--panel), #070812);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.25rem;
}
.panel-title {
  font-family: var(--display);
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.field {
  display: block;
  margin-bottom: 1rem;
}
.field-label {
  display: block;
  font-family: var(--display);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 0.5rem;
}
.select {
  width: 100%;
  font-family: var(--body);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.6rem 0.75rem;
}
.select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Text / number inputs (Graph Editor) */
.text-input {
  width: 100%;
  font-family: var(--body);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.6rem 0.75rem;
  min-height: 44px;
}
.text-input::placeholder {
  color: var(--dim);
}
.text-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.text-input[type='number']::-webkit-outer-spin-button,
.text-input[type='number']::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.edge-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 0.8fr;
  gap: 0.6rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.edge-fields .field {
  margin-bottom: 0.75rem;
}
.editor-error {
  color: #d9455a;
  font-size: 0.82rem;
  font-weight: 300;
  line-height: 1.4;
  margin-top: -0.4rem;
  margin-bottom: 0.6rem;
}
.editor-error:empty {
  display: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.75rem 1.1rem;
  min-height: 44px;
  border-radius: 2px;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
  box-shadow:
    0 0 24px rgba(0, 240, 255, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}
.btn-primary:hover {
  background: #5cf6ff;
  box-shadow: 0 0 34px rgba(0, 240, 255, 0.45);
}
.btn-primary:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
.btn-ghost {
  color: var(--ink);
  background: rgba(230, 235, 255, 0.04);
  border-color: rgba(230, 235, 255, 0.2);
}
.btn-ghost:hover {
  border-color: rgba(0, 240, 255, 0.5);
  color: var(--accent);
  background: var(--accent-soft);
}
.btn-ghost:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.btn-icon {
  color: var(--ink);
  background: rgba(0, 240, 255, 0.05);
  border-color: var(--line);
  min-width: 44px;
  padding: 0.75rem;
  font-size: 0.9rem;
}
.btn-icon:hover {
  border-color: rgba(0, 240, 255, 0.5);
  color: var(--accent);
}
.btn-icon:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-row {
  display: flex;
  gap: 0.6rem;
}
.btn-row .btn-primary {
  flex: 1;
}
.btn-full {
  width: 100%;
  margin-bottom: 1.1rem;
}

/* Inline Lucide icons inside buttons/links. Sized to the surrounding text and
   colored via currentColor so they inherit hover/focus states. */
.ico {
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
  display: block;
}
.btn-icon .ico {
  width: 1.2rem;
  height: 1.2rem;
}

/* Export toolbar (top of canvas): label + buttons in a horizontal row. */
.export {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.export-label {
  font-family: var(--display);
  font-size: 0.62rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--dim);
}
.export-btns {
  display: flex;
  gap: 0.5rem;
}
.btn-export {
  color: var(--muted);
  background: rgba(0, 240, 255, 0.05);
  border-color: var(--line);
  font-size: 0.72rem;
  padding: 0.5rem 0.6rem;
  min-height: 40px;
}
.btn-export:hover {
  color: var(--accent);
  border-color: rgba(0, 240, 255, 0.5);
  background: var(--accent-soft);
}
.btn-export:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- Playback ---------- */
.player-controls {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
}
.player-controls .btn-primary {
  flex: 1;
}
input[type='range'] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}
#narration {
  background: rgba(0, 240, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.9rem;
  min-height: 5.5rem;
  margin-bottom: 1rem;
}
#narration:empty {
  display: none;
}
.step-counter {
  font-family: var(--display);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.step-text {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink);
  font-weight: 300;
}
.hint {
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 300;
}

.legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  font-family: var(--display);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.swatch {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
}
.swatch.current {
  background: #dd6e42;
  box-shadow: 0 0 8px rgba(221, 110, 66, 0.6);
}
.swatch.visited {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
}
.swatch.frontier {
  background: #7f8c8d;
}
.swatch.relax {
  background: #33f0a5;
  box-shadow: 0 0 8px rgba(51, 240, 165, 0.5);
}

/* ---------- Result table ---------- */
.panel-result:empty {
  display: none;
}
.content-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
}
.content-table thead tr {
  background: var(--accent-soft);
}
.content-table th {
  font-family: var(--display);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  text-align: left;
  padding: 0.6rem 0.75rem;
}
.content-table td {
  padding: 0.55rem 0.75rem;
  color: var(--muted);
  font-weight: 300;
  border-bottom: 1px solid rgba(230, 235, 255, 0.06);
}
.content-table tbody tr.active-row td {
  color: #fff;
  font-weight: 500;
  background: rgba(221, 110, 66, 0.08);
}
.content-table tbody tr.clickable {
  cursor: pointer;
}
.content-table tbody tr.clickable:hover td,
.content-table tbody tr.clickable:focus-visible td {
  color: #fff;
  background: var(--accent-soft);
}
.content-table tbody tr.clickable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* ---------- Shortest-path result ---------- */
.panel-path:empty {
  display: none;
}
.path-hint {
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.5;
}
.path-title {
  font-family: var(--display);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
}
.path-route {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.path-node {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  font-family: var(--display);
  font-weight: 500;
  font-size: 0.95rem;
  color: #fff;
  background: rgba(221, 110, 66, 0.14);
  border: 1px solid rgba(221, 110, 66, 0.5);
  border-radius: 2px;
}
.path-arrow {
  color: #dd6e42;
  font-size: 1rem;
}
.path-distance {
  font-family: var(--display);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}
.path-distance strong {
  color: var(--accent);
  font-size: 1.1rem;
  margin-left: 0.4rem;
}
.path-none {
  font-size: 0.9rem;
  font-weight: 300;
  color: #dd6e42;
}

/* ---------- Instructions ---------- */
/* ---------- Info button ---------- */
.info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--accent);
  border: 1px solid rgba(0, 240, 255, 0.35);
  background: var(--accent-soft);
  text-decoration: none;
}
.info-btn svg {
  width: 18px;
  height: 18px;
}
.info-btn:hover {
  color: var(--accent);
  border-color: rgba(0, 240, 255, 0.5);
}
.info-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- Field Manual modal (CSS-only, :target driven) ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.modal:target {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 5, 10, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  max-height: 85vh;
  overflow-y: auto;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  background: linear-gradient(180deg, var(--panel), #070812);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 4px;
  box-shadow: 0 0 60px rgba(0, 240, 255, 0.12);
  transform: translateY(12px);
}
.modal:target .modal-panel {
  transform: translateY(0);
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.modal-head h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  text-transform: uppercase;
  letter-spacing: -0.005em;
  color: #fff;
  text-align: left;
}
.modal-close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 2px;
  text-decoration: none;
}
.modal-close .ico {
  width: 18px;
  height: 18px;
}
.modal-close:hover {
  color: var(--accent);
  border-color: rgba(0, 240, 255, 0.5);
}
.modal-close:focus-visible,
.modal-backdrop:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.guide-lede {
  color: var(--muted);
  font-weight: 300;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}
.guide-lede strong {
  color: var(--accent);
  font-weight: 500;
}
.guide-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.guide-list li {
  background: var(--panel);
  padding: 0.9rem 1.1rem;
  color: var(--muted);
  font-weight: 300;
  font-size: 0.92rem;
  line-height: 1.45;
}
.guide-list .k {
  display: block;
  font-family: var(--display);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 0.3rem;
}

/* ---------- Footer ---------- */
footer {
  padding: 2rem clamp(1.25rem, 5vw, 5rem);
  border-top: 1px solid var(--line);
  font-family: var(--display);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg);
}
footer a {
  color: var(--muted);
}
footer a:hover {
  color: var(--accent);
}
footer a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.error {
  display: block;
  color: #d9455a;
  line-height: 1.6;
  padding: 2rem;
  text-align: center;
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .btn,
  nav a,
  footer a,
  .select,
  .text-input {
    transition:
      color 0.25s ease,
      background 0.25s ease,
      border-color 0.25s ease,
      box-shadow 0.25s ease;
  }
  @keyframes pulse {
    0%,
    100% {
      opacity: 1;
    }
    50% {
      opacity: 0.4;
    }
  }
  .eyebrow::before {
    animation: pulse 2.4s ease-in-out infinite;
  }
  .modal {
    transition:
      opacity 0.22s ease,
      visibility 0.22s;
  }
  .modal-panel {
    transition: transform 0.22s ease;
  }
}

/* Prevent the page behind the modal from scrolling while it's open. */
body:has(.modal:target) {
  overflow: hidden;
}

@media (max-width: 768px) {
  footer {
    flex-direction: column;
    gap: 0.6rem;
  }
}
