/*
 * UI polish (review 17 Nov): rounded corners and a soft lift on the page's cards and controls, the
 * chapter openers' spacing, the scroll-story steps and quotes, and no orphans in running text.
 * Loads after the other parts (alphabetical), so these rules win over the square corners set elsewhere.
 * The charts are NOT in this system (17 Nov, round 2): chart cards, their controls and tooltips keep the square, flat look
 * they were built with (.np, .acm-card, .rl-card, .fig-frame, .fig-info, .fig-btn, .csp-pill, .np-tip).
 */
:root {
  --ui-radius: 12px;     /* cards, panels, dialogs */
  --ui-radius-s: 8px;    /* buttons, chips, pills, tooltips */
  --ui-shadow: 0 1px 2px rgba(40, 24, 12, .04), 0 6px 18px rgba(40, 24, 12, .06);
  --ui-shadow-s: 0 1px 2px rgba(40, 24, 12, .06), 0 2px 6px rgba(40, 24, 12, .04);
}

/* ---- cards: rounded, softly lifted ------------------------------------------------------------------------------ */
m-app-teaser, .journey-entry, .ck-dialog, .nv-stage {
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow);
}
.journey-entry, m-app-teaser { overflow: hidden; }   /* their pictures follow the corners */

/* ---- controls: smaller radius, a lighter lift ------------------------------------------------------------------- */
.ck-open, .ck-arrow, .ck-pdf, .ck-close, .apt-go, .apt-who,
.nv-chip, .nv-pill, .nv-open, .nv-close, .nv-go, .nv-here, .nv-obj {
  border-radius: var(--ui-radius-s);
}
.ck-open, .ck-pdf, .apt-go, .nv-chip, .nv-open { box-shadow: var(--ui-shadow-s); }
.nv-chip-obj, .nv-pill-obj { border-radius: 6px; }

/* ---- no orphans: running text keeps at least two words on its last line; headings balance --------------------- */
p, li, blockquote, figcaption, dd { text-wrap: pretty; }
h1, h2, h3, h4, .act-title, .ck-title { text-wrap: balance; }

/* ---- chapter openers: the deck centred under the title; even gaps title → deck → picture → text --------------- */
.chapter-deck, .age-deck { text-align: center; text-wrap: balance; margin-inline: auto; }
.chapter-opener ~ .chapter-deck, .age-report .chapter-opener ~ .age-deck {
  margin-top: calc(clamp(32px, 5vh, 56px) - var(--deck-pull, 0px)) !important;
}
.hero-track { margin-top: clamp(40px, 6vh, 64px); }
.chapter-opening { margin-bottom: clamp(48px, 7vh, 72px); }

/* ---- scroll stories: a step is hidden until it is the one in view; a little more air between steps ------------- */
@media (width >= 900px) {
  .sc-card { opacity: 0; transition: opacity .5s var(--rv-ease); }
  .sc-step.on .sc-card { opacity: 1; }
  .sc-step { padding-bottom: 10svh; }
}
/* one rhythm inside a step: kicker 16 · quote 20 · paragraphs 14 */
.sc-card .sc-kicker { margin-bottom: 16px; }
.sc-card p { margin-bottom: 14px; }
.sc-card .sc-quote { margin: 0 0 20px; }
.sc-card .sc-quote footer { margin-top: 10px; }
.sc-card .sc-quote + .sc-quote { margin-top: 4px; }

/* ---- GT Alpina at -2% tracking everywhere (review 17 Nov) -------------------------------------------------------
 * Every element set in GT Alpina whose tracking was looser than -2% (found by scanning the rendered page). Headlines
 * that were already tighter (chapter titles -4.5%, the opening's big numbers) keep their own. One :is() list, so every
 * entry gets the list's highest specificity and wins over the rules that set these elsewhere. */
html :is(
  .act-title, .ck-title, .big, .ck-open > span, .ck-period h4, .ck-item, .t-data-para, .fig-info-body h3, .fig-title,
  .hero > .t-h1, .hp-bill span, .hp-cs span, .hp-geo-h, .hp-geo-row span, .intro h3, .nv-chip-name, .nv-title .name,
  .nv-report, .op-app b, .op-count, .pp-photo b, .pp-name, .ov-index .c, h1 .t2,
  .sc-card .sc-name, .sc-card p, .sc-card p.sc-desc, .sc-desc .hp-room, .sc-card .sc-quote p
) { letter-spacing: -0.02em; }

/* ---- scroll stories start closer to their heading (review 17 Nov: the first step sat 30% of a screen down) ----- */
@media (width >= 900px) { .sc-steps { padding-top: 16svh; } }
