/* =====================================================================
   FAQ: hero with live search, grouped accordions, "Still curious?" card
   ===================================================================== */

/* Split-text headings: the per-word masks (base.css) would clip the Glow-mode text-shadow on <em>
   into hard boxes. Keep the glow off while the words rise, then drop the masks (.split-settled,
   added by faq.js) and let the em's text-shadow transition fade the glow in. */
.js[data-glow="on"] [data-split]:not(.split-settled) em { text-shadow: none; }
.js [data-split].split-settled .w { overflow: visible; }

/* ----------------------------------------------------------------- hero */
.faq-hero { position: relative; overflow: hidden; padding: clamp(48px, 7vw, 104px) 0 clamp(40px, 6vw, 80px); isolation: isolate; }
.faq-hero__grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr); gap: 40px clamp(40px, 6vw, 96px); align-items: end; }
.faq-hero__title { margin-top: 22px; }
.faq-hero .lede { margin-top: 26px; max-width: 50ch; }
.faq-hero .lede a { color: var(--ink); text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: .22em; }
.faq-hero .lede a:hover { color: var(--accent); }

/* drifting spores, kept clear of the headline column (mask), soft and faint by day, luminous in Glow */
.faq-spores {
  position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0 34%, #000 72%);
  mask-image: linear-gradient(90deg, transparent 0 34%, #000 72%);
}
[data-glow="on"] .faq-spores {
  -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, .3) 0 34%, #000 72%);
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, .3) 0 34%, #000 72%);
}
.faq-spores i {
  position: absolute; left: var(--x); top: 0; height: 100%; width: var(--s);
  transform: translate3d(0, 100%, 0);
  animation: spore-rise var(--dur) linear var(--delay) infinite;
}
.faq-spores i::before {
  content: ""; position: absolute; left: 0; top: 0; width: var(--s); height: var(--s); border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--moss) 30%, transparent) 0 35%, transparent 72%);
  opacity: .6; filter: blur(.6px);
  transition: opacity .6s var(--ease), box-shadow .6s var(--ease);
}
[data-glow="on"] .faq-spores i::before { background: var(--glow); box-shadow: 0 0 10px 2px color-mix(in srgb, var(--glow) 60%, transparent); opacity: .75; filter: none; }
@keyframes spore-rise {
  0% { transform: translate3d(0, 100%, 0); opacity: 0; }
  12% { opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translate3d(var(--drift), -6%, 0); opacity: 0; }
}

/* search */
.faq-search__label { display: block; margin-bottom: 12px; font-size: 13px; font-weight: 800; color: var(--ink-2); }
.faq-search__box {
  position: relative; display: flex; align-items: center; gap: 12px;
  height: 64px; padding: 0 12px 0 22px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line-2);
  box-shadow: 0 18px 40px -28px rgba(var(--shadow), .35);
  transition: border-color .25s var(--ease), box-shadow .35s var(--ease), background-color .6s var(--ease);
}
.faq-search__box:focus-within { border-color: var(--moss); box-shadow: 0 0 0 4px color-mix(in srgb, var(--moss) 16%, transparent), 0 18px 40px -28px rgba(var(--shadow), .35); }
[data-glow="on"] .faq-search__box:focus-within { border-color: var(--glow); box-shadow: 0 0 0 4px color-mix(in srgb, var(--glow) 14%, transparent), 0 0 40px -10px color-mix(in srgb, var(--glow) 40%, transparent); }
.faq-search__box > .i { width: 22px; height: 22px; color: var(--muted); }
.faq-search__box input {
  flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none;
  font-size: 17px; color: var(--ink);
}
.faq-search__box input::placeholder { color: var(--muted); opacity: .85; }
.faq-search__box input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.faq-search__kbd {
  display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px; margin-right: 6px;
  border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg);
  font: 700 13px/1 var(--font-sans); color: var(--muted);
}
.faq-search__box:focus-within .faq-search__kbd { display: none; }
.faq-search__clear {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--chip); color: var(--ink); transition: background-color .25s var(--ease), transform .3s var(--ease);
}
.faq-search__clear:hover { background: var(--moss); color: var(--moss-ink); transform: rotate(90deg); }
.faq-search__clear .i { width: 16px; height: 16px; }
.faq-search__status { margin-top: 12px; padding-left: 22px; font-size: 13px; font-weight: 700; color: var(--muted); min-height: 1.4em; }

/* -------------------------------------------------------------- layout */
.faq-main { padding: clamp(24px, 4vw, 48px) 0 clamp(56px, 8vw, 110px); }
.faq-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.faq-aside { position: sticky; top: calc(var(--header-h) + 28px); display: grid; gap: 28px; }
.faq-topics .eyebrow { margin-bottom: 12px; }
.faq-topics ul { border-top: 1px solid var(--line); }
.faq-topics a {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 14px 4px; border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--ink-2); font-weight: 700; font-size: 15px;
  transition: color .25s var(--ease), padding .4s var(--ease), opacity .3s var(--ease);
}
.faq-topics__num { font-family: var(--font-display); font-style: italic; font-weight: 400; color: var(--muted); font-size: 14px; }
.faq-topics__count {
  min-width: 26px; height: 24px; padding: 0 8px; border-radius: 999px; display: grid; place-items: center;
  background: var(--chip); font-size: 12px; color: var(--ink-2);
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
.faq-topics a:hover { color: var(--ink); padding-left: 10px; }
.faq-topics a[aria-current="true"] { color: var(--ink); }
.faq-topics a[aria-current="true"] .faq-topics__num { color: var(--accent); }
.faq-topics a[aria-current="true"] .faq-topics__count { background: var(--moss); color: var(--moss-ink); }
.faq-topics a.is-empty { opacity: .45; }
.faq-aside__ask {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 16px; border-radius: var(--r); background: var(--moss-tint); color: var(--ink);
  text-decoration: none; font-size: 14px; line-height: 1.35;
  transition: transform .45s var(--ease), background-color .6s var(--ease);
}
.faq-aside__ask > span:first-child { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); color: var(--moss); }
.faq-aside__ask .i { width: 18px; height: 18px; }
.faq-aside__ask > .i { transition: transform .35s var(--ease); }
.faq-aside__ask:hover { transform: translateY(-2px); }
.faq-aside__ask:hover > .i { transform: translateX(3px); }
.faq-aside__ask strong { display: block; font-weight: 800; }
[data-glow="on"] .faq-aside__ask > span:first-child { color: var(--glow); }

/* ---------------------------------------------------------------- groups */
/* a flex gap (not sibling margins) so groups hidden by the search leave no stray space */
.faq-groups { display: flex; flex-direction: column; gap: clamp(56px, 7vw, 96px); }
.faq-group { scroll-margin-top: calc(var(--header-h) + 24px); }
.faq-group__head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 18px; }
.faq-group__num { font-family: var(--font-display); font-style: italic; font-size: clamp(18px, 1.6vw, 22px); color: var(--accent); font-variation-settings: "SOFT" 100, "WONK" 1; }
.faq-group__title { font-size: clamp(30px, 3.4vw, 46px); letter-spacing: -.03em; }
.faq-list { border-bottom: 1px solid var(--line); }

.faq-item { border-top: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + 24px); }
.faq-item__q {
  position: relative; list-style: none; cursor: pointer;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center;
  /* 12px of inline breathing room for the focus ring, pulled back so the text stays aligned */
  padding: 26px 12px; margin-inline: -12px; border-radius: var(--r-s);
  font-family: var(--font-display); font-size: clamp(19px, 1.75vw, 24px); line-height: 1.25; letter-spacing: -.012em;
  font-variation-settings: "SOFT" 100, "WONK" 0; color: var(--ink);
  transition: color .3s var(--ease), padding .45s var(--ease);
}
.faq-item__q::-webkit-details-marker { display: none; }
.faq-item__q::marker { content: ""; }
.faq-item__q:hover { color: var(--moss); padding-left: 20px; }
[data-glow="on"] .faq-item__q:hover { color: var(--glow); }
.faq-item__q:focus-visible { outline-offset: -2px; border-radius: var(--r-s); }
.faq-item__icon {
  position: relative; width: 42px; height: 42px; border-radius: 50%; flex: none;
  border: 1px solid var(--line-2); background: var(--panel);
  transition: background-color .35s var(--ease), border-color .35s var(--ease), transform .5s var(--ease);
}
.faq-item__icon i { position: absolute; left: 50%; top: 50%; width: 14px; height: 1.5px; margin: -.75px 0 0 -7px; border-radius: 2px; background: currentColor; transition: transform .45s var(--ease); }
.faq-item__icon i + i { transform: rotate(90deg); }
.faq-item__q:hover .faq-item__icon { border-color: var(--moss); }
.faq-item[open] > .faq-item__q .faq-item__icon { background: var(--moss); border-color: var(--moss); color: var(--moss-ink); transform: rotate(180deg); }
.faq-item[open] > .faq-item__q .faq-item__icon i + i { transform: rotate(0deg); }
[data-glow="on"] .faq-item[open] > .faq-item__q .faq-item__icon { box-shadow: 0 0 22px -4px var(--glow); }
.faq-item[open] > .faq-item__q { color: var(--ink); }

/* the answer wrapper clips during the height animation; 6px of inline padding (pulled back with a
   negative margin) keeps focus rings inside it, e.g. on "Link to this answer", from being cut off */
.faq-item__a { overflow: hidden; padding-inline: 6px; margin-inline: -6px; }
.faq-item__inner { padding: 0 72px 30px 0; display: grid; gap: 16px; justify-items: start; }
.faq-item__inner p { max-width: 64ch; font-size: 16.5px; line-height: 1.7; color: var(--ink-2); }
.faq-item.is-opening .faq-item__inner, .faq-item.is-closing .faq-item__inner { will-change: opacity, transform; }
.faq-item__link {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 800; color: var(--muted);
  text-decoration: none; letter-spacing: .02em; transition: color .25s var(--ease);
}
.faq-item__link .i { width: 15px; height: 15px; }
.faq-item__link:hover { color: var(--ink); }
.faq-item__link.is-done { color: var(--moss); }
[data-glow="on"] .faq-item__link.is-done { color: var(--glow); }
.faq-item.is-target > .faq-item__q { animation: faq-flash 1.6s var(--ease) 1; }
@keyframes faq-flash { 0%, 40% { color: var(--accent); } 100% { color: var(--ink); } }

mark.faq-hit {
  background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit;
  border-radius: 4px; padding: 0 .08em; box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
[data-glow="on"] mark.faq-hit { background: color-mix(in srgb, var(--glow) 24%, transparent); }

.faq-empty {
  padding: clamp(28px, 4vw, 44px); border: 1px dashed var(--line-2); border-radius: var(--r-l);
  display: grid; gap: 10px; justify-items: start; background: var(--panel);
}
.faq-empty__t { font-family: var(--font-display); font-size: clamp(22px, 2.2vw, 30px); line-height: 1.2; letter-spacing: -.015em; }
.faq-empty__t span { font-style: italic; color: var(--accent); }
.faq-empty__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }

/* --------------------------------------------------------- still curious */
.faq-curious { padding-top: 0; }
.curious {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); align-items: center;
  padding: clamp(36px, 6vw, 88px);
  border-radius: var(--r-xl); background: var(--dark); color: var(--dark-ink);
  border: 1px solid transparent;
}
.curious__glow {
  position: absolute; inset: -40%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 40% at 20% 30%, rgba(179, 38, 30, .38), transparent 70%),
    radial-gradient(35% 45% at 85% 80%, rgba(181, 201, 143, .22), transparent 70%);
  animation: curious-drift 18s var(--ease) infinite alternate;
}
@keyframes curious-drift { to { transform: translate3d(6%, -4%, 0) rotate(8deg); } }
[data-glow="on"] .curious { border-color: color-mix(in srgb, var(--glow) 22%, transparent); box-shadow: 0 0 80px -40px var(--glow); }
[data-glow="on"] .curious__glow {
  background:
    radial-gradient(40% 40% at 20% 30%, rgba(124, 243, 196, .26), transparent 70%),
    radial-gradient(35% 45% at 85% 80%, rgba(143, 211, 255, .16), transparent 70%);
}
.curious__mark { width: clamp(84px, 11vw, 150px); height: auto; transform: rotate(-8deg); animation: curious-wave 5s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes curious-wave { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(5deg) translateY(-6px); } }
.curious__body .eyebrow { color: rgba(241, 235, 221, .6); }
.curious__title { margin-top: 16px; font-size: clamp(36px, 5vw, 72px); line-height: 1; letter-spacing: -.035em; color: var(--dark-ink); }
.curious__title em { font-style: italic; font-variation-settings: "SOFT" 100, "WONK" 1; color: #ff7a6b; }
[data-glow="on"] .curious__title em { color: var(--glow); text-shadow: 0 0 28px color-mix(in srgb, var(--glow) 55%, transparent); }
.curious__text { margin-top: 18px; max-width: 52ch; color: rgba(241, 235, 221, .75); font-size: 17px; }
.curious__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
[data-glow="on"] .curious .btn--light { --btn-bg: var(--glow); --btn-ink: #0c110b; --btn-hover: var(--dark-ink); box-shadow: 0 0 36px -8px var(--glow); }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1080px) {
  .faq-layout { grid-template-columns: minmax(0, 1fr); }
  .faq-aside { position: static; grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
  .faq-topics ul { display: flex; flex-wrap: wrap; gap: 8px; border: 0; }
  .faq-topics a { grid-template-columns: auto auto auto; height: 42px; padding: 0 8px 0 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-size: 14px; }
  .faq-topics a:hover { padding-left: 16px; border-color: var(--moss); }
  .faq-topics__num { display: none; }
}
@media (max-width: 900px) {
  .faq-hero__grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .faq-aside { grid-template-columns: minmax(0, 1fr); }
  .faq-aside__ask { display: none; }
  .faq-search__box { height: 58px; padding-left: 18px; }
  .faq-search__kbd { display: none; }
  .faq-search__status { padding-left: 18px; }
  .faq-item__q { gap: 16px; padding: 22px 10px; margin-inline: -10px; }
  .faq-item__q:hover { padding-left: 10px; }
  .faq-item__icon { width: 36px; height: 36px; }
  .faq-item__inner { padding-right: 0; }
  .curious { grid-template-columns: minmax(0, 1fr); border-radius: var(--r-l); }
  .curious__actions .btn { flex: 1 1 100%; }
}

@media (max-width: 900px) {
  .faq-spores {
    -webkit-mask-image: linear-gradient(180deg, transparent 0 42%, #000 85%);
    mask-image: linear-gradient(180deg, transparent 0 42%, #000 85%);
  }
  [data-glow="on"] .faq-spores {
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, .3) 0 42%, #000 85%);
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, .3) 0 42%, #000 85%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .faq-spores i { animation: none !important; transform: translate3d(0, var(--y), 0); opacity: .7; }
  html:not([data-glow="on"]) .faq-spores { display: none; } /* frozen dots read as dust by day */
  .curious__glow, .curious__mark { animation: none !important; }
}
