:root {
  --yellow: #F9B80C; /* Product mustard yellow */
  --yellow-soft: rgba(249, 184, 12, 0.18);
  --accent-label: #c3448e; /* eyebrow/kicker labels — kept distinct from Product yellow */
  --accent-label-soft: rgba(195, 68, 142, 0.18);
  --dark: #1A140F;
  --dark-soft: rgba(26, 20, 15, 0.16);
  --teal: #6B9FA0;
  --teal-soft: rgba(107, 159, 160, 0.20);
  --cream: #FFFCF9;
  --sand: #F4EFE7;
  --sand-deep: #EBE3D3;
  --rule: #E5DED2;
  --muted: #6B6661;
  --muted-soft: #948D85;
  --ink: #2A231D;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--cream);
  color: var(--ink);
  font-family: 'Outfit', sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 72px 64px 96px;
}

/* --- Top header --- */
.top-eyebrow {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-label);
  margin-bottom: 18px;
}

h1 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 64px;
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: var(--dark);
  margin-bottom: 24px;
}

.top-lede {
  font-family: 'Outfit', sans-serif;
  font-weight: 400;
  font-size: 22px;
  line-height: 1.5;
  color: var(--ink);
  margin-bottom: 12px;
}

.top-lede strong {
  font-weight: 400;
}

/* --- Section structure --- */
.model-section {
  margin-top: 88px;
}

.section-marker {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 50px;
}

.section-tag {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-tag.current {
  color: var(--accent-label);
}

.section-tag.now {
  color: var(--accent-label);
}

.section-rule {
  flex-grow: 1;
  height: 1px;
  background: var(--rule);
}

h2 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--dark);
  margin-bottom: 8px;
}

.section-body {
  font-family: 'Outfit', sans-serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  margin: 24px 0 32px;
}

.section-body strong {
  font-weight: 400;
}

/* --- Diagram frames --- */
.diagram-frame {
  padding: 48px 32px 40px;
  background: var(--sand);
  border-radius: 4px;
  position: relative;
}

/* --- Venn diagram SVG --- */
.venn-svg {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  display: block;
  height: auto;
}

/* Desktop only — let the Venn breathe + read larger in the wide frame */
@media (min-width: 1025px) {
  .venn-svg { max-width: 620px; }
  /* The flow-svg renders at ~0.87x in the wide frame, so the 10-unit
     annotations display under 10px. Bump the user-unit size to land at
     ~10px on screen. */
  .flow-svg .chart-annotation { font-size: 11.5px; }
}

/* --- Venn collapse: lanes → one integrated team (swipe / click pips) --- */
.venn-collapse { cursor: grab; }
.venn-collapse:active { cursor: grabbing; }
.vn-stage { touch-action: pan-y; }

/* Everything that moves shares one easing for a cohesive collapse */
.vn-c, .vn-role, .vn-roles, .vn-gates, .vn-team {
  transition: transform .72s cubic-bezier(.22, .61, .36, 1), opacity .5s ease;
}
.vn-team { opacity: 0; }

/* ===== Collapsed / integrated state ===== */
/* Circles slide ~65% of the way toward the centroid (240,197) */
.venn-collapse.now .vn-c-product { transform: translate(0px, 43px); }
.venn-collapse.now .vn-c-design  { transform: translate(39px, -22px); }
.venn-collapse.now .vn-c-eng     { transform: translate(-39px, -22px); }

/* Role labels travel with their circle while fading out */
.venn-collapse.now .vn-role-product { transform: translate(0px, 43px); }
.venn-collapse.now .vn-role-design  { transform: translate(39px, -22px); }
.venn-collapse.now .vn-role-eng     { transform: translate(-39px, -22px); }
.venn-collapse.now .vn-roles { opacity: 0; }

/* Hand-off gates dissolve; integrated core rises */
.venn-collapse.now .vn-gates { opacity: 0; }
.venn-collapse.now .vn-team  { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .vn-c, .vn-role, .vn-roles, .vn-gates, .vn-team { transition: none; }
}

/* --- Flow diagram --- */
.legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
  margin-bottom: 28px;
  padding-left: 8px;
}

.legend-item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.4;
  color: var(--dark);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  transform: translateY(1px);
}

.legend-role-name {
  font-weight: 700;
  color: var(--dark);
  flex-shrink: 0;
  width: 92px;
}

.legend-role {
  color: var(--muted);
  font-weight: 400;
  font-size: 16px;
  margin-left: 0;
}

.legend-dot.product { background: var(--yellow); }
.legend-dot.design { background: var(--dark); }
.legend-dot.engineering { background: var(--teal); }
/* Team — matches the Validate node in the flywheel: white fill, 1.5 black stroke */
.legend-dot.team { background: var(--cream); border: 1.5px solid var(--dark); }

/* Horizontal, name-only legend (under the flywheel) */
.legend-inline {
  flex-direction: row;
  justify-content: center;
  gap: 32px;
  margin-top: 4px;
  margin-bottom: 8px;
  padding-left: 0;
}

.legend-inline .legend-role-name {
  width: auto;
}

.flow-svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Phase labels rendered as HTML below the SVG so they stay legible on mobile
   regardless of the SVG transform. Percent positions = SVG viewBox x-coords / 1200. */
.phase-labels-row {
  position: relative;
  width: 100%;
  height: 18px;
  margin-top: 6px;
}

.phase-label-item {
  position: absolute;
  top: 0;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  color: var(--dark);
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.phase-label-item:focus-visible {
  outline: 2px solid var(--accent-label);
  outline-offset: 3px;
  border-radius: 4px;
}

.phase-label-start { left: 6.67%; }
.phase-label-mid   { transform: translateX(-50%); }
.phase-label-end   { left: 93.33%; transform: translateX(-100%); }

.phase-short { display: none; }

/* Active-phase anchor — underline sweeps in on desktop */
.phase-full {
  position: relative;
  display: inline-block;
  padding-bottom: 5px;
}
.phase-full::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent-label);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 380ms cubic-bezier(0.65, 0, 0.35, 1);
}
.phase-label-item.is-active .phase-full::after {
  transform: scaleX(1);
}

/* Desktop hover affordance — underline grows from the middle out */
@media (hover: hover) {
  .phase-label-item:hover .phase-full::after {
    transform: scaleX(1);
  }
}

/* Phase carousel — single card at all viewports, swipe on touch, arrows on hover-capable devices */
.annotations-wrap {
  margin-top: 16px;
}

.annotations-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.annotations {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: row;
  gap: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 8px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.annotations::-webkit-scrollbar { display: none; }

.annotation {
  flex: 0 0 100%;
  min-width: 100%;
  scroll-snap-align: center;
  text-align: center;
  padding: 4px 24px;
}

.annotation-phase {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.08em;
  color: var(--dark);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.annotation-leads {
  font-family: 'Outfit', sans-serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.55;
  color: var(--muted);
  /* Sized off the longest phase (Create) so every annotation holds one line at
     full width. Balance is the fallback for narrower viewports, where wrapping
     is unavoidable — it splits evenly instead of stranding a word. */
  max-width: 920px;
  margin: 0 auto;
  text-wrap: balance;
}

.annotations-arrow {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: var(--cream);
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease, background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.annotations-arrow svg {
  width: 22px;
  height: 22px;
  display: block;
}

.annotations-arrow:hover {
  color: var(--accent-label);
  border-color: var(--accent-label);
}

.annotations-arrow:active {
  background: var(--sand);
}

.annotations-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.annotations-pips {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  padding: 0;
}

.annotations-pips .pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: var(--rule);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.annotations-pips .pip.active {
  background: var(--accent-label);
  transform: scale(1.3);
}

/* --- The Shift section --- */
.shift-block {
  margin-top: 80px;
  margin-bottom: 80px;
  padding: 48px 56px;
  background: var(--dark);
  border-radius: 4px;
  color: var(--cream);
}

.shift-eyebrow {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-label);
  margin-bottom: 16px;
}

.shift-title {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 32px;
  line-height: 1.15;
  color: var(--cream);
  margin-bottom: 24px;
}

.shift-body {
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  font-size: 17px;
  line-height: 1.6;
  color: var(--cream);
}

.shift-body strong {
  font-weight: 400;
  color: var(--accent-label);
}

/* --- Principles --- */
.principles {
  margin-top: 56px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px 56px;
}

.principle {
  border-top: 1px solid var(--rule);
  padding-top: 20px;
}

.principle-num {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 18px;
  color: var(--accent-label);
  margin-bottom: 6px;
}

.principle-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 20px;
  color: var(--dark);
  margin-bottom: 8px;
  line-height: 1.3;
}

.principle-body {
  font-family: 'Outfit', sans-serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink);
}

.conclusion {
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--rule);
}

.conclusion-eyebrow {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-label);
  margin-bottom: 20px;
}

.conclusion-body {
  font-family: 'Outfit', sans-serif;
  font-weight: 400;
  font-size: 22px;
  color: var(--dark);
  line-height: 1.45;
}

.conclusion-body + .conclusion-body {
  margin-top: 1em;
}

.conclusion-body strong {
  font-weight: 400;
  color: var(--dark);
}

/* --- Essay back-half: the argument --- */
.essay-lead {
  font-family: 'Outfit', sans-serif;
  font-weight: 400;
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink);
}

.essay-lead strong {
  font-weight: 400;
  color: var(--dark);
}

.chain-step {
  margin-top: 64px;
}

.essay-sub {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.012em;
  color: var(--dark);
  margin-bottom: 28px;
}

/* Emphasis line that lands a step's point */
.section-body.kicker {
  color: var(--dark);
}

/* --- Proposed diagram slots (TBD — Rand to sketch) --- */
.diagram-frame.proposed {
  border: 1.5px dashed #D8CFBE;
  background: var(--sand);
}

.diagram-placeholder {
  min-height: 196px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding: 28px 16px 8px;
}

.placeholder-mark {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted-soft);
}

.placeholder-desc {
  font-family: 'Outfit', sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 440px;
}

/* ===== Diagram 01 — Translation layer collapsing (interactive) ===== */
/* Ported from Rand's HTML proto, reskinned to system tokens. All classes
   prefixed cd- and scoped to .collapse-diagram so they can't collide with
   the .pip / .stage / .annotation carousel above. */
.cd-stage {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 300px;
  margin: 10px auto 0;
  cursor: ns-resize; /* hints the vertical swipe-to-collapse gesture */
  -webkit-tap-highlight-color: transparent;
}

.cd-blk {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 78%;
  height: 62px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-family: 'Outfit', sans-serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: top .72s cubic-bezier(.66, 0, .34, 1),
              background-color .72s ease, color .72s ease;
}

.cd-design { top: 12px;  background: #DCD5C7; color: var(--muted); }
.cd-eng    { top: 226px; background: #DCD5C7; color: var(--muted); }
.cd-stage.now .cd-design { top: 88px;  background: var(--dark); color: var(--cream); }
.cd-stage.now .cd-eng    { top: 156px; background: var(--teal); color: var(--dark); }

.cd-lyr {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 88px;
  width: 88%;
  height: 124px;
  border-radius: 6px;
  background: #D5CEBF;
  border: 1px solid #C0B8A6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  gap: 0;
  padding: 6px 0;
  overflow: hidden;
  transition: top .72s cubic-bezier(.66, 0, .34, 1),
              height .72s cubic-bezier(.66, 0, .34, 1),
              background-color .72s ease, border-color .72s ease;
}
.cd-stage.now .cd-lyr {
  top: 150px;
  height: 6px;
  padding: 0;
  background: var(--accent-label);
  border-color: var(--accent-label);
}

/* "Product" role label sits at the top of the layer, in the Design/Engineering
   text style (Outfit 17/600). Fades out as the layer collapses. */
.cd-lyr-role {
  font-family: 'Outfit', sans-serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
  transition: opacity .3s ease;
}
.cd-stage.now .cd-lyr-role { opacity: 0; }

/* "The Translation Layer" label now lives inside the box, above the chips */
.cd-lyr-label {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
  transition: opacity .3s ease;
}
.cd-stage.now .cd-lyr-label { opacity: 0; }

.cd-chips {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  transition: opacity .3s ease;
}
.cd-stage.now .cd-chips { opacity: 0; }

.cd-chip {
  background: #E4DDCE;
  border: 1px solid #C7BFAD;
  border-radius: 5px;
  padding: 7px 15px;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.cd-sm-label {
  position: absolute;
  left: 0;
  right: 0;
  top: 236px;
  text-align: center;
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent-label);
  opacity: 0;
  transition: opacity .35s .22s;
}
.cd-stage.now .cd-sm-label { opacity: 1; }

/* Then / Now toggle */
.cd-pips {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-top: 24px;
}
.cd-pip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 4px;
  -webkit-tap-highlight-color: transparent;
}
.cd-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #C7C1B4;
  transition: background .25s, box-shadow .25s;
}
.cd-pip[aria-pressed="true"] { color: var(--ink); }
.cd-pip[aria-pressed="true"] .cd-dot {
  background: var(--accent-label);
  box-shadow: 0 0 0 4px var(--accent-label-soft);
}
/* No box around the active/focused pip — keyboard focus reads on the dot only */
.cd-pip:focus-visible { outline: none; }
.cd-pip:focus-visible .cd-dot {
  box-shadow: 0 0 0 4px var(--accent-label-soft);
}

.cd-caption {
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  color: var(--muted);
  margin: 18px 2px 0;
  text-align: center;
}
@media (min-width: 1025px) {
  .cd-caption { font-size: 17px; }
}

/* ===== Diagram 02 — Spec to prototype (interactive, slide-fade) ===== */
/* Faithful recreation of Rand's "Run It" proto, reskinned to system tokens.
   The two views cross-slide instead of plain-dissolving: the outgoing view
   slides + fades one way, the incoming slides in from the other. Pips +
   caption reuse the .cd- components from diagram 01. */
.r2-stage {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 248px;
  margin: 10px auto 0;
  overflow: hidden;
  cursor: ew-resize; /* hints the horizontal swipe-to-switch gesture */
  -webkit-tap-highlight-color: transparent;
}

/* live controls keep their own affordance over the swipe cursor */
.r2-toggle, .r2-seg, .r2-run { cursor: pointer; }

.r2-view {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease, transform .5s cubic-bezier(.5, 0, .2, 1);
}
.r2-view[data-view="spec"]  { transform: translateX(-40px); }
.r2-view[data-view="proto"] { transform: translateX(40px); }
.r2-view.show {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

/* Spec — the document */
.r2-doc {
  width: 170px;
  height: 158px;
  background: #DCD5C7;
  border: 1px solid #C0B8A6;
  border-radius: 6px;
  padding: 16px;
}
.r2-h {
  height: 12px;
  width: 58%;
  border-radius: 2px;
  background: #BBB2A1;
  margin-bottom: 16px;
}
.r2-l {
  height: 7px;
  border-radius: 2px;
  background: #CBC3B2;
  margin-bottom: 9px;
}
/* Prototype — the working app */
.r2-app {
  width: 204px;
  background: #FBF9F4;
  border: 1.5px solid var(--dark);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(26, 20, 15, 0.10);
}
.r2-chrome {
  height: 24px;
  background: #ECE7DC;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
}
.r2-chrome i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #C7C1B4;
}
.r2-body { padding: 14px; }
.r2-arow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 13px;
}
.r2-lbl {
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--dark);
}
.r2-toggle {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: #C7C1B4;
  border: 0;
  position: relative;
  cursor: pointer;
  transition: background .25s;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.r2-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #FBF9F4;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  transition: transform .25s;
}
.r2-toggle[aria-pressed="true"] { background: var(--accent-label); }
.r2-toggle[aria-pressed="true"] .r2-knob { transform: translateX(20px); }
.r2-seg {
  background: var(--dark);
  color: var(--cream);
  border: 0;
  border-radius: 4px;
  padding: 6px 12px;
  font-family: 'Outfit', sans-serif;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  min-width: 62px;
  -webkit-tap-highlight-color: transparent;
}
.r2-run {
  width: 100%;
  background: var(--accent-label);
  color: #FBF9F4;
  border: 0;
  border-radius: 5px;
  padding: 9px;
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: filter .15s;
  -webkit-tap-highlight-color: transparent;
}
.r2-run:active { filter: brightness(.92); }
.r2-status {
  height: 14px;
  text-align: center;
  font-family: 'Outfit', sans-serif;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--teal);
  margin-top: 9px;
  opacity: 0;
  transition: opacity .2s;
}
.r2-status.on { opacity: 1; }
.r2-toggle:focus-visible,
.r2-seg:focus-visible,
.r2-run:focus-visible {
  outline: 2px solid var(--accent-label);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .cd-blk, .cd-lyr, .cd-chips, .cd-lyr-role, .cd-lyr-label, .cd-sm-label, .r2-view {
    transition-duration: .001s;
  }
}

/* ===== Diagram 03 — Center of gravity / flywheel ===== */
/* Rand's v5, reskinned to system tokens. The arrowed ring rotates around the
   wheel hub; an invisible bounding circle in the group forces its box to
   center on (760,280) so fill-box rotation pivots exactly there. Nodes, hub
   and the orchestrator sit outside the group, so they stay fixed + legible. */
.fw-split {
  display: flex;
  align-items: flex-start; /* tops of THEN and NOW svgs stay level; legend under NOW adds height */
  gap: 8px;
  max-width: 880px;
  margin: 0 auto;
}

.flywheel-svg {
  display: block;
  width: 100%;
  height: auto;
}

.fw-half {
  flex: 1 1 50%;
  min-width: 0;
}

/* Mobile — stack the two halves so each gets full width and reads larger */
@media (max-width: 600px) {
  .fw-split {
    flex-direction: column;
    gap: 16px;
  }
  .fw-half {
    flex-basis: auto;
    width: 100%;
  }
}

.flywheel-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: flywheel-spin 14s linear infinite;
}

@keyframes flywheel-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .flywheel-ring { animation: none; }
}

/* --- Objection callout / aside --- */
.callout {
  margin: 36px 0 8px;
  padding: 28px 32px;
  background: var(--sand);
  border-left: 3px solid var(--accent-label);
  border-radius: 4px;
}

.callout-eyebrow {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-label);
  margin-bottom: 14px;
}

.callout p {
  font-family: 'Outfit', sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.62;
  color: var(--ink);
}

.callout p + p {
  margin-top: 0.9em;
}

.callout p strong {
  font-weight: 400;
  color: var(--dark);
}

/* --- Closer --- */
.closer {
  margin-top: 88px;
  padding-top: 48px;
  border-top: 1px solid var(--rule);
  text-align: center;
}

.closer-lead {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--dark);
}

.closer-punch {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--accent-label);
  margin-top: 14px;
}

/* --- Footer --- */
.site-footer {
  margin-top: 72px;
  text-align: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #ABA399;
}

/* --- Responsive --- */

/* Laptop / tablet landscape */
@media (max-width: 1024px) {
  main { padding: 64px 48px 88px; }
  h1 { font-size: 56px; }
  h2 { font-size: 36px; }
  .shift-block { padding: 44px 44px; }
  .shift-title { font-size: 28px; }
}

/* Tablet portrait */
@media (max-width: 768px) {
  main { padding: 56px 32px 72px; }
  h1 { font-size: 44px; }
  h2 { font-size: 32px; }
  .top-lede { font-size: 18px; }
  .principles { grid-template-columns: 1fr; gap: 28px; }
  .shift-block { padding: 36px 32px; }
  .shift-title { font-size: 26px; }
  .diagram-frame { padding: 40px 24px 32px; }
  .essay-sub { font-size: 25px; }
  .closer-lead, .closer-punch { font-size: 28px; }
}

/* Mobile — bigger body copy, hide arrows (swipe-only) */
@media (max-width: 600px) {
  main { padding: 40px 20px 56px; }
  h1 { font-size: 36px; }
  h2 { font-size: 28px; }
  .top-lede { font-size: 18px; }
  .section-body { font-size: 16px; line-height: 1.6; }
  .principle-body { font-size: 16px; line-height: 1.6; }
  .principle-title { font-size: 19px; }
  .conclusion-body { font-size: 19px; line-height: 1.5; }
  .shift-block { padding: 28px 20px; }
  .shift-title { font-size: 24px; }
  .shift-body { font-size: 16px; line-height: 1.6; }
  .diagram-frame { padding: 32px 16px 24px; }
  .essay-lead { font-size: 17px; }
  .chain-step { margin-top: 52px; }
  .essay-sub { font-size: 23px; }
  .diagram-placeholder { min-height: 150px; }
  .placeholder-desc { font-size: 14px; }
  .callout { padding: 24px 22px; }
  .callout p { font-size: 15px; }
  .cd-stage { max-width: 100%; }
  .cd-chip { font-size: 12px; padding: 6px 11px; }
  .cd-chips { gap: 8px; }
  .closer { margin-top: 64px; padding-top: 36px; }
  .closer-lead, .closer-punch { font-size: 25px; }
  .legend { gap: 12px; margin-bottom: 24px; padding-left: 0; }
  .legend-item { flex-wrap: wrap; gap: 4px 12px; font-size: 14px; line-height: 1.45; }
  .legend-role-name { width: auto; }
  .legend-role { font-size: 14px; flex-basis: 100%; padding-left: 22px; }
  /* The three rules above are for the stacked legend (dot + name + description).
     The inline legend under the flywheel inherits them and breaks: flex-wrap on
     the item pushes each name below its dot, which leaves the row unevenly
     spaced and off-center against the wheel. Keep each item on one line and let
     the row itself wrap instead, so it stays centered on the diagram's axis. */
  .legend-inline { flex-wrap: wrap; justify-content: center; gap: 10px 18px; }
  .legend-inline .legend-item { flex-wrap: nowrap; gap: 8px; }

  /* Stretch the chart vertically so the three curves visibly separate.
     Non-scaling stroke keeps lines crisp; circles get counter-scaled so they
     don't render as ellipses. Phase labels are HTML siblings of the SVG, so
     they don't need transform tricks. */
  .flow-svg {
    transform: scaleY(2.3);
    transform-origin: top center;
    margin-bottom: 140px;
  }
  .flow-svg path {
    vector-effect: non-scaling-stroke;
    stroke-width: 1;  /* matches desktop's visual proportion at smaller scale */
  }
  .flow-svg line { vector-effect: non-scaling-stroke; }
  /* Mobile dot size set via JS (setAttribute on r) for reliability — Safari
     has been historically flaky honoring the CSS r geometry property. */
  .flow-svg circle {
    transform: scaleY(0.435);
    transform-box: fill-box;
    transform-origin: center;
  }
  /* Hide the rotated y-axis label on mobile. Keep both CONVERGE labels,
     but re-anchor the SYNC one to middle so it sits centered over the
     gridline — gives breathing room from the LEARN label on the right. */
  .flow-svg .chart-annotation:not(.converge-label) { display: none; }
  .flow-svg .converge-start { text-anchor: middle; }
  .flow-svg .converge-label {
    transform: scaleY(0.435);
    transform-box: fill-box;
    transform-origin: center;
    font-size: 32px;
  }

  /* Phase labels collapse into single-letter circles centered on each gridline */
  .phase-labels-row { margin-top: 12px; height: 36px; }
  .phase-full { display: none; }
  .phase-label-item {
    /* Override desktop anchoring so EVERY item's center sits on its gridline */
    transform: translateX(-50%);
  }
  .phase-label-start { left: 6.67%; }
  .phase-label-end   { left: 93.33%; }

  .phase-short {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--cream);
    border: 1.5px solid var(--muted-soft);
    color: var(--dark);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 15px;
    line-height: 1;
    letter-spacing: 0;
    transition:
      border-color 320ms ease,
      box-shadow 320ms ease,
      transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  /* Mobile: accent ring on the active phase circle */
  .phase-label-item.is-active .phase-short {
    border-color: var(--accent-label);
    box-shadow: 0 0 0 4px var(--accent-label-soft);
    transform: scale(1.08);
  }

  /* Tap feedback — press the circle in slightly on touch-down */
  .phase-label-item:active .phase-short {
    transform: scale(0.92);
    border-color: var(--accent-label);
  }

  /* Don't double-up on mobile — desktop underline is hidden when full label is hidden */
  .phase-full::after { display: none; }

  /* Carousel adjustments for swipe-only */
  .annotations-arrow { display: none; }
  .annotation { padding: 4px 16px; }
  .annotation-phase { font-size: 17px; margin-bottom: 10px; }
  .annotation-leads { font-size: 16px; }
}

/* Small mobile — iPhone 17 Pro (402pt) is the narrowest supported device, and
   four legend items don't fit one row there. Lock it to an explicit 2x2 grid
   rather than letting flex wrap 3+1: with the markup order that lands
   Product + Design on top, Engineering + Team beneath. Capped at 420 so the
   Max sizes keep the single row. */
@media (max-width: 420px) {
  .legend-inline {
    display: grid;
    grid-template-columns: auto auto;
    justify-content: center;
    gap: 10px 22px;
  }
}

/* Small mobile — finer tuning */
@media (max-width: 375px) {
  main { padding: 32px 16px 48px; }
  h1 { font-size: 32px; }
  h2 { font-size: 26px; }
  .shift-title { font-size: 22px; }
}

@media print {
  body { background: white; }
  .diagram-frame, .shift-block { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .model-section { page-break-inside: avoid; }
}
