/* site/src/assets/css/page-faq.css
 * The FAQ page only. Loaded from src/pages/faq.html, used by nothing else.
 *
 * The page is a search that answers in public: an ink asking-band at the top,
 * then ten cards on paper. Each card owns an accent colour, and the colour of
 * whichever card the search likes best leaks into the band above it, so the
 * page visibly changes its mind as you type.
 *
 * Nothing here belongs in site.css — a second page must never inherit the
 * asking-band by accident.
 */

/* ── page scope ──────────────────────────────────────────────────────── */
/* The live accent starts neutral and is overwritten by faq.js with the
   colour of the closest answer. */
.ask, .answers, .next { --live: var(--teal); }

/* Controls that are useless without the script are not shown to someone who
   has no script. The <noscript> note explains what is missing instead. */
[data-needs-js] { display: none; }

/* Each card's own colour, and the tint it floods with when it is open. Two
   flat values rather than a colour function, so an older browser still gets
   the tint instead of nothing. */
.qa[data-hue="teal"]   { --accent: #00d9b8; --tint: #e6fbf7; }
.qa[data-hue="amber"]  { --accent: #ffb020; --tint: #fff4e0; }
.qa[data-hue="blue"]   { --accent: #2f6bff; --tint: #e9efff; }
.qa[data-hue="pink"]   { --accent: #ff5f8f; --tint: #ffecf1; }
.qa[data-hue="yellow"] { --accent: #ffd400; --tint: #fff9d9; }

/* ── the asking band ─────────────────────────────────────────────────── */
.ask {
	position: relative;
	background: var(--ink);
	color: var(--paper);
	padding: clamp(112px, 17vh, 190px) var(--gutter) clamp(44px, 7vh, 80px);
	overflow: hidden;
	border-bottom: 3px solid var(--live);
	transition: border-color .5s;
}

/* The oversized punctuation behind the band. faq.js swaps the character:
   "?" while browsing, "!" when one answer clearly wins, "…" when none do. */
.ask__glyph {
	position: absolute;
	right: -.06em; bottom: -.34em;
	font: 800 clamp(320px, 52vw, 720px)/.8 var(--display);
	color: transparent;
	-webkit-text-stroke: 2px var(--live);
	opacity: .16;
	pointer-events: none;
	user-select: none;
	transition: color .4s, opacity .4s, -webkit-text-stroke-color .5s;
}
.ask__glyph[data-hit] { color: var(--live); opacity: .12; }

.ask__inner { position: relative; max-width: var(--wide); margin: 0 auto; }

.ask__kicker { color: var(--live); transition: color .5s; }

.ask__title {
	margin-top: 14px;
	font: 800 clamp(44px, 8.6vw, 132px)/.9 var(--display);
	letter-spacing: -.045em;
	max-width: 14ch;
}
.ask__title em {
	font-style: normal;
	color: var(--live);
	transition: color .5s;
}

.ask__lead {
	margin-top: clamp(18px, 3vh, 30px);
	max-width: 54ch;
	color: rgba(251, 249, 244, .72);
	font-size: clamp(15px, 1.2vw, 19px);
}

/* ── the search itself ───────────────────────────────────────────────── */
.ask__form { margin-top: clamp(26px, 4.5vh, 46px); max-width: 780px; }
.ask__label { color: rgba(251, 249, 244, .5); display: block; margin-bottom: 10px; }

.ask__field {
	display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
	background: rgba(251, 249, 244, .07);
	border: 2px solid rgba(251, 249, 244, .22);
	border-radius: 18px;
	padding: 8px 8px 8px 16px;
	transition: border-color .3s, background .3s;
}
.ask__field:focus-within {
	border-color: var(--live);
	background: rgba(251, 249, 244, .11);
}

/* The listening dot. It only pulses while the form is on screen and the tab
   is in front — faq.js sets data-live for that. */
.ask__ear {
	flex: none;
	width: 12px; height: 12px; border-radius: 50%;
	background: var(--live);
	box-shadow: 0 0 16px var(--live);
	transition: background .5s;
}
.ask__ear[data-live] { animation: ear 2.2s ease-in-out infinite; }
@keyframes ear { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.6); opacity: .45; } }

.ask__input {
	flex: 1 1 14ch;
	min-width: 0;
	min-height: 44px;
	background: none;
	border: 0;
	color: var(--paper);
	font: 500 clamp(16px, 1.5vw, 21px)/1.2 var(--display);
	letter-spacing: -.01em;
}
.ask__input::placeholder { color: rgba(251, 249, 244, .38); }
.ask__input:focus { outline: none; } /* the whole field shows the focus ring */
.ask__input::-webkit-search-cancel-button { display: none; }

.ask__go, .ask__clear {
	flex: none;
	min-height: 44px;
	padding: 12px 20px;
	border: 0; border-radius: 12px;
	font: 500 13px/1 var(--mono);
	letter-spacing: .12em; text-transform: uppercase;
	cursor: pointer;
	transition: transform .2s, background .2s, color .2s;
}
.ask__go { background: var(--live); color: var(--ink); }
.ask__go:hover { transform: translateY(-2px); }
.ask__clear {
	background: none;
	color: rgba(251, 249, 244, .6);
	border: 1.5px solid rgba(251, 249, 244, .28);
}
.ask__clear:hover { color: var(--paper); border-color: var(--paper); }

.ask__field :where(button, input):focus-visible { outline: 3px solid var(--paper); outline-offset: 2px; }

/* What the search understood, in the visitor's own words. Empty until it has
   something true to say. */
.ask__heard {
	min-height: 1.6em;
	margin-top: 14px;
	font: 500 clamp(12px, 1vw, 14px)/1.5 var(--mono);
	letter-spacing: .06em;
	color: rgba(251, 249, 244, .52);
}
.ask__heard b { color: var(--live); font-weight: 500; }
.ask__heard i { font-style: normal; color: rgba(251, 249, 244, .8); }

.ask__chips {
	list-style: none;
	display: flex; flex-wrap: wrap; gap: 8px;
	margin-top: 12px;
}
.ask__chip {
	min-height: 44px;
	padding: 11px 16px;
	background: none;
	border: 1.5px solid rgba(251, 249, 244, .24);
	border-radius: 999px;
	color: rgba(251, 249, 244, .82);
	font: 400 14px/1 var(--mono);
	cursor: pointer;
	transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.ask__chip:hover { background: var(--live); border-color: var(--live); color: var(--ink); transform: rotate(-1.5deg); }
.ask__chip[aria-pressed="true"] { background: var(--live); border-color: var(--live); color: var(--ink); }

.ask__count {
	margin-top: clamp(18px, 3vh, 28px);
	font: 500 clamp(13px, 1.1vw, 16px)/1.4 var(--mono);
	color: rgba(251, 249, 244, .62);
}

.ask__noscript {
	margin-top: 22px;
	max-width: 52ch;
	padding: 14px 18px;
	border-left: 4px solid var(--amber);
	background: rgba(255, 176, 32, .12);
	color: rgba(251, 249, 244, .82);
	font-size: 15px;
}

/* ── the answers ─────────────────────────────────────────────────────── */
.answers {
	background: var(--paper);
	padding: clamp(46px, 8vh, 96px) var(--gutter) clamp(60px, 10vh, 120px);
}

.answers__title {
	max-width: var(--wide); margin: 0 auto clamp(20px, 3vh, 34px);
	font: 500 12px/1 var(--mono);
	letter-spacing: .18em; text-transform: uppercase;
	color: var(--ink-soft);
}

.answers__list {
	max-width: var(--wide);
	margin: 0 auto;
	display: grid;
	gap: 12px;
}

.qa {
	position: relative;
	background: #fff;
	border: 1px solid var(--line);
	border-left: 8px solid var(--accent, var(--teal));
	border-radius: 4px 14px 14px 4px;
	box-shadow: 0 2px 0 rgba(10, 10, 15, .04);
	transition: background .3s, opacity .3s, box-shadow .25s, border-left-width .25s;
}
.qa[open] { background: var(--tint, #fff); box-shadow: 0 14px 30px rgba(10, 10, 15, .1); }

.qa__q {
	display: flex; align-items: center; gap: clamp(10px, 1.6vw, 20px);
	min-height: 44px;
	padding: clamp(16px, 2.4vw, 24px) clamp(14px, 2.4vw, 26px);
	cursor: pointer;
	list-style: none;
	font: 700 clamp(17px, 2.05vw, 27px)/1.2 var(--display);
	letter-spacing: -.02em;
}
.qa__q::-webkit-details-marker { display: none; }
.qa__q:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; border-radius: 4px; }

.qa__n {
	flex: none;
	font: 500 clamp(11px, .9vw, 13px)/1 var(--mono);
	letter-spacing: .1em;
	color: var(--accent, var(--teal));
	padding-top: .25em;
}
.qa__text { flex: 1 1 auto; }

/* The highlighter swipe over the words the search matched. */
.qa__text mark {
	background: linear-gradient(transparent 55%, var(--accent, var(--yellow)) 55%);
	color: inherit;
	padding: 0 .06em;
}

/* Only the closest answer wears the badge, and only while something is typed. */
.qa__best {
	flex: none;
	display: none;
	font: 500 10px/1 var(--mono);
	letter-spacing: .14em; text-transform: uppercase;
	background: var(--accent, var(--teal));
	color: var(--ink);
	padding: 7px 10px;
	border-radius: 999px;
}
.qa[data-top] .qa__best { display: block; }

/* The chevron, drawn rather than typed so it does not depend on a glyph. */
.qa__mark {
	flex: none;
	width: 13px; height: 13px;
	border-right: 3px solid var(--ink-soft);
	border-bottom: 3px solid var(--ink-soft);
	transform: rotate(45deg) translate(-3px, -3px);
	transition: transform .25s, border-color .25s;
}
.qa[open] .qa__mark { transform: rotate(-135deg) translate(-3px, -3px); border-color: var(--accent, var(--ink)); }

.qa__a {
	padding: 0 clamp(14px, 2.4vw, 26px) clamp(20px, 3vw, 30px);
	display: grid; gap: 14px;
	max-width: 68ch;
	color: var(--ink-soft);
	font-size: clamp(15px, 1.12vw, 17.5px);
}
.qa__a strong { color: var(--ink); }
.qa__a a { color: var(--ink); text-decoration-color: var(--accent, var(--teal)); text-decoration-thickness: 3px; text-underline-offset: 3px; }
.qa__go a {
	display: inline-block;
	min-height: 44px;
	padding: 12px 0 0;
	font: 500 13px/1 var(--mono);
	letter-spacing: .1em; text-transform: uppercase;
	text-decoration-thickness: 2px;
}

/* A card the search did not pick is thinned rather than removed: still in the
   list, still focusable, still opens. Nothing on this page hides an answer. */
.qa[data-ghost]:not([open]) {
	opacity: .42;
	border-left-width: 3px;
	box-shadow: none;
}
.qa[data-ghost]:not([open]) .qa__q { font-size: clamp(14px, 1.3vw, 16px); padding-top: 11px; padding-bottom: 11px; }
.qa[data-ghost]:not([open]) .qa__n { display: none; }
/* Reaching for a ghost brings it back to full strength before it is clicked,
   so nobody has to guess whether a faded row is still a link. */
.qa[data-ghost]:not([open]):hover,
.qa[data-ghost]:not([open]):focus-within { opacity: 1; }

/* ── the card that is always there ───────────────────────────────────── */
.qa--ask {
	border-left-color: var(--ink);
	background: var(--ink);
	color: var(--paper);
	padding: clamp(22px, 3.4vw, 34px) clamp(18px, 3vw, 34px);
	display: grid; gap: 12px;
}
.qa--ask__h { font: 800 clamp(22px, 3vw, 38px)/1.05 var(--display); letter-spacing: -.03em; }
.qa--ask p { color: rgba(251, 249, 244, .74); max-width: 56ch; }
.qa--ask__links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }

/* ── buttons ─────────────────────────────────────────────────────────── */
.faq-btn {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 44px;
	padding: 13px 24px;
	border-radius: 999px;
	background: var(--teal);
	color: var(--ink);
	text-decoration: none;
	font: 500 13px/1 var(--mono);
	letter-spacing: .12em; text-transform: uppercase;
	transition: transform .2s, background .2s, color .2s;
}
.faq-btn:hover { transform: translateY(-2px); }
.faq-btn--ghost { background: none; color: currentColor; border: 1.5px solid currentColor; }
/* Both ghost buttons sit on ink, so the hover fills with paper. A
   currentColor fill would take on the ink text colour set in the same rule
   and paint the label out. */
.faq-btn--ghost:hover { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.faq-btn--big { padding: 18px 32px; font-size: 14px; }

/* ── the next stop ───────────────────────────────────────────────────── */
.next {
	background: var(--ink);
	color: var(--paper);
	padding: clamp(60px, 10vh, 130px) var(--gutter);
	border-top: 3px solid var(--live);
	transition: border-color .5s;
}
.next__inner { max-width: var(--wide); margin: 0 auto; }
.next__kicker { color: var(--amber); }
.next__title {
	margin-top: 14px;
	font: 800 clamp(32px, 5.6vw, 84px)/.96 var(--display);
	letter-spacing: -.04em;
	max-width: 18ch;
}
.next__title em { font-style: normal; color: var(--teal); }
.next__line { margin-top: 18px; max-width: 50ch; color: rgba(251, 249, 244, .7); }
.next__acts { display: flex; flex-wrap: wrap; gap: 14px; margin-top: clamp(24px, 4vh, 38px); }

.next__more {
	margin-top: clamp(38px, 6vh, 64px);
	padding-top: 22px;
	border-top: 1px solid rgba(251, 249, 244, .14);
	display: flex; flex-wrap: wrap; gap: 4px 6px;
}
.next__more a {
	display: inline-flex; align-items: center;
	min-height: 44px; padding: 10px 14px;
	border-radius: 999px;
	text-decoration: none;
	font: 400 14px/1 var(--mono);
	color: rgba(251, 249, 244, .62);
	transition: background .2s, color .2s;
}
.next__more a:hover { background: rgba(251, 249, 244, .1); color: var(--paper); }

/* ── small screens ───────────────────────────────────────────────────── */
@media (max-width: 560px) {
	.ask__glyph { font-size: 300px; right: -.1em; opacity: .12; }
	.ask__title { max-width: none; }
	.ask__go, .ask__clear { flex: 1 1 auto; }
	.qa { border-radius: 3px 10px 10px 3px; }
	.qa__q { gap: 10px; }
	.qa__best { display: none !important; } /* no room beside the question */
	.faq-btn--big { width: 100%; }
}

/* ── motion ──────────────────────────────────────────────────────────── */
/* site.css already flattens transitions for a visitor who asked for less
   motion; the pulse is switched off here as well, and faq.js skips the
   reordering animation entirely. */
@media (prefers-reduced-motion: reduce) {
	.ask__ear[data-live] { animation: none; }
	.ask__chip:hover { transform: none; }
}
