/* ============================================================
   site.css — the Mimir showcase chrome.

   Written for THIS property, not from a template. It reuses Scry's
   own token system (assets/scry/tokens.css) wholesale — the same
   deep-water surfaces, the same luminous accents, the same 4px
   spacing scale and halved radii — so the frame around a component
   is made of the same material as the component.

   The one idea driving every decision here: DEPTH IS AGE. It is the
   rule the Constellation and the Stats depth column both encode, so
   the site that documents them encodes it too. Sections sink as you
   scroll: strata rules thicken, the surround darkens toward
   --bg-deep, and every section carries a mono depth marker.

   Load order on a chrome page:
     scry.css  (the product's real CSS, verbatim)
     site.css  (this file — overrides the app-shell rules that
                assume a fixed, non-scrolling viewport)
   ============================================================ */

/* ---------- undo the app-shell viewport lock ----------
   global.css locks html/body to 100% with overflow:hidden because
   Scry is a fixed shell that never scrolls. A document site does.
   These four rules are the entire delta.                          */
html,
body {
  height: auto;
  min-height: 100%;
}
body {
  overflow-x: hidden;
  overflow-y: auto;
}

/* ================= the well surround ================= */
#well {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.surround {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(120% 70% at 50% -12%, var(--accent-soft), transparent 58%),
    radial-gradient(90% 60% at 50% 112%, rgba(7, 8, 12, 0.96), transparent 55%);
}

/* strata: horizontal sediment rules, denser toward the bottom */
.surround::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    180deg,
    rgba(42, 50, 68, 0.22) 0 1px,
    transparent 1px 96px
  );
  mask-image: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.7) 70%, rgba(0, 0, 0, 0.95));
  -webkit-mask-image: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.7) 70%, rgba(0, 0, 0, 0.95));
}

.wrap {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--s5) var(--s9);
}

/* ================= masthead ================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: var(--s4);
  padding: var(--s3) var(--s5);
  background: linear-gradient(180deg, rgba(12, 14, 19, 0.94), rgba(12, 14, 19, 0.72));
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.nav .mark {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--t-md);
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.nav .mark svg {
  color: var(--accent);
  filter: drop-shadow(0 0 10px var(--accent-glow));
}
.nav .mark em {
  font-style: normal;
  color: var(--muted);
  font-weight: 400;
}
.navlinks {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  min-width: 0;
}
.navlinks a {
  padding: 5px 10px;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: var(--t-sm);
  white-space: nowrap;
  transition: color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.navlinks a:hover {
  color: var(--ink);
  background: var(--hover-wash);
}
.navlinks a.on {
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}
.verbadge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.06em;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 3px 10px;
  white-space: nowrap;
}
.verbadge b {
  color: var(--accent);
  font-weight: 600;
}

/* site.js injects these two into .nav */
.site-tools {
  display: flex;
  align-items: center;
  gap: var(--s2);
  margin-left: auto;
}
.site-tools + .verbadge {
  margin-left: 0;
}
.searchbtn,
.reqbtn {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: 5px 11px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--sunk);
  color: var(--muted);
  font-size: var(--t-sm);
  transition: all var(--dur-1) var(--ease);
}
.searchbtn:hover,
.reqbtn:hover {
  color: var(--ink);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.searchbtn .lbl {
  min-width: 52px;
  text-align: left;
}
.searchbtn kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 5px;
  color: var(--faint);
}

/* ================= hero ================= */
.hero {
  position: relative;
  padding: var(--s9) 0 var(--s7);
  text-align: center;
}
.hero .eyebrow {
  display: block;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: var(--t-3xl);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: var(--s3) 0 0;
  background: linear-gradient(180deg, var(--ink), var(--ink-dim) 62%, var(--muted));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .lede {
  max-width: 68ch;
  margin: var(--s4) auto 0;
  color: var(--ink-dim);
  font-size: var(--t-md);
  line-height: 1.62;
}
.hero .lede b {
  color: var(--ink);
  font-weight: 600;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s2);
  margin-top: var(--s5);
}
.hero-rule {
  height: 1px;
  margin: var(--s7) 0 0;
  background: linear-gradient(90deg, transparent, var(--accent-line), transparent);
}

/* ================= sections ================= */
.wrap section {
  position: relative;
  padding-top: var(--s8);
  scroll-margin-top: 78px;
}
/* The section head is a wrapper, not an `<h2 data-*>`, because the search-index
   builder matches a bare `<h2>` — an attribute on it would silently drop every
   section from search. See references/page-anatomy.md. */
.sechead {
  display: flex;
  align-items: baseline;
  gap: var(--s3);
}
.sechead .depth {
  font-size: var(--t-xs);
  letter-spacing: 0.2em;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 2px 9px;
  white-space: nowrap;
  flex: none;
}
.wrap section h2 {
  font-family: var(--font-display);
  font-size: var(--t-2xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}
.sec-purpose {
  max-width: 76ch;
  margin: var(--s3) 0 var(--s5);
  color: var(--muted);
  font-size: var(--t-base);
  line-height: 1.62;
}
.sec-purpose b {
  color: var(--ink-dim);
  font-weight: 600;
}

/* ================= category page header ================= */
.phead {
  padding: var(--s8) 0 var(--s5);
  border-bottom: 1px solid var(--line-soft);
}
.phead h1 {
  font-family: var(--font-display);
  font-size: var(--t-2xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: var(--s2) 0 0;
}
.phead > p {
  max-width: 76ch;
  margin: var(--s3) 0 0;
  color: var(--muted);
  font-size: var(--t-md);
  line-height: 1.6;
}
.phead .back {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}
.phead .back:hover {
  color: var(--accent);
}

/* ================= surface (shot) cards ================= */
.shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: var(--s4);
  /* Without this a standard card sharing a row with a `lead` card stretches to
     the lead's height and trails dead space under its caption. */
  align-items: start;
}
.shotcard {
  display: block;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, var(--card-top), var(--card-bottom));
  overflow: hidden;
  color: inherit;
  transition: border-color var(--dur-2) var(--ease), transform var(--dur-2) var(--ease),
    box-shadow var(--dur-2) var(--ease);
}
.shotcard:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2), 0 0 46px -18px var(--accent-glow);
}
.shotcard.lead {
  grid-column: span 2;
}
.shotcard .thumb {
  position: relative;
  aspect-ratio: 1280 / 800;
  overflow: hidden;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--line-soft);
}
/* Width/height/transform are set by assets/thumbs.js from the card's measured
   width — a fixed factor is only correct at one viewport. The values here are a
   sane no-JS fallback at the ~365px the 3-column grid gives a standard card. */
.shotcard .thumb iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 1280px;
  height: 800px;
  border: 0;
  transform: scale(0.285);
  transform-origin: top left;
  pointer-events: none;
}
.shotcard .cap {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  padding: var(--s4);
}
.shotcard .cap .num {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--accent);
  border: 1px solid var(--accent-line);
  border-radius: var(--r-sm);
  padding: 1px 6px;
  flex: none;
}
.shotcard .cap .t {
  font-family: var(--font-display);
  font-size: var(--t-md);
  font-weight: 600;
  color: var(--ink);
}
.shotcard .cap .d {
  margin-top: 3px;
  color: var(--muted);
  font-size: var(--t-sm);
  line-height: 1.5;
}
.shotcard .cap .arrow {
  margin-left: auto;
  color: var(--faint);
  flex: none;
}
.shotcard:hover .cap .arrow {
  color: var(--accent);
}

/* ================= category tiles ================= */
.cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: var(--s3);
}
.cattile {
  display: block;
  padding: var(--s4);
  border-radius: var(--r-md);
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, var(--card-top), var(--card-bottom));
  color: inherit;
  transition: all var(--dur-2) var(--ease);
}
.cattile:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.cattile .e {
  font-size: 20px;
  line-height: 1;
}
.cattile .t {
  margin-top: var(--s3);
  font-family: var(--font-display);
  font-size: var(--t-md);
  font-weight: 600;
  color: var(--ink);
}
.cattile .d {
  margin-top: 4px;
  color: var(--muted);
  font-size: var(--t-sm);
  line-height: 1.5;
}
.cattile .k {
  margin-top: var(--s3);
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--faint);
  letter-spacing: 0.08em;
}

/* ================= component cards ================= */
.lib {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}
.libcard {
  position: relative;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, var(--card-top), var(--card-bottom));
  padding: var(--s5);
  scroll-margin-top: 84px;
  transition: border-color var(--dur-2) var(--ease);
}
.libcard:hover {
  border-color: var(--line);
}
.libcap {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px var(--s3);
  align-items: start;
  margin-bottom: var(--s4);
}
.libcap .e {
  grid-row: span 3;
  font-size: 17px;
  line-height: 1.3;
  opacity: 0.85;
}
.libcap .t {
  font-family: var(--font-display);
  font-size: var(--t-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.libcap .d {
  color: var(--muted);
  font-size: var(--t-base);
  line-height: 1.55;
  max-width: 78ch;
}
.libcap .src {
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--faint);
  letter-spacing: 0.02em;
  word-break: break-all;
}
.libcap .src::before {
  content: '⌁ ';
  color: var(--ret);
}

/* status flag for anything not shipped */
.tag-status {
  display: inline-block;
  margin-left: var(--s2);
  vertical-align: 2px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  border: 1px solid currentColor;
}
.tag-status.dev {
  color: var(--cap);
}
.tag-status.planned {
  color: var(--muted-2);
}
.tag-status.quirk {
  color: var(--proc);
}

.variants {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s4);
  align-items: flex-start;
}
.variant {
  flex: 1 1 320px;
  min-width: 0;
}
.variant.wide {
  flex-basis: 100%;
}
.vlabel {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: var(--s2);
  display: flex;
  align-items: center;
  gap: var(--s2);
}
.vlabel::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}
.vbody {
  position: relative;
  padding: var(--s4);
  border-radius: var(--r-md);
  border: 1px dashed var(--line);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(110, 168, 254, 0.045), transparent 65%),
    var(--sunk);
  overflow: auto;
}
.vbody.flush {
  padding: 0;
  border-style: solid;
}
.vbody.dark {
  background: var(--bg-deep);
}

/* per-card feedback actions, injected by site.js */
.cardfb {
  display: flex;
  gap: var(--s2);
  margin-top: var(--s4);
  padding-top: var(--s3);
  border-top: 1px solid var(--line-soft);
}
.cardfb button {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  color: var(--muted-2);
  background: transparent;
  transition: all var(--dur-1) var(--ease);
}
.cardfb button:hover {
  color: var(--ink);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.cardfb button.bug:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: rgba(240, 97, 107, 0.09);
}

/* ================= guide ================= */
.guide {
  display: grid;
  grid-template-columns: 236px 1fr;
  gap: var(--s7);
  align-items: start;
}
.guide-toc {
  position: sticky;
  top: 78px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  padding-right: var(--s2);
}
.guide-toc .eyebrow {
  display: block;
}
.guide-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: g;
}
.guide-toc a {
  display: block;
  padding: 5px 10px 5px 0;
  color: var(--muted);
  font-size: var(--t-sm);
  line-height: 1.35;
  border-left: 2px solid transparent;
  padding-left: var(--s3);
  transition: all var(--dur-1) var(--ease);
}
.guide-toc a:hover {
  color: var(--ink);
  border-left-color: var(--line);
}
.guide-toc a .k {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--faint);
  margin-right: 6px;
}
.doc {
  scroll-margin-top: 84px;
  padding-bottom: var(--s7);
  margin-bottom: var(--s7);
  border-bottom: 1px solid var(--line-soft);
  max-width: 74ch;
}
.doc:last-child {
  border-bottom: 0;
}
.doc > .eyebrow {
  display: block;
}
.doc h2 {
  font-family: var(--font-display);
  font-size: var(--t-2xl);
  font-weight: 600;
  letter-spacing: -0.022em;
  margin: var(--s2) 0 var(--s4);
}
.doc h3 {
  font-family: var(--font-display);
  font-size: var(--t-lg);
  font-weight: 600;
  color: var(--ink);
  margin: var(--s6) 0 var(--s3);
  padding-left: var(--s3);
  border-left: 2px solid var(--accent-line);
}
.doc p {
  color: var(--ink-dim);
  font-size: var(--t-md);
  line-height: 1.72;
  margin: 0 0 var(--s4);
}
.doc p > b,
.doc p > strong {
  color: var(--ink);
  font-weight: 600;
}
.doc code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--ret);
  background: var(--sunk);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 1px 5px;
}
.doc .callout {
  border-left: 2px solid var(--cap);
  background: rgba(242, 166, 90, 0.06);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: var(--s3) var(--s4);
  margin: 0 0 var(--s4);
}
.doc .callout p:last-child {
  margin-bottom: 0;
}
.doc .callout .eyebrow {
  display: block;
  color: var(--cap);
}
.doc ol.plain {
  color: var(--ink-dim);
  font-size: var(--t-md);
  line-height: 1.7;
  padding-left: var(--s5);
}
.doc ol.plain li {
  margin-bottom: var(--s2);
}

/* glossary */
.gloss {
  display: grid;
  gap: 0;
  max-width: none;
}
.gloss > div {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--s4);
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--line-soft);
}
.gloss dt {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  font-size: var(--t-md);
}
.gloss dd {
  margin: 0;
  color: var(--muted);
  font-size: var(--t-base);
  line-height: 1.62;
}

/* ================= roadmap / issues boards ================= */
/* 206px keeps all five stages on one row at the 1180px wrap — a kanban that
   wraps its last column under the others stops reading as a board. */
.board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(206px, 1fr));
  gap: var(--s3);
  align-items: start;
}
.col {
  border-radius: var(--r-md);
  border: 1px solid var(--line-soft);
  background: var(--sunk);
  padding: var(--s3);
}
.col > header {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: var(--s3);
}
.col > header .e {
  font-size: 15px;
}
.col > header .t {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--t-md);
}
.col > header .n {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--faint);
}
.col .blurb {
  color: var(--muted-2);
  font-size: var(--t-sm);
  line-height: 1.5;
  margin: 0 0 var(--s3);
}
.rcard {
  border-radius: var(--r-sm);
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, var(--card-top), var(--card-bottom));
  padding: var(--s3);
  margin-bottom: var(--s2);
  scroll-margin-top: 90px;
}
.rcard h3 {
  font-family: var(--font-display);
  font-size: var(--t-base);
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--ink);
}
.rcard p {
  margin: 0;
  color: var(--muted);
  font-size: var(--t-sm);
  line-height: 1.55;
}
.rcard .ver {
  display: inline-block;
  margin-top: var(--s2);
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--store);
  border: 1px solid currentColor;
  border-radius: var(--r-pill);
  padding: 1px 7px;
}

/* issues list */
.ifilters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-bottom: var(--s5);
  align-items: center;
}
.ifilters .lbl {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-right: var(--s2);
}
.ilist {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}
.issue {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: var(--s4);
  border-radius: var(--r-md);
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, var(--card-top), var(--card-bottom));
  padding: var(--s4);
  scroll-margin-top: 90px;
}
.issue.hide {
  display: none;
}
.issue .side {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}
.issue h3 {
  font-family: var(--font-display);
  font-size: var(--t-md);
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--ink);
}
.issue p {
  margin: 0 0 var(--s2);
  color: var(--muted);
  font-size: var(--t-base);
  line-height: 1.6;
}
.issue .where {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--faint);
  word-break: break-all;
}
.issue .fix {
  margin-top: var(--s2);
  font-size: var(--t-sm);
  color: var(--ink-dim);
  border-left: 2px solid var(--store);
  padding-left: var(--s3);
}
.issue .fix em {
  color: var(--faint);
  font-style: normal;
  font-family: var(--font-mono);
  font-size: var(--t-xs);
}
.sev {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  border: 1px solid currentColor;
}
.sev.dead { color: var(--danger); }
.sev.broken { color: var(--cap); }
.sev.degraded { color: var(--use); }
.sev.cosmetic { color: var(--muted-2); }
.sev.unverified { color: var(--rep); }
.sev.open { color: var(--ret); }
.sev.planned { color: var(--muted-2); }
.sev.fixed { color: var(--store); }

/* ================= misc ================= */
.foot {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
  padding: var(--s6) var(--s5) var(--s7);
  border-top: 1px solid var(--line-soft);
  color: var(--muted-2);
  font-size: var(--t-sm);
  line-height: 1.7;
}
.foot b {
  color: var(--ink-dim);
}
.notebox {
  border-radius: var(--r-md);
  border: 1px solid var(--line-soft);
  background: var(--sunk);
  padding: var(--s4);
  margin: var(--s4) 0 var(--s5);
  color: var(--muted);
  font-size: var(--t-base);
  line-height: 1.62;
  max-width: 82ch;
}
.notebox b {
  color: var(--ink-dim);
}
.notebox.warn {
  border-left: 2px solid var(--cap);
}

/* ================= overlays (search + feedback) ================= */
.ovl {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh var(--s4) var(--s4);
  background: var(--scrim);
  backdrop-filter: blur(6px);
}
.ovl.open {
  display: flex;
}
.ovl-box {
  width: 100%;
  max-width: 640px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: var(--shadow-3), 0 0 0 1px var(--accent-line);
  overflow: hidden;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
}

.sx-top {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s4);
  border-bottom: 1px solid var(--line-soft);
}
.sx-top .ic {
  opacity: 0.6;
}
#sx-input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  color: var(--ink);
  font-size: var(--t-md);
}
.sx-esc {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
  cursor: pointer;
}
.sx-results {
  overflow-y: auto;
  flex: 1;
  padding: var(--s2);
}
.sx-item {
  display: flex;
  gap: var(--s3);
  align-items: flex-start;
  padding: var(--s3);
  border-radius: var(--r-sm);
  color: inherit;
}
.sx-item[aria-selected='true'] {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}
.sx-item .e {
  flex: none;
  font-size: 15px;
}
.sx-item .body {
  min-width: 0;
}
.sx-item .t {
  display: flex;
  align-items: center;
  gap: var(--s2);
  flex-wrap: wrap;
  color: var(--ink);
  font-weight: 600;
  font-size: var(--t-base);
}
.sx-item .d {
  color: var(--muted);
  font-size: var(--t-sm);
  line-height: 1.45;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sx-item mark {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 3px;
  padding: 0 1px;
}
.sx-kind {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  border: 1px solid currentColor;
  font-weight: 400;
}
.sx-kind.component { color: var(--accent); }
.sx-kind.surface { color: var(--ret); }
.sx-kind.section { color: var(--rep); }
.sx-kind.page { color: var(--muted-2); }
.sx-kind.roadmap { color: var(--store); }
.sx-empty {
  padding: var(--s6) var(--s4);
  text-align: center;
  color: var(--muted);
  font-size: var(--t-base);
}
.sx-empty .sub {
  margin-top: var(--s2);
  color: var(--faint);
  font-size: var(--t-sm);
}
.sx-empty b {
  color: var(--ink-dim);
}
.sx-foot {
  display: flex;
  align-items: center;
  gap: var(--s4);
  padding: var(--s2) var(--s4);
  border-top: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--faint);
}
.sx-foot b {
  color: var(--muted);
}
.grow {
  flex: 1;
}

/* feedback modal */
.fb-head {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s4);
  border-bottom: 1px solid var(--line-soft);
}
.fb-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--t-lg);
  font-weight: 600;
  flex: 1;
}
.fb-head .x {
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: var(--r-sm);
}
.fb-head .x:hover {
  color: var(--ink);
  background: var(--hover-wash);
}
.fb-body {
  padding: var(--s4);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}
.fb-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fb-row label {
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--ink-dim);
}
.fb-row input[type='text'],
.fb-row input[type='email'],
.fb-row textarea {
  width: 100%;
  background: var(--sunk);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 8px 11px;
  color: var(--ink);
  font-size: var(--t-base);
  outline: none;
}
.fb-row textarea {
  min-height: 116px;
  resize: vertical;
  line-height: 1.55;
}
.fb-row input:focus,
.fb-row textarea:focus {
  border-color: var(--accent-line);
  box-shadow: 0 0 22px -10px var(--accent-glow);
}
.fb-row .hint {
  font-size: var(--t-xs);
  color: var(--faint);
}
.fb-seg {
  display: flex;
  gap: var(--s2);
  flex-wrap: wrap;
}
.fb-seg label {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 5px 12px;
  color: var(--muted);
  font-weight: 400;
  font-size: var(--t-sm);
}
.fb-seg label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.fb-seg label.on-bug {
  color: var(--danger);
  border-color: var(--danger);
  background: rgba(240, 97, 107, 0.1);
}
.fb-seg label.on-feature {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.fb-msg {
  display: none;
  border-radius: var(--r-sm);
  padding: var(--s3);
  font-size: var(--t-sm);
}
.fb-msg.show {
  display: block;
}
.fb-msg.err {
  color: var(--danger);
  border: 1px solid var(--danger);
  background: rgba(240, 97, 107, 0.08);
}
.fb-foot {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s3) var(--s4);
  border-top: 1px solid var(--line-soft);
}
.fb-foot .note {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--faint);
}
.btn {
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 6px 15px;
  color: var(--muted);
  font-size: var(--t-sm);
  background: transparent;
  transition: all var(--dur-1) var(--ease);
}
.btn:hover {
  color: var(--ink);
  border-color: var(--accent-line);
}
.btn.primary {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.btn.primary:hover {
  box-shadow: 0 0 26px -8px var(--accent-glow);
}
.fb-done {
  padding: var(--s7) var(--s5);
  text-align: center;
}
.fb-done .e {
  font-size: 30px;
}
.fb-done h4 {
  font-family: var(--font-display);
  font-size: var(--t-lg);
  margin: var(--s3) 0 var(--s2);
}
.fb-done p {
  color: var(--muted);
  font-size: var(--t-base);
  line-height: 1.6;
  max-width: 46ch;
  margin: 0 auto;
}

/* ================= responsive ================= */
@media (max-width: 900px) {
  .guide {
    grid-template-columns: 1fr;
  }
  .guide-toc {
    position: static;
    max-height: none;
  }
  .shotcard.lead {
    grid-column: auto;
  }
  .shotcard.lead .thumb iframe {
    transform: scale(0.24);
  }
  .gloss > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .issue {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .wrap {
    padding: 0 var(--s4) var(--s8);
  }
  .hero h1 {
    font-size: var(--t-2xl);
  }
  .nav {
    flex-wrap: wrap;
    gap: var(--s2);
  }
  .site-tools {
    margin-left: 0;
  }
  .searchbtn .lbl {
    display: none;
  }
}

/* ================= light theme tweaks ================= */
:root[data-theme='light'] .nav {
  background: linear-gradient(180deg, rgba(238, 241, 247, 0.95), rgba(238, 241, 247, 0.75));
}
:root[data-theme='light'] .surround {
  background:
    radial-gradient(120% 70% at 50% -12%, var(--accent-soft), transparent 60%),
    radial-gradient(90% 60% at 50% 112%, rgba(196, 209, 232, 0.8), transparent 55%);
}
:root[data-theme='light'] .surround::after {
  background-image: repeating-linear-gradient(
    180deg,
    rgba(150, 168, 196, 0.2) 0 1px,
    transparent 1px 96px
  );
}
