/* FAQ comp (/faq): a page for reading, set like the index of a good report.
   Built on tokens.css + site.css; this file only adds what the FAQ needs and site.css does not
   have: the hero with its contents rail (pinned on desktop, with a cobalt tick that follows the
   group you are reading), the reading-size group heads, the FAQ's measures for the accordion
   (19 px questions, a cobalt icon when open, the source line under answer 1), the "Open all
   answers" button and the closing call to action's headline. The header, footer, hero label,
   section titles and the call-to-action band's parts are shared (site.css). Breakpoints as
   site.css (480, 720, 1100), plus 1280, where the rail settles into columns 10 to 12. */

/* ===================================================================== Page */
.faq-page {
  --faq-q: 1.1875rem; /* 19 px: the questions and the group ledes share one size */
  --faq-rail-top: var(--s-9); /* under the compact header, with room to breathe */
  position: relative;
  isolation: isolate;
  padding-top: var(--s-8);
}
@media (min-width: 1100px) {
  .faq-page {
    padding-top: var(--s-9);
  }
}

/* The faint paper grid: up under the transparent header, fading out to the right and down.
   No cobalt light here: the hero's one cobalt moment is the contents' tick. */
.faq-backdrop {
  inset: calc(-1 * var(--s-9)) 0 auto;
  height: calc(var(--s-9) + 640px);
}
.faq-backdrop::before {
  -webkit-mask-image:
    linear-gradient(to right, #000 20%, rgba(0, 0, 0, 0.4) 62%, transparent 92%),
    linear-gradient(to bottom, #000 35%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, #000 20%, rgba(0, 0, 0, 0.4) 62%, transparent 92%),
    linear-gradient(to bottom, #000 35%, transparent 100%);
  mask-composite: intersect;
}
.faq-backdrop::after {
  content: none;
}

/* ===================================================================== Grid */
/* One grid for the hero, the contents and the groups, so the contents can stay pinned beside
   the groups on desktop. Phones and tablets: hero, contents, groups, in reading order. */
.faq-grid {
  display: grid;
  grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
  column-gap: var(--gutter);
}
.faq-grid > * {
  grid-column: 1 / -1;
  min-width: 0;
}
@media (min-width: 720px) and (max-width: 1099.98px) {
  .faq-hero,
  .faq-groups {
    grid-column: 1 / span 10;
  }
  .faq-rail {
    grid-column: 1 / span 7;
  }
}
@media (min-width: 1100px) {
  .faq-hero {
    grid-column: 1 / span 8;
    grid-row: 1;
  }
  .faq-groups {
    grid-column: 1 / span 8;
    grid-row: 2;
  }
  /* 1100 to 1279: four columns, so "Early access and pricing" keeps to one line */
  .faq-rail {
    grid-column: 9 / span 4;
    grid-row: 1 / span 2;
    padding-left: var(--s-4);
  }
  .faq-rail-in {
    position: sticky;
    top: var(--faq-rail-top);
  }
  /* pinned beside the reading column, the contents step back to the header's 15 px */
  .faq-toc .faq-toc-link {
    font-size: var(--fs-small);
  }
}
@media (min-width: 1280px) {
  .faq-rail {
    grid-column: 10 / span 3;
    padding-left: 0;
  }
}

/* ===================================================================== Hero */
/* 15ch of Inter's display cut, written in em: a ch is measured on whichever font is showing, and
   the stand-in's is 12% narrower, so in ch the headline would run a line longer until Inter
   arrives. */
.faq-title {
  max-width: 9.57em;
}
.faq-lede {
  max-width: 46ch;
}
/* The two masked lines need the room of eight columns. Narrower, the headline flows and
   balances as one sentence, and holds still. */
@media (max-width: 1099.98px) {
  .faq-title .line,
  .faq-title .line > span {
    display: inline;
    overflow: visible;
    margin: 0;
    padding: 0;
    animation: none;
  }
}
@media (min-width: 1100px) {
  .faq-title {
    max-width: none;
  }
}

/* ===================================================================== Contents */
/* Drawn like a report's index: a mono label, five rows between hairlines, the mono index on
   the left and the count of questions on the right, in tabular figures. */
.faq-rail {
  margin-top: var(--s-7);
}
@media (min-width: 1100px) {
  .faq-rail {
    margin-top: 0;
  }
}
.faq-toc-label {
  display: block;
  margin: 0 0 var(--s-3);
}
.faq-toc-track {
  position: relative;
}
.faq-toc-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}
.faq-toc-list > li {
  border-bottom: 1px solid var(--border);
}
.faq-toc-link {
  display: grid;
  grid-template-columns: var(--s-6) minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: var(--s-2);
  min-height: 48px;
  padding: var(--s-3) var(--s-2) var(--s-3) var(--s-4);
  border-radius: var(--r-xs);
  color: var(--text);
  font-size: var(--fs-body);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.005em;
  text-decoration: none;
  transition:
    background-color var(--dur-1) var(--ease-out),
    color var(--dur-1) var(--ease-out);
}
.faq-toc-link:hover {
  background: color-mix(in srgb, var(--text) 4%, transparent);
}
.faq-toc-link:active {
  background: color-mix(in srgb, var(--text) 7%, transparent);
}
.faq-toc-link:focus-visible {
  outline-offset: -2px;
}
.faq-toc-n,
.faq-toc-count {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
  transition: color var(--dur-1) var(--ease-out);
}
.faq-toc-count {
  min-width: 2ch;
  text-align: right;
}
.faq-toc-link:hover .faq-toc-n,
.faq-toc-link:hover .faq-toc-count,
.faq-toc-link[aria-current='location'] .faq-toc-n {
  color: var(--text);
}
/* Pinned beside the reading column, the rail says "you are here" at a glance: the group you are
   reading stays in ink, the others step back to ink-2. Only once faq.js has placed the tick, so
   without JavaScript (or unpinned, on tablets and phones) every name stays in ink. */
@media (min-width: 1100px) {
  .faq-toc-track.has-tick
    .faq-toc-link:not([aria-current='location']):not(:hover):not(:focus-visible) {
    color: var(--text-2);
  }
}

/* The tick: 2 px of cobalt on the left of the group you are reading, with a little of the
   gate's glow, only while the rail is pinned beside the groups. faq.js places it and slides it
   (250 ms); without JavaScript, or unpinned on tablets and phones (where the contents are a plain
   list above the groups), it is not there. */
.faq-toc-tick {
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: var(--tick-h, var(--s-5));
  border-radius: 2px;
  background: var(--brand);
  box-shadow: 0 0 10px 1px var(--gate-glow);
  transform: translateY(var(--tick-y, 0px));
  opacity: 0;
  pointer-events: none;
}
@media (min-width: 1100px) {
  .faq-toc-track.has-tick .faq-toc-tick {
    opacity: 1;
  }
}
.faq-toc-track.is-ready .faq-toc-tick {
  transition:
    transform var(--dur-2) var(--ease-out),
    height var(--dur-2) var(--ease-out),
    opacity var(--dur-1) var(--ease-out);
}

/* "Open all answers": a plus that becomes a minus once all are open. It is in the first paint
   (faq.js only wires it up), so nothing below it moves when the script arrives; without
   JavaScript it is not there, as the theme switches are not. */
.faq-openall {
  margin-top: var(--s-5);
}
@media (scripting: none) {
  .faq-openall {
    display: none;
  }
}
/* phones and tablets: a full 44 px target, whatever the pointer */
@media (max-width: 1099.98px) {
  .faq-openall {
    min-height: 44px;
  }
}
.faq-openall-icon {
  position: relative;
  width: 12px;
  height: 12px;
  flex: none;
}
.faq-openall-icon::before,
.faq-openall-icon::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 1.75px;
  margin-top: -0.875px;
  border-radius: 2px;
  background: currentColor;
  transition: transform var(--dur-2) var(--ease-out);
}
.faq-openall-icon::after {
  transform: rotate(90deg);
}
.faq-openall.is-open .faq-openall-icon::after {
  transform: rotate(0deg);
}

/* ===================================================================== Groups */
.faq-group {
  padding-top: var(--section);
  /* A jump from the contents lands the group's index label 96 px down, level with the pinned
     rail's "On this page" (site.css keeps 88 px clear of the header; this adds 8 px and skips
     the section's top padding), not 160 px of empty paper further down. */
  scroll-margin-top: calc(var(--s-2) - var(--section));
}
.faq-group-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-4);
  margin-bottom: var(--s-7);
}
.faq-group-head .section-index {
  margin: 0;
}
.faq-group-title {
  margin: var(--s-1) 0 0;
}
.faq-group-lede {
  max-width: var(--measure-lede);
  font-size: var(--faq-q);
  line-height: 1.5;
  color: var(--text-2);
  text-wrap: pretty;
}
.faq-group-foot {
  margin-top: var(--s-5);
}

/* ===================================================================== Accordion */
/* site.css's accordion at the FAQ's measures: 19 px questions (17 on phones), answers at most
   62 characters wide, and the open row's icon in cobalt, the group's one cobalt moment. */
.faq-acc .accordion-summary {
  min-height: 72px;
  font-size: var(--faq-q);
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.faq-acc .accordion-summary {
  position: relative;
  /* opening pulls the answer 8 px up into the row's own padding, so it sits 16 px under its
     question (the copy deck's measure) while the question itself never moves */
  transition: margin-bottom var(--dur-2) var(--ease-out);
}
.faq-acc .accordion-item[open] > .accordion-summary {
  margin-bottom: calc(-1 * var(--s-2));
}
.faq-acc .accordion-summary > span:first-child {
  text-wrap: pretty;
}
/* Keyboard focus: the 2 px cobalt ring drawn inside the row's hairlines and 12 px out to the
   sides (8 px on phones), so the question and the icon have room inside it rather than touching
   it. The transparent outline keeps a ring in Windows' forced colours. */
.faq-acc .accordion-summary:focus-visible {
  outline: 2px solid transparent;
  outline-offset: -2px;
}
.faq-acc .accordion-summary:focus-visible::before {
  content: '';
  position: absolute;
  inset: var(--s-1) calc(-1 * var(--s-3));
  border-radius: var(--r-sm);
  box-shadow: 0 0 0 2px var(--focus);
  pointer-events: none;
}
@media (max-width: 719.98px) {
  .faq-acc .accordion-summary:focus-visible::before {
    inset-inline: calc(-1 * var(--s-2));
  }
}
.faq-acc .accordion-panel {
  max-width: 62ch;
  padding: 0 var(--s-8) var(--s-6) 0;
}
.faq-acc .accordion-panel p {
  text-wrap: pretty;
}
.faq-acc .accordion-item[open] .accordion-icon {
  background: var(--info-bg);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 45%, transparent);
  color: var(--brand);
}
.faq-acc .accordion-item[open] > .accordion-summary:hover .accordion-icon {
  box-shadow: inset 0 0 0 1px var(--brand);
}
.faq-acc .accordion-item[open] > .accordion-summary:active .accordion-icon {
  background: color-mix(in srgb, var(--info-bg) 80%, var(--brand));
}
/* the source line under answer 1, for Meta's rule in it, in mono */
.faq-footnote {
  padding-top: var(--s-1);
}

@media (max-width: 719.98px) {
  .faq-group-lede,
  .faq-acc .accordion-summary {
    font-size: var(--fs-body);
  }
  .faq-acc .accordion-summary {
    min-height: 64px;
  }
  /* the full column on phones, so answers keep a comfortable 38 or so characters a line */
  .faq-acc .accordion-panel {
    padding-right: 0;
  }
}

/* ===================================================================== Call to action */
/* Two sentences, two lines, at every width: no one-word line on phones. Each line is a mask
   the words rise through once, as the band scrolls in (faq.js adds .is-waiting, then .is-in;
   without JavaScript or under reduced motion the headline simply stands). */
.faq-cta-title {
  max-width: none;
  /* 20 px to the line under it (the band's gap plus 4), the top of the brief's 16 to 20: at 52 px
     the bare 16 px gap read tighter than the space above the headline */
  margin-bottom: var(--s-1);
}
.faq-cta-line {
  display: block;
  overflow: clip;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}
.faq-cta-line > span {
  display: block;
}
.faq-cta-title.is-waiting .faq-cta-line > span {
  transform: translateY(105%);
}
.faq-cta-title.is-in .faq-cta-line > span {
  animation: line-up var(--dur-3) var(--ease-out) both;
}
.faq-cta-title.is-in .faq-cta-line + .faq-cta-line > span {
  animation-delay: var(--stagger);
}
@media (prefers-reduced-motion: reduce) {
  .faq-cta-title.is-waiting .faq-cta-line > span {
    transform: none;
  }
}
:root[data-motion='reduce'] .faq-cta-title.is-waiting .faq-cta-line > span {
  transform: none;
}
@media print {
  .faq-cta-title.is-waiting .faq-cta-line > span {
    transform: none;
  }
}
/* phones: a size of its own, so "Still have a question?" holds one line from 360 px */
@media (max-width: 479.98px) {
  .faq-cta-title {
    font-size: 1.875rem;
  }
}
