/* ==========================================================================
   FAQ — "The index"
   A search-first reference desk: typewriter search hero, sticky category rail
   with a sliding marker, and a numbered answer index with live highlighting.
   Loads after site.css + pages.css.
   ========================================================================== */

/* the one utility this page used from the retired pages.css */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ---- Hero -------------------------------------------------------------- */
.qhero { position: relative; padding: clamp(7.5rem, 12vw, 9.5rem) 0 clamp(2rem, 4vw, 3rem); overflow: hidden; isolation: isolate; }
/* Paper Shaders "Grain Gradient" in its dot shape, mounted by js/shader-bg.js;
   faded out hard so it never competes with the answers */
.weavebg { position: absolute; inset: 0; z-index: -2; background: radial-gradient(60% 70% at 78% 18%, #0d1f3d, #04060b 68%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 88%); mask-image: linear-gradient(180deg, #000 0%, transparent 88%); }
.weavebg canvas { opacity: 0; transition: opacity 1.4s var(--ease); }
.weavebg.is-live canvas { opacity: .55; }
.qhero::before { content: ''; position: absolute; z-index: -1; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(4,6,11,.55) 0%, rgba(4,6,11,.2) 40%, rgba(4,6,11,.9) 92%, var(--bg) 100%); }
.qhero__title { font-weight: 500; font-size: clamp(2.3rem, 1rem + 5vw, 4.8rem); line-height: 1; letter-spacing: -.05em; margin-top: 1rem; }
.qhero__title em { color: var(--blue-2); }
.qhero__note { margin-top: 1.25rem; max-width: 52ch; color: var(--ink-3); font-size: .9rem; }

/* ---- Search: the page's front door -------------------------------------- */
.qsearch { position: relative; display: flex; align-items: center; gap: 1rem; max-width: 720px; margin-top: clamp(2rem, 4vw, 2.75rem);
  padding: .9rem .25rem; border-bottom: 1px solid var(--line-2); transition: border-color .4s; }
.qsearch:focus-within { border-color: var(--blue-2); }
.qsearch__ic { flex: none; width: 21px; height: 21px; fill: none; stroke: var(--ink-3); stroke-width: 1.8; stroke-linecap: round; transition: stroke .4s; }
.qsearch:focus-within .qsearch__ic { stroke: var(--blue-2); }
.qsearch input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--ink);
  font: 400 clamp(1.05rem, 1rem + .5vw, 1.3rem)/1.4 var(--sans); letter-spacing: -.025em; }
.qsearch input::placeholder { color: var(--ink-3); }
.qsearch input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.qsearch kbd { flex: none; display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 .45rem; border-radius: 7px;
  border: 1px solid var(--line-2); color: var(--ink-3); font: 500 .72rem/1 var(--mono); }
.qsearch__x { flex: none; display: none; place-items: center; width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
  background: none; border: 1px solid var(--line-2); color: var(--ink-2); font-size: .9rem; line-height: 1; transition: color .3s, border-color .3s; }
.qsearch__x:hover { color: var(--ink); }
.qsearch.has-value .qsearch__x { display: grid; }
.qsearch.has-value kbd { display: none; }
.qhero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; margin-top: 1.1rem; color: var(--ink-3);
  font: 500 .72rem/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.qhero__meta b { color: var(--blue-2); font-weight: 500; }

/* ---- Rail + list -------------------------------------------------------- */
.qwrap { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); padding-bottom: clamp(4rem, 8vw, 7rem); }
/* min-width:0 or the scrolling topic strip inflates the grid column instead
   of scrolling inside it */
.frail { position: sticky; top: 108px; align-self: start; min-width: 0; }
.frail__k { color: var(--ink-3); margin-bottom: 1rem; }
.frail__nav { position: relative; padding-left: 12px; }
/* the marker slides to whichever category you're reading */
.frail__mark { position: absolute; left: 0; top: 0; width: 2px; height: 0; border-radius: 2px; background: var(--blue);
  transition: transform .55s var(--ease), height .55s var(--ease), opacity .4s; opacity: 0; }
.frail__nav.is-live .frail__mark { opacity: 1; }
.frail a { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .62rem .8rem; border-radius: 9px;
  color: var(--ink-3); font: 500 .73rem/1.35 var(--mono); letter-spacing: .05em; text-transform: uppercase;
  transition: color .35s, background .35s, opacity .35s; }
.frail a:hover { color: var(--ink); background: rgba(238,242,250,.04); }
.frail a.is-on { color: var(--ink); }
.frail a.is-empty { opacity: .28; }
.frail__n { flex: none; color: var(--blue-2); font-variant-numeric: tabular-nums; }
.frail a.is-empty .frail__n { color: inherit; }

/* ---- Categories --------------------------------------------------------- */
.qcat { scroll-margin-top: 118px; }
.qcat + .qcat { margin-top: clamp(2.75rem, 5vw, 4rem); }
.qcat.is-hidden { display: none; }
.qcat__h { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding-bottom: 1.1rem; border-bottom: 1px solid var(--line-2); }
.qcat__h h2 { font-size: clamp(1.45rem, 1.2rem + .9vw, 2rem); font-weight: 500; letter-spacing: -.038em; }
.qcat__h h2 em { color: var(--blue-2); }
.qcat__k { color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ---- Questions ---------------------------------------------------------- */
.q { position: relative; border-bottom: 1px solid var(--line); }
.q.is-hidden { display: none; }
/* an accent rule draws down the side of whichever answer is open */
.q::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--blue);
  transform: scaleY(0); transform-origin: 50% 0; transition: transform .55s var(--ease); }
.q[open]::before { transform: scaleY(1); }
.q summary { list-style: none; cursor: pointer; display: flex; align-items: flex-start; gap: 1.1rem; padding: 1.3rem 0;
  transition: padding .5s var(--ease); }
.q summary::-webkit-details-marker { display: none; }
.q:hover summary, .q[open] summary { padding-left: 1.15rem; }
.q__n { flex: none; padding-top: .3rem; color: var(--ink-3); font: 500 .7rem/1.3 var(--mono); letter-spacing: .06em;
  font-variant-numeric: tabular-nums; transition: color .35s; }
.q:hover .q__n, .q[open] .q__n { color: var(--blue-2); }
.q__t { flex: 1; font-size: clamp(1.02rem, .98rem + .25vw, 1.16rem); letter-spacing: -.022em; transition: color .3s; }
.q[open] .q__t { color: var(--blue-2); }
.q__ic { position: relative; flex: none; display: grid; place-items: center; width: 30px; height: 30px; margin-top: -.1rem; border-radius: 50%;
  border: 1px solid var(--line-2); transition: transform .5s var(--ease), background .35s, border-color .35s; }
.q__ic::before, .q__ic::after { content: ''; position: absolute; background: var(--ink); border-radius: 2px; }
.q__ic::before { width: 10px; height: 1.5px; }
.q__ic::after { width: 1.5px; height: 10px; transition: opacity .4s; }
.q[open] .q__ic { transform: rotate(180deg); background: var(--blue); border-color: var(--blue); }
.q[open] .q__ic::after { opacity: 0; }
.q__a { overflow: hidden; }
/* the answer sits on its own panel rather than loose under the question, so an
   open row reads as a resolved thing and has somewhere to send you next */
.q__a > div { margin: 0 0 1.5rem 1.15rem; padding: clamp(1.1rem, 2vw, 1.5rem) clamp(1.2rem, 2.4vw, 1.75rem);
  border-radius: 14px; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(12,20,40,.85), rgba(7,11,22,.6)); }
.q__a p { color: var(--ink-2); max-width: 68ch; }
.q__a p + p { margin-top: .8rem; }
.q__a a { color: var(--ink); border-bottom: 1px solid var(--blue-2); }
.q__a a:hover { color: var(--blue-2); }
.q__next { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.1rem; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.q__next span { color: var(--ink-3); font: 500 .66rem/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; }
.q__next a { display: inline-flex; align-items: center; gap: .45rem; border: 0; color: var(--blue-2); font-size: .9rem; letter-spacing: -.01em; }
.q__next a::after { content: '→'; transition: transform .4s var(--ease); }
.q__next a:hover { color: var(--ink); }
.q__next a:hover::after { transform: translateX(3px); }
.q mark { background: rgba(61,123,255,.3); color: var(--ink); border-radius: 3px; padding: 0 .14em; }

/* ---- Nothing found ------------------------------------------------------- */
.qempty { display: none; padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.qempty.is-on { display: block; }
.qempty h2 { font-size: clamp(1.4rem, 1.2rem + .8vw, 1.9rem); font-weight: 500; letter-spacing: -.035em; margin-bottom: .75rem; }
.qempty h2 span { color: var(--blue-2); }
.qempty p { color: var(--ink-2); max-width: 46ch; margin-bottom: 1.75rem; }
.qempty__row { display: flex; flex-wrap: wrap; gap: .75rem; }

@media (max-width: 900px) {
  .qwrap { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
  /* the rail becomes a sticky strip you can swipe */
  .frail { position: sticky; top: 78px; z-index: 15; padding: .75rem 0; background: var(--bg); }
  .frail__k { display: none; }
  .frail__nav { padding-left: 0; display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; }
  .frail__nav::-webkit-scrollbar { display: none; }
  .frail__mark { display: none; }
  .frail a { flex: none; border: 1px solid var(--line); border-radius: 999px; padding: .55rem .9rem; }
  .frail a.is-on { border-color: var(--line-2); background: rgba(61,123,255,.12); }
  .q__a > div { padding-right: 0; }
}
