/* ============================================================
 * /guides/glossary  —  the question header's own pieces
 *
 * The question header comes from product-page.css. This file adds
 * the guide's byline inside the header and the glossary card on the
 * right: a small stack of index cards, the front one turning a term
 * into plain words. The term arrives, then what it stands for, then
 * what it means. Three terms, one quiet fifteen-second loop.
 * ============================================================ */

.breadcrumb + .product-hero:has(.q-head) { padding-block-start: var(--space-24); }

/* The byline: guides keep theirs. */
.q-text .glossary-meta {
  margin-block-start: var(--space-24);
  font-family: var(--font-sans);
  font-size: var(--type-body-s);
  color: var(--color-stone-60);
  letter-spacing: 0.01em;
}

/* THE GLOSSARY CARD */
.term-card { margin: 0; display: grid; gap: var(--space-16); justify-items: center; }
.term-card figcaption { color: var(--color-stone-60); text-align: center; }
.term-card-svg { display: block; inline-size: 100%; max-inline-size: 30rem; block-size: auto; overflow: visible; }

.term-sheet { fill: var(--color-paper); stroke: color-mix(in srgb, var(--color-navy) 14%, transparent); stroke-width: 1.2; }
.term-sheet.is-back { fill: color-mix(in srgb, var(--color-mist) 55%, var(--color-paper)); }
.term-sheet.is-mid { fill: color-mix(in srgb, var(--color-mist) 30%, var(--color-paper)); }
.term-sheet.is-front { stroke: color-mix(in srgb, var(--color-royal) 30%, transparent); }
.term-shade { fill: color-mix(in srgb, var(--color-navy) 7%, transparent); }

.term-kicker { font: 600 12px var(--font-sans); letter-spacing: 0.08em; text-transform: uppercase; fill: var(--color-royal); }
.term-word { font: 400 60px var(--font-display); fill: var(--color-midnight); }
.term-long { font: 600 18px var(--font-sans); fill: var(--color-navy); }
.term-initial { fill: var(--color-sky); }
.term-rule { fill: none; stroke: color-mix(in srgb, var(--color-royal) 30%, transparent); stroke-width: 1.2; transform-box: fill-box; transform-origin: left center; }
.term-plain { font: 400 17px var(--font-sans); fill: var(--color-stone-60); }

/* Each term holds the card for a third of the loop. Within it the word,
   then its expansion, then the rule and the plain words settle in. */
.term .term-kicker, .term .term-word,
.term .term-long, .term .term-rule, .term .term-plain {
  animation: 15s var(--ease-out) infinite both;
}
.term .term-kicker, .term .term-word { animation-name: term-in-1; }
.term .term-long { animation-name: term-in-2; }
.term .term-rule { animation-name: term-rule; }
.term .term-plain { animation-name: term-in-3; }
/* The loop opens on the first term already written out, so the card is
   never blank on arrival or in a still capture. */
.term.is-1 > * { animation-delay: -2.5s; }
.term.is-2 > * { animation-delay: 2.5s; }
.term.is-3 > * { animation-delay: 7.5s; }

@keyframes term-in-1 {
  0%          { opacity: 0; transform: translateY(6px); }
  3%, 30%     { opacity: 1; transform: none; }
  33.3%, 100% { opacity: 0; transform: none; }
}
@keyframes term-in-2 {
  0%, 4%      { opacity: 0; transform: translateY(6px); }
  8%, 30%     { opacity: 1; transform: none; }
  33.3%, 100% { opacity: 0; transform: none; }
}
@keyframes term-rule {
  0%, 8%      { opacity: 1; transform: scaleX(0); }
  13%, 30%    { opacity: 1; transform: scaleX(1); }
  33.3%, 100% { opacity: 0; transform: scaleX(1); }
}
@keyframes term-in-3 {
  0%, 11%     { opacity: 0; transform: translateY(4px); }
  15%, 30%    { opacity: 1; transform: none; }
  33.3%, 100% { opacity: 0; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  /* Still: the first term, written out in full. */
  .term-card .term > * { animation: none; }
  .term.is-2, .term.is-3 { display: none; }
}

@media (max-width: 575.98px) {
  .term-kicker { font-size: 14px; }
  .term-long { font-size: 20px; }
  .term-plain { font-size: 18.5px; }
}
