/* GrowthMotif v4 — module: review (the About section; paper look, phyllotaxis motif)
   Base rules = the no-JS composition: a heading, a line and a plain list.
   .gm-review--on = enhanced, pinned scroll scene (added by review.js): text column left, canvas stage right.
   .gm-review--static = reduced motion / no GSAP: the finished composition, all three beats readable. */

.gm-review {
  --gm-review-gut: var(--gutter-l, clamp(16px, 3.2vw, 48px));
  position: relative;
  box-sizing: border-box;
  color: var(--ink);
  padding: clamp(96px, 14vh, 168px) var(--gm-review-gut);
  overflow-x: clip;
  font-family: var(--f-display);
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 20, "WONK" 0;
}

.gm-review h2 {
  font-family: var(--f-display);
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 20, "WONK" 0;
  font-size: var(--fs-h1, clamp(2rem, 4vw, 3.6rem));
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.022em;
  text-transform: none;
  color: var(--ink);
  margin: 0 0 1.1rem;
  max-width: 10.5em;
  text-wrap: balance;
}

.gm-review .gm-review-intro {
  font-family: var(--f-display);
  font-size: var(--fs-lead, clamp(1.05rem, 1.3vw, 1.25rem));
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: -0.006em;
  color: var(--muted);
  margin: 0;
  max-width: 32ch;
}

.gm-review ol {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 1.15rem;
  max-width: 32rem;
}

.gm-review li {
  position: relative;
  padding-left: 1.35em;
  font-size: var(--fs-lead, clamp(1.12rem, 1.5vw, 1.42rem));
  line-height: 1.2;
}

/* a small seed marks each beat */
.gm-review li::before {
  content: "";
  position: absolute;
  left: 0.12em;
  top: 0.36em;
  width: 0.42em;
  height: 0.42em;
  border-radius: 50%;
  box-sizing: border-box;
  background: var(--ink);
}

.gm-review li strong {
  display: block;
  font-weight: 500;
  font-size: 1em;
  letter-spacing: -0.012em;
  color: var(--ink);
}

.gm-review li span {
  display: block;
  font-weight: 400;
  font-size: var(--fs-body, max(0.98rem, 0.74em));
  line-height: 1.42;
  letter-spacing: -0.004em;
  color: var(--muted);
  margin-top: 0.3em;
  max-width: 34ch;
}

/* ---------- enhanced scene ----------
   One composition, top to bottom: the heading and its line, the scene, then the three points as captions directly
   under the picture they describe. On phones the points sit above the scene so they stay readable while it plays. */

.gm-review.gm-review--on {
  padding: 0 var(--gm-review-gut);
  height: 100vh;
  min-height: 620px;
  overflow: hidden;
  background: transparent;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
}
@supports (height: 100svh) {
  .gm-review.gm-review--on { height: 100svh; }
}

/* the heading stays clear of the fixed top bar (about 88px tall on desktop now the logo is larger) */
.gm-review-head {
  position: relative;
  z-index: 2;
  min-width: 0;
  padding-top: max(108px, 10vh);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 48px;
}
.gm-review--on h2 { margin: 0; max-width: none; font-size: var(--fs-h1, clamp(1.9rem, 3.4vw, 2.9rem)); }
.gm-review--on .gm-review-intro { max-width: 34ch; padding-bottom: 0.2em; }

.gm-review-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  pointer-events: none;
}
.gm-review-stage canvas {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

.gm-review--on ol {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 0 0 clamp(28px, 6vh, 64px);
  max-width: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 48px);
  align-items: start;
}

.gm-review--on li strong { color: var(--muted); transition: color 0.4s ease; }
.gm-review--on li::before { display: none; }
/* in the scene the marker belongs to the title, so it grows and moves with it */
.gm-review--on li strong { position: relative; }
.gm-review--on li strong::before {
  content: "";
  position: absolute;
  left: -1.23em;
  top: 0.36em;
  width: 0.42em;
  height: 0.42em;
  border-radius: 50%;
  box-sizing: border-box;
  background: transparent;
  border: 1px solid var(--glyph);
  transition: background-color 0.4s ease, border-color 0.4s ease, transform 0.4s cubic-bezier(.34, 1.56, .64, 1);
}
/* the detail lines stay on screen; only the marker and the title track the beat */
.gm-review--on li span { margin-top: 0.3em; }

.gm-review--on li.is-past strong::before { background: var(--muted); border-color: var(--muted); }
.gm-review--on li.is-now strong { color: var(--ink); }
/* the current title grows and stays large for its whole part of the scroll, with a yellow marker stroke under it;
   when the next beat takes over it eases back to its normal size. Titles wrap at 78% so the enlarged one never runs into the next column. */
.gm-review--on li strong {
  max-width: 78%;
  text-wrap: balance;
  transform-origin: left bottom;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 0.38em;
  text-underline-offset: -0.18em;
  text-decoration-skip-ink: none;
  transition: color 0.4s ease, text-decoration-color 0.5s ease 0.15s, transform 0.55s cubic-bezier(.3, 1.4, .5, 1);
}
.gm-review--on li.is-now strong {
  text-decoration-color: var(--accent);
  transform: scale(1.28);
}
@media (prefers-reduced-motion: reduce) {
  .gm-review--on li strong { transition: color 0.4s ease, text-decoration-color 0.4s ease; }
}
.gm-review--on li.is-now strong::before { background: var(--accent); border-color: var(--ink); }

/* reduced motion / no GSAP: not pinned, every beat readable */
.gm-review.gm-review--static { height: auto; min-height: max(640px, 100vh); }
@supports (height: 100svh) {
  .gm-review.gm-review--static { min-height: max(640px, 100svh); }
}
.gm-review--static li strong { color: var(--ink); }
.gm-review--static li strong::before { background: var(--ink); border-color: var(--ink); }
.gm-review--static li:last-child strong::before { background: var(--accent); }

/* phones: heading, then the points, then the scene in whatever height is left */
@media (max-width: 699px) {
  .gm-review.gm-review--on { padding: 0; grid-template-rows: auto auto minmax(0, 1fr); }
  .gm-review-head { order: 1; display: block; padding: max(86px, 10vh) var(--gm-review-gut) 0; }
  .gm-review--on h2 { margin: 0 0 0.9rem; max-width: 10.5em; font-size: var(--fs-h1, clamp(2rem, 4vw, 3.6rem)); }
  .gm-review--on .gm-review-intro { max-width: 32ch; padding-bottom: 0; }
  .gm-review--on ol { order: 2; grid-template-columns: minmax(0, 1fr); gap: 0.8rem; margin-top: 1.4rem; padding: 0 var(--gm-review-gut) 8px; }
  .gm-review-stage { order: 3; }
  .gm-review .gm-review-intro { font-size: var(--fs-lead, 1.02rem); }
  .gm-review li { font-size: var(--fs-lead, 1.08rem); }
  .gm-review li span { font-size: var(--fs-body, 0.95rem); }
  .gm-review.gm-review--static { min-height: 0; grid-template-rows: auto auto 320px; }
}
/* short phones: only the current beat keeps its detail line, so the stage still has room */
@media (max-width: 699px) and (max-height: 739px) {
  .gm-review--on:not(.gm-review--static) li:not(.is-now) span { display: none; }
}

/* ---------- side layout (.gm-review--side) ----------
   The words lead: heading, line and the three points in a column on the left. The scene runs beside them on a loop,
   as an illustration. Nothing is pinned and the section is as tall as its text.
   Under 900px it stacks: words first, picture last (or picture between the line and the points, data-porder="picture"). */
.gm-review.gm-review--side {
  height: auto;
  min-height: 0;
  padding: clamp(88px, 13vh, 160px) var(--gm-review-gut);
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  grid-template-rows: auto auto;
  column-gap: clamp(32px, 5vw, 96px);
  row-gap: clamp(24px, 3.6vh, 40px);
  align-items: start;
}
.gm-review--side .gm-review-head { grid-column: 1; grid-row: 1; display: block; padding: 0; }
.gm-review--side h2 { margin: 0 0 0.5em; max-width: 12em; font-size: var(--fs-h1, clamp(2rem, 3.3vw, 3.1rem)); }
.gm-review--side .gm-review-intro { max-width: 38ch; padding: 0; }
.gm-review--side ol {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
  padding: 0;
  max-width: 30rem;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.15rem, 2.6vh, 1.75rem);
}
.gm-review--side li { font-size: var(--fs-lead, clamp(1.2rem, 1.55vw, 1.5rem)); }
.gm-review--side li strong { max-width: none; }
.gm-review--side li span { max-width: 36ch; }
.gm-review.gm-review--side:not(.gm-review--static) li:not(.is-now) span { display: block; }
.gm-review--side .gm-review-stage {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  width: 100%;
  aspect-ratio: 7 / 5;
  max-height: min(72vh, 640px);
  transition: opacity 0.5s ease;
}
@media (max-width: 899px) {
  .gm-review.gm-review--side { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; padding-top: clamp(72px, 10vh, 120px); padding-bottom: clamp(48px, 7vh, 88px); }
  .gm-review--side .gm-review-head { grid-column: 1; grid-row: auto; order: 1; }
  .gm-review--side ol { grid-column: 1; grid-row: auto; order: 2; max-width: none; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); }
  .gm-review--side .gm-review-stage { grid-column: 1; grid-row: auto; order: 3; aspect-ratio: 16 / 10; max-height: none; }
  html[data-porder="picture"] .gm-review--side .gm-review-stage { order: 2; }
  html[data-porder="picture"] .gm-review--side ol { order: 3; }
}
@media (max-width: 699px) {
  .gm-review--side ol { grid-template-columns: minmax(0, 1fr); gap: 1.15rem; }
  .gm-review--side li { font-size: var(--fs-lead, 1.15rem); }
  /* phones: a square picture. Everything in it is held by the screen's width, so the extra height lets the six versions
     and the loop be drawn larger. Wider screens keep the landscape picture. */
  .gm-review--side .gm-review-stage { aspect-ratio: 1 / 1; height: auto; max-height: none; }
  .gm-review.gm-review--side.gm-review--static { grid-template-rows: none; }
}
