/* NonOp's library: compact chapters, with the existing paper and pastel palette. */
.page-hub .hero { padding: 24px 0 0; }
.page-hub .hero__stage { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.page-hub .hero__text { min-width: 0; }
.page-hub .hero h1 { max-width: 19ch; margin-bottom: 16px; font-size: clamp(2.15rem, 1.55rem + 2.2vw, 3.6rem); }
.page-hub .hero__lede { max-width: 35rem; margin: 0; font-size: 1.2rem; line-height: 1.55; }
.page-hub .hero__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 25rem; margin-top: 22px; }
.page-hub .hero__actions .btn { min-width: 0; min-height: 52px; padding: 10px 12px; font-size: 1rem; text-align: center; }
.hero__reassurance { max-width: 39rem; margin: 20px 0 0; color: var(--muted); font-size: 1rem; line-height: 1.6; }
.page-hub .hero__art { order: 0; justify-self: center; margin: 0; }
.page-hub .hero__art .motif { --m: 84px; }
.page-hub .hero-callout { margin-top: 14px; }
.page-hub .hero-callout .callout { padding: 18px 20px; border-radius: 18px; font-size: 1rem; line-height: 1.6; }

.page-hub .index { padding-block: 38px 0; scroll-margin-top: 24px; }
.page-hub .index h2 { font-size: clamp(1.7rem, 1.5rem + .8vw, 2.25rem); }
.page-hub .index > .wrap > p { max-width: 68ch; }
.page-hub .index__intro { margin-bottom: 12px; }
.page-hub .foundation-link { margin-bottom: 24px; font-size: 1rem; line-height: 1.6; }
.foundation-link a { font-weight: 760; }
.guide-search { max-width: 44rem; padding-bottom: 30px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.guide-search[hidden], .search-results[hidden], .search-empty[hidden], .search-results li[hidden] { display: none; }
.guide-search label { display: block; font-size: 1.32rem; font-weight: 800; line-height: 1.3; }
.search-hint { margin: 6px 0 12px; color: var(--muted); font-size: 1rem; }
.search-field { display: flex; gap: 10px; align-items: center; padding: 4px 6px 4px 14px; border: 1.5px solid #978C7F; border-radius: 14px; background: var(--surface); }
.search-field > .icon { width: 21px; height: 21px; color: var(--muted); }
.search-field:focus-within { outline: 2px solid var(--accent-deep); outline-offset: 3px; }
.search-field input { width: 100%; min-width: 0; min-height: 48px; padding: 6px 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 1rem; }
.search-field input::placeholder { color: var(--muted); opacity: 1; }
.search-field input:focus-visible { outline: none; }
.search-field button { flex: none; min-width: 58px; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 10px; background: var(--paper-deep); color: var(--ink); font: inherit; font-size: .95rem; font-weight: 750; cursor: pointer; }
.search-field button:hover { background: var(--accent-soft); }
.search-status { min-height: 1.6em; margin: 8px 0 0; color: var(--muted); font-size: .94rem; }
.search-results { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--line); }
.search-results li { border-bottom: 1px solid var(--line); }
.search-results a { display: block; min-height: 48px; padding: 12px 4px; font-weight: 720; line-height: 1.45; }
.search-empty { margin-top: 12px; padding: 16px 18px; border-radius: 12px; background: var(--paper-deep); font-size: 1rem; }
.search-empty p { margin-bottom: 8px; }
.search-empty a { font-weight: 760; }

.page-hub .chips { gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.page-hub .chips > li { min-width: 0; }
.page-hub .chip { height: 100%; min-height: 80px; gap: 8px; padding: 12px 10px; border-radius: 14px; font-size: .98rem; line-height: 1.3; }
.page-hub .chip > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.page-hub .chip__icon { width: 28px; height: 32px; border-radius: 9px; }
.page-hub .chip__icon .icon { width: 19px; height: 19px; }
.page-hub .chip small { margin-top: 4px; font-size: .82rem; line-height: 1.25; }
.page-hub .chip:hover { background: var(--tint); box-shadow: inset 0 0 0 1.5px var(--deep); }
.page-hub .az { margin-top: 20px; padding: 4px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 24px; }
.page-hub .az summary { display: flex; width: fit-content; max-width: 100%; gap: 10px; padding: 6px 4px; min-height: 48px; }
.az__chevron { width: 21px; height: 21px; margin-left: 6px; flex: none; }
.az[open] .az__chevron { transform: rotate(180deg); }
.page-hub .az ul { padding: 14px 0 18px; list-style: none; columns: 18rem; column-gap: 28px; }
.page-hub .az li { margin: 0; }
.page-hub .az li a { display: block; max-width: 100%; overflow-wrap: anywhere; min-height: 44px; padding-block: 8px; font-size: 1rem; line-height: 1.45; }

.page-hub .scenes { --gap: 0px; padding: 36px 0 0; }
.page-hub .scenes > .scene { padding-inline: var(--gutter); scroll-margin-top: 24px; }
.page-hub .scene + .scene { margin-top: 36px; }
.page-hub .scene__stage { display: block; max-width: calc(var(--wide) - var(--gutter) * 2); padding: 22px 18px 8px; border-radius: 22px; background: var(--tint); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--deep) 16%, transparent); }
.page-hub .scene__body { min-width: 0; }
.page-hub .scene__head { display: grid; grid-template-columns: minmax(0, 1fr) 72px; grid-template-rows: auto auto auto; align-items: start; column-gap: 12px; }
.page-hub .scene__art { position: relative; top: auto; order: 0; grid-column: 2; grid-row: 1 / span 2; width: 72px; height: 72px; justify-self: end; align-self: center; margin: 0; overflow: clip; }
.page-hub .scene__art .motif { --m: 72px; }
.page-hub .scene__kicker { grid-column: 1; grid-row: 1; gap: 6px; margin: 0 0 8px; font-size: .66rem; letter-spacing: .1em; line-height: 1.4; }
.page-hub .scene__kicker .icon { width: 16px; height: 16px; }
.page-hub .scene__title { grid-column: 1; grid-row: 2; font-size: clamp(1.65rem, 1.35rem + 1vw, 2.1rem); margin: 0 0 12px; line-height: 1.13; }
.page-hub .scene__lede { grid-column: 1 / -1; grid-row: 3; max-width: 66ch; color: #3E3832; font-size: 1rem; line-height: 1.6; }
.page-hub .scene__lede p { margin-bottom: 12px; }
.page-hub .scene__cards { margin-top: 4px; }
.page-hub .scene__cards > li:last-child { border-bottom: 0; }
.page-hub .scene__cards .card--row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; padding: 20px 2px; border-radius: 10px; }
.page-hub .scene__cards .card__title { font-size: 1.16rem; line-height: 1.3; }
.page-hub .scene__cards .card__summary { max-width: 66ch; font-size: 1rem; line-height: 1.6; }
.page-hub .scene__cards .card__more { margin: 2px 0 0; color: var(--accent-deep); font-size: .94rem; text-decoration: underline; text-underline-offset: 4px; }
.page-hub .scene__cards .card__more::after { display: none; }
.page-hub .scene__cards .card__link:focus-visible::before { outline: 3px solid var(--accent-deep); outline-offset: 4px; }
.page-hub .closing { padding-block: 44px 0; }
.page-hub .closing .card--feature { padding: 26px; background: var(--accent-soft); }
.page-hub .closing .card--feature:hover { background: var(--accent-soft); }

@media (min-width: 640px) {
  .page-hub .chips { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .page-hub .chip { gap: 10px; padding: 12px 14px; }
  .page-hub .chip__icon { width: 36px; height: 36px; }
  .page-hub .scene__stage { padding: 28px 30px 12px; }
  .page-hub .scene__head { grid-template-columns: minmax(0, 1fr) 100px; column-gap: 24px; }
  .page-hub .scene__art { grid-row: 1 / span 3; width: 100px; height: 100px; }
  .page-hub .scene__art .motif { --m: 100px; }
  .page-hub .scene__lede { grid-column: 1; }
  .page-hub .scene__kicker { font-size: .7rem; }
  .page-hub .scene__cards .card--row { grid-template-columns: minmax(0, 1fr) auto; column-gap: 28px; padding: 22px 8px; }
  .page-hub .scene__cards .card__title, .page-hub .scene__cards .card__summary { grid-column: 1; }
  .page-hub .scene__cards .card__more { grid-column: 2; grid-row: 1 / span 2; align-self: center; margin: 0; }
  .page-hub .scenes { padding-top: 44px; }
  .page-hub .scene + .scene { margin-top: 48px; }
}
@media (min-width: 900px) {
  .page-hub .hero { padding-top: 38px; }
  .page-hub .hero__stage { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 28px; }
  .page-hub .hero__art { justify-self: center; }
  .page-hub .hero__art .motif { --m: clamp(230px, 28vw, 340px); }
  .page-hub .hero-callout { margin-top: 28px; }
  .page-hub .hero__reassurance { margin-top: 22px; }
  .page-hub .index { padding-top: 48px; }
}
@media (min-width: 1100px) {
  .page-hub .chips { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 360px) {
  .page-hub .chips { grid-template-columns: minmax(0, 1fr); }
  .page-hub .chip { min-height: 60px; }
  .page-hub .hero__actions { grid-template-columns: minmax(0, 1fr); }
  .page-hub .scene__head { grid-template-columns: minmax(0, 1fr); }
  .page-hub .scene__art { display: none; }
  .page-hub .scene__kicker, .page-hub .scene__title, .page-hub .scene__lede { grid-column: 1; }
}
@media print {
  .page-hub .guide-search, .page-hub .hero__art, .page-hub .scene__art { display: none !important; }
  .page-hub .scene__stage { box-shadow: none; background: white; }
  .page-hub .scene__cards > li { break-inside: avoid; }
}

/* Original scroll illustrations are a defining part of NonOp. Keep their
   transition space and geometry while the reading text remains stationary. */
.motion-control { margin-top: 10px; }
.motion-control button { min-height: 44px; padding: 8px 2px; border: 0; border-radius: 6px; background: transparent; color: var(--accent-deep); font: inherit; font-size: .9rem; font-weight: 740; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.motion-control button:disabled { color: var(--muted); text-decoration: none; cursor: default; }
.page-hub .scenes { --transition-gap: 128px; }
.page-hub .scenes > .scene { --gap: var(--transition-gap); overflow-x: clip; overflow-y: visible; }
.page-hub .scene + .scene { margin-top: var(--transition-gap); }
.page-hub .scene__stage { display: flex; flex-direction: column; gap: 12px; padding: 24px 20px 14px; background: none; box-shadow: none; }
.page-hub .scene__body { order: 0; width: 100%; }
.page-hub .scene__head { display: block; }
.page-hub .scene__art { order: 1; position: relative; top: auto; align-self: center; justify-self: center; width: 160px; height: 160px; margin: 4px 0 0; overflow: visible; }
.page-hub .scene__art .motif { --m: 160px; }
.page-hub .scene__vessel { clip-path: inset(-2px 0 calc(-1 * var(--transition-gap)) 0); }
.page-hub .scene__vessel .v-surface { border-radius: 22px; }
.page-hub .scene__fx { height: var(--transition-gap); z-index: 1; clip-path: inset(0 0 0 0); }
/* Tint bridge: as one modality exits, its color hands off to the next
   modality's color across the transition gap. Scroll-driven via --out, so
   the resting page is unchanged; --next-tint is set by scenes.js. The band's
   top and bottom edges are feathered with a mask so the handoff dissolves
   into the rounded scene cards instead of drawing hard lines. */
.page-hub .scene__fx::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--tint, #ffffff) 60%, #ffffff),
    color-mix(in srgb, var(--next-tint, #ffffff) 60%, #ffffff));
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 32%, #000 68%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 32%, #000 68%, transparent 100%);
  opacity: var(--out); }
.page-hub .scene__lede { max-width: 66ch; }
.page-hub .scene__cards .card--row { padding-inline: 2px; }
.page-hub .scene__head > *, .page-hub .scene__cards > li { opacity: 1 !important; transform: none !important; }
.page-hub:not(.motion-enabled) .motif, .page-hub:not(.motion-enabled) .motif *, .page-hub:not(.motion-enabled) .motif *::before, .page-hub:not(.motion-enabled) .motif *::after, .page-hub:not(.motion-enabled) .scene__vessel *, .page-hub:not(.motion-enabled) .scene__fx * { animation: none !important; }
.page-hub .scene:not(.is-live) .motif, .page-hub .scene:not(.is-live) .motif *, .page-hub .scene:not(.is-live) .motif *::before, .page-hub .scene:not(.is-live) .motif *::after, .page-hub .scene:not(.is-live) .scene__vessel *, .page-hub .scene:not(.is-live) .scene__fx * { animation-play-state: paused !important; }
@media (min-width: 760px) {
  .page-hub .scenes { --transition-gap: 152px; }
  .page-hub .scene__stage { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 28px; align-items: start; padding: 34px 30px 24px; }
  .page-hub .scene__body { grid-column: 1; grid-row: 1; }
  .page-hub .scene__art { order: 0; grid-column: 2; grid-row: 1; position: sticky; top: 14vh; align-self: start; width: 200px; height: 200px; margin: 0; }
  .page-hub .scene__art .motif { --m: 200px; }
  .page-hub .scene__cards .card--row { grid-template-columns: minmax(0, 1fr); }
  .page-hub .scene__cards .card__more { grid-column: 1; grid-row: auto; margin-top: 2px; }
}
@media (min-width: 1100px) {
  .page-hub .scene__stage { grid-template-columns: minmax(0, 1fr) 240px; gap: 42px; padding: 38px 38px 28px; }
  .page-hub .scene__art { width: 240px; height: 240px; }
  .page-hub .scene__art .motif { --m: 240px; }
}
@media (max-width: 360px) {
  .page-hub .scene__art { display: block; width: 140px; height: 140px; }
  .page-hub .scene__art .motif { --m: 140px; }
}
@media (prefers-reduced-motion: reduce) {
  .page-hub .scenes { --transition-gap: 40px; }
  .page-hub .scene__fx { display: none; }
  .page-hub .scene { --in: 1 !important; --out: 0 !important; }
}
@media print {
  .motion-control, .page-hub .scene__vessel, .page-hub .scene__fx { display: none !important; }
  .page-hub .scenes { --transition-gap: 24px; }
  .page-hub .scene__stage { display: block; }
}

/* Keep the procedure symbol still beside reading; the chapter's original
   exit transition remains controlled by scrolling. */
.page-hub #injections .syringe-move,
.page-hub #injections .plunger,
.page-hub #injections .med-fill,
.page-hub #injections .dose,
.page-hub #injections .site-glow,
.page-hub #injections .tissue { animation: none !important; }

/* The final scene needs the same visible exit runway as the earlier chapters.
   Its leaves finish before the closing guide and footer enter the reading area. */
.page-hub .scenes { padding-bottom: var(--transition-gap); }
@media (prefers-reduced-motion: reduce) { .page-hub .scenes { padding-bottom: 0; } }
@media print { .page-hub .scenes { padding-bottom: 0; } }
