/* Fieldcraft — training edition
   Field notebook and survey map: cool squared paper, survey blue, marker yellow.
   Type: Lexend (headings, numbers) + Atkinson Hyperlegible (reading). */

:root {
  color-scheme: light;
  --paper: #f1f5f3;
  --surface: #ffffff;
  --ink: #17222d;
  --muted: #55636e;
  --blue: #2441a6;
  --blue-deep: #172d78;
  --yellow: #ffc21a;
  --moss: #2e7d57;
  --red: #b3372b;
  --grid: #d6e1e2;
  --display: 'Lexend', 'Segoe UI', Arial, sans-serif;
  --body: 'Atkinson Hyperlegible', 'Segoe UI', Arial, sans-serif;
  --measure: 64ch;

  --arx-popup-bg: var(--surface);
  --arx-popup-radius: 6px;
  --arx-popup-max-width: 32rem;
  --arx-popup-padding: 1.75rem 1.9rem;
  --arx-popup-backdrop: rgba(23, 34, 45, .55);

  --arx-sequencer-gap: 1rem;
  --arx-sequence-step-radius: 6px;
  --arx-sequence-step-border-color: var(--grid);
  --arx-sequence-step-padding: 1.4rem 1.5rem;
  --arx-sequence-step-bg: var(--surface);
  --arx-sequence-step-completed-border-color: var(--moss);
  --arx-sequencer-control-bg: var(--yellow);
  --arx-sequencer-control-border: var(--yellow);
  --arx-sequencer-control-color: var(--ink);
  --arx-sequencer-control-completed-bg: #e3f1e9;
  --arx-sequencer-control-completed-color: var(--moss);
  --arx-sequencer-return-bg: var(--surface);
  --arx-sequencer-return-border: var(--blue);
  --arx-sequencer-return-color: var(--blue);
}

/* First-paint guard (see arx-cloak). */
arx-cloak:not(:defined) { display: block; opacity: 0; animation: first-paint-failsafe 0s linear 4s forwards; }
@keyframes first-paint-failsafe { to { opacity: 1; } }

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.65 var(--body); }
arx-magazine-switcher {
  display: block;
  --arx-magazine-switcher-gutter-width: clamp(40px, 5vw, 60px);
  --arx-magazine-switcher-viewport-height: 100dvh;
  --arx-magazine-switcher-view-bg: var(--paper);
  --arx-magazine-switcher-gutter-crease: var(--grid);
  --arx-magazine-switcher-tab-bg: var(--yellow);
  --arx-magazine-switcher-tab-color: var(--ink);
  --arx-magazine-switcher-focus-color: var(--blue);
}
/* Side rail: compact tab and titles so they sit inside the spine. */
arx-magazine-switcher::part(back-tab) { font: 600 .8rem/1 var(--display); letter-spacing: .02em; padding: .9rem .55rem; border-radius: 0 5px 5px 0;
  /* Second, unshifted shadow fills the 2px the offset leaves bare where the tab meets the screen edge. */
  box-shadow: 2px 3px 0 var(--ink), 0 3px 0 var(--ink); }
arx-magazine-switcher::part(titles) { font: 400 .8rem/1 var(--body); padding: 1rem .5rem; }
arx-magazine-switcher::part(article-title) { color: var(--ink); font-weight: 700; }
arx-magazine-switcher::part(document-title) { color: var(--muted); }
button { font: inherit; cursor: pointer; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.skip-link { position: fixed; z-index: 100; top: -5rem; left: 1rem; background: var(--surface); padding: .7rem 1rem; }
.skip-link:focus { top: 1rem; }

/* ── Cover ─────────────────────────────────────────── */
.cover-intro {
  --arx-magazine-intro-pad: clamp(1.5rem, 5vw, 4.5rem);
  color: #fff;
}
.cover-intro [slot='title'] { font: 700 clamp(3.6rem, 11vw, 9.5rem)/.9 var(--display); letter-spacing: -.045em; margin: 0; }
.cover-intro [slot='standfirst'] { font: 400 clamp(1.25rem, 2.4vw, 1.9rem)/1.3 var(--display); margin: 1rem 0 0; max-width: 22ch; }
.cover-publisher { font: 600 1rem/1 var(--display); margin: 0; display: inline-flex; align-items: center; gap: .6rem; }
.cover-publisher::before { content: ''; width: .85rem; height: .85rem; border-radius: 50%; background: var(--yellow); }
.cover-byline { font: 400 .95rem/1.4 var(--body); opacity: .85; margin: 0; }

/* ── Contents: the route ───────────────────────────── */
.contents {
  min-height: 100svh;
  padding: clamp(4rem, 9vw, 8rem) clamp(1.25rem, 6vw, 6rem);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
}
.contents-inner { max-width: 58rem; margin: 0 auto; }
.contents-title { font: 700 clamp(2.8rem, 6vw, 5rem)/1 var(--display); letter-spacing: -.035em; margin: 0 0 1.2rem; color: var(--blue-deep); }
.contents-intro { max-width: 46ch; font-size: 1.2rem; margin-bottom: 3.5rem; }
.contents-intro p { margin: 0 0 .9rem; }

.chapter-list { list-style: none; margin: 0; padding: 0; position: relative; counter-reset: stop; }
.chapter-list::before {
  content: ''; position: absolute; left: 27px; top: 2rem; bottom: 2rem;
  border-left: 3px dashed var(--blue);
}
.chapter-list li { counter-increment: stop; position: relative; padding-left: 84px; margin-bottom: 1.75rem; }
.chapter-list li::before {
  content: counter(stop); position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 58px; height: 58px; border-radius: 50%; background: var(--yellow); color: var(--ink);
  border: 3px solid var(--paper); box-shadow: 0 0 0 3px var(--blue);
  display: grid; place-items: center; font: 700 1.5rem/1 var(--display); z-index: 1;
}
.chapter-card {
  width: 100%; display: grid; grid-template-columns: 200px 1fr; align-items: stretch;
  border: 2px solid var(--ink); background: var(--surface); color: var(--ink); text-align: left; padding: 0;
  border-radius: 6px; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease;
}
.chapter-card:hover, .chapter-card:focus-visible { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--blue); }
.card-art img { width: 100%; height: 100%; min-height: 150px; object-fit: cover; display: block; }
.card-copy { padding: 1.3rem 1.5rem; display: grid; gap: .35rem; align-content: center; }
.card-number { font: 600 .9rem/1 var(--display); color: var(--blue); }
.chapter-card strong { font: 700 1.6rem/1.15 var(--display); letter-spacing: -.02em; }
.card-text { color: var(--muted); }

.site-footer { padding: 2rem clamp(1.25rem, 6vw, 6rem) 3rem; background: var(--ink); color: #c9d3d8; font-size: .9rem; }
.site-footer p { max-width: 70ch; margin: 0; }

/* ── Chapters ──────────────────────────────────────── */
.chapter-intro { --arx-magazine-intro-pad: clamp(1.5rem, 5vw, 4.5rem); color: #fff; }
.chapter-intro [slot='title'] { font: 700 clamp(3rem, 8vw, 7rem)/.95 var(--display); letter-spacing: -.04em; margin: 0; }
.chapter-intro [slot='standfirst'] { font: 400 clamp(1.15rem, 2vw, 1.6rem)/1.35 var(--display); max-width: 28ch; margin: .8rem 0 0; }
.intro-eyebrow { font: 600 1rem/1 var(--display); margin: 0; color: var(--yellow); }

.prose { max-width: var(--measure); margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 2rem); }
.chapter > .prose:first-of-type { padding-top: clamp(3rem, 7vw, 6rem); }
.prose p, .prose li { font-size: 1.125rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin: .35rem 0; }
.prose li::marker { color: var(--blue); }
.section-title { font: 600 clamp(1.7rem, 3vw, 2.3rem)/1.15 var(--display); letter-spacing: -.02em; margin: 3.5rem 0 1rem; color: var(--blue-deep); }

.term {
  border: 0; background: none; padding: 0; color: var(--blue); font: inherit; font-weight: 700;
  text-decoration: underline dotted 2px; text-underline-offset: 4px;
}
.term:hover { background: color-mix(in srgb, var(--yellow) 45%, transparent); }

.pull-quote { margin: 3rem 0; }
.pull-quote blockquote { margin: 0; }
.pull-quote p {
  font: 600 clamp(1.5rem, 2.8vw, 2.1rem)/1.3 var(--display) !important; letter-spacing: -.02em; margin: 0;
}
.pull-quote p { background: linear-gradient(transparent 58%, color-mix(in srgb, var(--yellow) 70%, transparent) 58%); display: inline; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

.note { margin: 2rem 0; padding: 1rem 1.25rem; border-left: 4px solid var(--blue); background: #e5ecf7; }
.note p { margin: 0; font-size: 1rem !important; }

/* Knowledge check */
.check { margin: 3rem 0; padding: 1.6rem; border: 2px solid var(--ink); border-radius: 6px; background: var(--surface); }
.check-question { font: 600 1.35rem/1.3 var(--display); margin: 0 0 1.1rem; }
.answers { list-style: none; padding: 0 !important; margin: 0; display: grid; gap: .6rem; }
.answers li { margin: 0 !important; }
.answer {
  width: 100%; text-align: left; padding: .9rem 1.1rem; border: 2px solid var(--grid); border-radius: 6px;
  background: var(--paper); color: var(--ink); font-size: 1.05rem;
}
.answer:hover, .answer:focus-visible { border-color: var(--blue); background: #fff8e1; }

/* Pop-outs */
.popout-title { font: 600 1.4rem/1.2 var(--display); margin: 0 0 .6rem; color: var(--blue-deep); }
.popout p { margin: 0 0 .7rem; }
.verdict { font: 700 1.3rem/1.2 var(--display); }
.popout--right .verdict { color: var(--moss); }
.popout--wrong .verdict { color: var(--red); }

/* Step sequence */
.steps { margin: 3rem 0; }
.steps-title { font: 600 1.35rem/1.3 var(--display); margin: 0 0 1rem; }

/* Key figures */
.figures { background: var(--blue-deep); color: #fff; padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1.25rem, 6vw, 6rem); margin: 3.5rem 0; }
.figures-title { font: 600 1.3rem/1.2 var(--display); margin: 0 auto 1.5rem; max-width: 64rem; }
.figures dl { margin: 0 auto; max-width: 64rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 2rem; }
.figures dt { font: 700 clamp(3.5rem, 8vw, 6rem)/1 var(--display); color: var(--yellow); letter-spacing: -.04em; }
.figures dd { margin: .4rem 0 0; font-size: 1.1rem; max-width: 22ch; }

/* Chapter navigation */
.chapter-nav {
  max-width: 64rem; margin: 5rem auto 0; padding: 2rem clamp(1.25rem, 4vw, 2rem) 4rem;
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; border-top: 2px solid var(--ink);
}
.chapter-nav button { border: 0; background: none; color: var(--ink); text-align: left; padding: .5rem 0; display: grid; gap: .2rem; }
.chapter-nav span { font: 600 .85rem/1 var(--display); color: var(--blue); }
.chapter-nav strong { font: 700 1.25rem/1.2 var(--display); }
.nav-next { justify-self: end; text-align: right !important; }
.nav-home { border: 2px solid var(--ink) !important; border-radius: 999px; padding: .6rem 1.2rem !important; font: 600 .95rem/1 var(--display); background: var(--yellow) !important; }

@media (max-width: 720px) {
  .chapter-card { grid-template-columns: 1fr; }
  .card-art img { min-height: 130px; max-height: 160px; }
  .chapter-list li { padding-left: 64px; }
  .chapter-list li::before { width: 44px; height: 44px; font-size: 1.15rem; top: 1.5rem; transform: none; }
  .chapter-list::before { left: 20px; }
  .chapter-nav { grid-template-columns: 1fr 1fr; }
  .nav-home { grid-column: 1 / -1; grid-row: 1; justify-self: center; }
}

@media (prefers-reduced-motion: reduce) {
  .chapter-card { transition: none; }
}

/* ── Contents: reference stop (after the route) ────── */
.reference-stop { margin: 3rem 0 0; padding: 2.25rem 0 0 84px; border-top: 3px dashed var(--blue); }
.reference-card {
  width: 100%; display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: .5rem;
  border: 2px solid var(--ink); background: var(--ink); color: #fff; text-align: left; padding: 1.1rem 1.4rem 1.1rem 1.2rem;
  border-radius: 6px; transition: transform .2s ease, box-shadow .2s ease;
}
.reference-card:hover, .reference-card:focus-visible { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--yellow); }
.reference-icon { width: 72px; height: 72px; border-radius: 50%; background: var(--yellow); display: grid; place-items: center; }
.reference-icon svg { width: 34px; height: 34px; fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; }
.reference-card .card-number { color: var(--yellow); }
.reference-card strong { font: 700 1.6rem/1.15 var(--display); letter-spacing: -.02em; }
.reference-card .card-text { color: #c9d3d8; }
.reference-tags { font: 600 .85rem/1 var(--display); color: #fff; opacity: .8; margin-top: .3rem; }

/* ── Checklist ─────────────────────────────────────── */
.checklist { margin: 2.5rem 0; padding: 1.5rem 1.6rem; background: var(--surface); border: 2px solid var(--ink); border-radius: 6px; }
.checklist-title { font: 600 1.35rem/1.3 var(--display); margin: 0 0 1rem; }
.checklist ul { list-style: none; padding: 0 !important; margin: 0; display: grid; gap: .25rem; }
.checklist li { margin: 0 !important; }
.checklist label { display: grid; grid-template-columns: 1.6rem 1fr; gap: .8rem; align-items: start; padding: .5rem 0; cursor: pointer; }
.checklist input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.checklist label::before {
  content: ''; width: 1.6rem; height: 1.6rem; border: 2px solid var(--ink); border-radius: 5px; background: var(--paper);
  margin-top: .1rem; transition: background-color .15s ease, border-color .15s ease;
}
.checklist input:checked + label::before {
  background: var(--moss) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 12.5 4 4 8-9' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 80% no-repeat;
  border-color: var(--moss);
}
.checklist input:checked + label { color: var(--muted); }
.checklist input:focus-visible + label::before { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ── Instruction sequence (swipe cards) ────────────── */
.sequence { margin: 3rem 0; --seq-card: min(84%, 30rem); }
.sequence-kicker { font: 600 .85rem/1 var(--display); color: var(--blue); margin: 0 0 .5rem; text-transform: uppercase; letter-spacing: .08em; }
.sequence-title { font: 600 1.45rem/1.25 var(--display); margin: 0 0 1rem; letter-spacing: -.01em; }
.sequence-progress { list-style: none; padding: 0 !important; margin: 0 0 1.1rem; display: flex; gap: 5px; }
.sequence-progress li { flex: 1; height: 6px; margin: 0 !important; border-radius: 3px; background: var(--grid); overflow: hidden; position: relative; }
.sequence-progress li::after { content: ''; position: absolute; inset: 0; background: var(--blue); transform: scaleX(0); transform-origin: left; transition: transform .45s cubic-bezier(.2, .7, .2, 1); }
.sequence-progress li.is-done::after { transform: scaleX(1); }
.sequence-progress li.is-current::after { transform: scaleX(1); background: var(--yellow); }
.sequence.is-complete .sequence-progress li::after { background: var(--moss); transform: scaleX(1); }

.sequence-track {
  /* A small left gutter (pulled back out with the negative margin) so the active card's border,
     shadow and focus ring are never shaved off when snapping lands on a fractional position. */
  --seq-gutter: 10px;
  list-style: none; margin: 0 calc(-1 * clamp(1.25rem, 4vw, 2rem)) 0 calc(-1 * var(--seq-gutter));
  padding: .5rem 0 1rem var(--seq-gutter) !important;
  display: flex; gap: 1rem; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-left: var(--seq-gutter); scrollbar-width: none; outline: none;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 4rem), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 4rem), transparent);
}
/* Room after the last card, so the completion card can line up with the start edge like the others. */
.sequence-track::after { content: ''; flex: 0 0 calc(100% - var(--seq-card) - 1rem); }
.sequence-track:focus-visible .sequence-card.is-active { outline: 3px solid var(--blue); outline-offset: 4px; }
.sequence-track::-webkit-scrollbar { display: none; }
.sequence-card {
  flex: 0 0 var(--seq-card); margin: 0 !important; scroll-snap-align: start; scroll-snap-stop: always;
  background: var(--surface); border: 2px solid var(--ink); border-radius: 8px; overflow: hidden;
  display: flex; flex-direction: column;
  transition: opacity .35s ease, transform .35s ease, box-shadow .35s ease;
  opacity: .42; transform: scale(.965);
}
.sequence-card.is-active { opacity: 1; transform: none; box-shadow: 6px 6px 0 var(--blue); }
.sequence-art {
  aspect-ratio: 16 / 10; display: grid; place-items: center; border-bottom: 2px solid var(--ink);
  background-color: #fbfcfc;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 20px 20px; background-position: -1px -1px;
}
.sequence-art img { width: 86%; height: auto; display: block; }
.sequence-copy { padding: 1.1rem 1.3rem 1.4rem; }
.sequence-count { font: 600 .9rem/1 var(--display); color: var(--muted); margin: 0 0 .6rem !important; }
.sequence-count span { font: 700 2.1rem/1 var(--display); color: var(--blue); letter-spacing: -.03em; margin-right: .1rem; vertical-align: -.2rem; }
.sequence-copy h4 { font: 700 1.3rem/1.2 var(--display); margin: 0 0 .45rem; letter-spacing: -.01em; }
.sequence-copy p:not(.sequence-count) { margin: 0; font-size: 1.05rem !important; line-height: 1.55; }

.sequence-card--done { background: var(--ink); color: #fff; justify-content: center; }
.sequence-done { padding: 2rem 1.6rem; display: grid; justify-items: start; gap: .6rem; }
.sequence-done h4 { font: 700 1.6rem/1.15 var(--display); margin: .4rem 0 0; }
.sequence-done p { margin: 0 0 .6rem; color: #c9d3d8; font-size: 1.05rem !important; }
.sequence-tick { width: 64px; height: 64px; border-radius: 50%; background: var(--moss); display: grid; place-items: center; }
.sequence-tick::after { content: ''; width: 26px; height: 14px; border: solid #fff; border-width: 0 0 4px 4px; transform: translateY(-3px) rotate(-45deg); }
.sequence-card--done.is-active .sequence-tick { animation: tick-in .5s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes tick-in { from { transform: scale(.4); opacity: 0; } }
.sequence-again { border: 2px solid var(--yellow); background: none; color: var(--yellow); border-radius: 999px; padding: .55rem 1.1rem; font: 600 .95rem/1 var(--display); }
.sequence-again:hover { background: var(--yellow); color: var(--ink); }
.sequence-card--done.is-active { box-shadow: 6px 6px 0 var(--moss); }

.sequence-controls { display: flex; align-items: center; gap: 1rem; margin-top: .4rem; }
.sequence-status { flex: 1; margin: 0; white-space: nowrap; font: 600 .95rem/1.2 var(--display); color: var(--muted); }
.sequence-controls button {
  border: 2px solid var(--ink); border-radius: 999px; background: var(--surface); color: var(--ink);
  min-width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: 600 1rem/1 var(--display); padding: 0 1rem; transition: background-color .15s ease, opacity .15s ease;
}
.sequence-next { background: var(--yellow) !important; }
.sequence-controls button:hover:not(:disabled) { background: #fff8e1; }
.sequence-controls button:disabled { opacity: .3; cursor: default; }
.sequence-prev { order: -1; }

/* ── Search ────────────────────────────────────────── */
.search-launch {
  position: fixed; z-index: 60; top: max(14px, env(safe-area-inset-top)); right: 14px;
  display: inline-flex; align-items: center; gap: .45rem; height: 44px; padding: 0 1rem 0 .8rem;
  border: 2px solid var(--ink); border-radius: 999px; background: var(--yellow); color: var(--ink);
  font: 600 .95rem/1 var(--display); box-shadow: 2px 3px 0 var(--ink); transition: transform .15s ease, box-shadow .15s ease;
}
.search-launch:hover { transform: translate(-1px, -1px); box-shadow: 3px 4px 0 var(--ink); }
.search-launch svg, .search-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; flex: none; }

.search-popup { --arx-popup-max-width: 40rem; --arx-popup-padding: 1.5rem 1.5rem 1.25rem; }
.edition-search { position: relative; }
.search-label { display: block; font: 600 1.3rem/1.2 var(--display); color: var(--blue-deep); margin: 0 0 .8rem; }
.edition-search--inline .search-label { font-size: 1rem; color: var(--ink); margin-bottom: .5rem; }
.search-field { position: relative; }
.search-field .search-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--blue); pointer-events: none; }
.search-field input {
  width: 100%; height: 56px; padding: 0 1rem 0 3rem; border: 2px solid var(--ink); border-radius: 8px;
  background: var(--surface); color: var(--ink); font: 400 1.1rem/1 var(--body); -webkit-appearance: none; appearance: none;
}
.search-field input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 22%, transparent); }
.search-status:empty { display: none; }
.search-status { margin: .6rem 0 .4rem; font: 600 .85rem/1.3 var(--display); color: var(--muted); }
.search-results { list-style: none; padding: 0 !important; margin: 0; display: grid; gap: .45rem; }
.search-popup .search-results { max-height: min(55vh, 30rem); overflow-y: auto; overscroll-behavior: contain; padding-right: .25rem !important; }
.search-results li { margin: 0 !important; }
.search-result {
  display: grid; gap: .25rem; padding: .8rem 1rem; border: 2px solid var(--grid); border-radius: 8px; background: var(--surface);
  cursor: pointer; transition: border-color .12s ease, background-color .12s ease;
}
.search-result[aria-selected='true'], .search-result:hover { border-color: var(--blue); background: #f6f8fe; }
.search-crumb { font: 600 .78rem/1.2 var(--display); color: var(--blue); text-transform: uppercase; letter-spacing: .05em; }
.search-crumb .search-kind { display: inline-block; margin-right: .4rem; padding: .15rem .4rem; border-radius: 3px; background: var(--yellow); color: var(--ink); }
.search-title { font: 600 1.08rem/1.3 var(--display); color: var(--ink); }
.search-snippet { font-size: .97rem; line-height: 1.5; color: var(--muted); }
.search-results mark { background: color-mix(in srgb, var(--yellow) 70%, transparent); color: inherit; padding: 0 .1em; border-radius: 2px; }

/* Arrival highlight: where a search result or glossary link lands. */
[id] { scroll-margin-top: 5rem; }
.is-found { animation: found 2.4s ease-out; border-radius: 6px; }
@keyframes found { 0%, 35% { background-color: color-mix(in srgb, var(--yellow) 55%, transparent); box-shadow: 0 0 0 8px color-mix(in srgb, var(--yellow) 55%, transparent); } 100% { background-color: transparent; box-shadow: 0 0 0 8px transparent; } }

/* ── Pop-out → glossary link ───────────────────────── */
.popout-more { margin-top: .4rem; border: 0; background: none; padding: 0; color: var(--blue); font: 600 .95rem/1.3 var(--display); text-decoration: underline; text-underline-offset: 3px; }

/* ── Reference page: glossary ──────────────────────── */
.chapter--field-reference .edition-search--inline { margin: 2rem 0 0; padding: 1.4rem; background: var(--surface); border: 2px solid var(--ink); border-radius: 8px; box-shadow: 6px 6px 0 var(--blue); }
.glossary { padding: 1rem 0 0; }
.glossary-inner { max-width: var(--measure); margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 2rem); }
.glossary-letters { position: sticky; top: 0; z-index: 5; background: var(--paper); padding: .75rem 0; margin-bottom: 1rem; border-bottom: 2px solid var(--ink); }
.glossary-letters ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.glossary-letters button { width: 2.4rem; height: 2.4rem; border: 2px solid var(--ink); border-radius: 6px; background: var(--surface); font: 700 1rem/1 var(--display); color: var(--ink); }
.glossary-letters button:hover { background: var(--yellow); }
.glossary-group { display: grid; grid-template-columns: 3.5rem 1fr; gap: 0 1rem; padding: 1.2rem 0; border-bottom: 1px solid var(--grid); }
.glossary-letter { font: 700 2.4rem/1 var(--display); color: var(--blue); margin: .2rem 0 0; }
.glossary-group dl { margin: 0; display: grid; gap: 1.1rem; }
.glossary-entry { padding: .35rem .5rem; margin: 0 -.5rem; }
.glossary-entry:focus { outline: none; }
.glossary-entry dt { font: 700 1.15rem/1.3 var(--display); color: var(--ink); }
.glossary-entry dd { margin: .2rem 0 0; font-size: 1.05rem; }

@media (max-width: 720px) {
  .search-launch span { display: none; }
  .search-launch { width: 44px; padding: 0; justify-content: center; }
  .reference-stop { padding-left: 0; }
  .reference-card { grid-template-columns: 1fr; }
  .reference-icon { width: 56px; height: 56px; }
  .sequence { --seq-card: 86%; }
  .glossary-group { grid-template-columns: 2.4rem 1fr; }
  .glossary-letter { font-size: 1.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .reference-card, .sequence-card, .sequence-progress li::after { transition: none; }
  .is-found, .sequence-card--done.is-active .sequence-tick { animation: none; }
  .is-found { outline: 3px solid var(--yellow); }
}
