/* ─── REASONING — brand-colour audit & rhythm bake-in ──────────
   Off-brand "dark-peach"/"dark-gold" tints used in the .rc-3 and
   .rc-4 illustrations are remapped to on-brand olive via attribute
   selectors (no SVG markup edits needed). Plus equal-height cards
   and a unified vertical rhythm. */

.reasoning {
  padding-top:    clamp(72px, 8vw, 104px);
  padding-bottom: clamp(72px, 8vw, 104px);
}
.reasoning .reasoning-intro        { margin-bottom: clamp(40px, 4vw, 56px); max-width: var(--w-narrow); }
.reasoning .reasoning-data-sources { margin-bottom: clamp(32px, 3.5vw, 44px); }
.reasoning .reasoning-commons      { margin-top: clamp(36px, 4vw, 56px); }

/* ─── Principles FAQ (replaces 2×2 reasoning-cards grid) ─────── */
.principles {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 2.4fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.principles-aside {
  position: sticky;
  top: 96px;
}

.principles-title {
  font-family: var(--font-body);
  font-style: normal;
  font-weight: 500;
  font-size: var(--text-2xl);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-normal);
  color: #5E6B22;
  margin: 0;
  max-width: 22ch;
}
.principles-title em {
  font-style: normal;
  color: inherit;
}

.principles-lifecycle {
  margin: 28px 0 0;
  max-width: 260px;
}
.principles-lifecycle svg {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 900px) {
  .principles-lifecycle {
    margin: 24px auto 4px;
  }
}

.principles-list {
  display: flex;
  flex-direction: column;
  /* No row dividers — white-space rhythm carries the list.
     Per-principle padding on .principle-summary provides the cadence. */
}

.principle {
  /* No bottom border — see .principles-list. */
}

.principle-summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 56px 1fr 24px;
  align-items: start;
  gap: 18px;
  padding: 22px 4px;
  transition: background-color 0.2s ease;
}
.principle-summary::-webkit-details-marker { display: none; }
.principle-summary:hover { background-color: var(--olive-tint); }
.principle-summary:focus-visible {
  outline: 2px solid var(--uguisu);
  outline-offset: -2px;
}

.principle-num {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 32px;
  line-height: 1;
  color: #5E6B22;
  padding-top: 2px;
}

.principle-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.principle-title {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-lg);
  letter-spacing: var(--tracking-snug);
  line-height: var(--leading-snug);
  color: var(--dark);
}

.principle-chevron {
  position: relative;
  width: 14px;
  height: 14px;
  margin-top: 12px;
  transition: transform 0.25s ease;
}
.principle-chevron::before,
.principle-chevron::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  background-color: #5E6B22;
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.principle-chevron::before {
  width: 14px;
  height: 1.5px;
  transform: translate(-50%, -50%);
}
.principle-chevron::after {
  width: 1.5px;
  height: 14px;
  transform: translate(-50%, -50%);
}
.principle[open] .principle-chevron::after { opacity: 0; }

.principle-body {
  padding: 4px 4px 26px 78px;
  max-width: var(--measure);
}
.principle-body p {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: #4a4a4a;
  margin: 0;
}

.principle-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.principle-tag {
  font-family: var(--font-body);
  font-size: var(--text-2xs);
  font-weight: 500;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: #5E6B22;
  background: var(--olive-hairline);
  border: 1px solid var(--olive-border);
  padding: 5px 11px;
}

@media (max-width: 900px) {
  .principles {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .principles-aside {
    position: static;
  }
  .principles-title {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .principle-summary {
    grid-template-columns: 44px 1fr 20px;
    gap: 12px;
    padding: 18px 0;
  }
  .principle-num { font-size: 26px; }
  .principle-body { padding: 4px 0 22px 56px; }
}

/* ─── Section headings (How it works / What grounds the output) ── */

/* Observational Commons label is now an <h3> — keep visual treatment */
h3.rcommons-label {
  margin-top: 0;
}

/* ─── "What grounds the output" — the one olive evidence band ────
   Olive is the brand's trust colour and this is the trust claim. The
   band's ground now comes from .surface--olive (the section carries
   `grounds-section surface--olive`); .grounds-section only styles the
   evidence apparatus (chips, commons) for the dark ground. */
.grounds-section h2 { color: var(--rawsilk); }
.grounds-section .headline-secondary { color: var(--color-spring); }
.grounds-section h2.declarative { margin-bottom: clamp(32px, 3.5vw, 48px); }

/* Foundations strip on dark */
.grounds-section .reasoning-data-sources {
  background: var(--on-dark-hairline);
  border-color: var(--on-dark-hairline);
}

.grounds-section .rds-label {
  color: var(--spring);
}

/* Chips on dark */
.grounds-section .rds-chip {
  background: var(--on-dark-hairline);
  border-color: var(--on-dark-line);
}
.grounds-section .rds-chip:hover {
  background: var(--on-dark-hairline);
  border-color: rgba(168, 192, 96, 0.5);
  box-shadow: none;
}

/* Tint chip icon strokes (originally olive #5E6B22) to Wakakusa on dark —
   spring carries structure across the section; peach is reserved for the title accent */

.grounds-section .rds-chip-id {
  color: var(--spring);
}
.grounds-section .rds-chip-name {
  color: var(--peach);
}

/* Hover-reveal for chip description — no truncation */
.grounds-section .rds-chip-detail {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-top: 0;
  transition: max-height 0.35s ease, opacity 0.3s ease, margin-top 0.3s ease;
  color: var(--on-dark-body);
}
.grounds-section .rds-chip:hover .rds-chip-detail {
  max-height: 400px;
  opacity: 1;
  margin-top: 4px;
}
@media (hover: none) {
  .grounds-section .rds-chip-detail {
    max-height: none;
    opacity: 1;
    margin-top: 4px;
  }
}

/* Epistemic refusal on dark */
.grounds-section .refusal {
  background: var(--on-dark-hairline);
  border-left-color: rgba(168, 192, 96, 0.5);
}

/* Observational Commons inside grounds-section — drop own background */
.grounds-section .reasoning-commons {
  background: transparent;
  padding: 0;
  margin-top: clamp(36px, 4vw, 56px);
}

/* ─────────────────────────────────────────────────────────────
   Reasoning section — visual-first rebuild
   ───────────────────────────────────────────────────────────── */

/* Functions row — four illustrated medallions (matches hero idiom) */
.fn-medallion-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 8px;
}
.fn-medallion {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 8px 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.fn-medallion-art {
  width: 156px;
  height: 156px;
  border-radius: 50%;
  background: var(--bg-surface-2);
  border: 2px solid var(--olive-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  flex-shrink: 0;
}
.fn-medallion-label {
  font-family: var(--font-body);
  font-style: normal;
  font-weight: 500;
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  color: var(--uguisu);
  max-width: 200px;
}

/* Diptych — two large illustrated scenes */
.scene-diptych {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 0;
  margin-top: 12px;
}
.scene-card {
  padding: 36px 32px 32px;
  background: var(--bg-surface);
  border: 1px solid var(--olive-hairline);
  border-radius: 20px;   /* DOCUMENTED EXCEPTION (brand-system.md): off the
                            12/16 card ladder — the hero diptych keeps its
                            softer 20px on purpose. Do not snap. */
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.scene-card.scene-conventional { background: rgba(168,192,96,0.06); }
.scene-card.scene-perenos      { background: rgba(224,160,122,0.07); }
/* Inside the hero, the topo background sits behind translucent cards.
   Layer the brand palette tint over Raw Silk so the topo lines don't bleed through.
   Asymmetric treatment: the conventional card is washed/archival; the PerenOS card
   is warm and present. The visual hierarchy carries the narrative (past → future). */
.hero .scene-card.scene-conventional {
  background: #E5DECC; /* flat = rgba(150,148,128,.14) over #F2EAD8 */
}
.hero .scene-card.scene-perenos {
  background: #EEDBC5; /* flat = rgba(224,160,122,.20) over #F2EAD8 */
  box-shadow: 0 2px 1px var(--olive-tint), 0 20px 44px -22px rgba(224,160,122,0.42);
}
/* Desaturate the conventional illustration — keeps brand palette but reads as
   archival/obsolete. Right card stays vivid. */
.hero .scene-card.scene-conventional .scene-art svg {
  filter: saturate(0.45) opacity(0.88);
}
.hero .scene-card.scene-conventional .scene-title,
.hero .scene-card.scene-conventional .scene-caption {
  opacity: 0.78;
}
.hero .scene-card.scene-conventional .scene-eyebrow {
  opacity: 0.7;
}
/* Hero diptych — narrower cards, wider arrow column carrying a label.
   Left card is intentionally a touch narrower than the right to signal
   that the right card is the destination/preferred approach. */
.hero .scene-diptych { grid-template-columns: 4.4fr 1.6fr 5fr; }
.hero .scene-card { padding: 32px 26px 28px; }
/* Right card reads as the destination through depth, not delineation:
   no border. The left card stays flat (pressed-specimen); the right
   catches warm light and sits forward. */
.hero .scene-card.scene-perenos {
  border: none;
}
.hero .scene-arrow-cell {
  flex-direction: column;
  gap: 14px;
  padding: 0 18px;
  opacity: 1;
  font-size: inherit;
  color: inherit;
  /* Solid Raw Silk mask so the topo flow lines stop behind the arrow column */
  background: var(--rawsilk);
}
.hero .scene-arrow-cell .scene-arrow-glyph {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 44px;
  line-height: 1;
  color: #5E6B22;
  opacity: 0.55;
}
.hero .scene-arrow-cell .scene-arrow-label {
  font-family: var(--font-body);
  font-style: normal;
  font-weight: 800;
  font-size: var(--text-2xl);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-normal);
  color: var(--uguisu);
  text-align: center;
  max-width: 200px;
  text-wrap: pretty;
}
@media (max-width: 760px) {
  .hero .scene-diptych { grid-template-columns: 1fr; }
  .hero .scene-arrow-cell { transform: none; flex-direction: column; padding: 8px 0 4px; background: transparent; }
  .hero .scene-arrow-cell .scene-arrow-glyph { transform: rotate(90deg); display: inline-block; }
}

/* Right-card destination emphasis — peach pull-quote weight on the strong phrase */
.hero .scene-card.scene-perenos .scene-caption strong {
  color: var(--peach);
  font-weight: 700;
}
.scene-eyebrow {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--fg-tertiary);
  margin-bottom: 4px;
}
.scene-card.scene-perenos .scene-eyebrow { color: var(--color-soil); }
.scene-title {
  font-family: var(--font-body);
  font-style: normal;
  font-weight: 500;
  font-size: 28px;
  line-height: var(--leading-tight);
  color: var(--uguisu);
  margin: 4px 0 22px;
}
.scene-art {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 4 / 3;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scene-art svg { width: 100%; height: 100%; }
.scene-caption {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--fg-secondary);
  max-width: 340px;
  margin: 0;
  text-wrap: pretty;
}
.scene-caption strong { color: var(--uguisu); font-weight: 600; }
.scene-arrow-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 32px;
  color: #5E6B22;
  opacity: 0.45;
}

@media (max-width: 1000px) {
  .fn-medallion-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .scene-diptych { grid-template-columns: 1fr; }
  .scene-arrow-cell { padding: 14px 0; transform: rotate(90deg); }
  .scene-art { max-width: 280px; }
  .fn-medallion-art { width: 132px; height: 132px; }
}
@media (max-width: 460px) {
  .fn-medallion-grid { grid-template-columns: 1fr; }
}

/* ─── Pipeline nested inside .reasoning ──────────────────────── */
/* When the pipeline graph is placed inside the reasoning section,
   strip its standalone background / horizontal padding / negative
   top margin so it sits cleanly under the section title. */
.reasoning .pipeline {
  background: transparent;
  padding: 0;
  margin-bottom: clamp(40px, 5vw, 64px);
}
.reasoning .pipeline-inner {
  margin-top: 0;
  max-width: none;
}

/* .back-to-top base + individual-audience override moved to components.css. */

/* ─── INDIVIDUAL PAGE — non-title text uses Grotesk only ─────
   Only h1 and h2 should render in EB Garamond on the individual page.
   These overrides drop font-display on display-styled non-heading text.
   Note: .scene-title is now Grotesk Medium globally (figure/diagram
   label track — see brand system), so no per-audience override is needed. */
[data-audience="individual"] .scene-arrow-cell,
[data-audience="individual"] .hero .scene-arrow-cell .scene-arrow-glyph,
[data-audience="individual"] .scene-diptych.is-featured .scene-arrow-cell .scene-arrow-glyph {
  font-family: var(--font-body);
  font-style: normal;
}

/* ============================================================
   INDIVIDUAL SURFACE POSTURE — warm rhythm
   Canonical definition: docs/brand-system.md → "Individual surface posture".
   Individual-only; the professional page keeps editorial restraint.

   CORE RULE: never wash a section that contains a dominant card.
   A wash behind a centred card reads as matting — a coloured frame
   on a photo — no matter how low the chroma. On this card-dominated
   page the section ground therefore stays Raw Silk; rhythm is carried
   by the 1px Uguisu hairline, the one cardless lead-in wash, and the
   single crescendo. (To add warmth, tint the CARDS, not the grounds.)

   Cadence down the page:
     02 For whom    → Raw Silk (contains cards)
     (How it works) → Raw Silk (contains cards)
     05 Process     → Raw Silk (the big diagram card — no wash, was the offender)
     04 Reasoning   → Raw Silk (contains cards)
     (closing block)→ peach whisper — the ONE cardless section, lead-in to crescendo
     Legacy band    → full Wakakusa #A8C060 (the one earned crescendo; set inline)

   Uguisu spine removed: the constellation between sections is now the
   sole divider on silk. No top-rule on individual body sections.
   ============================================================ */

/* Closing-section ground now comes from a .surface--* class on the
   section in markup (the brittle sibling-combinator bg hack was removed). */

/* Foundations: cardless epistemic statement closing the research page.
   Open prose at a comfortable measure (the cycle pull-quote caps at 32ch). */
.ind-foundations .ind-foundations-text {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: #3A3010;
  max-width: 62ch;
  margin: 0;
}
.ind-foundations .ind-foundations-text + .ind-foundations-text {
  margin-top: 16px;
}

/* ════════════════════════════════════════════════════════════════
   PIPELINE — MOBILE LAYOUT (authoritative)
   Nested section/container/card padding crushes the diagram to a
   narrow column on phones, which makes the stage titles wrap to a
   single word and the chips stack raggedly. Reclaim the width, drop
   the oversized desktop roundel, and lay each stage out as a clean
   icon + title row with left-aligned chips beneath. Scoped under
   .pipeline (specificity 0,2,0) and placed last so it wins over the
   earlier unconditional .stage / .ppl / .stage-chips overrides
   without needing !important.
   ──────────────────────────────────────────────────────────────── */
@media (max-width: 560px) {
  .pipeline .pipeline-inner { padding-left: 0; padding-right: 0; }
  .pipeline .ppl { padding: 20px 16px; }

  .pipeline .stages { grid-template-columns: 1fr; gap: 0; }
  .pipeline .stage {
    padding: 20px 0;
    align-items: stretch;
    text-align: left;
  }
  .pipeline .stage:first-child { padding-top: 4px; }
  .pipeline .stage { padding-bottom: 28px; }
  .pipeline .stage:last-child { padding-bottom: 0; }

  .pipeline .stage-head {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding-bottom: 14px;
  }
  .pipeline .stage-ico {
    width: 72px;
    height: 72px;
    border-radius: 14px;
  }
  .pipeline .stage-ico svg { width: 48px; height: 48px; }
  .pipeline .stage-label {
    justify-content: flex-start;
    flex: 1 1 auto;
    min-width: 0;
  }
  .pipeline .stage-title { font-size: var(--text-base); }

  .pipeline .stage-chips { justify-content: flex-start; }

  /* Example summary — 4-col grid is unreadable on phones; stack it */
  .pipeline .ppl-example {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .pipeline .ppl-example-col {
    border-right: none;
    padding: 16px 14px;
  }
}
