/* Insight Bay Field Guides openings v3 (12 Nov 2026). Pairs with assets/js/guides-v3.js. Colours are the --ib-* tokens.
   The stage is a dark instrument plate (the footer token) in both themes. Everything in it is decoration (aria-hidden).
   No JS: the stage shows its static figure (inside noscript). Reduced motion: guides-v3.js paints one still.
   Layout (takeover pass): readouts sit in a row at the TOP of the stage, the canvas fills the rest. On a volume page the
   stage stands right under the H1, so on a phone the first screen is the title, the live figure and the sticky buy bar,
   and the stage always runs past the bottom of the first screen (no page words ever sit behind the fixed buy bar). */
.gv-pre { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding-top: 1rem !important; }
.gv-pre > nav { margin-bottom: 0 !important; }
.gv-stage {
  --gv-in: cubic-bezier(.23, 1, .32, 1);
  position: relative; isolation: isolate; overflow: hidden; border-radius: 1.5rem;
  height: clamp(340px, 54vh, 500px);
  display: block;
  background: var(--ib-footer-bg, #20201E); color: var(--ib-footer-text, #F5F1EB);
  border: 1px solid var(--ib-footer-line, rgba(245,241,235,.12));
  box-shadow: var(--ib-shadow-lg);
  contain: layout paint;
  touch-action: pan-y; cursor: grab;
}
.gv-stage.is-drag { cursor: grabbing; }
.gv-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.gv-static { position: absolute; inset: 4.5rem 0 0 0; display: grid; place-items: center; padding: 1.25rem; }
.gv-static svg { width: min(100%, 44rem); height: 100%; max-height: 100%; stroke: var(--ib-footer-text); }
.gv-ro { position: absolute; top: 0; left: 0; right: 12.5rem; padding: .85rem; display: flex; flex-wrap: wrap; gap: .4rem; pointer-events: none; z-index: 2; min-width: 0; }
.gv-r { display: flex; flex-direction: column; gap: .14rem; padding: .42rem .7rem .46rem; border-radius: .75rem; min-width: 5.2rem;
  background: color-mix(in srgb, var(--ib-footer-bg, #20201E) 70%, var(--ib-footer-text, #F5F1EB) 4%); border: 1px solid var(--ib-footer-line, rgba(245,241,235,.12)); }
.gv-k { font: 500 .62rem/1.15 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--ib-footer-text-faint, rgba(245,241,235,.55)); white-space: nowrap; }
.gv-v { min-height: 1.2em; font: 600 1.02rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ib-footer-text, #F5F1EB); white-space: nowrap; display: flex; align-items: flex-start; font-variant-numeric: tabular-nums; }
.gv-dg { display: inline-block; height: 1.2em; overflow: hidden; vertical-align: top; }
.gv-dg i { display: block; font-style: normal; white-space: pre; line-height: 1.2; transition: transform .45s var(--gv-in); }
.gv-ch { display: inline-block; height: 1.2em; }
.gv-hint { position: absolute; top: 0; right: 0; max-width: 12.5rem; padding: 1.2rem 1.1rem 0 .5rem; text-align: right; justify-content: flex-end; z-index: 2; pointer-events: none; display: flex; align-items: center; gap: .5rem;
  font: 500 .66rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--ib-footer-text-faint, rgba(245,241,235,.6)); transition: opacity .5s var(--gv-in); visibility: hidden; white-space: normal; }
.gv-stage.is-live .gv-hint { visibility: visible; }
.gv-hint::before { content: ''; flex: 0 0 auto; width: .45rem; height: .45rem; border-radius: 50%; background: var(--ib-accent); animation: gv-pulse 1.6s ease-in-out infinite; }
.gv-stage.is-used .gv-hint { opacity: 0; }
@keyframes gv-pulse { 50% { transform: scale(1.6); opacity: .5; } }
.gv-stage.is-live .gv-static { display: none; }
@media (max-width: 1100px) { .gv-hint { display: none; } .gv-ro { right: 0; } }
@media (max-width: 560px) {
  .gv-stage { border-radius: 1.1rem; }
  .gv-r { min-width: 0; padding: .3rem .5rem .34rem; border-radius: .6rem; }
  .gv-v { font-size: .74rem; } .gv-k { font-size: .54rem; letter-spacing: .08em; }
  .gv-ro { padding: .55rem .55rem .1rem; gap: .3rem; }
}
@media (prefers-reduced-motion: reduce) { .gv-hint::before { animation: none; } .gv-dg i { transition: none; } }

/* ---- volume pages: the stage stands under the H1, the paragraph follows it */
.gv-pdp .gv-wrap { margin: 1.4rem 0 .4rem; }
.gv-pdp .gv-stage { height: clamp(380px, calc(100vh - 395px), 600px); }
@media (min-width: 960px) {
  /* the figure is the star of the first screen: the main column takes more of the row, the cover column less */
  .ib-pdp.gv-pdp { grid-template-columns: minmax(0, 1.85fr) minmax(20rem, .8fr); gap: 3rem; }
  .gv-pdp .gv-stage[data-gv="sat"] { height: clamp(380px, calc(100vh - 455px), 600px); }
}
/* the H1's 18ch width is measured in the "0" of whichever font is drawing it; before Inter arrives the fallback's narrower
   "0" made the box narrower, the title took an extra line and the stage under it jumped (CLS). The same width in em
   (18 x 0.6825 em, Inter's "0") does not change when the font does. */
.gv-pdp .ib-pdp__main > h1 { max-width: 12.3em !important; }
/* the cover files are 1400 by 1982: reserve that shape, so nothing below the cover moves when it arrives */
.gv-pdp .ib-buybox__cover { aspect-ratio: 1400 / 1982; height: auto; object-fit: cover; }
@media (max-width: 959px) {
  /* the sticky buy bar shows below 960 px: the stage runs past the first screen, so only the stage sits behind the bar */
  .gv-pdp .gv-wrap { margin: 1rem 0 .5rem; }
  .gv-pdp .gv-stage { height: max(26rem, calc(100svh - 18rem)); }
}

/* ---- index pages (field guides, shop): the shelf */
.gv-shelf { height: clamp(460px, 78vh, 700px); }
.gv-shelf.is-live ~ .ib-pair .ib-pair__stage, .sv3 .gv-shelf ~ .ib-pair .ib-pair__stage { display: none; }
.gv-shelf ~ .ib-pair { margin-top: 1rem; }
.gv-col.ib-reveal { opacity: 1; transform: none; transition: none; }
.gv-shelf .gv-v { font-size: .86rem; }
.gv-shelf .gv-r { min-width: 0; }
@media (max-width: 900px) {
  /* phone order: eyebrow, H1, the shelf, then the rest of the copy (the left column's children join the hero grid) */
  .ib-fg-hero:has(> .gv-col) { row-gap: 0; }
  .ib-fg-hero:has(> .gv-col) > div:first-child { display: contents; }
  .ib-fg-hero:has(> .gv-col) > div:first-child > * { order: 3; }
  .ib-fg-hero:has(> .gv-col) > div:first-child > :is(.ib-eyebrow, h1) { order: 1; }
  .ib-fg-hero:has(> .gv-col) > div:first-child > .ib-eyebrow { justify-self: start; }
  .ib-fg-hero > .gv-col { order: 2; margin: 1.1rem 0 1.75rem; }
  .gv-shelf { height: max(26rem, calc(100svh - 15.5rem)); }
}
@media (max-width: 560px) { .gv-shelf .gv-v { font-size: .74rem; } }

/* ---- single-card pages (free note, practice gate): the stage stands beside the card on wide screens, above it on phones */
.gv-side { height: auto; margin: 0 0 1.5rem; width: 100%; max-width: 34rem; border-radius: 1.1rem; }
.gv-side { height: clamp(330px, 46vh, 420px); }
@media (min-width: 1200px) {
  .gv-side { position: fixed; top: 0; right: 0; bottom: 0; width: 62vw; max-width: none; height: auto; margin: 0; border-radius: 0; border-width: 0 0 0 1px; z-index: 0; }
  .gv-fn .fn-wrap { align-items: flex-start; padding-left: clamp(1.5rem, 7vw, 8rem); padding-right: 64vw; }
  #ib-gate .ib-gate-wrap { margin: 0 0 0 5vw; max-width: 24rem; position: relative; z-index: 1; }
}
.gv-fn .fn-wrap { position: relative; z-index: 1; }
/* practice gate: the stats block is hidden until stats.js arrives; when the gate showed first, the form below jumped
   262 px (CLS). Keep its room from the start, invisible until the page's own script un-hides it. Two ids, so it outranks
   the page's own "#ib-gate [hidden] { display: none !important }", which sits later in the document. */
#ib-gate #ib-gate-stats[hidden] { display: block !important; visibility: hidden; }
