/* Insight Bay library group v3 (12 Nov 2026): /blog and the four curriculum landing pages.
   Pairs with assets/js/library-v3.js. Colours are the --ib-* tokens only (mixes via color-mix). Prefix: lv3-.
   Everything that hides or moves lives behind html.sv3-m or html.lv3-m, so without JavaScript (and with reduced
   motion) every page is complete and still. Scroll-linked pieces use transform and opacity only. */

:root { --lv3-in: cubic-bezier(.23, 1, .32, 1); --lv3-move: cubic-bezier(.77, 0, .175, 1); }

/* ======================================================================================================
   A. CURRICULUM OPENING: a live orbit behind the page's own cells
   ====================================================================================================== */
.lv3-hero { position: relative; overflow: hidden; overflow: clip; }
.lv3-hero > .ib-container { position: relative; z-index: 1; }
.lv3-cv { position: absolute; left: -16px; top: -16px; width: calc(100% + 32px); height: calc(100% + 32px); pointer-events: none; z-index: 0; display: none; will-change: transform; }
.lv3-hero.lv3-live .lv3-cv { display: block; }

/* No JavaScript: a still orbit, drawn in SVG, with the satellite near the first stage. */
.lv3-still { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; color: var(--ib-ink); }
.lv3-hero.lv3-live .lv3-still { display: none; }
.lv3-still .o { fill: none; stroke: currentColor; stroke-opacity: .2; stroke-width: 1.2; }
.lv3-still .s { fill: var(--ib-accent); fill-opacity: .1; }
.lv3-still .r { stroke: var(--ib-accent); stroke-opacity: .55; stroke-width: 1; }
.lv3-still .m { fill: none; stroke: currentColor; stroke-opacity: .4; stroke-width: 1.2; }
.lv3-still .sat { fill: currentColor; }
.lv3-still .satc { fill: var(--ib-accent); }

/* The card of cells is the dial. */
.lv3-card { position: relative; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
html.sv3 .lv3-card { cursor: ew-resize; }
.lv3-card.lv3-drag { cursor: grabbing; }
.lv3-card:focus-visible { outline: 2px solid var(--ib-accent); outline-offset: 4px; }
.lv3-card .grid > div { position: relative; }
.lv3-card .grid > div::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  border: 1.5px solid var(--ib-accent); background: color-mix(in srgb, var(--ib-accent) 9%, transparent);
  opacity: 0; transition: opacity .35s ease;
}
.lv3-card .grid > div.lv3-on::after { opacity: 1; }

/* The trace under the cells. Its space is reserved from the first paint on (html.sv3), so nothing shifts. */
.lv3-trace { display: none; margin-top: 1.2rem; padding-top: .9rem; border-top: 1px solid var(--ib-line); }
html.sv3 .lv3-trace { display: block; }
.lv3-trace canvas { display: block; width: 100%; height: 5.4rem; }
.lv3-read { margin-top: .65rem; min-height: 3.5rem; font-size: .76rem; line-height: 1.5; color: var(--ib-ink-muted); font-variant-numeric: tabular-nums; }
.lv3-read span { display: flex; flex-wrap: wrap; gap: .1rem 1rem; }
.lv3-read b { font-weight: 500; }
.lv3-read .lv3-r1 b:first-child, .lv3-read .lv3-r2 b:first-child { color: var(--ib-ink); }
.lv3-read .lv3-hint { margin-top: .3rem; font-size: .7rem; letter-spacing: .02em; opacity: .8; }

/* ======================================================================================================
   B. SECTIONS (curriculum pages). --p is the section's own scroll progress, written by library-v3.js.
   ====================================================================================================== */
.lv3-cover, .lv3-naplan, .lv3-portal, .lv3-edu, .lv3-price, .lv3-cta { --p: 1; }
html.lv3-m .lv3-cover, html.lv3-m .lv3-naplan, html.lv3-m .lv3-portal, html.lv3-m .lv3-cta { --p: 0; }
html.lv3-m .lv3-edu, html.lv3-m .lv3-price { --p: .5; }

/* cover: the stage track draws across, a dot travels it, a marker lights under each card as it passes */
.lv3-track { display: none; position: relative; height: 1.1rem; margin-top: 2.2rem; margin-bottom: -.4rem; }
html.lv3-m .lv3-track { display: block; }
.lv3-track .lv3-line { position: absolute; left: 0; right: 0; top: 50%; height: 1px; transform-origin: left center; transform: scaleX(var(--p)); background: linear-gradient(90deg, var(--ib-accent), color-mix(in srgb, var(--ib-ink) 20%, transparent)); }
.lv3-track .lv3-dot { position: absolute; left: 0; top: 50%; width: .6rem; height: .6rem; margin: -.3rem 0 0 -.3rem; border-radius: 50%; background: var(--ib-accent);
  box-shadow: 0 0 0 .3rem color-mix(in srgb, var(--ib-accent) 18%, transparent); transform: translateX(calc(var(--p) * var(--w, 0px))); }
.lv3-track b { position: absolute; top: 50%; width: .7rem; height: .7rem; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--ib-ink) 34%, transparent);
  background: var(--ib-bg-soft); transform: translate(-50%, -50%) scale(.7); transition: transform .5s var(--lv3-in), background-color .3s ease, border-color .3s ease; }
.lv3-track b.is-on { transform: translate(-50%, -50%) scale(1); background: var(--ib-accent); border-color: var(--ib-accent); }

/* naplan: a line bridges the two cards behind them and a node settles in the gap */
.lv3-naplan .ib-grid { position: relative; }
.lv3-naplan .ib-grid > * { position: relative; z-index: 1; }
@media (min-width: 700px) {
  html.lv3-m .lv3-naplan .ib-grid::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; z-index: 0; transform-origin: left center; transform: scaleX(var(--p));
    background: linear-gradient(90deg, var(--ib-accent), color-mix(in srgb, var(--ib-ink) 24%, transparent)); }
  html.lv3-m .lv3-naplan .ib-grid::after { content: ""; position: absolute; left: 50%; top: 50%; width: .7rem; height: .7rem; margin: -.35rem 0 0 -.35rem; z-index: 2; border-radius: 50%;
    background: var(--ib-accent); box-shadow: 0 0 0 .35rem color-mix(in srgb, var(--ib-accent) 18%, transparent); opacity: var(--p); transform: scale(calc(.6 + .4 * var(--p))); }
}

/* portal: a tilted orbit ring turns behind the text as the section passes */
html.lv3-m .lv3-portal > .ib-container { position: relative; }
html.lv3-m .lv3-portal > .ib-container > * { position: relative; z-index: 1; }
html.lv3-m .lv3-portal > .ib-container::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: min(46rem, 96vw); aspect-ratio: 1; z-index: 0; pointer-events: none; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--ib-ink) 12%, transparent); border-top-color: var(--ib-accent); border-right-color: color-mix(in srgb, var(--ib-accent) 35%, transparent);
  transform: translate(-50%, -50%) scaleY(.34) rotate(calc(var(--p) * 220deg));
}

/* educator: the portrait drifts inside its frame against the scroll */
html.lv3-m .lv3-edu .ib-educator-card__portrait img { transform: translate3d(0, calc((.5 - var(--p)) * 2.6rem), 0) scale(1.12); will-change: transform; }

/* pricing: the block counter-drifts, slower than the page */
html.lv3-m .lv3-price > .ib-container > div { transform: translate3d(0, calc((.5 - var(--p)) * 1.8rem), 0); will-change: transform; }

/* final block: eases up to full size while an orbit turns inside it */
html.lv3-m .lv3-cta > .ib-container > div { position: relative; overflow: hidden; transform: scale(calc(.955 + .045 * var(--p))); transform-origin: 50% 50%; }
html.lv3-m .lv3-cta > .ib-container > div > * { position: relative; z-index: 1; }
html.lv3-m .lv3-cta > .ib-container > div::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 52rem; max-width: 150%; aspect-ratio: 1; z-index: 0; pointer-events: none; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--ib-emphasis-text) 14%, transparent); border-top-color: var(--ib-accent); border-left-color: color-mix(in srgb, var(--ib-accent) 40%, transparent);
  transform: translate(-50%, -50%) scaleY(.3) rotate(calc(var(--p) * -260deg));
}

/* ======================================================================================================
   C. BLOG: a library you can browse
   ====================================================================================================== */
.lv3-shelf.ib-anim { animation: none; position: relative; margin-top: 2.4rem; }
html:not(.sv3) .lv3-shelf { display: none; }
.lv3-row { display: flex; align-items: flex-end; gap: clamp(2px, .28vw, 5px); height: 10.6rem; clip-path: inset(-60px -12px 0 -12px); }
.lv3-row i {
  display: block; position: relative; flex: var(--g, 1) 1 0; min-width: 4px; max-width: 2.1rem; height: var(--h, 100px);
  border-radius: 3px 3px 1px 1px; transform-origin: 50% 100%; cursor: pointer;
  background: color-mix(in srgb, var(--ib-accent) 100%, var(--ib-ink) 0%);
  transition: transform .5s var(--lv3-move), opacity .45s ease;
}
.lv3-row i[data-t="0"] { background: color-mix(in srgb, var(--ib-accent) 100%, var(--ib-ink)); }
.lv3-row i[data-t="1"] { background: color-mix(in srgb, var(--ib-accent) 72%, var(--ib-ink)); }
.lv3-row i[data-t="2"] { background: color-mix(in srgb, var(--ib-accent) 46%, var(--ib-bg)); }
.lv3-row i[data-t="3"] { background: color-mix(in srgb, var(--ib-ink) 44%, var(--ib-bg)); }
.lv3-row i[data-t="4"] { background: color-mix(in srgb, var(--ib-ink) 22%, var(--ib-bg)); }
.lv3-row i[data-t="5"] { background: color-mix(in srgb, var(--ib-accent) 26%, var(--ib-bg)); }
.lv3-row i::before, .lv3-row i::after { content: ""; position: absolute; left: 0; right: 0; height: 3px; background: color-mix(in srgb, var(--ib-bg) 52%, transparent); }
.lv3-row i::before { top: 12%; }
.lv3-row i::after { bottom: 16%; height: 2px; }
.lv3-row i.lv3-up { transform: translateY(-14px); }
.lv3-row i.lv3-lean-l { transform: rotate(-3.5deg); }
.lv3-row i.lv3-lean-r { transform: rotate(3.5deg); }
.lv3-row i.lv3-off { opacity: .18; transform: translateY(9px); }
.lv3-plank { position: relative; z-index: 2; height: .62rem; margin-top: -1px; border-radius: 2px; transform-origin: left center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--ib-ink) 24%, var(--ib-bg)), color-mix(in srgb, var(--ib-ink) 10%, var(--ib-bg)));
  box-shadow: 0 16px 24px -16px color-mix(in srgb, var(--ib-ink) 38%, transparent); }
.lv3-tip { position: absolute; z-index: 5; left: var(--x, 50%); top: 0; width: max-content; max-width: min(22rem, 86vw); padding: .5rem .8rem; border-radius: .5rem;
  background: var(--ib-ink); color: var(--ib-bg); font-size: .8rem; line-height: 1.4; pointer-events: none;
  opacity: 0; transform: translate(-50%, -115%); transition: opacity .25s ease; }
.lv3-tip.is-on { opacity: 1; }
@media (max-width: 720px) { .lv3-row { height: 9.4rem; } .lv3-row i { min-width: 3px; } }

html.sv3-m .lv3-row i { animation: lv3-spine .95s var(--lv3-in) backwards; animation-delay: calc(.02s + var(--i, 0) * .012s); }
@keyframes lv3-spine { from { translate: 0 112%; } to { translate: 0 0; } }
html.sv3-m .lv3-plank { animation: lv3-plank .8s var(--lv3-in) backwards; }
@keyframes lv3-plank { from { transform: scaleX(0.02); } to { transform: scaleX(1); } }

/* the featured essay: two columns wide, side by side, large */
.ib-libgroup .ib-grid[data-filter-target] { grid-auto-flow: dense; }
@media (min-width: 960px) {
  .ib-post.lv3-feature { grid-column: span 2; flex-direction: row; }
  .ib-post.lv3-feature .thumb { flex: 1.15 1 0; aspect-ratio: auto; min-height: 17rem; border-bottom: 0; border-right: 1px solid var(--ib-line); }
  .ib-post.lv3-feature .thumb::after { font-size: clamp(3.4rem, 6vw, 5.2rem); }
  .ib-post.lv3-feature .body { flex: 1 1 0; padding: 2.2rem 2rem; justify-content: center; }
  .ib-post.lv3-feature h3 { font-size: 1.75rem; line-height: 1.22; }
  .ib-post.lv3-feature .dek { font-size: 1.02rem; }
}
.lv3-tag { position: absolute; z-index: 2; left: .9rem; top: .9rem; padding: .22rem .65rem; border-radius: 62.4375rem; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 600;
  background: var(--ib-accent-ink, var(--ib-accent)); color: var(--ib-bg); }
.ib-post.lv3-feature .thumb::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: repeating-linear-gradient(0deg, transparent 0 2.4375rem, var(--ib-grid-line) 2.4375rem 2.5rem), repeating-linear-gradient(90deg, transparent 0 2.4375rem, var(--ib-grid-line) 2.4375rem 2.5rem); }

/* cards slide into their shelves (each group from its own side), then a plank draws under the group */
html.sv3-m .ib-post.lv3-w { opacity: 0; translate: var(--lv3x, 0) var(--lv3y, 0); }
html.sv3-m [data-lv3-dir="r"] .ib-post.lv3-w { --lv3x: .5rem; }
html.sv3-m [data-lv3-dir="l"] .ib-post.lv3-w { --lv3x: -.5rem; }
html.sv3-m [data-lv3-dir="u"] .ib-post.lv3-w { --lv3y: .5rem; }
html.sv3-m .ib-post.lv3-w.is-in { opacity: 1; translate: 0 0;
  transition: opacity .6s ease var(--d, 0s), translate 1s var(--lv3-in) var(--d, 0s), transform .25s ease, box-shadow .25s ease; }
.ib-post.lv3-flash { animation: lv3-flash 1.4s ease; }
@keyframes lv3-flash { 0%, 100% { outline: 2px solid transparent; outline-offset: 3px; } 25%, 70% { outline: 2px solid var(--ib-accent); outline-offset: 5px; } }

.lv3-g > .ib-container { position: relative; }
.lv3-g > .ib-container::after { content: ""; display: block; height: .5rem; margin-top: 1.6rem; border-radius: 2px; transform-origin: left center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--ib-ink) 20%, var(--ib-bg)), color-mix(in srgb, var(--ib-ink) 8%, var(--ib-bg)));
  box-shadow: 0 14px 22px -16px color-mix(in srgb, var(--ib-ink) 34%, transparent); }
html.sv3-m .lv3-g:not(.lv3-in) > .ib-container::after { transform: scaleX(.02); }
html.sv3-m .lv3-g.lv3-in > .ib-container::after { transform: scaleX(1); transition: transform 1.1s var(--lv3-in) .2s; }

@media (prefers-reduced-motion: reduce) {
  .lv3-row i, .lv3-plank { animation: none !important; }
  .lv3-row i, .lv3-tip { transition: none; }
}

/* The finder bar's own text arrives after first paint (counts, the showing line). Reserve its room so nothing shifts. */
.ib-filter-bar button .cnt { display: inline-block; min-width: 1.35em; text-align: left; }
.ib-dir-count { min-height: 1.45em; }

/* The cells float over the scene: a glass card, so the 3D ribbon reads through it. */
html.sv3 .lv3-card { background: color-mix(in srgb, var(--ib-bg-soft) 52%, transparent); border: 1px solid color-mix(in srgb, var(--ib-ink) 10%, transparent); }
html.sv3 .lv3-card .grid > div { background: color-mix(in srgb, var(--ib-card-bg) 70%, transparent) !important; }

/* THE CASE: a lit bookcase of the page's own essays, drawn on a canvas. Its room is reserved from first paint. */
.lv3-case.lv3-shelf { height: clamp(19rem, 29vw, 26rem); margin-top: 2rem; border-radius: .6rem; overflow: hidden; touch-action: pan-y; }
.lv3-cvs { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lv3-panel { position: absolute; right: .9rem; bottom: .8rem; z-index: 2; display: flex; flex-direction: column; align-items: flex-end; gap: .1rem; padding: .45rem .75rem; border-radius: .5rem;
  font-size: .74rem; line-height: 1.45; font-variant-numeric: tabular-nums; color: var(--ib-ink); background: color-mix(in srgb, var(--ib-bg) 78%, transparent); pointer-events: none; }
@media (max-width: 720px) { .lv3-case.lv3-shelf { height: 17rem; } .lv3-panel { left: .6rem; right: .6rem; align-items: flex-start; font-size: .68rem; } }
@media (max-width: 720px) { .lv3-read { min-height: 6rem; } .lv3-read b { white-space: nowrap; } }

/* IB Mathematics AA (12 Nov 2026): at desktop widths "IB Mathematics AA," is a few pixels wider than its column in Inter
   (604 against 598 at 1440) but narrower in the fallback fonts, so the H1 went from three lines to four when Inter arrived:
   CLS 0.028. A width in em, between "taught by a rocket" (8.47em) and "IB Mathematics AA," in Arial (8.85em), makes it
   break after "Mathematics" in every font: the four lines visitors already saw once Inter loaded, now from the first paint. */
@media (min-width: 1024px) { .lv3-hero[data-lv3-hero="ib"] h1 { max-width: 8.66em; } }
