/* search.css | sitewide search (Package G7, 12 Oct 2026). Loaded by search.js on first open (and by the /search page).
   The dialog: a command palette above 720 px, a full screen sheet below. Theme tokens from styles.css (--page, --page-2,
   --page-text, --page-muted, --page-faint, --page-line, --accent-ink, --focus), so dark and light follow the site. */
html.srch-lock, html.srch-lock body { overflow: hidden; }
.srch { position: fixed; inset: 0; z-index: 1000; display: flex; justify-content: center; align-items: flex-start; padding: max(9vh, 72px) 16px 24px; font: 400 16px/1.45 Inter, "Inter Fallback", system-ui, -apple-system, sans-serif; }
.srch[hidden] { display: none; }
.srch-scrim { position: absolute; inset: 0; background: rgba(3, 6, 12, .64); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .2s var(--ease); }
html:not([data-theme="dark"]) .srch-scrim { background: rgba(11, 18, 32, .38); }
.srch.is-open .srch-scrim { opacity: 1; }
.srch-panel { position: relative; display: flex; flex-direction: column; width: min(720px, 100%); max-height: min(660px, calc(100vh - max(9vh, 72px) - 24px)); color: var(--page-text); background: var(--page-2); border: 1px solid var(--page-line); border-radius: 20px; box-shadow: 0 32px 90px rgba(0, 0, 0, .5), 0 0 0 1px rgba(127, 178, 255, .06); overflow: hidden; opacity: 0; transform: translateY(10px) scale(.985); transition: opacity .18s, transform .24s var(--ease); }
html:not([data-theme="dark"]) .srch-panel { box-shadow: 0 30px 80px rgba(11, 18, 32, .22); }
.srch.is-open .srch-panel { opacity: 1; transform: none; }

.srch-bar { display: flex; align-items: center; gap: 10px; min-height: 66px; padding: 10px 10px 10px 20px; border-bottom: 1px solid var(--page-line); }
.srch-bar > svg { flex: none; color: var(--page-faint); }
.srch-q { flex: 1; min-width: 0; height: 46px; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: inherit; font: 500 18px/1.2 Inter, "Inter Fallback", system-ui, sans-serif; letter-spacing: -.005em; outline: none; -webkit-appearance: none; appearance: none; }
.srch-q::placeholder { color: var(--page-faint); opacity: 1; }
.srch-q::-webkit-search-cancel-button, .srch-q::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.srch-x { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 8px; border: 1px solid var(--page-line); border-radius: 12px; background: transparent; color: var(--page-muted); cursor: pointer; transition: border-color .2s, color .2s; }
.srch-x:hover { color: var(--page-text); border-color: var(--page-faint); }
.srch-x svg { display: none; }
.srch kbd { display: inline-block; min-width: 22px; padding: 3px 6px; border: 1px solid var(--page-line); border-bottom-width: 2px; border-radius: 6px; background: var(--page); color: var(--page-muted); font: 600 11.5px/1.2 "JetBrains Mono", "JBM Fallback", ui-monospace, monospace; text-align: center; }
.srch-x kbd { border: 0; background: transparent; padding: 0; color: inherit; font-size: 12px; }

.srch-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px 8px 12px; scroll-padding: 12px; }
.srch-g + .srch-g { margin-top: 4px; }
.srch-gh, .srch-ch { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0; padding: 14px 12px 6px; font: 500 11.5px/1 "JetBrains Mono", "JBM Fallback", ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--page-faint); }
.srch-gh { justify-content: flex-start; }
.srch-gh span { padding: 2px 6px; border: 1px solid var(--page-line); border-radius: 6px; letter-spacing: .04em; }
.srch-o { display: flex; flex-direction: column; justify-content: center; gap: 3px; min-height: 54px; padding: 9px 12px; border-radius: 12px; color: inherit; text-decoration: none; scroll-margin: 8px; }
.srch-o.is-active { background: rgba(127, 178, 255, .13); box-shadow: inset 0 0 0 1px rgba(127, 178, 255, .42); }
html:not([data-theme="dark"]) .srch-o.is-active { background: rgba(36, 99, 235, .07); box-shadow: inset 0 0 0 1px rgba(36, 99, 235, .34); }
.srch-ot { font-size: 15.5px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.srch-od { overflow: hidden; color: var(--page-muted); font-size: 13.5px; line-height: 1.4; white-space: nowrap; text-overflow: ellipsis; }
.srch mark, .srp mark { background: transparent; color: var(--accent-ink); font-weight: 700; }
.srch-none, .srch-load { margin: 0; padding: 22px 14px; color: var(--page-muted); font-size: 15px; }
.srch-none a, .srch-none b { color: var(--page-text); }

.srch-chipg { padding: 2px 4px 6px; }
.srch-ch { padding-left: 8px; padding-right: 0; min-height: 44px; padding-top: 6px; padding-bottom: 0; }
.srch-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 0; padding: 0 4px; list-style: none; }
.srch-chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--page-line); border-radius: 999px; background: var(--page); color: var(--page-text); font-size: 14.5px; font-weight: 500; text-decoration: none; transition: border-color .2s, background .2s; }
.srch-chip:hover { border-color: var(--accent-ink); }
.srch-recent { margin: 0; padding: 0; list-style: none; }
.srch-rq { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: inherit; font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.srch-rq:hover { background: rgba(127, 178, 255, .1); }
.srch-rq svg { flex: none; color: var(--page-faint); }
.srch-rq span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srch-clear { min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--accent-ink); font: 600 13px/1 Inter, "Inter Fallback", system-ui, sans-serif; letter-spacing: 0; text-transform: none; cursor: pointer; }

.srch-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 8px 6px 18px; border-top: 1px solid var(--page-line); color: var(--page-faint); font-size: 13px; }
.srch-help { margin: 0; }
.srch-keys kbd { margin: 0 1px; }
.srch-all { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-left: auto; padding: 0 12px; border-radius: 10px; color: var(--accent-ink); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.srch-all:hover { text-decoration: underline; text-underline-offset: 3px; }
.srch :focus-visible { outline: 2px solid var(--focus, #7FB2FF); outline-offset: 2px; }
.srch .srch-q:focus-visible { outline: none; }
.srch-bar:focus-within { box-shadow: inset 0 -2px 0 var(--focus, #7FB2FF); }

@media (max-width: 719px) {
  .srch { padding: 0; align-items: stretch; }
  .srch-panel { width: 100%; height: 100vh; height: 100dvh; max-height: none; border: 0; border-radius: 0; box-shadow: none; transform: translateY(14px); }
  .srch-bar { gap: 8px; min-height: 64px; padding: calc(8px + env(safe-area-inset-top, 0px)) 8px 8px 16px; }
  .srch-q { font-size: 17px; }
  .srch-x { border-color: transparent; }
  .srch-x kbd { display: none; }
  .srch-x svg { display: block; }
  .srch-help { display: none; }
  .srch-foot { padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px)); }
  .srch-od { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}
@media (hover: none) { .srch-help { display: none; } }
@media (prefers-reduced-motion: reduce) { .srch-scrim, .srch-panel { transition: none; transform: none; } }

/* ---------- the /search page ---------- */
.srp { min-height: 70vh; padding: calc(var(--hdr, 68px) + 64px) var(--pad, 20px) clamp(56px, 8vw, 96px); color: var(--page-text); }
.srp-in { max-width: 920px; margin: 0 auto; }
.srp .kicker { color: var(--page-muted); }
.srp-h { margin: 0 0 12px; font-size: clamp(34px, 5vw, 56px); font-weight: 700; line-height: 1.05; letter-spacing: -.025em; }
.srp-lead { max-width: 64ch; margin: 0 0 28px; color: var(--page-muted); font-size: clamp(16px, 1.6vw, 18px); }
.srp-form { display: flex; gap: 10px; align-items: center; padding: 8px 8px 8px 20px; border: 1px solid var(--page-line); border-radius: 999px; background: var(--page-2); }
.srp-form:focus-within { border-color: var(--focus, #7FB2FF); box-shadow: 0 0 0 1px var(--focus, #7FB2FF); }
.srp-q { flex: 1; min-width: 0; height: 46px; border: 0; background: transparent; color: inherit; font: 500 18px/1.2 Inter, "Inter Fallback", system-ui, sans-serif; outline: none; -webkit-appearance: none; appearance: none; }
.srp-q::placeholder { color: var(--page-faint); opacity: 1; }
.srp-q::-webkit-search-decoration { -webkit-appearance: none; }
html:not([data-theme="dark"]) .srp-go { background: var(--page-text); color: #fff; }
.srp-status { min-height: 1.5em; margin: 18px 4px 6px; color: var(--page-muted); font-size: 15px; }
.srp-g { margin-top: 26px; }
.srp-gh { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font: 500 12px/1 "JetBrains Mono", "JBM Fallback", ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--page-faint); }
.srp-gh span { padding: 3px 7px; border: 1px solid var(--page-line); border-radius: 6px; letter-spacing: .04em; }
.srp-gh:focus { outline: none; }
.srp-ul { margin: 0; padding: 0; list-style: none; border: 1px solid var(--page-line); border-radius: 16px; background: var(--page-2); overflow: hidden; }
.srp-ul li + li { border-top: 1px solid var(--page-line); }
.srp-a { display: flex; flex-direction: column; gap: 4px; min-height: 56px; padding: 12px 18px; color: inherit; text-decoration: none; transition: background .2s; }
.srp-a:hover { background: rgba(127, 178, 255, .08); }
.srp-a b { font-size: 16px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.srp-a span { color: var(--page-muted); font-size: 14px; line-height: 1.45; }
.srp-more { margin-top: 10px; color: var(--page-text); border-color: var(--page-line); background: var(--page-2); }
.srp-start { margin-top: 30px; }
.srp-start[hidden] { display: none; }
.srp-h2 { margin: 0 0 6px; font-size: clamp(20px, 2.2vw, 26px); font-weight: 650; letter-spacing: -.01em; }
.srp-chipg { margin-top: 18px; }
.srp-ch { margin: 0 0 8px; font: 500 12px/1 "JetBrains Mono", "JBM Fallback", ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--page-faint); }
.srp .srch-chips { padding: 0; }
.srp-note { margin: 28px 0 0; color: var(--page-faint); font-size: 13.5px; max-width: 70ch; }
@media (max-width: 719px) {
  .srp { padding-top: calc(var(--hdr, 68px) + 52px); }
  .srp-form { padding: 6px 6px 6px 16px; }
  .srp-go { padding: 0 16px; }
  .srp-a { padding: 12px 14px; }
}
