/* Extension stylesheet: homepage sections, subpage sections, handoff band */

h4 {
  margin: 0;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

/* Window bar actions inside the hero frame */
.window-bar-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.window-host {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  color: var(--emerald-deep);
  font-weight: 620;
}

.window-launch-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.4375rem 1rem;
  border-radius: 999px;
  background-color: var(--emerald-deep);
  color: var(--surface);
  font-size: 0.875rem;
  font-weight: 660;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 180ms var(--ease-out);
}

/* Pillar row directly under the hero */
.value-pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-top: clamp(2rem, 4vw, 2.75rem);
  border-top: 1px solid var(--hairline);
}

/* The three-point answer under the features heading (moved from under the hero so the page
   states the problem before the answer). */
.fs-answer-pillars {
  margin-block: clamp(2rem, 4vw, 3rem) clamp(2.5rem, 5vw, 4rem);
}

.value-pillar {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding-inline: clamp(1rem, 2.5vw, 2rem);
}

.value-pillar:first-child {
  padding-left: 0;
}

.value-pillar + .value-pillar {
  border-left: 1px solid var(--hairline);
}

.value-pillar strong {
  display: block;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
}

.value-pillar p {
  margin-top: 0.25rem;
  font-size: 0.96875rem;
  line-height: 1.65;
  color: var(--ink-muted);
}

.card-icon,
.step-icon,
.check-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  background-color: var(--mint-surface);
  color: var(--emerald-deep);
}

/* Live production figures: the one bold moment on the site. Large tabular numerals that roll
   like an odometer (see createOdometers in app.js), calm labels, hairlines, no cards. */
.stats-band {
  padding-block: clamp(1rem, 3vw, 2.5rem) clamp(5rem, 10vw, 8.5rem);
  background-color: var(--surface);
}

.stats-band h2 {
  font-size: clamp(1.25rem, 1.8vw, 1.5rem);
  font-weight: 720;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.stat-row {
  list-style: none;
  margin: clamp(1.5rem, 3vw, 2.25rem) 0 0;
  padding: clamp(2.25rem, 5vw, 3.75rem) 0 0;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: clamp(2rem, 4vw, 3rem) 0;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  min-width: 0;
  padding-inline: clamp(1rem, 2.5vw, 2.5rem);
}

.stat-item:first-child {
  padding-left: 0;
}

.stat-item:last-child {
  padding-right: 0;
}

.stat-item + .stat-item {
  border-left: 1px solid var(--hairline);
}

.stat-figure {
  --stat-size: clamp(3rem, 7.5vw, 6rem);
  display: flex;
  align-items: flex-end;
  gap: 0.4rem;
  white-space: nowrap;
}

/* The unit sits at the numeral's baseline and never rolls */
.stat-unit {
  margin-bottom: calc(var(--stat-size) * 0.2);
  font-size: clamp(1rem, 1.7vw, 1.5rem);
  font-weight: 650;
  line-height: 1;
  color: var(--ink-muted);
}

.stat-value {
  font-size: var(--stat-size);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--emerald-deep);
  white-space: nowrap;
}

.stat-label {
  font-size: 0.96875rem;
  line-height: 1.5;
  color: var(--ink-muted);
}

.stat-note {
  margin-top: clamp(2rem, 4vw, 3rem);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

/* Odometer: one column per digit, built at runtime. Only transform moves. */
[data-roll].is-rolling {
  display: flex;
  height: 1.1em;
}

.odo-col {
  display: block;
  height: 1.1em;
  overflow: hidden;
}

.odo-strip {
  display: block;
  transform: translate3d(0, calc(var(--row, 0) * -1.1em), 0);
  transition-property: transform;
}

.odo-strip > span {
  display: block;
  height: 1.1em;
}

.odo-sep {
  display: block;
  height: 1.1em;
}

@media (max-width: 48rem) {
  .stat-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.25rem 0;
  }

  .stat-item,
  .stat-item:first-child,
  .stat-item:last-child {
    padding-inline: 0 0.75rem;
    border-left: 0;
  }

  /* Two columns: only the right-hand column keeps a divider */
  .stat-item:nth-child(odd) {
    border-left: 0;
  }

  .stat-item:nth-child(even) {
    padding-left: 1.25rem;
    border-left: 1px solid var(--hairline);
  }

  .stat-figure {
    --stat-size: clamp(2.5rem, 12vw, 3.5rem);
  }
}

@media (prefers-reduced-motion: no-preference) {
  /* Figures start 150ms apart; the odometer inside follows the same stagger */
  html.js-ready .stat-row[data-cascade].is-revealed > * {
    animation-duration: 700ms;
    animation-delay: calc(var(--i, 0) * 150ms);
  }
}

/* Problem content is red (problem = red, solution = green); only the two problem sections */
#evidence-heading,
#challenges-heading {
  color: var(--alert-strong);
}

/* 数据印证 carries a soft garnet wash: white at both edges, so it fades in and out of the
   neighbouring white sections instead of ending in a hard band edge */
#evidence {
  --alert-wash: color-mix(in srgb, var(--alert-soft) 60%, #fff);
  background: linear-gradient(
    to bottom,
    var(--surface) 0,
    var(--alert-wash) clamp(4rem, 9vw, 7rem),
    var(--alert-wash) calc(100% - clamp(4rem, 9vw, 7rem)),
    var(--surface) 100%
  );
}

/* Card titles stay in ink: with the 数据印证 section right below, red is kept to this h2 and the icon tiles */
#challenges .challenge-card h3 {
  color: var(--ink);
}

#challenges .card-icon {
  background-color: var(--alert-soft);
  color: var(--alert);
}

.band-header,
.band-intro {
  max-width: 52rem;
}

.band-header {
  margin-bottom: clamp(2.25rem, 4.5vw, 3.5rem);
}

.band-header h2,
.band-intro h2 {
  font-size: clamp(2rem, 4.6vw, 3.5rem);
  font-weight: 780;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.band-lead {
  max-width: 44rem;
  margin-top: 1rem;
  font-size: clamp(1.0625rem, 1.4vw, 1.1875rem);
  line-height: 1.75;
  color: var(--ink-muted);
}

/* Subpage hero: light, same typography as the homepage hero */
.subhero {
  background-color: var(--surface);
  padding-block: clamp(3.5rem, 7vw, 6rem) clamp(3rem, 6vw, 5rem);
  border-bottom: 1px solid var(--hairline);
  background-image: linear-gradient(180deg, var(--surface) 0%, var(--mint-subtle) 100%);
}

.subhero-inner {
  display: block;
}

.subhero-copy {
  max-width: 52rem;
}

.subhero h1 {
  max-width: none;
  font-size: clamp(2.25rem, 4.6vw, 3.75rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.035em;
  color: var(--emerald-deep);
}

.subhero .hero-lead {
  max-width: 42rem;
}

/* Content bands */
.content-band {
  scroll-margin-top: 5.5rem;
  padding-block: clamp(4.5rem, 8vw, 7.5rem);
  background-color: var(--surface);
}

.content-band-mint {
  background-color: var(--mint-subtle);
}

.band-header,
.band-intro {
  max-width: 52rem;
}

.band-header {
  margin-bottom: clamp(2.25rem, 4.5vw, 3.5rem);
}

.band-header h2,
.band-intro h2,
.collab-intro h2 {
  font-size: clamp(1.875rem, 3.2vw, 2.75rem);
  font-weight: 760;
  line-height: 1.22;
  letter-spacing: -0.03em;
  color: var(--emerald-deep);
}

.band-lead {
  max-width: 44rem;
  margin-top: 1rem;
  font-size: clamp(1.0625rem, 1.4vw, 1.125rem);
  line-height: 1.8;
  color: var(--ink-muted);
}

/* Cards */
.challenge-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}

.challenge-card {
  padding: clamp(1.5rem, 2.6vw, 2rem);
  background-color: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 1rem;
  box-shadow: var(--shadow-card);
  overflow-wrap: anywhere;
  transition:
    transform 240ms var(--ease-out),
    border-color 200ms var(--ease-out),
    box-shadow 240ms var(--ease-out);
}

.challenge-card h3 {
  margin-top: 1.25rem;
  font-size: 1.375rem;
  font-weight: 720;
  line-height: 1.35;
  color: var(--emerald-deep);
}

.challenge-card > p {
  margin-top: 0.625rem;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--ink-muted);
}

.sub-points {
  margin: 1.25rem 0 0;
  display: grid;
  gap: 1.125rem;
}

.sub-points dt {
  font-size: 1rem;
  font-weight: 680;
  line-height: 1.45;
  color: var(--ink);
}

.sub-points dd {
  margin: 0.25rem 0 0;
  font-size: 0.96875rem;
  line-height: 1.75;
  color: var(--ink-muted);
}

.closing-line {
  margin-top: clamp(2rem, 4vw, 3rem);
  padding-top: clamp(1.25rem, 2.5vw, 1.75rem);
  border-top: 1px solid var(--hairline);
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  line-height: 1.75;
  color: var(--ink);
}

/* Evidence section */
.evidence-layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.insight-lead {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem clamp(1rem, 2vw, 1.75rem);
}

.insight-callout {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
}

/* Ring gauge on a true 0-100% circle: it shows "about one third" at a glance */
.insight-gauge {
  order: -1;
  width: clamp(6.5rem, 10vw, 8.5rem);
  aspect-ratio: 1;
}

.insight-gauge svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.insight-gauge circle {
  fill: none;
  stroke-width: 10;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

.gauge-track {
  stroke: var(--alert-soft);
}

.gauge-arc {
  stroke: var(--alert);
  stroke-linecap: round;
  /* The spotlight sets --spot-pct (app.js); at rest it is the leading finding, 32.14% */
  stroke-dasharray: var(--spot-pct, 32.14) 100;
  transition-property: stroke-dasharray;
  transition-duration: 900ms;
  transition-timing-function: var(--ease-roll);
}

@keyframes gauge-fill {
  from {
    stroke-dasharray: 0.01 100;
  }
}

.callout-number {
  font-size: clamp(3rem, 4.8vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
  color: var(--alert);
  font-variant-numeric: tabular-nums;
}

.callout-sub {
  font-size: 1.125rem;
  font-weight: 650;
  color: var(--ink);
}

.callout-source {
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink-muted);
}

.insight-list-title {
  margin-top: clamp(1.75rem, 3vw, 2.5rem);
  font-size: 1.125rem;
  font-weight: 720;
  color: var(--ink);
}

.insight-list {
  list-style: none;
  margin: 0.875rem 0 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.insight-list li {
  padding: 0.875rem 0;
  border-top: 1px solid var(--hairline);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink);
  text-wrap: pretty;
}

.insight-panel {
  padding: clamp(1.5rem, 3.2vw, 2.5rem);
  background-color: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 1rem;
  box-shadow: var(--shadow-card);
}

.insight-panel h3 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 740;
  line-height: 1.3;
  color: var(--ink);
}

.insight-meta {
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.bar-list {
  /* Row timing (mirrors computeEvidenceSchedule / TOUR_OPTIONS in app.js): rows start 90ms apart;
     in the spotlight tour (.is-tour, wide layout) one row per 1.2s step, each bar filling over 1s */
  --row-lead: 450ms;
  --row-gap: 90ms;
  --bar-dur: 1300ms;
  --scale-max: 34; /* the chart's scale is 0-34%: the leading 32.14% bar nearly fills its track */
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.375rem;
  position: relative;
}

/* Faint vertical gridlines at 10%, 20% and 30%, one continuous line each behind all rows
   (tick labels: .bar-axis). Same 0-34% scale as the bars. */
.bar-list::before {
  content: "";
  position: absolute;
  inset: -0.5rem 0;
  z-index: 0;
  background:
    linear-gradient(var(--hairline-strong), var(--hairline-strong)) calc(100% * 10 / 34) 0 / 1px 100% no-repeat,
    linear-gradient(var(--hairline-strong), var(--hairline-strong)) calc(100% * 20 / 34) 0 / 1px 100% no-repeat,
    linear-gradient(var(--hairline-strong), var(--hairline-strong)) calc(100% * 30 / 34) 0 / 1px 100% no-repeat;
  opacity: 0.55;
  transform-origin: 50% 0;
  pointer-events: none;
}

.bar-row {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.5rem 1rem;
  transition: opacity 320ms var(--ease-out);
}

/* A brief soft highlight when a row's bar lands */
.bar-row::before {
  content: "";
  position: absolute;
  inset: -0.5rem -0.75rem;
  z-index: -1;
  border-radius: 0.75rem;
  background-color: var(--alert-soft);
  opacity: 0;
  pointer-events: none;
}

.bar-label {
  grid-column: 1;
  grid-row: 1;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.bar-stat {
  grid-column: 2;
  grid-row: 1;
  font-size: 1.1875rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--alert);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}

.bar-row:first-child .bar-label {
  font-size: 1.125rem;
  font-weight: 760;
}

.bar-row:first-child .bar-stat {
  font-size: 1.625rem;
  color: var(--alert-strong);
}

.bar-track {
  position: relative;
  grid-column: 1 / -1;
  grid-row: 2;
  display: block;
  width: 100%;
  height: 0.875rem;
  border-radius: 999px;
  background-color: var(--alert-soft);
  /* Clips the sliding fill at the track's ends only; the end marker may rise above and below */
  clip-path: inset(-0.5rem 0 -0.5rem 0);
}

.bar-row:first-child .bar-track {
  height: 1rem;
}

/* A bar's length is its real percentage on the 0-34% scale; colour steps down by rank */
.bar-fill {
  position: relative;
  display: block;
  height: 100%;
  width: calc(var(--bar-pct, 0%) * 100 / var(--scale-max));
  min-width: 0.5rem;
  max-width: 100%;
  border-radius: 999px;
  background-color: var(--bar-tone, var(--alert-mid));
}

/* Small end marker: a dot in the bar's colour with a white ring */
.bar-fill::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -0.125rem;
  height: calc(100% + 0.25rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background-color: inherit;
  box-shadow: 0 0 0 2px var(--surface);
  transform: translateY(-50%);
}

.bar-row:first-child { --bar-tone: var(--alert-strong); }
.bar-row:nth-child(2) { --i: 1; --bar-tone: color-mix(in srgb, var(--alert-mid) 87%, var(--alert-light)); }
.bar-row:nth-child(3) { --i: 2; --bar-tone: color-mix(in srgb, var(--alert-mid) 74%, var(--alert-light)); }
.bar-row:nth-child(4) { --i: 3; --bar-tone: color-mix(in srgb, var(--alert-mid) 61%, var(--alert-light)); }
.bar-row:nth-child(5) { --i: 4; --bar-tone: color-mix(in srgb, var(--alert-mid) 48%, var(--alert-light)); }
.bar-row:nth-child(6) { --i: 5; --bar-tone: color-mix(in srgb, var(--alert-mid) 38%, var(--alert-light)); }
.bar-row:nth-child(7) { --i: 6; --bar-tone: color-mix(in srgb, var(--alert-mid) 28%, var(--alert-light)); }
.bar-row:nth-child(8) { --i: 7; --bar-tone: var(--alert-light); }

.bar-axis {
  position: relative;
  height: 1rem;
  margin-top: clamp(1.25rem, 2.5vw, 1.75rem);
  margin-bottom: 0.6rem;
  font-size: 0.75rem;
  line-height: 1;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.bar-axis span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
}

.bar-axis span:nth-child(1) { left: 0; transform: none; }
.bar-axis span:nth-child(2) { left: calc(100% * 10 / 34); }
.bar-axis span:nth-child(3) { left: calc(100% * 20 / 34); }
.bar-axis span:nth-child(4) { left: calc(100% * 30 / 34); }

.bar-list.is-tour {
  --row-gap: 1200ms;
  --bar-dur: 1000ms;
}

/* Spotlight: the row the left figure shows is highlighted, the others dim slightly */
.bar-row.is-spot::before {
  opacity: 0.9;
}

.bar-row::before {
  transition: opacity 320ms var(--ease-out);
}

.bar-list.has-spot .bar-row:not(.is-spot) {
  opacity: 0.7;
}

/* The line under the spotlight figure: every line shares one grid cell, so the block always
   reserves the longest one and nothing shifts as the text changes */
.callout-sub {
  display: block;
}

.spot-stack {
  display: grid;
}

.spot-line {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translate3d(0, 6px, 0);
  transition:
    opacity 280ms var(--ease-out),
    transform 280ms var(--ease-out);
}

.spot-line.is-on {
  opacity: 1;
  transform: none;
}

/* Highlight: the rows an insight points at stay, the rest recede */
.bar-list.has-focus .bar-row:not(.is-focus) {
  opacity: 0.3;
}

/* A bar grows by sliding in from the left of its track: after t, its visible length is
   (final length x ease(t)), the same curve the figures count along (BAR_EASE in app.js). */
@keyframes bar-grow {
  from {
    transform: translate3d(calc(-100% - 1rem), 0, 0);
  }
}

@keyframes grid-draw {
  from {
    opacity: 0;
    transform: scaleY(0.04);
  }
}

@keyframes row-land {
  0% {
    opacity: 0;
  }

  25% {
    opacity: 0.85;
  }

  100% {
    opacity: 0;
  }
}

/* The guided sequence (timings mirror computeEvidenceSchedule in app.js): the scale draws in,
   then rows run 90ms apart, each bar filling from empty over 1.3s with its figure counting
   alongside; the insight points follow, one at a time. Starts when the chart card is >= 40% in view. */
@media (prefers-reduced-motion: no-preference) {
  /* Headline figure and ring: they start with the chart (wide) or when on screen (stacked).
     The number is odometer-rolled by app.js (data-roll="sequence" opts out of the reveal pass). */
  html.js-ready .insight-lead:not(.is-on) .gauge-arc {
    stroke-dasharray: 0.01 100;
  }

  html.js-ready .insight-lead:not(.is-on) .callout-number {
    opacity: 0;
  }

  html.js-ready .insight-lead.is-on .gauge-arc {
    animation: gauge-fill 1100ms var(--ease-roll) backwards;
  }

  html.js-ready .bar-axis,
  html.js-ready .bar-list::before {
    opacity: 0;
  }

  html.js-ready .insight-panel.is-seq .bar-axis {
    opacity: 1;
    animation: fade-in 600ms ease-out backwards;
  }

  html.js-ready .bar-list.is-inview::before {
    opacity: 0.55;
    animation: grid-draw 700ms var(--ease-out) 150ms backwards;
  }

  html.js-ready .bar-list:not(.is-inview) .bar-label,
  html.js-ready .bar-list:not(.is-inview) .bar-stat {
    opacity: 0;
  }

  html.js-ready .bar-list:not(.is-inview) .bar-fill {
    transform: translate3d(calc(-100% - 1rem), 0, 0);
  }

  html.js-ready .bar-list.is-inview .bar-label,
  html.js-ready .bar-list.is-inview .bar-stat {
    animation: fade-in 500ms ease-out calc(var(--row-lead) + var(--i, 0) * var(--row-gap)) backwards;
  }

  html.js-ready .bar-list.is-inview .bar-fill {
    animation: bar-grow var(--bar-dur) cubic-bezier(0.22, 1, 0.36, 1) calc(var(--row-lead) + var(--i, 0) * var(--row-gap)) backwards;
  }

  html.js-ready .bar-list.is-inview:not(.is-tour) .bar-row::before {
    animation: row-land 1100ms ease-out calc(var(--row-lead) + var(--i, 0) * var(--row-gap) + 1100ms) backwards;
  }
}

/* Insight points appear one at a time (wide layout); on stacked layouts they are simply there
   and take turns lighting their rows. */
@media (min-width: 64.0625rem) and (prefers-reduced-motion: no-preference) {
  html.js-ready [data-insights] li:not(.is-on) {
    opacity: 0;
    transform: translate3d(0, 16px, 0);
  }

  html.js-ready [data-insights] li.is-on {
    animation: lift-in 700ms var(--ease-enter) backwards;
  }
}

.insight-list li {
  transition: color 240ms var(--ease-out);
}

.insight-list li b {
  color: var(--alert);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.insight-list li.is-lit {
  color: var(--ink);
  background-color: var(--alert-soft);
}

@media (hover: hover) and (pointer: fine) {
  .bar-list:has(.bar-row:hover) .bar-row:not(:hover) {
    opacity: 0.4;
  }
}

.insight-takeaway {
  margin-top: clamp(1.75rem, 3vw, 2.25rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--hairline);
  font-size: 1.0625rem;
  font-weight: 650;
  line-height: 1.7;
  color: var(--emerald-deep);
}

/* The answer: the one place in the section that returns to emerald */
.insight-takeaway {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.takeaway-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  margin-top: 0.1rem;
  border-radius: 50%;
  background-color: var(--mint-surface);
  color: var(--emerald);
}

.takeaway-icon .icon {
  width: 1.0625rem;
  height: 1.0625rem;
  stroke-width: 2.2;
}

/* Feature panels: copy and checklist beside the framed screenshot */
.feature-panel {
  display: grid;
  grid-template-columns: minmax(0, 4.5fr) minmax(0, 7.5fr);
  column-gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}

.feature-panel > .chapter-head {
  grid-column: 1 / -1;
  grid-row: 1;
}

.feature-panel > .panel-header {
  grid-column: 1;
  grid-row: 2;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.feature-panel > .panel-points {
  grid-column: 1;
  grid-row: 3;
}

.feature-panel > .panel-note {
  grid-column: 1;
  grid-row: 4;
  margin-top: 1.25rem;
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

.feature-panel > .window-frame {
  grid-column: 2;
  grid-row: 2 / span 3;
}

.panel-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.125rem;
}

.panel-points li {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  font-size: 0.96875rem;
  line-height: 1.7;
  color: var(--ink-muted);
  overflow-wrap: anywhere;
}

.panel-points .check-tile {
  width: 1.75rem;
  height: 1.75rem;
  margin-top: 0.125rem;
  border-radius: 0.5rem;
}

.panel-points .check-tile .icon {
  width: 1rem;
  height: 1rem;
  stroke-width: 2;
}

.panel-points strong {
  display: block;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink);
}

.panel-points span:not(.check-tile) {
  display: block;
}

.feature-panel .window-frame-surface {
  border: 1px solid var(--hairline);
}

/* Chapter layout: each panel is one capability told in full. The first screen is the grid above;
   long chapter content (check matrix, format chapter) spans the full panel width below it. */
.fs-features-lead {
  max-width: 40rem;
  margin: 1rem auto 0;
  font-size: clamp(1.0625rem, 1.4vw, 1.1875rem);
  line-height: 1.8;
  color: var(--ink-muted);
}

.feature-panel > .fs-lead-block {
  grid-column: 1;
  grid-row: 3;
}

.feature-panel > .cm,
.feature-panel > .fs-chapter {
  grid-column: 1 / -1;
  grid-row: auto;
}

.feature-panel h5 {
  margin: 0;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

/* The four chapters are stacked in normal flow. The tablist is the chapter indicator and switcher,
   pinned under the site header for the whole height of .feature-switcher (its parent contains every
   chapter, so the bar has room to stick). Sticky needs a tall parent and no overflow on any
   ancestor; --header-h is measured by app.js from the real header. Without JS the bar stays a
   static list. z-index 30 keeps it under the header (40) and the scroll-progress line. */
html.js-ready .feature-tablist-wrap {
  position: sticky;
  top: var(--header-h);
  z-index: 30;
}

.feature-tablist-wrap {
  padding-block: 0.625rem;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.feature-tablist-wrap::before {
  content: "";
  position: absolute;
  inset: 0 calc(50% - 50vw);
  z-index: -1;
  background-color: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--hairline);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.feature-tablist {
  background-color: var(--mint-surface);
  border-color: var(--hairline-strong);
  box-shadow: var(--shadow-card);
}

.feature-tab {
  padding-inline: clamp(0.875rem, 2.4vw, 1.75rem);
  font-size: clamp(0.9375rem, 1.5vw, 1.0625rem);
  font-weight: 700;
  color: var(--ink);
}

@media (max-width: 30rem) {
  .feature-tablist-wrap {
    padding-block: 0.4375rem;
  }

  /* Five short labels must fit one row without scrolling, down to 320 px */
  .feature-tab {
    flex: 1 1 auto;
    padding-inline: 0.25rem;
    font-size: 0.8125rem;
    min-height: 2.5rem;
  }
}

@media (max-width: 23rem) {
  .feature-tab {
    padding-inline: 0.125rem;
    font-size: 0.75rem;
    letter-spacing: -0.02em;
  }
}

@media (max-width: 63.99rem) {
  .feature-panel > .fs-lead-block {
    grid-column: 1;
    grid-row: auto;
    margin-top: 1.5rem;
  }
}

@media (max-width: 48rem) {
  :root {
    --tabbar-h: 3.75rem;
  }
}

/* Chapter heading row: name and one-line promise open each chapter, with a divider and space
   above every chapter but the first. */
.chapter-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 1.25rem;
  row-gap: 0.375rem;
  margin-bottom: clamp(1.75rem, 3.5vw, 2.5rem);
}

.chapter-head h3 {
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  font-weight: 760;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
  transition: color 240ms var(--ease-out);
}

.chapter-promise {
  font-size: clamp(1rem, 1.5vw, 1.1875rem);
  line-height: 1.6;
  color: var(--ink-muted);
}

.feature-panel {
  scroll-margin-top: var(--pin-offset);
}

.feature-panel + .feature-panel {
  padding-top: clamp(3.5rem, 7vw, 5.5rem);
  border-top: 1px solid var(--hairline);
}

/* Anchors inside chapters land below the pinned header and chapter bar */
.cm,
.cm-card,
.fs-chapter,
#format-heading {
  scroll-margin-top: var(--pin-offset);
}

/* Human-in-the-loop: the one solid deep-emerald content band */
.collab-section {
  scroll-margin-top: 5.5rem;
  padding-block: clamp(4.5rem, 9vw, 8rem);
  background-color: var(--emerald-deep);
  color: var(--on-deep);
}

.collab-section .collab-intro h2 {
  color: var(--surface);
}

.collab-intro {
  max-width: 48rem;
}

.collab-section .collab-lead {
  margin-top: 1.25rem;
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  line-height: 1.8;
  color: var(--on-deep-muted);
}

.collab-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  margin-top: clamp(2.5rem, 5vw, 3.75rem);
}

.collab-point {
  padding-top: 1.75rem;
  border-top: 1px solid var(--hairline-deep);
}

.collab-section .step-icon {
  background-color: var(--tile-deep);
  color: var(--surface);
}

.collab-point h3 {
  margin-top: 1.125rem;
  font-size: 1.375rem;
  font-weight: 720;
  line-height: 1.35;
  color: var(--surface);
}

.collab-point p {
  margin-top: 0.625rem;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--on-deep-muted);
}

.loop-flow {
  --seq-idle-line: rgba(255, 255, 255, 0.12);
  --seq-idle-fill: transparent;
  list-style: none;
  margin: clamp(2.5rem, 5vw, 3.75rem) 0 0;
  padding: 0;
  display: flex;
  align-items: center;
}

.loop-flow li {
  display: flex;
  align-items: center;
  flex: 1 1 0;
  min-width: 0;
}

.loop-flow li:last-child {
  flex: 0 1 auto;
}

.loop-node {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.5rem;
  padding: 0.5rem 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 0.75rem;
  background-color: var(--tile-deep);
  color: var(--surface);
  font-size: 1rem;
  font-weight: 650;
  text-align: center;
  line-height: 1.4;
}

.loop-arrow {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  min-width: 1.5rem;
  color: var(--on-deep-muted);
}

.loop-arrow svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.collab-statement {
  max-width: 62rem;
  margin-top: clamp(3rem, 6vw, 4.5rem);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 720;
  line-height: 1.5;
  letter-spacing: -0.02em;
  color: var(--surface);
}

/* Handoff band: light */
.page-handoff {
  scroll-margin-top: 5.5rem;
  padding-block: clamp(4rem, 8vw, 6.5rem);
  background-color: var(--mint-surface);
  border-top: 1px solid var(--hairline);
  color: var(--ink);
}

.handoff-inner,
.page-handoff-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(1.5rem, 3vw, 2.25rem);
}

.page-handoff h2 {
  max-width: 48rem;
  font-size: clamp(1.875rem, 3.2vw, 2.75rem);
  font-weight: 760;
  line-height: 1.22;
  letter-spacing: -0.03em;
  color: var(--emerald-deep);
}

.page-handoff p,
.page-handoff .band-lead {
  max-width: 42rem;
  margin-top: 1rem;
  font-size: clamp(1.0625rem, 1.4vw, 1.125rem);
  line-height: 1.8;
  color: var(--ink-muted);
}

.handoff-actions,
.page-handoff-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.875rem;
}

/* Hover states */
@media (hover: hover) and (pointer: fine) {
  .window-launch-link:hover {
    background-color: var(--emerald-hover);
  }

  .challenge-card:hover,
  .pf-card:hover,
  .pf-metric:hover {
    transform: translate3d(0, -3px, 0);
    border-color: rgba(14, 163, 113, 0.5);
    box-shadow: var(--shadow-card-hover);
  }

  .feature-panel .window-frame-surface:hover {
    box-shadow:
      0 0 0 1px rgba(14, 163, 113, 0.22),
      0 36px 64px -28px rgba(10, 95, 65, 0.36),
      0 8px 20px -10px rgba(10, 95, 65, 0.14);
  }
}

/* Responsive */
@media (max-width: 64rem) {
  .evidence-layout {
    grid-template-columns: 1fr;
  }

  .feature-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .feature-panel > .panel-header,
  .feature-panel > .panel-points,
  .feature-panel > .panel-note,
  .feature-panel > .window-frame {
    grid-column: 1;
    grid-row: auto;
  }

  .feature-panel > .window-frame {
    margin-top: 2rem;
  }

  .collab-points {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 56rem) {
  .challenge-grid {
    grid-template-columns: 1fr;
  }

  .value-pillars {
    grid-template-columns: 1fr;
    row-gap: 1.5rem;
  }

  .value-pillar,
  .value-pillar:first-child {
    padding-inline: 0;
  }

  .value-pillar + .value-pillar {
    border-left: 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--hairline);
  }

  .loop-flow {
    flex-direction: column;
    align-items: stretch;
  }

  .loop-flow li,
  .loop-flow li:last-child {
    flex-direction: column;
    flex: none;
    align-items: stretch;
  }

  .loop-node {
    justify-content: flex-start;
  }

  .loop-arrow {
    padding-block: 0.25rem;
    justify-content: flex-start;
    padding-left: 1.25rem;
  }

  .loop-arrow svg {
    transform: rotate(90deg);
  }
}

@media (max-width: 48rem) {
  .content-band,
  .features-section,
  .collab-section {
    scroll-margin-top: 8rem;
  }

  .section-header .band-lead {
    margin-inline: 0;
  }
}

@media (max-width: 42rem) {
  .window-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
  }

  .window-bar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .window-launch-link,
  .window-bar-actions .zoom-trigger {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.375rem 0.65rem;
    font-size: 0.8125rem;
  }

  .panel-header {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
  }

  .panel-copy {
    flex: 1 1 14rem;
  }

  /* The tab panels stack their header in a column: a 14rem basis would become a 14rem height */
  .feature-panel > .panel-header .panel-copy {
    flex: 0 1 auto;
  }
}

@media (max-width: 34rem) {
  .hero h1,
  .subhero h1 {
    font-size: clamp(2.5rem, 11vw, 2.9rem);
  }

  .handoff-actions .btn,
  .page-handoff-actions .btn {
    width: 100%;
  }

  .handoff-actions,
  .page-handoff-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .insight-panel {
    padding: 1.5rem 1.125rem;
  }

  .bar-row:first-child .bar-stat {
    font-size: 1.375rem;
  }

  .bar-row:first-child .bar-label {
    font-size: 1.0625rem;
  }

  .handoff-actions .btn,
  .page-handoff-actions .btn {
    width: 100%;
  }

  .footer-nav {
    width: 100%;
    gap: 0.25rem;
  }

  .footer-nav a {
    padding-inline: 0.625rem;
    font-size: 0.875rem;
  }
}

/* ==========================================================================
   PAGE: platform.html — page-specific styles (pf- prefix). Keep all rules for
   this page, including its own responsive and reduced-motion rules, inside
   this block.
   ========================================================================== */

/* Section intros: let long headings use the full shell width */
.band-intro.pf-intro {
  max-width: none;
}

/* Architecture: metric cards */
.pf-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
  margin-top: clamp(2.25rem, 4.5vw, 3.5rem);
}

.pf-metric {
  padding: clamp(1.5rem, 2.6vw, 2rem);
  background-color: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 1rem;
  box-shadow: var(--shadow-card);
  overflow-wrap: anywhere;
  transition:
    transform 240ms var(--ease-out),
    border-color 200ms var(--ease-out),
    box-shadow 240ms var(--ease-out);
}

.pf-metric-tag {
  font-size: 0.9375rem;
  font-weight: 650;
  line-height: 1.4;
  color: var(--ink-muted);
}

.pf-metric-value {
  margin-top: 0.75rem;
  font-size: clamp(3rem, 5vw, 3.75rem);
  font-weight: 780;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--emerald-deep);
}

.pf-metric-name {
  margin-top: 0.75rem;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
}

.pf-metric-detail {
  margin-top: 0.5rem;
  font-size: 0.96875rem;
  line-height: 1.75;
  color: var(--ink-muted);
}

/* Architecture: CAGE-CSC diagram, built as inline SVG (two layouts, one graph) */
.pf-figure {
  margin: clamp(2.5rem, 5vw, 3.75rem) 0 0;
  padding: clamp(1rem, 2.4vw, 2rem);
  background-color: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 1rem;
  box-shadow: var(--shadow-card);
}

.pf-legend {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--ink-muted);
}

.pf-legend li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pf-legend svg {
  flex: none;
}

.pf-sw-llm { fill: #ECF8F3; stroke: #0C7A54; stroke-width: 1.5; }
.pf-sw-rule { fill: #FBF5EB; stroke: #A06A2C; stroke-width: 1.5; }
.pf-sw-dec { fill: #FFFFFF; stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
.pf-sw-rej { fill: #F7F9F8; stroke: #6E827A; stroke-width: 1.5; stroke-dasharray: 3 2.5; }

.pf-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  font-family: var(--font-sans);
}

.pf-diagram {
  position: relative;
}

/* Short sentinel over the top of the figure: starts the reveal when the top is comfortably in view */
.pf-trigger {
  position: absolute;
  inset: 0 0 auto 0;
  height: min(12rem, 30%);
  pointer-events: none;
}

.pf-svg-tall {
  display: none;
  max-width: 32rem;
  margin-inline: auto;
}

.cg-box {
  stroke-width: 1.5;
}

.cg-llm .cg-box { fill: #ECF8F3; stroke: #0C7A54; }
.cg-rule .cg-box { fill: #FBF5EB; stroke: #A06A2C; }
.cg-plain .cg-box { fill: #F7F9F8; stroke: #6E827A; }
.cg-dec .cg-box { fill: #FFFFFF; stroke: var(--ink); stroke-linejoin: round; }
.cg-node.dashed .cg-box { stroke-dasharray: 5 4; }

.cg-lit {
  fill: none;
  stroke: var(--emerald);
  stroke-width: 3.5;
  stroke-linejoin: round;
  opacity: 0;
}

.cg-title { font-size: 14.5px; font-weight: 700; fill: var(--ink); }
.cg-sub { font-size: 11.5px; fill: var(--ink-muted); }
.cg-elabel { font-size: 12.5px; font-weight: 700; fill: var(--ink); }

/* Mathematics: italic serif variables, upright operators, true subscripts (no web fonts) */
.cg-mi,
.cg-mo {
  font-family: "STIX Two Text", "STIX Two Math", "Cambria Math", "Latin Modern Roman", "Times New Roman", Times, serif;
}

.cg-mi { font-style: italic; }
.cg-ms { font-size: 0.72em; }
.cg-title .cg-mi,
.cg-title .cg-mo { font-size: 1.1em; font-weight: 400; }

math {
  font-family: "STIX Two Text", "STIX Two Math", "Cambria Math", "Latin Modern Roman", "Times New Roman", Times, serif;
  font-size: 1.1em;
  font-weight: 400;
}


 .cg-plain .cg-title { fill: var(--ink-muted); }

.cg-path { font-size: 14.5px; font-weight: 700; fill: var(--ink); }
.cg-pathsub { font-size: 11.5px; fill: var(--ink-muted); }
.cg-stage { font-size: 12.5px; font-weight: 600; fill: var(--ink-muted); }
.cg-note { font-size: 11.5px; font-weight: 400; fill: var(--ink-muted); }
.cg-fx { font-size: 17px; font-weight: 400; fill: var(--ink); }
.cg-edge.dashed .cg-line { stroke-dasharray: 4 3; stroke: #6E827A; }
.cg-edge.dashed .cg-head { fill: #6E827A; }

.pf-svg-tall .cg-title { font-size: 13px; }
.pf-svg-tall .cg-sub { font-size: 10.5px; }
.pf-svg-tall .cg-elabel { font-size: 10.5px; }
.pf-svg-tall .cg-path { font-size: 12px; }
.pf-svg-tall .cg-pathsub { font-size: 10px; }
.pf-svg-tall .cg-stage { font-size: 10px; }
.pf-svg-tall .cg-fx { font-size: 13px; }

.cg-line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: butt;
}

.cg-head {
  fill: var(--ink);
}

.pf-caption {
  margin-top: 1rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--ink-muted);
}

.pf-flowtext {
  margin-top: 0.75rem;
  border-top: 1px solid var(--hairline);
  padding-top: 0.75rem;
}

.pf-flowtext summary {
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 650;
  line-height: 1.6;
  color: var(--emerald-deep);
}

.pf-flowtext ol {
  margin: 0.75rem 0 0;
  padding-left: 1.5rem;
  font-size: 0.9375rem;
  line-height: 1.85;
  color: var(--ink-muted);
}

.pf-flowtext li::marker {
  color: var(--emerald-deep);
}

.pf-flowtext strong {
  font-weight: 650;
  color: var(--ink);
}

/* Fine pointers: hovering a node lights it and the edges into and out of it */
@media (hover: hover) and (pointer: fine) {
  .cg-node .cg-box {
    transition:
      stroke-width 160ms var(--ease-out),
      fill 160ms var(--ease-out);
  }

  .cg-line {
    transition:
      stroke 180ms var(--ease-out),
      stroke-width 180ms var(--ease-out);
  }

  .cg-head,
  .cg-elabel {
    transition: fill 180ms var(--ease-out);
  }

  .cg-node:hover .cg-box { stroke-width: 2.6; }
  .cg-llm:hover .cg-box { fill: #DDF3E8; }
  .cg-rule:hover .cg-box { fill: #F8EBD6; }
  .cg-plain:hover .cg-box { fill: #EAF0EE; }
  .cg-dec:hover .cg-box { fill: #F1FAF6; stroke: var(--emerald-deep); }

  .pf-diagram:has(.ni:hover) .cg-edge.e-ni .cg-line { stroke: var(--emerald); stroke-width: 2.6; }
  .pf-diagram:has(.ni:hover) .cg-edge.e-ni .cg-head { fill: var(--emerald); }
  .pf-diagram:has(.ni:hover) .cg-elabel.e-ni { fill: var(--emerald-deep); }
  .pf-diagram:has(.pp:hover) .cg-edge.e-pp .cg-line { stroke: var(--emerald); stroke-width: 2.6; }
  .pf-diagram:has(.pp:hover) .cg-edge.e-pp .cg-head { fill: var(--emerald); }
  .pf-diagram:has(.pp:hover) .cg-elabel.e-pp { fill: var(--emerald-deep); }
  .pf-diagram:has(.bp:hover) .cg-edge.e-bp .cg-line { stroke: var(--emerald); stroke-width: 2.6; }
  .pf-diagram:has(.bp:hover) .cg-edge.e-bp .cg-head { fill: var(--emerald); }
  .pf-diagram:has(.bp:hover) .cg-elabel.e-bp { fill: var(--emerald-deep); }
  .pf-diagram:has(.vf:hover) .cg-edge.e-vf .cg-line { stroke: var(--emerald); stroke-width: 2.6; }
  .pf-diagram:has(.vf:hover) .cg-edge.e-vf .cg-head { fill: var(--emerald); }
  .pf-diagram:has(.vf:hover) .cg-elabel.e-vf { fill: var(--emerald-deep); }
  .pf-diagram:has(.pa:hover) .cg-edge.e-pa .cg-line { stroke: var(--emerald); stroke-width: 2.6; }
  .pf-diagram:has(.pa:hover) .cg-edge.e-pa .cg-head { fill: var(--emerald); }
  .pf-diagram:has(.pa:hover) .cg-elabel.e-pa { fill: var(--emerald-deep); }
  .pf-diagram:has(.sp:hover) .cg-edge.e-sp .cg-line { stroke: var(--emerald); stroke-width: 2.6; }
  .pf-diagram:has(.sp:hover) .cg-edge.e-sp .cg-head { fill: var(--emerald); }
  .pf-diagram:has(.sp:hover) .cg-elabel.e-sp { fill: var(--emerald-deep); }
  .pf-diagram:has(.br:hover) .cg-edge.e-br .cg-line { stroke: var(--emerald); stroke-width: 2.6; }
  .pf-diagram:has(.br:hover) .cg-edge.e-br .cg-head { fill: var(--emerald); }
  .pf-diagram:has(.br:hover) .cg-elabel.e-br { fill: var(--emerald-deep); }
  .pf-diagram:has(.mg:hover) .cg-edge.e-mg .cg-line { stroke: var(--emerald); stroke-width: 2.6; }
  .pf-diagram:has(.mg:hover) .cg-edge.e-mg .cg-head { fill: var(--emerald); }
  .pf-diagram:has(.mg:hover) .cg-elabel.e-mg { fill: var(--emerald-deep); }
  .pf-diagram:has(.sa:hover) .cg-edge.e-sa .cg-line { stroke: var(--emerald); stroke-width: 2.6; }
  .pf-diagram:has(.sa:hover) .cg-edge.e-sa .cg-head { fill: var(--emerald); }
  .pf-diagram:has(.sa:hover) .cg-elabel.e-sa { fill: var(--emerald-deep); }
  .pf-diagram:has(.nl:hover) .cg-edge.e-nl .cg-line { stroke: var(--emerald); stroke-width: 2.6; }
  .pf-diagram:has(.nl:hover) .cg-edge.e-nl .cg-head { fill: var(--emerald); }
  .pf-diagram:has(.nl:hover) .cg-elabel.e-nl { fill: var(--emerald-deep); }
  .pf-diagram:has(.nr:hover) .cg-edge.e-nr .cg-line { stroke: var(--emerald); stroke-width: 2.6; }
  .pf-diagram:has(.nr:hover) .cg-edge.e-nr .cg-head { fill: var(--emerald); }
  .pf-diagram:has(.nr:hover) .cg-elabel.e-nr { fill: var(--emerald-deep); }
  .pf-diagram:has(.cr:hover) .cg-edge.e-cr .cg-line { stroke: var(--emerald); stroke-width: 2.6; }
  .pf-diagram:has(.cr:hover) .cg-edge.e-cr .cg-head { fill: var(--emerald); }
  .pf-diagram:has(.cr:hover) .cg-elabel.e-cr { fill: var(--emerald-deep); }
  .pf-diagram:has(.lr:hover) .cg-edge.e-lr .cg-line { stroke: var(--emerald); stroke-width: 2.6; }
  .pf-diagram:has(.lr:hover) .cg-edge.e-lr .cg-head { fill: var(--emerald); }
  .pf-diagram:has(.lr:hover) .cg-elabel.e-lr { fill: var(--emerald-deep); }
}

/* Playback: one pass in reading order, about five seconds; transform, opacity, stroke-dash only */
@keyframes cg-node-in {
  from {
    opacity: 0;
    transform: translate3d(0, 10px, 0);
  }
}

@keyframes cg-draw {
  from {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
  }

  to {
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
  }
}

@keyframes cg-fade {
  from {
    opacity: 0;
  }
}

@keyframes cg-lit {
  0% {
    opacity: 0;
  }

  35% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html.js-ready .pf-diagram:not(:has(> .pf-trigger.is-revealed)) :is(.cg-node, .cg-head, .cg-elabel, .cg-path, .cg-pathsub, .cg-stage) {
    opacity: 0;
  }

  html.js-ready .pf-diagram:not(:has(> .pf-trigger.is-revealed)) .cg-line {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
  }

  html.js-ready .pf-diagram:not(:has(> .pf-trigger.is-revealed)) .cg-edge.dashed .cg-line {
    stroke-dasharray: 4 3;
    stroke-dashoffset: 0;
    opacity: 0;
  }

  html.js-ready .pf-diagram:has(> .pf-trigger.is-revealed) .cg-edge.dashed .cg-line {
    animation: cg-fade var(--t, 400ms) var(--ease-out) var(--d, 0ms) backwards;
  }

  html.js-ready .pf-diagram:has(> .pf-trigger.is-revealed) .cg-node {
    animation: cg-node-in 320ms var(--ease-enter) var(--d, 0ms) backwards;
  }

  html.js-ready .pf-diagram:has(> .pf-trigger.is-revealed) .cg-line {
    animation: cg-draw var(--t, 500ms) var(--ease-out) var(--d, 0ms) backwards;
  }

  html.js-ready .pf-diagram:has(> .pf-trigger.is-revealed) .cg-head {
    animation: cg-fade 160ms linear var(--d, 0ms) backwards;
  }

  html.js-ready .pf-diagram:has(> .pf-trigger.is-revealed) :is(.cg-elabel, .cg-path, .cg-pathsub, .cg-stage) {
    animation: cg-fade 300ms var(--ease-out) var(--d, 0ms) backwards;
  }

  /* The two verification branches light together, then the AND decision resolves */
  html.js-ready .pf-diagram:has(> .pf-trigger.is-revealed) :is(.pa, .sa) .cg-lit {
    animation: cg-lit 500ms ease-in-out calc(var(--d, 0ms) + 200ms) backwards;
  }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: reduce) {
  .cg-node .cg-box,
  .cg-line,
  .cg-head,
  .cg-elabel {
    transition: none;
  }
}

/* Architecture: design principles */
.pf-principles {
  margin-top: clamp(3rem, 6vw, 4.5rem);
}

.pf-principles h3 {
  font-size: clamp(1.375rem, 2.2vw, 1.75rem);
  font-weight: 740;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.pf-pgrid {
  list-style: none;
  margin: clamp(1.5rem, 3vw, 2rem) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 2.25rem) clamp(1.25rem, 3vw, 2.5rem);
}

.pf-principle {
  padding-top: 1rem;
  border-top: 2px solid var(--hairline-strong);
}

.pf-principle h4 {
  font-size: 1.125rem;
  font-weight: 720;
  line-height: 1.4;
  color: var(--emerald-deep);
}

.pf-principle p {
  margin-top: 0.5rem;
  font-size: 0.96875rem;
  line-height: 1.75;
  color: var(--ink-muted);
}

/* Roles: alternating copy and framed screenshot */
.pf-roles {
  display: grid;
  gap: clamp(3rem, 7vw, 5.5rem);
  margin-top: clamp(2.5rem, 5vw, 4rem);
}

.pf-role {
  display: grid;
  grid-template-columns: minmax(0, 4.5fr) minmax(0, 7.5fr);
  column-gap: clamp(2rem, 4vw, 3.5rem);
  align-items: center;
}

.pf-role-rev {
  grid-template-columns: minmax(0, 7.5fr) minmax(0, 4.5fr);
}

.pf-role-rev .pf-role-copy {
  grid-column: 2;
  grid-row: 1;
}

.pf-role-rev .window-frame {
  grid-column: 1;
  grid-row: 1;
}

.pf-role .window-frame {
  border: 1px solid var(--hairline);
}

/* Explicit cells: the photo inset occupies one, so auto-placement would push the frame down */
.pf-role:not(.pf-role-rev) .window-frame {
  grid-column: 2;
  grid-row: 1;
}

.pf-role:not(.pf-role-rev) .pf-role-copy {
  grid-column: 1;
  grid-row: 1;
}

.pf-role-copy h3 {
  font-size: clamp(1.625rem, 2.6vw, 2rem);
  font-weight: 760;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--emerald-deep);
}

.pf-role-copy .pf-role-sub {
  margin-top: 0.375rem;
  font-size: 1.125rem;
  font-weight: 680;
  line-height: 1.5;
  color: var(--ink);
}

.pf-role-copy p {
  margin-top: 0.875rem;
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--ink-muted);
}

.pf-role-copy .pf-role-sub + p {
  margin-top: 0.875rem;
}

.pf-role-copy .zoom-trigger {
  margin-top: 1.5rem;
}

/* Admin: 2x2 icon cards and closing statement */
.pf-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
  margin-top: clamp(2.25rem, 4.5vw, 3.5rem);
}

.pf-card {
  padding: clamp(1.5rem, 2.6vw, 2rem);
  background-color: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 1rem;
  box-shadow: var(--shadow-card);
  overflow-wrap: anywhere;
  transition:
    transform 240ms var(--ease-out),
    border-color 200ms var(--ease-out),
    box-shadow 240ms var(--ease-out);
}

.pf-card h3 {
  margin-top: 1.25rem;
  font-size: 1.375rem;
  font-weight: 720;
  line-height: 1.35;
  color: var(--emerald-deep);
}

.pf-card p {
  margin-top: 0.625rem;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--ink-muted);
}

.pf-statement {
  max-width: 52rem;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: clamp(1.25rem, 2.5vw, 1.75rem);
  border-top: 1px solid var(--hairline);
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: -0.01em;
  color: var(--emerald-deep);
}

@media (max-width: 64rem) {
  .pf-role,
  .pf-role-rev {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 1.5rem;
  }

  .pf-role:not(.pf-role-rev) .pf-role-copy {
    grid-row: 1;
  }

  .pf-role:not(.pf-role-rev) .window-frame {
    grid-column: 1;
    grid-row: 2;
  }

  .pf-role-rev .pf-role-copy,
  .pf-role-rev .window-frame {
    grid-column: 1;
  }

  .pf-role-rev .pf-role-copy {
    grid-row: 1;
  }

  .pf-role-rev .window-frame {
    grid-row: 2;
  }
}

@media (max-width: 64rem) {
  .pf-svg-wide {
    display: none;
  }

  .pf-svg-tall {
    display: block;
  }

  .pf-pgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 48rem) {
  .pf-metrics,
  .pf-cards {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 40rem) {
  .pf-pgrid {
    grid-template-columns: minmax(0, 1fr);
  }

  .pf-figure {
    padding: 0.875rem;
  }

  .pf-legend {
    gap: 0.375rem 1.25rem;
    font-size: 0.8125rem;
  }
}

/* Odometer cells for the rolling metric numerals (same geometry as .stat-value) */
.pf-metric-value {
  white-space: nowrap;
}

.pf-metric-value.is-rolling {
  display: flex;
  height: 1.1em;
}

.pf-metric-value .odo-col,
.pf-metric-value .odo-sep {
  display: block;
  height: 1.1em;
}

.pf-metric-value .odo-col {
  overflow: hidden;
}

.pf-metric-value .odo-strip {
  display: block;
  transform: translate3d(0, calc(var(--row, 0) * -1.1em), 0);
  transition-property: transform;
}

.pf-metric-value .odo-strip > span {
  display: block;
  height: 1.1em;
}

/* Metric visuals: bars are proportional to the real values on a 0-1 scale */
.pf-bars {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
}

.pf-bar-row {
  display: grid;
  grid-template-columns: 4.75rem minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0.625rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--ink-muted);
}

.pf-bar-track {
  display: block;
  height: 0.5rem;
  overflow: hidden;
  border-radius: 999px;
  background-color: var(--hairline);
}

.pf-bar-fill {
  display: block;
  height: 100%;
  width: calc(var(--v) * 100%);
  border-radius: 999px;
  background-color: var(--emerald);
}

.pf-bar-fill-muted {
  background-color: var(--hairline-strong);
}

.pf-bar-v511 { --v: 0.511; }
.pf-bar-v896 { --v: 0.896; }
.pf-bar-v082 { --v: 0.082; }

.pf-bar-num,
.pf-bar-note {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pf-bar-num {
  font-weight: 650;
  color: var(--ink);
}

.pf-bars-line {
  margin-top: 1rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--ink-muted);
}

@media (prefers-reduced-motion: no-preference) {
  /* clip-path wipe instead of animating width (never animate layout) */
  html.js-ready .pf-metrics:not(.is-revealed) .pf-bar-fill {
    clip-path: inset(0 100% 0 0);
  }

  html.js-ready .pf-metrics.is-revealed .pf-bar-fill {
    clip-path: inset(0 0 0 0);
    transition: clip-path 1100ms var(--ease-out) calc(var(--i, 0) * 80ms + 500ms);
  }

  /* Second bar of the comparison follows the first */
  html.js-ready .pf-metrics.is-revealed .pf-bar-row:nth-child(2) .pf-bar-fill {
    transition-delay: calc(var(--i, 0) * 80ms + 1100ms);
  }
}

@media (max-width: 30rem) {
  .pf-bar-row {
    grid-template-columns: 4.25rem minmax(0, 1fr) auto;
    column-gap: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pf-metric,
  .pf-card,
  .pf-role .window-frame,
  .pf-bar-fill {
    transition: none;
  }
}

/* === END PAGE: platform.html === */

/* ==========================================================================
   PAGE: solutions.html — page-specific styles (sl- prefix). Keep all rules
   for this page, including its own responsive and reduced-motion rules,
   inside this block.
   ========================================================================== */

/* Discipline coverage: a quiet reference grid */
.sl-coverage {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: clamp(1.5rem, 3vw, 2rem);
  border-top: 1px solid var(--hairline);
}

.sl-coverage h3 {
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
}

.sl-discipline-grid {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
}

.sl-discipline-grid li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.5rem;
  padding: 0.5rem 1rem;
  background-color: var(--mint-subtle);
  border: 1px solid var(--hairline);
  border-radius: 0.75rem;
  font-size: 1rem;
  font-weight: 620;
  line-height: 1.3;
  color: var(--ink);
}

.sl-discipline-grid .icon {
  width: 1.375rem;
  height: 1.375rem;
  color: var(--emerald-deep);
}

/* Service lifecycle strip */
.sl-flow {
  --seq-idle-line: rgba(10, 95, 65, 0.1);
  --seq-idle-fill: transparent;
  list-style: none;
  max-width: 34rem;
  margin: 0 0 clamp(2rem, 4vw, 2.5rem);
  padding: 0;
  display: flex;
  align-items: center;
}

.sl-flow li {
  display: flex;
  align-items: center;
  flex: 1 1 0;
  min-width: 0;
}

.sl-flow li:last-child {
  flex: 0 1 auto;
}

.sl-flow-node {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.5rem;
  padding: 0.5rem 1.5rem;
  background-color: var(--mint-subtle);
  border: 1px solid var(--hairline-strong);
  border-radius: 0.75rem;
  color: var(--emerald-deep);
  font-size: 1.0625rem;
  font-weight: 680;
  line-height: 1.4;
  text-align: center;
  white-space: nowrap;
}

.sl-flow-arrow {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  min-width: 1.5rem;
  color: var(--emerald);
}

.sl-flow-arrow svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sl-service-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sl-statement {
  font-size: clamp(1.125rem, 1.8vw, 1.375rem);
  font-weight: 650;
  line-height: 1.7;
  color: var(--emerald-deep);
}

@media (max-width: 64rem) {
  .sl-discipline-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 56rem) {
  .sl-discipline-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 34rem) {
  .sl-discipline-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.625rem;
  }

  .sl-discipline-grid li {
    padding-inline: 0.75rem;
    gap: 0.5rem;
  }

  .sl-flow-node {
    padding-inline: 0.75rem;
    font-size: 1rem;
  }

  .sl-flow-arrow {
    min-width: 1rem;
  }

  .sl-flow-arrow svg {
    width: 1.125rem;
    height: 1.125rem;
  }

  .sl-service-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* === END PAGE: solutions.html === */

/* ==========================================================================
   SECTION: format story (the format chapter inside the 格式校验与模板排版 tab panel).
   fs- prefix. Keep every rule for this chapter, including responsive and
   reduced-motion rules, inside this block.
   ========================================================================== */

/* Format chapter (inside the 格式校验与模板排版 tab panel). Layout hooks for the panel itself live in
   the "Chapter layout" rules next to the feature-panel styles. */
.fs-lead-block h4 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 760;
  line-height: 1.35;
  color: var(--emerald-deep);
}

.fs-lead {
  margin-top: 0.75rem;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--ink-muted);
}

.fs-chapter {
  grid-column: 1 / -1;
  scroll-margin-top: var(--pin-offset);
  margin-top: clamp(3rem, 6vw, 4.5rem);
}

.fs-problem {
  padding: clamp(1.25rem, 3.5vw, 2.5rem);
  border-radius: 1.25rem;
  background-color: var(--mint-subtle, #F4FBF8);
  border: 1px solid var(--hairline);
}

.fs-answer {
  margin-top: clamp(2.5rem, 5vw, 4rem);
}

.fs-act-climax {
  margin-top: clamp(3rem, 6vw, 4.5rem);
}

.fs-act-title {
  max-width: 40rem;
  font-size: clamp(1.375rem, 2.4vw, 1.875rem);
  font-weight: 740;
  line-height: 1.3;
  color: var(--emerald-deep);
}

.fs-act-lead {
  max-width: 40rem;
  margin-top: 0.75rem;
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--ink-muted);
}

/* Easy block: the word-count rules, small and calm */
.fs-chips {
  list-style: none;
  margin: 0.875rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.fs-chips li {
  padding: 0.375rem 0.875rem;
  border-radius: 999px;
  background-color: var(--surface);
  border: 1px solid var(--hairline-strong);
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 560;
  line-height: 1.4;
}

.fs-easy-title {
  font-size: clamp(1.1875rem, 1.8vw, 1.375rem);
  font-weight: 720;
  line-height: 1.4;
  color: var(--ink);
}

.fs-easy-note {
  margin-top: 0.875rem;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--ink-muted);
}

.fs-act-easy {
  margin-top: clamp(2.25rem, 4.5vw, 3.25rem);
  padding-top: clamp(1.5rem, 3vw, 2rem);
  border-top: 1px solid var(--hairline);
}

.fs-school {
  max-width: 44rem;
  margin-top: clamp(1.75rem, 3vw, 2.25rem);
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--ink-muted);
}

.fs-school strong {
  margin-right: 0.5rem;
  color: var(--ink);
  font-weight: 700;
}

.fs-datapoint {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.25rem, 4vw, 3rem);
  max-width: 52rem;
  margin-top: clamp(1.25rem, 2.5vw, 1.75rem);
  padding: clamp(1.25rem, 3vw, 2rem) clamp(1.25rem, 3vw, 2.25rem);
  background-color: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 1rem;
}

.fs-num {
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.fs-dp-figure {
  color: var(--alert, #C81E1E);
  white-space: nowrap;
}

.fs-dp-figure .fs-num {
  font-size: clamp(2.5rem, 5.4vw, 4.25rem);
}

.fs-dp-text {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--ink-muted);
}

.fs-dp-track {
  display: block;
  height: 0.5rem;
  margin-top: 0.875rem;
  border-radius: 999px;
  background-color: var(--alert-soft, #FDE8E8);
  overflow: hidden;
}

.fs-dp-fill {
  display: block;
  width: 16.67%;
  height: 100%;
  border-radius: inherit;
  background-color: var(--alert-mid, #E02424);
  transform-origin: 0 50%;
}

/* Act 2: pain cards beside the schematic page */
.fs-pain {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
  margin-top: clamp(1.75rem, 3.5vw, 2.5rem);
}

.fs-pain-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.6vw, 1.25rem);
}

.fs-pain-card {
  padding: clamp(1.25rem, 2.2vw, 1.75rem);
  background-color: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 1rem;
  box-shadow: var(--shadow-card);
}

.fs-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  background-color: var(--mint-surface);
  color: var(--emerald-deep);
}

.fs-pain-card h5 {
  margin-top: 1rem;
  font-size: 1.1875rem;
  font-weight: 720;
  line-height: 1.4;
  color: var(--ink);
}

.fs-pain-card p {
  margin-top: 0.5rem;
  font-size: 0.96875rem;
  line-height: 1.75;
  color: var(--ink-muted);
}

.fs-doc {
  margin: 0;
}

.fs-doc figcaption,
.fs-payoff-note {
  margin-top: 0.625rem;
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

/* Schematic pages */
.fs-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.fs-page {
  fill: #fff;
  stroke: rgba(14, 52, 38, 0.14);
  stroke-width: 1;
  filter: drop-shadow(0 14px 18px rgba(14, 52, 38, 0.1));
}

.fs-ln-l {
  fill: #D6DCD9;
}

.fs-ln-h {
  fill: #AFBAB5;
}

.fs-ln-t {
  fill: #96A39E;
}

.fs-st {
  fill: none;
  stroke: var(--alert-mid, #E02424);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fs-pill rect {
  fill: var(--alert-soft, #FDE8E8);
  stroke: var(--alert-light, #F87171);
  stroke-width: 1;
}

.fs-pill text {
  fill: var(--alert-strong, #9B1C1C);
  font-size: 11.5px;
  font-weight: 650;
  font-family: inherit;
}

/* Act 3: steps */
.fs-steps {
  --fs-gap: clamp(1rem, 2.4vw, 2rem);
  list-style: none;
  margin: clamp(2rem, 4vw, 3rem) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 var(--fs-gap);
}

.fs-step {
  position: relative;
  padding-top: 4rem;
}

.fs-step-icon {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  box-shadow: 0 0 0 4px var(--surface);
}

.fs-step::after {
  content: "";
  position: absolute;
  top: calc(1.375rem - 1px);
  left: 3.5rem;
  width: calc(100% + var(--fs-gap) - 4rem);
  height: 2px;
  border-radius: 2px;
  background-color: var(--emerald, #0EA371);
  opacity: 0.5;
  transform-origin: 0 50%;
}

.fs-step:last-child::after {
  display: none;
}

.fs-step h5 {
  font-size: 1.1875rem;
  font-weight: 720;
  line-height: 1.4;
  color: var(--emerald-deep);
}

.fs-step p {
  margin-top: 0.5rem;
  font-size: 0.96875rem;
  line-height: 1.75;
  color: var(--ink-muted);
}

/* Template pager: the whole template, one before/after pair at a time. Without JS every part is
   listed one under another (rules first, then the pair); JS stacks them in one place and turns them. */
.fs-tp {
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  padding: clamp(0.875rem, 2vw, 1.125rem);
  background-color: var(--mint-subtle, #F4FBF8);
  border: 1px solid var(--hairline);
  border-radius: 1.25rem;
  overflow-x: clip;
}

.fs-tp-head {
  margin-bottom: clamp(1rem, 2.2vw, 1.5rem);
}

.fs-tp-note {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--ink-muted);
}

.fs-tp-parts {
  display: grid;
  gap: clamp(2rem, 4vw, 3rem);
}

.fs-tp-part {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.fs-tp-part .fs-tp-rules {
  order: -1;
}

.fs-pair {
  display: grid;
  grid-template-columns: minmax(0, 30rem) minmax(4.5rem, 6rem) minmax(0, 30rem);
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
}

.fs-side {
  margin: 0;
  min-width: 0;
}

.fs-side figcaption {
  margin-top: 0.875rem;
  text-align: center;
  font-size: 1.0625rem;
  font-weight: 700;
}

.fs-side-before figcaption {
  color: var(--alert-strong, #9B1C1C);
}

.fs-side-after figcaption {
  color: var(--emerald-deep);
}

.fs-pg {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  aspect-ratio: 794 / 1123;
  border: 1px solid rgba(14, 52, 38, 0.22);
  border-radius: 2px;
  background-color: #fff;
  box-shadow: 0 1px 0 rgba(14, 52, 38, 0.06), 0 22px 34px -20px rgba(14, 52, 38, 0.5);
  overflow: hidden;
  cursor: zoom-in;
  line-height: 0;
}

.fs-pg img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
}

/* Marks on the pages: garnet on the original, emerald on the template page (percent positioned) */
.fs-pg-marks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.fs-mk {
  fill: none;
  stroke: var(--alert-mid, #E02424);
  stroke-width: 3;
  stroke-linecap: round;
}

.fs-ck {
  fill: none;
  stroke: var(--emerald, #0EA371);
  stroke-width: 3;
  stroke-linecap: round;
}

.fs-tag {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1875rem 0.625rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
}

.fs-tag-bad {
  background-color: var(--alert-soft, #FDE8E8);
  border: 1px solid var(--alert-light, #F87171);
  color: var(--alert-strong, #9B1C1C);
}

.fs-tag-ok {
  background-color: var(--mint-surface, #ECF8F3);
  border: 1px solid var(--emerald, #0EA371);
  color: var(--emerald-deep, #0A5F41);
}

.fs-tag svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}


.fs-press-col {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.fs-press-col::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 2px dashed rgba(14, 163, 113, 0.45);
}

.fs-press-col::after {
  content: "";
  position: absolute;
  right: 0;
  top: calc(50% - 5px);
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--emerald, #0EA371);
  border-right: 2px solid var(--emerald, #0EA371);
  transform: rotate(45deg);
}

.fs-press {
  position: relative;
  z-index: 1;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 0.875rem;
  border-radius: 1.125rem;
  background-color: var(--emerald-deep);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 10px 20px -10px rgba(10, 95, 65, 0.7);
}

.fs-press svg {
  fill: #fff;
  stroke: #fff;
  stroke-width: 1.2;
  stroke-linejoin: round;
}

.fs-press::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  border: 2px solid var(--emerald, #0EA371);
  opacity: 0;
  pointer-events: none;
}

.fs-payoff-note {
  margin-top: 0.75rem;
  text-align: center;
}

/* Rules for the current part: one calm panel */
.fs-tp-rules {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  column-gap: 1.5rem;
  align-items: baseline;
  padding: 1rem 1.25rem 1.125rem;
  background-color: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 0.875rem;
}

.fs-tp-rules h5 {
  margin: 0;
  font-size: 1.1875rem;
  font-weight: 730;
  line-height: 1.5;
  color: var(--emerald-deep);
}

.fs-tp-rules ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}

.fs-tp-rules li {
  position: relative;
  padding-left: 0.875rem;
  font-size: 0.96875rem;
  line-height: 1.7;
  color: var(--ink-muted);
}

.fs-tp-rules li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 0.3125rem;
  height: 0.3125rem;
  border-radius: 50%;
  background-color: var(--emerald, #0EA371);
}

/* JS upgrade: tabs, one stacked stage, page buttons, one rules panel */
html.js-ready .fs-tp-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
}

.fs-tp-tabs[hidden],
.fs-tp-nav[hidden],
.fs-tp-rulebox[hidden] {
  display: none;
}

html.js-ready .fs-tp-tabs {
  display: flex;
  gap: 0.5rem;
  max-width: 100%;
  margin: -3px;
  padding: 3px;
  overflow-x: auto;
  scrollbar-width: none;
}

html.js-ready .fs-tp-tabs::-webkit-scrollbar {
  display: none;
}

.fs-tp-tab {
  flex: none;
  min-height: 2.75rem;
  padding: 0 1.125rem;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  background-color: var(--surface);
  color: var(--emerald-deep);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 180ms var(--ease-out), color 180ms var(--ease-out), border-color 180ms var(--ease-out);
}

.fs-tp-tab.is-active {
  background-color: var(--emerald-deep);
  border-color: var(--emerald-deep);
  color: #fff;
}

@media (hover: hover) {
  .fs-tp-tab:not(.is-active):hover {
    background-color: var(--mint-surface);
  }
}

.fs-tp-tab:focus-visible,
.fs-tp-btn:focus-visible {
  outline: 2px solid var(--emerald, #0EA371);
  outline-offset: 2px;
}

html.js-ready .fs-tp-parts {
  gap: 0;
  touch-action: pan-y;
}

html.js-ready .fs-tp-part {
  grid-area: 1 / 1;
}

html.js-ready .fs-tp-part:not(.is-current) {
  visibility: hidden;
  pointer-events: none;
}

html.js-ready .fs-tp-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: clamp(1rem, 2.2vw, 1.5rem);
}

.fs-tp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0 1.25rem 0 0.875rem;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  background-color: var(--surface);
  color: var(--emerald-deep);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
  transition: background-color 180ms var(--ease-out), transform 160ms var(--ease-out);
}

.fs-tp-btn[data-tp-next] {
  padding: 0 0.875rem 0 1.25rem;
}

.fs-tp-btn svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fs-tp-btn:active {
  transform: scale(0.97);
}

@media (hover: hover) {
  .fs-tp-btn:hover {
    background-color: var(--mint-surface);
  }
}

.fs-tp-count {
  min-width: 4rem;
  text-align: center;
  font-size: 1.0625rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

html.js-ready .fs-tp-rulebox {
  display: grid;
  margin-top: clamp(0.875rem, 2vw, 1.25rem);
}

html.js-ready .fs-tp-rulebox > .fs-tp-rules {
  grid-area: 1 / 1;
  opacity: 0;
  visibility: hidden;
  transition: opacity 240ms var(--ease-out), visibility 0s linear 240ms;
}

html.js-ready .fs-tp-rulebox > .fs-tp-rules.is-current {
  opacity: 1;
  visibility: visible;
  transition: opacity 320ms var(--ease-out) 140ms, visibility 0s;
}

.fs-closing {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  max-width: none;
  border-top-color: var(--hairline);
  font-size: clamp(1.375rem, 2.6vw, 2rem);
  font-weight: 760;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: var(--emerald-deep);
}

.fs-cta {
  margin-top: 1.5rem;
}

@media (max-width: 64rem) {
  .fs-pain {
    grid-template-columns: minmax(0, 1fr);
  }

  .fs-doc {
    max-width: 26rem;
  }

  .fs-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 2.25rem;
  }

  .fs-step:nth-child(2)::after {
    display: none;
  }
}

@media (max-width: 47.99rem) {
  .fs-datapoint {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
  }

  .fs-pain-cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .fs-pain-card {
    display: grid;
    grid-template-columns: 2.75rem minmax(0, 1fr);
    column-gap: 1rem;
    padding: 1.125rem;
  }

  .fs-pain-card .fs-tile {
    grid-row: 1 / span 2;
  }

  .fs-pain-card h5 {
    margin-top: 0;
  }

  .fs-steps {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0;
  }

  .fs-step {
    padding: 0 0 2rem 4rem;
    min-height: 3.25rem;
  }

  .fs-step:last-child {
    padding-bottom: 0;
  }

  .fs-step:nth-child(2)::after {
    display: block;
  }

  .fs-step::after {
    top: 3.25rem;
    bottom: 0.5rem;
    left: calc(1.375rem - 1px);
    width: 2px;
    height: auto;
    transform-origin: 50% 0;
  }

  .fs-step:last-child::after {
    display: none;
  }

  /* phones: the two pages stay side by side at reduced size; the control becomes a slim vertical pill */
  .fs-tp {
    padding: 0.75rem 0.5rem 1rem;
    border-radius: 1rem;
  }

  .fs-tp-head {
    margin-bottom: 0.875rem;
  }

  .fs-pair {
    grid-template-columns: minmax(0, 1fr) 2rem minmax(0, 1fr);
    gap: 0.25rem;
  }

  .fs-side figcaption {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    line-height: 1.45;
  }

  .fs-tag {
    display: none;
  }

  .fs-press {
    padding: 0.75rem 0.375rem;
    border-radius: 0.75rem;
    font-size: 0.8125rem;
    letter-spacing: 0.08em;
    writing-mode: vertical-rl;
  }

  .fs-press svg {
    display: none;
  }

  .fs-press-col::after {
    display: none;
  }

  .fs-tp-rules {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0.375rem;
    padding: 0.875rem 1rem 1rem;
  }

  .fs-tp-nav .fs-tp-btn {
    flex: 1 1 0;
    max-width: 8.5rem;
  }

  .fs-cta .btn {
    width: 100%;
  }
}

/* Motion: keyframe animations keyed to the state classes set by app.js. They restart whenever the
   chapter becomes visible, even if the element was marked revealed while its tab was hidden. */
@keyframes fs-chip-in {
  from {
    opacity: 0;
    transform: translate3d(0, 10px, 0) scale(0.9);
  }
}

@keyframes fs-line-x {
  from {
    transform: scaleX(0);
  }
}

@keyframes fs-line-y {
  from {
    transform: scaleY(0);
  }
}

@keyframes fs-pop {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
}

@keyframes fs-lift {
  from {
    opacity: 0;
    transform: translate3d(0, 14px, 0);
  }
}

@keyframes fs-draw {
  from {
    stroke-dashoffset: 1;
  }
}

@keyframes fs-fade {
  from {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html.js-ready .fs-chips[data-cascade].is-revealed > * {
    animation: fs-chip-in 600ms var(--ease-enter) calc(var(--i, 0) * 55ms) backwards;
  }

  html.js-ready .fs-datapoint:not(.is-revealed) .fs-dp-fill {
    transform: scaleX(0);
  }

  html.js-ready .fs-datapoint.is-revealed .fs-dp-fill {
    animation: fs-line-x 1100ms var(--ease-enter) 450ms backwards;
  }

  /* act 2 schematic: red marks draw in one after another, then their labels */
  html.js-ready .fs-doc .fs-st {
    stroke-dasharray: 1;
  }

  html.js-ready .fs-doc:not(.is-revealed) .fs-st {
    stroke-dashoffset: 1;
  }

  html.js-ready .fs-doc:not(.is-revealed) .fs-pill {
    opacity: 0;
  }

  html.js-ready .fs-doc.is-revealed .fs-st {
    animation: fs-draw 650ms var(--ease-enter) calc(var(--m, 0) * 650ms + 600ms) backwards;
  }

  html.js-ready .fs-doc.is-revealed .fs-pill {
    animation: fs-fade 500ms var(--ease-enter) calc(var(--m, 0) * 650ms + 1000ms) backwards;
  }

  /* steps: the line draws, the tile pops, the text follows */
  html.js-ready .fs-steps[data-sequence="steps"]:not(.is-revealed) .fs-step::after {
    transform: scaleX(0);
  }

  html.js-ready .fs-steps[data-sequence="steps"]:not(.is-revealed) .fs-step-icon {
    opacity: 0;
    transform: scale(0.6);
  }

  html.js-ready .fs-steps[data-sequence="steps"]:not(.is-revealed) .fs-step > :is(h5, p) {
    opacity: 0;
  }

  html.js-ready .fs-steps[data-sequence="steps"].is-revealed .fs-step::after {
    animation: fs-line-x 700ms var(--ease-enter) calc(var(--i, 0) * 520ms + 200ms) backwards;
  }

  html.js-ready .fs-steps[data-sequence="steps"].is-revealed .fs-step-icon {
    animation: fs-pop 560ms var(--ease-enter) calc(var(--i, 0) * 520ms) backwards;
  }

  html.js-ready .fs-steps[data-sequence="steps"].is-revealed .fs-step > :is(h5, p) {
    animation: fs-lift 800ms var(--ease-enter) calc(var(--i, 0) * 520ms + 200ms) backwards;
  }
}

@media (max-width: 47.99rem) and (prefers-reduced-motion: no-preference) {
  html.js-ready .fs-steps[data-sequence="steps"]:not(.is-revealed) .fs-step::after {
    transform: scaleY(0);
  }

  html.js-ready .fs-steps[data-sequence="steps"].is-revealed .fs-step::after {
    animation-name: fs-line-y;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fs-chapter *,
  .fs-chapter *::before,
  .fs-chapter *::after {
    animation: none;
    transition: none;
  }
}

/* Scroll-driven paging. app.js wraps the viewer's room in .fs-tp-track and, when the whole stage
   fits under the pinned bars, adds .is-pinned: the track becomes tall (--tp-track-h) and the viewer
   sticks below the header and chapter bar while scroll progress through the track picks the page.
   --tp-book-h caps the page height to what fits. Without JS, or when it does not fit, none of this
   applies and the viewer is the manual one above. */
.fs-tp-track {
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
}

.fs-tp-track > .fs-tp {
  margin-top: 0;
}

.fs-tp-progress {
  display: none;
}

.fs-tp-track.is-pinned {
  height: var(--tp-track-h);
}

.fs-tp-track.is-pinned > .fs-tp {
  position: sticky;
  top: calc(var(--header-h) + var(--tabbar-h) + 0.75rem);
  padding: 0.625rem 0.875rem 0.75rem;
}

.fs-tp-track.is-pinned .fs-tp-head {
  position: relative;
  margin-bottom: 0.625rem;
  padding-bottom: 0.5rem;
}

.fs-tp-track.is-pinned .fs-tp-tab,
.fs-tp-track.is-pinned .fs-tp-btn {
  min-height: 2.5rem;
}

.fs-tp-track.is-pinned .fs-tp-progress {
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 2px;
  background-color: var(--hairline);
  overflow: hidden;
}

.fs-tp-progress-fill {
  display: block;
  width: 100%;
  height: 100%;
  background-color: var(--emerald, #0EA371);
  transform-origin: 0 50%;
  transform: scaleX(var(--tp-p, 0));
}

.fs-tp-track.is-pinned .fs-tp-rulebox {
  margin-top: 0.625rem;
}

.fs-tp-track.is-pinned .fs-tp-rules {
  padding: 0.625rem 1rem 0.75rem;
}

.fs-tp-track.is-pinned .fs-tp-rules h5 {
  font-size: 1.0625rem;
}

.fs-tp-track.is-pinned .fs-tp-rules li {
  font-size: 0.9375rem;
  line-height: 1.6;
}

@media (max-width: 47.99rem) {
  .fs-tp-track.is-pinned > .fs-tp {
    padding: 0.5rem 0.5rem 0.625rem;
  }

  .fs-tp-track.is-pinned .fs-tp-note {
    display: none;
  }

  .fs-tp-track.is-pinned .fs-tp-nav {
    margin-top: 0.5rem;
  }

  .fs-tp-track.is-pinned .fs-tp-rules {
    padding: 0.5rem 0.75rem 0.625rem;
  }

  .fs-tp-track.is-pinned .fs-tp-rules li {
    font-size: 0.875rem;
    line-height: 1.5;
  }
}

/* ==========================================================================
   The books. app.js (when StPageFlip has loaded) moves the page buttons of every part into
   .fs-pf-page elements inside two .fs-tp-book boxes: a draft book and a formatted book, each showing
   one page at a time. The library sizes and positions each page element itself; only the paper turns.
   Labels, the control, notes, controls and rules sit outside the books and never move.
   --tp-page-w / --tp-page-h are the size of one page, --tp-book-w the width of both books, --tp-gap
   the space between them (wide: horizontal, stacked: the height of the strip with the control).
   ========================================================================== */
.fs-tp.has-book .fs-tp-parts {
  display: none;
}

.fs-tp-bookwrap {
  display: flex;
  justify-content: center;
  width: var(--tp-book-w, 0);
  margin-inline: auto;
}

/* each book is clipped on its left edge only: the lifted page swings out over it, never over its neighbour */
.fs-tp-book {
  flex: none;
  width: var(--tp-page-w, 0);
  height: var(--tp-page-h, 0);
  clip-path: inset(-10px -40px -10px 0);
  touch-action: pan-y;
}

.fs-tp-gap {
  display: flex;
  flex: none;
  width: var(--tp-gap, 0);
  align-self: stretch;
}

.fs-tp-gap .fs-press-col {
  flex: 1;
}

.fs-tp-side {
  display: none;
}

.fs-pf-page {
  background-color: #fff;
}

.fs-pf-page .fs-pg {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  container-type: inline-size;
}

/* An image that has not arrived must never paint its alt text onto the paper */
.fs-pf-page .fs-pg img {
  color: transparent;
  font-size: 0;
  line-height: 0;
  text-indent: -9999px;
  background-color: #fff;
}

/* tag chips scale with the page and never overflow it (--x is a chip's left in %, set by app.js) */
.fs-tp.has-book .fs-tag {
  display: inline-flex;
  max-width: 94cqw;
  font-size: clamp(0.625rem, 3.3cqw, 0.8125rem);
  padding: 0.125rem clamp(0.3rem, 1.6cqw, 0.625rem);
  translate: min(0px, calc(98cqw - var(--x, 0) * 1cqw - 100%)) 0;
}

.fs-tp.has-book .fs-tag svg {
  width: 1.1em;
  height: 1.1em;
}

@container (max-width: 219px) {
  .fs-tag {
    display: none;
  }
}

/* labels: the page they name is the draft (garnet) or the formatted page (green) */
.fs-tp-lab {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.fs-tp-lab-before {
  color: var(--alert-strong, #9B1C1C);
}

.fs-tp-lab-after {
  color: var(--emerald-deep);
}

/* wide: the labels sit over the two books */
.fs-tp-bar {
  display: none;
}

.fs-tp.is-wide .fs-tp-bar {
  display: grid;
  grid-template-columns: var(--tp-page-w, 0) var(--tp-gap, 0) var(--tp-page-w, 0);
  width: var(--tp-book-w, 0);
  height: 2rem;
  margin: 0 auto 0.5rem;
  align-items: center;
  text-align: center;
}

.fs-tp-bar .fs-tp-lab-before {
  grid-column: 1;
}

.fs-tp-bar .fs-tp-lab-after {
  grid-column: 3;
}

.fs-tp.has-book .fs-tp-nav {
  margin-top: 0.5rem;
}

/* wide: the page buttons sit beside the books, the indicator beside the labels */
.fs-tp.is-wide .fs-tp-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--tp-book-w, 0) minmax(0, 1fr);
  align-items: center;
}

.fs-tp.is-wide .fs-tp-bar {
  grid-column: 2;
  grid-row: 1;
}

.fs-tp.is-wide .fs-tp-bookwrap {
  grid-column: 2;
  grid-row: 2;
}

.fs-tp.is-wide .fs-tp-nav {
  display: contents;
}

.fs-tp.is-wide .fs-tp-nav .fs-tp-btn {
  grid-row: 2;
  min-width: 2.75rem;
  padding: 0;
  border-radius: 50%;
}

.fs-tp.is-wide .fs-tp-nav .fs-tp-btn[data-tp-prev] {
  grid-column: 1;
  justify-self: end;
  margin-right: 1rem;
}

.fs-tp.is-wide .fs-tp-nav .fs-tp-btn[data-tp-next] {
  grid-column: 3;
  justify-self: start;
  margin-left: 1rem;
}

.fs-tp.is-wide .fs-tp-nav .fs-tp-btn span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.fs-tp.is-wide .fs-tp-count {
  grid-column: 3;
  grid-row: 1;
  justify-self: start;
  margin-left: 1rem;
  min-width: 0;
  font-size: 1rem;
}

/* wide: the rules as one calm band under the books, the list running in lines */
.fs-tp.is-wide .fs-tp-rulebox > .fs-tp-rules {
  grid-template-columns: auto minmax(0, 1fr);
  padding: 0.5rem 1.25rem;
}

.fs-tp.is-wide .fs-tp-rulebox .fs-tp-rules ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
}

/* stacked (phones): draft page above, formatted page below, the control and its arrow between them.
   Beside each page there is room for notes: the draft's problems, the part's rules. */
.fs-tp.is-stacked .fs-tp-bookwrap {
  display: grid;
  grid-template-columns: var(--tp-page-w, 0) minmax(0, 1fr);
  column-gap: 0.75rem;
  align-items: start;
  justify-content: stretch;
  width: 100%;
}

.fs-tp.is-stacked .fs-tp-gap {
  grid-column: 1 / -1;
  height: var(--tp-gap, 0);
  width: auto;
}

.fs-tp.is-stacked .fs-tp-gap .fs-press-col {
  flex: none;
  width: var(--tp-page-w, 0);
}

/* the arrow points down, through the control */
.fs-tp.is-stacked .fs-tp-gap .fs-press-col::before {
  left: calc(50% - 1px);
  right: auto;
  top: 0;
  bottom: 0;
  border-top: 0;
  border-left: 2px dashed rgba(14, 163, 113, 0.45);
}

.fs-tp.is-stacked .fs-tp-gap .fs-press-col::after {
  display: block;
  left: calc(50% - 5px);
  right: auto;
  top: auto;
  bottom: 1px;
  transform: rotate(135deg);
}

.fs-tp.is-stacked .fs-tp-gap .fs-press {
  flex-direction: row;
  gap: 0.25rem;
  padding: 0.3125rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  letter-spacing: 0;
  writing-mode: horizontal-tb;
}

.fs-tp.is-stacked .fs-tp-gap .fs-press svg {
  display: block;
  width: 13px;
  height: 13px;
}

.fs-tp.is-stacked .fs-tp-side {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  height: var(--tp-page-h, 0);
  min-width: 0;
  overflow: hidden;
}

.fs-tp-taglists {
  display: grid;
}

.fs-tp-tags {
  grid-area: 1 / 1;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 240ms var(--ease-out), visibility 0s linear 240ms;
}

.fs-tp-tags.is-current {
  opacity: 1;
  visibility: visible;
  transition: opacity 320ms var(--ease-out) 140ms, visibility 0s;
}

.fs-tp-tags li {
  padding: 0.125rem 0.5rem;
  border: 1px solid var(--alert-light, #F87171);
  border-radius: 999px;
  background-color: var(--alert-soft, #FDE8E8);
  color: var(--alert-strong, #9B1C1C);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
}

.fs-tp.is-stacked .fs-tag {
  display: none;
}

/* compact chrome on phones: the height goes to the pages */
.fs-tp-track.is-pinned .fs-tp.is-stacked .fs-tp-head {
  margin-bottom: 0.375rem;
  padding-bottom: 0.25rem;
}

.fs-tp-track.is-pinned .fs-tp.is-stacked .fs-tp-tab,
.fs-tp-track.is-pinned .fs-tp.is-stacked .fs-tp-btn {
  min-height: 2.375rem;
}

.fs-tp-track.is-pinned .fs-tp.is-stacked.has-book .fs-tp-nav {
  margin-top: 0.25rem;
}

/* the rules panel lives beside the formatted page on phones, as a plain list */
.fs-tp.is-stacked .fs-tp-side .fs-tp-rulebox {
  margin: 0;
  min-height: 0;
}

.fs-tp.is-stacked .fs-tp-side .fs-tp-rules {
  display: block;
  padding: 0;
  border: 0;
  background: none;
}

.fs-tp.is-stacked .fs-tp-side .fs-tp-rules h5 {
  display: none;
}

.fs-tp.is-stacked .fs-tp-side .fs-tp-rules ul {
  display: grid;
  gap: 0.1875rem;
}

.fs-tp.is-stacked .fs-tp-side .fs-tp-rules li {
  padding-left: 0.75rem;
  font-size: 0.75rem;
  line-height: 1.45;
}

.fs-tp.is-stacked .fs-tp-side .fs-tp-rules li::before {
  top: 0.55em;
  width: 0.25rem;
  height: 0.25rem;
}

/* === END SECTION: format story === */

/* ==========================================================================
   SECTION: check matrix (the 32-item check report inside the 整体评价 tab panel).
   cm- prefix. Keep every rule for this chapter, including responsive and
   reduced-motion rules, inside this block.
   ========================================================================== */

.cm {
  grid-column: 1 / -1;
  grid-row: auto;
  scroll-margin-top: var(--pin-offset);
  margin-top: clamp(3rem, 6vw, 4.5rem);
  padding-top: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--hairline);
}

.cm-head {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: end;
}

.cm-head h4 {
  font-size: clamp(1.5rem, 2.8vw, 2.125rem);
  font-weight: 780;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--emerald-deep);
}

.cm-lead {
  max-width: 40rem;
  margin-top: 1rem;
  font-size: clamp(1.0625rem, 1.4vw, 1.1875rem);
  line-height: 1.8;
  color: var(--ink-muted);
}

.cm-figure {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.75rem;
  white-space: nowrap;
}

.cm-big {
  font-size: clamp(4.5rem, 9vw, 6.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--emerald-deep);
}

.cm-big-unit {
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  font-weight: 700;
  color: var(--ink);
}

.cm-summary {
  list-style: none;
  margin: clamp(2rem, 4vw, 3rem) 0 0;
  padding: clamp(1rem, 2vw, 1.5rem) 0 0;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cm-summary a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.25rem 1rem;
  border-radius: 999px;
  background-color: var(--mint-surface);
  color: var(--emerald-deep);
  font-size: 0.96875rem;
  font-weight: 650;
  text-decoration: none;
  transition: background-color 180ms var(--ease-out);
}

.cm-summary b {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.cm-summary a:hover {
  background-color: var(--mint);
}

.cm-legend {
  margin-top: 1.25rem;
}

.cm-legend-title {
  font-size: 0.9375rem;
  font-weight: 650;
  color: var(--ink);
}

.cm-legend ul {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 1.75rem;
}

.cm-legend li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink-muted);
}

.cm-legend li b {
  color: var(--ink);
  font-weight: 650;
}

.cm-dot {
  flex-shrink: 0;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  transform: translateY(-0.0625rem);
}

.cm-dot-ok {
  background-color: var(--emerald, #0EA371);
}

.cm-dot-fix {
  background-color: var(--alert, #C81E1E);
}

.cm-dot-hold {
  background-color: var(--ink-muted);
}

/* Matrix */
.cm-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.875rem, 1.8vw, 1.25rem);
  margin-top: clamp(1.75rem, 3.5vw, 2.5rem);
  align-items: stretch;
}

.cm-stack {
  display: flex;
  flex-direction: column;
  gap: clamp(0.875rem, 1.8vw, 1.25rem);
  min-width: 0;
}

.cm-stack .cm-card {
  flex: 1 1 auto;
}

.cm-card {
  scroll-margin-top: var(--pin-offset);
  min-width: 0;
  padding: clamp(1.125rem, 2vw, 1.5rem);
  background-color: var(--mint-subtle, #F4FBF8);
  border: 1px solid var(--hairline);
  border-radius: 1rem;
}

.cm-card-wide {
  grid-column: 1 / -1;
}

.cm-card-wide .cm-items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 1.5rem;
  grid-auto-flow: row;
}

.cm-card-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cm-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.625rem;
  background-color: var(--surface);
  color: var(--emerald-deep);
  box-shadow: 0 0 0 1px var(--hairline);
}

.cm-tile .icon {
  width: 1.375rem;
  height: 1.375rem;
}

.cm-card-head h5 {
  flex: 1 1 auto;
  font-size: 1.1875rem;
  font-weight: 740;
  line-height: 1.3;
  color: var(--emerald-deep);
}

.cm-count {
  font-size: 0.875rem;
  color: var(--ink-muted);
  white-space: nowrap;
}

.cm-count b {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--emerald-deep);
  font-variant-numeric: tabular-nums;
}

.cm-items {
  list-style: none;
  margin: 0.875rem 0 0;
  padding: 0;
}

.cm-items li {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.5rem 0;
  border-top: 1px solid rgba(14, 163, 113, 0.12);
  font-size: 0.96875rem;
  line-height: 1.55;
  color: var(--ink);
}

.cm-tick {
  flex-shrink: 0;
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.1875rem;
  fill: var(--surface);
  stroke: var(--emerald, #0EA371);
  stroke-width: 1.5;
}

.cm-tick path {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke: var(--emerald-deep);
}

/* Closing strip */
.cm-follow {
  margin-top: clamp(2rem, 4vw, 3rem);
  padding-top: clamp(1.5rem, 3vw, 2rem);
  border-top: 1px solid var(--hairline);
}

.cm-benefits {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem clamp(1rem, 3vw, 2.5rem);
}

.cm-benefits li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 1.0625rem;
  font-weight: 620;
  line-height: 1.6;
  color: var(--ink);
}

.cm-bicon {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0.25rem;
  margin-top: 0.125rem;
  border-radius: 50%;
  background-color: var(--mint-surface);
  fill: none;
  stroke: var(--emerald-deep);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  box-sizing: border-box;
}

.cm-adjust {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.5rem;
  margin-top: 1.25rem;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink-muted);
}

@media (max-width: 64rem) {
  .cm-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cm-card-wide .cm-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cm-stack-b {
    grid-column: 1 / -1;
    flex-direction: row;
  }

  .cm-stack-b .cm-card {
    flex: 1 1 0;
  }

  .cm-stack-b .cm-card:last-child {
    flex: 0 1 38%;
    align-self: flex-start;
  }

  .cm-card-wide {
    grid-column: 1 / -1;
  }

  .cm-benefits {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 47.99rem) {
  .cm-head {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .cm-figure {
    justify-content: flex-start;
  }

  .cm-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .cm-stack,
  .cm-stack-b {
    flex-direction: column;
  }

  .cm-stack-b .cm-card:last-child {
    flex: 1 1 auto;
    align-self: stretch;
  }

  .cm-card-wide .cm-items {
    grid-template-columns: minmax(0, 1fr);
  }

  .cm-legend li {
    flex-wrap: wrap;
  }
}

/* Motion: each card's items tick down in quick sequence. Keyframe animations, so they restart
   whenever the chapter becomes visible, even if the card was marked revealed while hidden. */
@keyframes cm-tick-draw {
  from {
    stroke-dashoffset: 1;
  }
}

@keyframes cm-tick-ring {
  from {
    stroke-opacity: 0.25;
  }
}

@keyframes cm-text-in {
  from {
    opacity: 0.4;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html.js-ready .cm-tick path {
    stroke-dasharray: 1;
  }

  html.js-ready .cm-card:not(.is-revealed) .cm-tick path {
    stroke-dashoffset: 1;
  }

  html.js-ready .cm-card:not(.is-revealed) .cm-tick circle {
    stroke-opacity: 0.25;
  }

  html.js-ready .cm-card:not(.is-revealed) .cm-item-text {
    opacity: 0.4;
  }

  html.js-ready .cm-card.is-revealed .cm-tick path {
    animation: cm-tick-draw 380ms var(--ease-enter) calc(var(--d, 0ms) + 420ms + var(--k, 0) * 55ms) backwards;
  }

  html.js-ready .cm-card.is-revealed .cm-tick circle {
    animation: cm-tick-ring 380ms var(--ease-enter) calc(var(--d, 0ms) + 420ms + var(--k, 0) * 55ms) backwards;
  }

  html.js-ready .cm-card.is-revealed .cm-item-text {
    animation: cm-text-in 380ms var(--ease-enter) calc(var(--d, 0ms) + 420ms + var(--k, 0) * 55ms) backwards;
  }

  html.js-ready .cm-summary[data-cascade].is-revealed > * {
    animation-duration: 700ms;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cm *,
  .cm *::before,
  .cm *::after {
    animation: none;
    transition: none;
  }
}

/* === END SECTION: check matrix === */

/* === SECTION: people imagery ===
   Photographs of teachers and students (assets/people). One component, three placements:
   .ph-photo       wide scene (statistics strip, deep-emerald band, closing band)
   .ph-card-photo  top of a stakeholder card (solutions.html)
   .ph-inset       small portrait card that overlaps a product screenshot (platform.html)
   Anatomy: figure > .ph-frame (rounded, masked, clipped) > .ph-shift (parallax, taller than the
   frame so it never shows an edge) > img, plus .ph-tint, a pre-composed emerald layer whose
   opacity is the only colour grading that animates. Reveal reuses the existing hooks:
   data-reveal on a figure, [data-cascade] on the card grid, [data-split] on a role row.
   Final state (no JS, reduced motion) is the natural-colour photograph. ======================== */
.ph-photo,
.ph-card-photo,
.ph-inset {
  --ph-r: 1rem;
  --ph-ease: cubic-bezier(0.33, 0.85, 0.4, 1);
  position: relative;
  margin: 0;
}

.ph-frame {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--ph-r);
  background-color: var(--mint-surface);
  aspect-ratio: var(--ph-ratio, 16 / 9);
}

.ph-shift {
  position: absolute;
  inset: -1.75rem 0;
}

.ph-shift img,
.ph-frame > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--ph-pos, 50% 50%);
  filter: saturate(0.92);
}

.ph-frame > img {
  position: absolute;
  inset: 0;
}

.ph-tint {
  position: absolute;
  inset: 0;
  background-color: var(--emerald-deep);
  opacity: var(--ph-tint, 0.07);
  pointer-events: none;
}

/* Crops: faces stay inside the frame at every aspect */
.ph-card-photo.ph-pos-faculty { --ph-pos: 50% 30%; }
.ph-card-photo.ph-pos-reviewing { --ph-pos: 62% 8%; }
.ph-card-photo.ph-pos-library { --ph-pos: 60% 12%; }
.ph-inset.ph-pos-faculty { --ph-pos: 24% 50%; }
.ph-inset.ph-pos-reviewing { --ph-pos: 64% 30%; }
.ph-inset.ph-pos-library { --ph-pos: 60% 30%; }

/* 1. Statistics strip: the scene the numbers come from. The photo dissolves into the page
   and the figures sit on a white panel that overlaps it. */
.ph-stage {
  position: relative;
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
}

.ph-stats-photo {
  --ph-r: clamp(1rem, 2vw, 1.5rem);
  --ph-curtain: inset(0 100% 0 0);
}

.ph-stats-photo .ph-frame {
  --ph-ratio: 2.3 / 1;
  --ph-pos: 50% 22%;
  -webkit-mask-image: linear-gradient(to bottom, #fff 0, #fff 48%, transparent 100%);
  mask-image: linear-gradient(to bottom, #fff 0, #fff 48%, transparent 100%);
}

.ph-panel {
  position: relative;
  z-index: 1;
  margin: calc(-1 * clamp(3rem, 8vw, 6.5rem)) clamp(0.5rem, 1.6vw, 1.5rem) 0;
  padding: clamp(1.5rem, 3.2vw, 2.5rem) clamp(1.25rem, 2.4vw, 2.25rem);
  background-color: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: clamp(1rem, 1.6vw, 1.25rem);
  box-shadow: var(--shadow-surface-window);
}

.ph-panel .stat-row {
  margin: 0;
  padding: 0;
  border-top: 0;
}

@media (min-width: 48.01rem) {
  .ph-panel .stat-figure {
    --stat-size: clamp(3rem, 6vw, 5rem);
  }

  .ph-panel .stat-item {
    padding-inline: clamp(0.75rem, 2vw, 2rem);
  }

  .ph-panel .stat-item:first-child {
    padding-left: 0;
  }

  .ph-panel .stat-item:last-child {
    padding-right: 0;
  }
}

.ph-stage + .stat-note {
  margin-top: clamp(1.5rem, 3vw, 2rem);
}

/* 2. Deep-emerald band: the photo sits on the right and melts into the emerald */
.collab-section {
  position: relative;
}

.collab-section > .shell {
  position: relative;
  z-index: 1;
}

.ph-collab-photo {
  --ph-r: 0;
  --ph-curtain: inset(0 0 0 100%);
  --ph-tint: 0.2;
  position: absolute;
  top: 0;
  right: 0;
  z-index: 0;
  width: min(54%, 50rem);
  pointer-events: none;
}

.ph-collab-photo .ph-frame {
  --ph-ratio: 2.1 / 1;
  --ph-pos: 56% 78%;
  background-color: transparent;
  -webkit-mask-image:
    linear-gradient(to right, transparent 0, #fff 46%),
    linear-gradient(to bottom, #fff 0, #fff 42%, transparent 100%);
  mask-image:
    linear-gradient(to right, transparent 0, #fff 46%),
    linear-gradient(to bottom, #fff 0, #fff 42%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

@media (min-width: 64.01rem) {
  .collab-section .collab-intro {
    max-width: 46%;
  }

  /* Room under the photo so no body text sits on it */
  .collab-section .collab-points {
    margin-top: clamp(4rem, 7vw, 6.5rem);
  }
}

/* 3. Closing band: soft companion beside the buttons */
.ph-handoff .handoff-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr);
  grid-template-areas:
    "copy photo"
    "actions photo";
  align-items: start;
  column-gap: clamp(1.5rem, 4vw, 4rem);
  row-gap: clamp(1.5rem, 3vw, 2.25rem);
}

.ph-handoff-copy {
  grid-area: copy;
  align-self: end;
}

.ph-handoff .handoff-actions {
  grid-area: actions;
  gap: 0.5rem;
}

.ph-handoff .handoff-actions .btn {
  padding-inline: 1.25rem;
}

.ph-handoff-photo {
  grid-area: photo;
  align-self: center;
  --ph-r: 0;
}

.ph-handoff-photo .ph-frame {
  --ph-ratio: 1264 / 848;
  --ph-pos: 56% 50%;
  background-color: transparent;
  -webkit-mask-image:
    linear-gradient(to right, transparent 0, #fff 18%, #fff 82%, transparent 100%),
    linear-gradient(to bottom, transparent 0, #fff 20%, #fff 80%, transparent 100%);
  mask-image:
    linear-gradient(to right, transparent 0, #fff 18%, #fff 82%, transparent 100%),
    linear-gradient(to bottom, transparent 0, #fff 20%, #fff 80%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

.ph-keep {
  white-space: nowrap;
}

/* 4. Stakeholder cards: photo across the top of the card, its foot fading into the white */
.ph-card {
  --ph-pad: clamp(1.5rem, 2.6vw, 2rem);
}

.ph-card-photo {
  margin: calc(-1 * var(--ph-pad)) calc(-1 * var(--ph-pad)) 0;
}

.ph-card-photo .ph-frame {
  --ph-ratio: 16 / 10;
  border-radius: calc(1rem - 1px) calc(1rem - 1px) 0 0;
  -webkit-mask-image: linear-gradient(to bottom, #fff 0, #fff 74%, transparent 100%);
  mask-image: linear-gradient(to bottom, #fff 0, #fff 74%, transparent 100%);
}

.ph-card .card-icon {
  position: relative;
  margin-top: -1.75rem;
  margin-left: 0;
  box-shadow: 0 0 0 4px var(--surface);
}

/* 5. Platform: a person beside the workspace they use, hanging off a corner of the screenshot */
.pf-role > .ph-inset {
  --ph-r: 0.875rem;
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  justify-self: start;
  z-index: 2;
  width: clamp(6.5rem, 13vw, 9.25rem);
  border-radius: var(--ph-r);
  /* drop-shadow follows the clipped frame, so the card and its shadow arrive together */
  filter: drop-shadow(0 14px 16px rgb(10 95 65 / 0.2)) drop-shadow(0 2px 3px rgb(10 95 65 / 0.12));
  transform: translate3d(-1.5rem, 2rem, 0);
}

.pf-role-rev > .ph-inset {
  grid-column: 1;
  justify-self: end;
  transform: translate3d(1.5rem, 2rem, 0);
}

.ph-inset .ph-frame {
  --ph-ratio: 4 / 5;
  box-sizing: border-box;
  border: 3px solid var(--surface);
}

@media (max-width: 64rem) {
  .pf-role > .ph-inset,
  .pf-role-rev > .ph-inset {
    grid-column: 1;
    grid-row: 2;
    justify-self: end;
    transform: translate3d(-0.75rem, 1.5rem, 0);
  }

  .ph-collab-photo {
    width: min(56%, 40rem);
  }

  .collab-section .collab-intro {
    max-width: 48%;
  }
}

@media (max-width: 40rem) {
  /* Phones: the portrait stops overlapping the screenshot and leads the card as a wide photo,
     so the order reads photo, copy, screenshot from top to bottom. */
  .pf-role > .ph-inset,
  .pf-role-rev > .ph-inset {
    grid-row: 1;
    justify-self: stretch;
    width: 100%;
    filter: none;
    transform: none;
  }

  .pf-role > .ph-inset .ph-frame {
    --ph-ratio: 3 / 2;
    border: 0;
  }

  .pf-role:not(.pf-role-rev) .pf-role-copy,
  .pf-role-rev .pf-role-copy {
    grid-row: 2;
  }

  .pf-role:not(.pf-role-rev) .window-frame,
  .pf-role-rev .window-frame {
    grid-row: 3;
  }
}

@media (max-width: 48rem) {
  .ph-stats-photo .ph-frame {
    --ph-ratio: 4 / 3;
  }

  .ph-panel {
    margin-inline: 0;
    padding-inline: 1.125rem;
  }

  .ph-panel .stat-figure {
    --stat-size: clamp(2.1rem, 9.5vw, 3.25rem);
  }

  .ph-collab-photo {
    position: relative;
    width: auto;
    margin: calc(-1 * clamp(4.5rem, 9vw, 8rem)) 0 -1rem;
  }

  .ph-collab-photo .ph-frame {
    --ph-ratio: 16 / 11;
    -webkit-mask-image: linear-gradient(to bottom, #fff 0, #fff 55%, transparent 100%);
    mask-image: linear-gradient(to bottom, #fff 0, #fff 55%, transparent 100%);
    -webkit-mask-composite: source-over;
    mask-composite: add;
  }

  .collab-section .collab-intro {
    max-width: none;
  }

  .ph-handoff .handoff-inner {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "photo"
      "copy"
      "actions";
  }

  .ph-handoff-photo .ph-frame {
    --ph-ratio: 16 / 10;
  }
}

/* Motion: curtain, settle, develop. Hidden start states only with JS and no reduced motion. */
@keyframes ph-curtain {
  from {
    clip-path: var(--ph-curtain, inset(0 100% 0 0));
  }

  to {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes ph-settle {
  from {
    transform: scale(1.08);
  }
}

@keyframes ph-develop {
  from {
    opacity: var(--ph-tint-from, 0.5);
  }
}

@keyframes ph-grey {
  from {
    filter: grayscale(1) saturate(0.92);
  }
}

@media (prefers-reduced-motion: no-preference) {
  /* The figure itself stays put; its frame is the curtain, so shadows are never clipped */
  html.js-ready .ph-photo[data-reveal],
  html.js-ready .ph-photo[data-reveal]:not(.is-revealed),
  html.js-ready .ph-photo[data-reveal].is-revealed {
    opacity: 1;
    transform: none;
    animation: none;
  }

  html.js-ready .ph-photo[data-reveal]:not(.is-revealed) .ph-frame,
  html.js-ready [data-cascade]:not(.is-revealed) .ph-card .ph-frame,
  html.js-ready .pf-role[data-split]:not(.is-revealed) .ph-inset .ph-frame {
    clip-path: var(--ph-curtain, inset(0 100% 0 0));
  }

  html.js-ready [data-cascade]:not(.is-revealed) .ph-card .ph-frame {
    --ph-curtain: inset(0 0 100% 0);
  }

  html.js-ready .pf-role[data-split]:not(.is-revealed) .ph-inset .ph-frame {
    --ph-curtain: inset(100% 0 0 0);
  }

  html.js-ready .ph-photo[data-reveal].is-revealed .ph-frame {
    animation: ph-curtain 1100ms var(--ease-enter) backwards;
  }

  html.js-ready [data-cascade].is-revealed .ph-card .ph-frame {
    --ph-curtain: inset(0 0 100% 0);
    animation: ph-curtain 1000ms var(--ease-enter) calc(var(--i, 0) * 80ms + 240ms) backwards;
  }

  html.js-ready .pf-role[data-split].is-revealed .ph-inset .ph-frame {
    --ph-curtain: inset(100% 0 0 0);
    animation: ph-curtain 1000ms var(--ease-enter) 620ms backwards;
  }

  html.js-ready .pf-role[data-split].is-revealed > .ph-inset {
    animation: lift-in 800ms var(--ease-enter) 620ms backwards;
  }

  /* Slow settle of the picture inside its frame */
  html.js-ready .ph-photo[data-reveal].is-revealed .ph-shift img {
    animation: ph-settle 1300ms var(--ph-ease) backwards;
  }

  html.js-ready [data-cascade].is-revealed .ph-card .ph-shift img {
    animation: ph-settle 1300ms var(--ph-ease) calc(var(--i, 0) * 80ms + 240ms) backwards;
  }

  html.js-ready .pf-role[data-split].is-revealed .ph-inset .ph-frame > img {
    animation: ph-settle 1300ms var(--ph-ease) 620ms backwards;
  }

  /* The picture develops: emerald tint (and, on the deep band, greyscale) eases off */
  html.js-ready .ph-photo[data-reveal].is-revealed .ph-tint,
  html.js-ready [data-cascade].is-revealed .ph-card .ph-tint,
  html.js-ready .pf-role[data-split].is-revealed .ph-inset .ph-tint {
    animation: ph-develop 1500ms var(--ph-ease) backwards;
  }

  html.js-ready .ph-collab-photo.is-revealed .ph-tint {
    --ph-tint-from: 0.78;
    animation-duration: 1800ms;
  }

  html.js-ready .ph-collab-photo.is-revealed .ph-shift img {
    animation: ph-settle 1300ms var(--ph-ease) backwards, ph-grey 1800ms var(--ph-ease) backwards;
  }

  /* Closing band: fades in and settles, no curtain */
  html.js-ready .ph-handoff-photo[data-reveal]:not(.is-revealed) .ph-frame {
    clip-path: none;
    opacity: 0;
  }

  html.js-ready .ph-handoff-photo[data-reveal].is-revealed .ph-frame {
    animation: fade-in 1100ms var(--ph-ease) backwards;
  }
}

/* Hover (fine pointers only): the picture in a card eases in a touch */
@media (hover: hover) and (pointer: fine) {
  .ph-card-photo .ph-shift img {
    transition: transform 260ms var(--ease-out);
  }

  .ph-card:hover .ph-shift img {
    transform: scale(1.04);
  }
}

/* ---- Second set: problem imagery, chapter companions, campus backdrop ---- */

/* Feathered edge shared by the soft-edged photos: all four sides dissolve */
.ph-feather .ph-frame {
  -webkit-mask-image:
    linear-gradient(to right, transparent 0, #fff 14%, #fff 86%, transparent 100%),
    linear-gradient(to bottom, transparent 0, #fff 16%, #fff 84%, transparent 100%);
  mask-image:
    linear-gradient(to right, transparent 0, #fff 14%, #fff 86%, transparent 100%),
    linear-gradient(to bottom, transparent 0, #fff 16%, #fff 84%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

/* Grades. Problem imagery: cooler, drained, a faint garnet tint ("before").
   Chapter imagery in the green sections: neutral and slightly drained.
   AI imagery: the cool blue-grey is turned toward the palette. */
.ph-pain {
  --ph-tint: 0.16;
  --ph-tint-from: 0.5;
}

.ph-pain .ph-tint {
  background-color: var(--alert);
}

.ph-pain .ph-shift img {
  filter: saturate(0.62);
}

.ph-neutral {
  --ph-tint: 0.05;
  --ph-tint-from: 0.3;
}

.ph-neutral .ph-shift img {
  filter: saturate(0.72);
}

.ph-ai {
  --ph-tint: 0.1;
  --ph-tint-from: 0.4;
}

.ph-ai .ph-shift img {
  filter: hue-rotate(-16deg) saturate(0.86);
}

.ph-glow {
  position: absolute;
  left: 32%;
  top: 38%;
  width: 32%;
  height: 42%;
  background: radial-gradient(ellipse at 50% 50%, rgb(255 255 255 / 0.85), transparent 68%);
  opacity: 0;
  pointer-events: none;
}

/* 1. Challenges: the teacher beside the heading, dissolving into the white */
.ph-head {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  align-items: center;
  column-gap: clamp(1.5rem, 4vw, 3.5rem);
}

.ph-head .band-header {
  max-width: none;
}

.ph-challenge-photo {
  --ph-curtain: inset(0 0 0 100%);
  --ph-r: 1.25rem;
}

.ph-challenge-photo .ph-frame {
  --ph-ratio: 16 / 10;
  --ph-pos: 56% 26%;
}

/* 2. Evidence: the stack of marked papers under the insights, dissolving into the tint */
.ph-evidence-photo {
  --ph-r: 1.25rem;
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
}

.ph-evidence-photo .ph-frame {
  --ph-ratio: 16 / 11;
  --ph-pos: 68% 40%;
}

/* 3. Format chapter, hard problems: modest face beside the heading */
.ph-act-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(13rem, 24vw, 18.5rem);
  align-items: center;
  column-gap: clamp(1.5rem, 4vw, 3rem);
}

.ph-format-pain-photo {
  --ph-curtain: inset(0 0 0 100%);
  --ph-r: 1rem;
}

.ph-format-pain-photo .ph-frame {
  --ph-ratio: 4 / 3;
  --ph-pos: 52% 22%;
}

/* 4. Format chapter, payoff: the finished thesis beside the closing line */
.ph-payoff {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  column-gap: clamp(1.5rem, 4vw, 3.5rem);
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
}

.ph-payoff .fs-closing {
  margin-top: 0;
}

.ph-payoff-photo {
  --ph-r: 1.25rem;
  --ph-tint: 0.04;
}

.ph-payoff-photo .ph-frame {
  --ph-ratio: 16 / 10;
  --ph-pos: 50% 50%;
}

/* 5. 专业批改: companion under the checklist, blended into the white */
.feature-panel > .ph-suggest-col,
.feature-panel > .ph-col {
  grid-column: 2;
  grid-row: 2 / span 3;
}

.ph-suggest-photo {
  margin-top: 1.5rem;
  --ph-r: 1.25rem;
}

.ph-suggest-photo .ph-frame {
  --ph-ratio: 2.4 / 1;
  --ph-pos: 62% 36%;
}

/* 7. solutions.html opens on a campus */
.subhero {
  position: relative;
}

.subhero > .shell {
  position: relative;
  z-index: 1;
}

/* Copy stays on the clear (left) side of the campus photo */
.subhero .subhero-copy {
  text-align: left;
}

.ph-campus-photo {
  --ph-r: 0;
  --ph-curtain: inset(0 0 0 100%);
  --ph-tint: 0.05;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  width: min(60%, 64rem);
  pointer-events: none;
}

.ph-campus-photo .ph-frame {
  --ph-pos: 56% 58%;
  aspect-ratio: auto;
  height: 100%;
  background-color: transparent;
  -webkit-mask-image:
    linear-gradient(to right, transparent 0, transparent 30%, #fff 62%),
    linear-gradient(to bottom, #fff 0, #fff 62%, transparent 100%);
  mask-image:
    linear-gradient(to right, transparent 0, transparent 30%, #fff 62%),
    linear-gradient(to bottom, #fff 0, #fff 62%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

@media (max-width: 64rem) {
  .feature-panel > .ph-suggest-col {
    grid-column: 1;
    grid-row: auto;
    margin-top: 2rem;
  }

  .ph-suggest-photo .ph-frame {
    --ph-ratio: 16 / 10;
  }

  .ph-act-head,
  .ph-payoff {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 1.25rem;
  }

  .ph-act-head {
    align-items: start;
  }

  .ph-format-pain-photo,
  .ph-payoff-photo {
    max-width: 30rem;
  }

  .ph-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .ph-challenge-photo {
    max-width: 30rem;
  }

  .ph-head .band-header {
    margin-bottom: 1rem;
  }
}

@media (max-width: 48rem) {
  .ph-campus-photo {
    position: relative;
    inset: auto;
    width: auto;
    margin: 1.75rem 0 calc(-1 * clamp(3rem, 6vw, 5rem));
  }

  .ph-campus-photo .ph-frame {
    aspect-ratio: 16 / 9;
    height: auto;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #fff 40%);
    mask-image: linear-gradient(to bottom, transparent 0, #fff 40%);
    -webkit-mask-composite: source-over;
    mask-composite: add;
  }
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes ph-glow-run {
    0%,
    42% {
      opacity: 0;
    }

    62% {
      opacity: 1;
    }

    100% {
      opacity: 0;
    }
  }

  /* The light arc is the last thing to resolve: a soft flash after the picture has developed */
  html.js-ready .ph-suggest-photo.is-revealed .ph-glow {
    animation: ph-glow-run 2600ms var(--ph-ease) backwards;
  }

  html.js-ready .ph-suggest-photo.is-revealed .ph-tint {
    animation-duration: 1800ms;
  }

  /* Campus: curtain starts a beat after the hero text */
  html.js-ready .ph-campus-photo.is-revealed .ph-frame {
    animation-delay: 200ms;
    animation-duration: 1300ms;
  }
}


/* ---- Third set: role portraits, closing campus, technology backdrop, section companions ---- */

/* Role portraits (4:5, already composed): inset cards on the workspace screenshots */
.ph-inset.ph-pos-admin { --ph-pos: 62% 35%; }
.ph-inset.ph-pos-teacher { --ph-pos: 58% 35%; }
.ph-inset.ph-pos-student { --ph-pos: 50% 25%; }

/* Closing band: the campus fills the right, the left third stays clear for heading and buttons */
.ph-handoff {
  position: relative;
  overflow: hidden;
}

.ph-handoff .ph-handoff-copy,
.ph-handoff .handoff-actions {
  position: relative;
  z-index: 1;
}

.ph-handoff .handoff-inner {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "copy"
    "actions";
}

.ph-handoff .ph-handoff-copy,
.ph-handoff .handoff-actions {
  max-width: 46%;
}

.ph-handoff .ph-closing {
  --ph-pos: 66% 38%;
  --ph-tint: 0.05;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  width: min(74%, 72rem);
  grid-area: auto;
  align-self: stretch;
  pointer-events: none;
}

.ph-handoff .ph-closing .ph-frame {
  height: 100%;
  aspect-ratio: auto;
  -webkit-mask-image: linear-gradient(to right, transparent 0, transparent 10%, #fff 56%);
  mask-image: linear-gradient(to right, transparent 0, transparent 10%, #fff 56%);
  -webkit-mask-composite: source-over;
  mask-composite: add;
}

@media (max-width: 64rem) {
  .ph-handoff .handoff-inner {
    grid-template-areas:
      "photo"
      "copy"
      "actions";
  }

  .ph-handoff .ph-handoff-copy,
  .ph-handoff .handoff-actions {
    max-width: none;
  }

  .ph-handoff .ph-closing {
    position: relative;
    inset: auto;
    width: auto;
    align-self: auto;
    grid-area: photo;
    margin: calc(-1 * clamp(4rem, 8vw, 6.5rem)) calc(-1 * clamp(1.5rem, 4vw, 3rem)) 0;
  }

  .ph-handoff .ph-closing .ph-frame {
    height: auto;
    aspect-ratio: 16 / 10;
    -webkit-mask-image: linear-gradient(to bottom, #fff 0, #fff 60%, transparent 100%);
    mask-image: linear-gradient(to bottom, #fff 0, #fff 60%, transparent 100%);
  }
}

/* Technology: a quiet abstract backdrop behind the intro only, dissolving into the page */
#technology {
  position: relative;
}

#technology > .shell {
  position: relative;
  z-index: 1;
}

.ph-tech-photo {
  --ph-r: 0;
  --ph-tint: 0;
  position: absolute;
  top: 0;
  right: 0;
  z-index: 0;
  width: min(100%, 68rem);
  pointer-events: none;
}

.ph-tech-photo .ph-frame {
  --ph-pos: 50% 50%;
  aspect-ratio: auto;
  height: clamp(17rem, 30vw, 26rem);
  background-color: transparent;
  opacity: 0.85;
  -webkit-mask-image:
    linear-gradient(to right, transparent 0, #fff 30%, #fff 100%),
    linear-gradient(to bottom, #fff 0, #fff 40%, transparent 100%);
  mask-image:
    linear-gradient(to right, transparent 0, #fff 30%, #fff 100%),
    linear-gradient(to bottom, #fff 0, #fff 40%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

/* Section heads with a photograph: admin (card on the right), why (photo on the left) */
.ph-head-card {
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
}

.ph-head-left {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}

.ph-admin-photo {
  --ph-r: 1.25rem;
  --ph-curtain: inset(0 0 0 100%);
  margin-bottom: clamp(2.25rem, 4.5vw, 3.5rem);
  filter: drop-shadow(0 18px 22px rgb(10 95 65 / 0.16)) drop-shadow(0 2px 3px rgb(10 95 65 / 0.1));
}

.ph-admin-photo .ph-frame {
  --ph-ratio: 16 / 10;
  --ph-pos: 45% 40%;
}

.ph-why-photo {
  --ph-r: 1.25rem;
}

.ph-why-photo .ph-frame {
  --ph-ratio: 16 / 10;
  --ph-pos: 46% 50%;
}

/* Service: a wide strip between the heading and the lifecycle */
.ph-service-photo {
  --ph-r: 1.25rem;
  margin-bottom: clamp(1.75rem, 3.5vw, 2.75rem);
}

.ph-service-photo .ph-frame {
  --ph-ratio: 3.4 / 1;
  --ph-pos: 50% 40%;
}

/* Chapter companions: always smaller than the screenshot they sit with */
.feature-panel > .ph-report-photo {
  grid-column: 1;
  grid-row: 3;
  margin-top: 1.5rem;
  align-self: start;
  --ph-r: 1.25rem;
}

.ph-report-photo .ph-frame {
  --ph-ratio: 4 / 3;
  --ph-pos: 50% 50%;
}

.ph-col > .ph-photo {
  margin-top: 1.25rem;
  --ph-r: 1.25rem;
}

.ph-student-photo .ph-frame {
  --ph-ratio: 3 / 1;
  --ph-pos: 50% 22%;
}

.ph-word-photo .ph-frame {
  --ph-ratio: 3 / 1;
  --ph-pos: 50% 52%;
}

@media (max-width: 64rem) {
  .feature-panel > .ph-col {
    grid-column: 1;
    grid-row: auto;
    margin-top: 2rem;
  }

  .feature-panel > .ph-report-photo {
    grid-column: 1;
    grid-row: auto;
    max-width: 30rem;
  }

  .ph-head-card,
  .ph-head-left {
    grid-template-columns: minmax(0, 1fr);
  }

  .ph-admin-photo,
  .ph-why-photo {
    max-width: 30rem;
    margin-bottom: 0;
  }

  .ph-head-left {
    margin-bottom: 1rem;
  }

  .ph-why-photo {
    order: 2;
  }

  .ph-student-photo .ph-frame,
  .ph-word-photo .ph-frame {
    --ph-ratio: 16 / 9;
  }

  .ph-service-photo .ph-frame {
    --ph-ratio: 16 / 10;
  }

  .ph-tech-photo {
    width: 100%;
  }

  .ph-tech-photo .ph-frame {
    height: 14rem;
    opacity: 0.7;
  }
}

@media (prefers-reduced-motion: no-preference) {
  /* The backdrop and the closing band fade in; they are scenery, not subjects */
  html.js-ready .ph-backdrop[data-reveal]:not(.is-revealed) .ph-frame {
    clip-path: none;
    opacity: 0;
  }

  html.js-ready .ph-backdrop[data-reveal].is-revealed .ph-frame {
    animation: fade-in 1600ms var(--ph-ease) backwards;
  }

  html.js-ready .ph-closing[data-reveal]:not(.is-revealed) .ph-frame {
    clip-path: none;
    opacity: 0;
  }

  html.js-ready .ph-closing[data-reveal].is-revealed .ph-frame {
    animation: fade-in 1400ms var(--ph-ease) backwards;
  }
}

/* === END SECTION: people imagery === */
