/* Case-flow extension — keeps the approved V4 shell and gives the evidence its own rhythm. */

.hero-attitude {
  margin: 0 0 18px;
  font-size: clamp(17px, 1.45vw, 25px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.035em;
}

.hero-copy { min-width: 0; }
.hero h1 { max-width: 7.7em; }
.hero-for {
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: -.015em;
}

.case-intro {
  min-height: min(560px, 64svh);
  display: grid;
  grid-template-columns: minmax(110px, .55fr) minmax(0, 3fr) minmax(220px, .8fr);
  grid-template-rows: auto 1fr auto;
  align-items: start;
  gap: 28px clamp(24px, 4vw, 76px);
  border-bottom: 1px solid;
}
.case-intro .section-label,
.case-heading .section-label {
  margin: 0;
  font: 500 9px/1.45 var(--mono);
  letter-spacing: .03em;
}
.case-intro h2 {
  grid-column: 2 / 4;
  margin: -.08em 0 0;
  max-width: 9.6em;
  align-self: center;
  font-size: clamp(66px, 9.8vw, 164px);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -.045em;
}
.intro-copy {
  grid-column: 2;
  margin: 0;
  font-size: clamp(17px, 1.55vw, 25px);
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: -.03em;
}
.case-caption {
  grid-column: 3;
  margin: 0;
  max-width: 32em;
  font-size: 11px;
  line-height: 1.7;
}

.case-study {
  padding: clamp(76px, 7.8vw, 112px) var(--pad);
  border-bottom: 1px solid;
}
.case-heading {
  display: grid;
  grid-template-columns: minmax(110px, 18%) minmax(0, 1fr);
  gap: 24px;
  padding-top: 18px;
  border-top: 1px solid;
}
.case-heading h2 {
  margin: 0;
  max-width: 12em;
  font-size: clamp(48px, 6.4vw, 108px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -.045em;
}
.step-number {
  font: 500 9px/1.4 var(--mono);
  letter-spacing: .04em;
}

.story-layout {
  display: grid;
  grid-template-columns: minmax(360px, .92fr) minmax(420px, 1.08fr);
  gap: clamp(46px, 8vw, 140px);
  margin-top: clamp(48px, 5.5vw, 80px);
  align-items: start;
}
.story-stage {
  position: sticky;
  top: clamp(88px, 12vh, 140px);
  height: min(66svh, 650px);
  min-height: 500px;
  padding: 24px;
  border: 1px solid;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.stage-kicker {
  font: 500 9px/1.4 var(--mono);
}
.topic-cloud {
  min-height: 300px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 18px;
}
.topic-cloud span,
.topic-cloud strong {
  display: block;
  font-size: clamp(36px, 4.1vw, 72px);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -.04em;
  transition: color .25s ease, opacity .25s ease;
}
.topic-cloud :nth-child(even) { text-align: right; }
.story-stage:is([data-stage="1"],[data-stage="2"]) .topic-cloud > :not(.selected-topic) { opacity: .18; }
.story-stage:is([data-stage="1"],[data-stage="2"]) .selected-topic { color: var(--red); }
.topic-return {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  padding-top: 18px;
  border-top: 1px solid;
  font-size: 11px;
}
.topic-return b {
  font-size: clamp(20px, 2vw, 34px);
  line-height: 1.15;
  letter-spacing: -.03em;
}
.story-stage[data-stage="2"] .topic-return { color: var(--red); }
.stage-progress {
  position: absolute;
  left: -1px;
  right: -1px;
  bottom: -1px;
  height: 4px;
  overflow: hidden;
}
.stage-progress i {
  display: block;
  width: 33.333%;
  height: 100%;
  background: var(--red);
  transition: transform .3s ease;
}
.story-stage[data-stage="1"] .stage-progress i { transform: translateX(100%); }
.story-stage[data-stage="2"] .stage-progress i { transform: translateX(200%); }
.story-step {
  min-height: min(65svh, 560px);
  padding: 22px 0 48px;
  border-top: 1px solid;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
}
.story-step h3,
.guide-step h3,
.writing-flow h3 {
  margin: clamp(36px, 5vw, 72px) 0 24px;
  font-size: clamp(36px, 4.5vw, 76px);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -.04em;
}
.story-step > p:not(.step-take),
.guide-step > p,
.writing-flow article > p {
  max-width: 35em;
  margin: 0;
  font-size: 16px;
  line-height: 1.75;
}
.step-take {
  margin: auto 0 0;
  padding-top: 22px;
  border-top: 1px solid;
  font-size: 12px;
  font-weight: 700;
}

.case-footnote {
  margin-top: clamp(40px, 5vw, 72px);
  padding: 22px 0;
  border-top: 1px solid;
  border-bottom: 1px solid;
  display: grid;
  grid-template-columns: minmax(110px, 18%) minmax(0, 1fr) minmax(220px, .65fr);
  gap: 24px;
  align-items: center;
}
.case-footnote span { font: 500 9px/1.4 var(--mono); }
.case-footnote strong {
  font-size: clamp(23px, 2.5vw, 42px);
  line-height: 1.15;
  letter-spacing: -.035em;
}
.case-footnote p { margin: 0; font-size: 10px; line-height: 1.6; }

.guide-flow {
  margin-top: clamp(48px, 5.5vw, 80px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr) 34px minmax(0, 1fr);
  align-items: start;
}
.guide-step { min-width: 0; }
.guide-step > .step-number { display: block; border-top: 1px solid; padding-top: 14px; }
.flow-connector {
  padding-top: clamp(120px, 14vw, 220px);
  text-align: center;
  color: var(--red);
  font-size: 24px;
}
.book-shape,
.db-shape {
  height: clamp(220px, 25vw, 390px);
  margin-top: 24px;
  position: relative;
}
.book-shape {
  width: 72%;
  padding: 25px 22px;
  border: 1px solid;
  box-shadow: 14px 14px 0 transparent, 15px 15px 0 var(--ink);
  display: flex;
  flex-direction: column;
}
.book-shape:before {
  content: "";
  position: absolute;
  top: -1px;
  bottom: -1px;
  left: 13px;
  border-left: 1px solid;
}
.book-shape span,
.book-shape small { margin-left: 9px; font: 500 9px/1.4 var(--mono); }
.book-shape b {
  margin: auto 0 auto 9px;
  font-size: clamp(31px, 3vw, 52px);
  line-height: 1.04;
  letter-spacing: -.04em;
}
.book-shape.premium { margin-left: auto; background: var(--red); color: white; border-color: var(--red); }
.db-shape {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  place-items: center;
}
.db-shape i { width: clamp(34px, 4vw, 62px); aspect-ratio: 1; border: 1px solid; border-radius: 50%; }
.db-shape b {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  padding: 12px;
  background: var(--paper);
  color: var(--red);
  font: 900 clamp(42px, 5vw, 84px)/1 var(--mono);
}
.guide-step h3 { font-size: clamp(28px, 3vw, 50px); }
.case-note {
  margin: clamp(80px, 10vw, 150px) 0 0 33%;
  padding-top: 22px;
  border-top: 1px solid;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
.case-note p { margin: 0; font-size: 13px; line-height: 1.75; }

.writing-flow {
  margin-top: clamp(48px, 5.5vw, 80px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px minmax(0, 1fr);
  align-items: stretch;
}
.writing-flow article {
  min-width: 0;
  padding: 22px 0 0;
  border-top: 1px solid;
}
.writing-arrow { align-self: center; text-align: center; color: var(--red); font-size: 28px; }
.writing-sample {
  min-height: 250px;
  margin-top: 46px;
  padding: 24px;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.writing-sample b { margin-bottom: auto; font-size: clamp(31px, 3.4vw, 56px); line-height: 1.08; letter-spacing: -.04em; }
.writing-sample i { display: block; height: 1px; background: currentColor; opacity: .6; }
.writing-sample i:nth-of-type(2) { width: 76%; }
.writing-sample i:nth-of-type(3) { width: 52%; }
.writing-sample.alternate { background: var(--red); }
.return-flow {
  min-height: 125px;
  margin-top: clamp(75px, 8vw, 120px);
  padding: 20px 24px;
  border: 1px solid;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto;
  gap: 24px;
  align-items: center;
  font-size: clamp(18px, 2vw, 32px);
  font-weight: 800;
  letter-spacing: -.03em;
}
.return-flow b { color: var(--red); }
.return-symbol { font-size: 38px; }
.return-explanation { max-width: 54em; margin: 24px 0 0 auto; font-size: 15px; line-height: 1.75; }

.loop-summary {
  background: var(--ink);
  color: var(--paper);
  border-bottom: 1px solid var(--paper);
}
.loop-summary > h2 {
  max-width: 10em;
  margin: 34px 0 clamp(55px, 7vw, 105px);
  font-size: clamp(58px, 8vw, 132px);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -.045em;
}
.summary-lead { max-width: 52em; margin: 0; font-size: clamp(16px, 1.6vw, 25px); font-weight: 700; line-height: 1.65; letter-spacing: -.025em; }
.format-band {
  margin: clamp(55px, 7vw, 100px) 0;
  border-top: 1px solid rgba(243,241,235,.55);
  border-bottom: 1px solid rgba(243,241,235,.55);
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  font-size: clamp(25px, 3.4vw, 58px);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -.04em;
  white-space: nowrap;
}
.format-band b { color: var(--red); font-weight: 400; }
.accumulation {
  margin-top: clamp(55px, 7vw, 100px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(243,241,235,.55);
  border-bottom: 1px solid rgba(243,241,235,.55);
}
.accumulation > div { min-height: 220px; padding: 22px; display: flex; flex-direction: column; justify-content: space-between; }
.accumulation > div + div { border-left: 1px solid rgba(243,241,235,.55); }
.accumulation strong { color: #f1483b; font-size: clamp(42px, 5vw, 84px); letter-spacing: -.05em; }
.accumulation p { margin: 0; font-size: 11px; }
.zero-note { max-width: 54em; margin: 36px 0 0 auto; font-size: 15px; line-height: 1.75; }

@media (max-width: 850px) {
  .hero-attitude { margin-bottom: 14px; }
  .hero h1 { max-width: none; }
  .case-intro { min-height: 520px; grid-template-columns: 56px minmax(0, 1fr); grid-template-rows: auto 1fr auto auto; }
  .case-intro h2 { grid-column: 2; font-size: clamp(58px, 13.5vw, 104px); }
  .intro-copy, .case-caption { grid-column: 2; }
  .case-heading { grid-template-columns: 56px minmax(0, 1fr); }
  .story-layout { grid-template-columns: 1fr; gap: 0; }
  .story-stage { position: relative; top: auto; height: auto; min-height: 350px; margin-bottom: 42px; }
  .topic-cloud { min-height: 205px; }
  .topic-cloud span, .topic-cloud strong { font-size: clamp(29px, 8vw, 54px); }
  .story-step { min-height: 0; padding: 24px 0 42px; }
  .story-step + .story-step { margin-top: 10px; }
  .step-take { margin-top: 48px; }
  .guide-flow { grid-template-columns: 1fr; gap: 58px; }
  .flow-connector { display: none; }
  .guide-step { display: grid; grid-template-columns: minmax(190px, .7fr) minmax(0, 1fr); gap: 0 32px; }
  .guide-step > .step-number { grid-column: 1 / -1; }
  .guide-step > .book-shape, .guide-step > .db-shape { grid-row: 2 / 4; }
  .guide-step h3 { margin-top: 28px; }
  .book-shape { width: 82%; }
  .case-note { margin-left: 0; }
  .writing-flow { grid-template-columns: 1fr; gap: 38px; }
  .writing-arrow { transform: rotate(90deg); }
  .return-flow { grid-template-columns: 1fr auto; }
  .return-flow span { min-width: 0; }
  .format-band { flex-wrap: wrap; white-space: normal; }
}

@media (max-width: 560px) {
  .hero-attitude { font-size: 16px; line-height: 1.2; letter-spacing: -.03em; }
  .hero-for { font-size: 15px; line-height: 1.65; }
  .case-intro { min-height: 0; padding: 56px var(--pad); grid-template-columns: 1fr; gap: 24px; }
  .case-intro .section-label, .case-intro h2, .intro-copy, .case-caption { grid-column: 1; }
  .case-intro h2 { align-self: center; margin: 0; font-size: clamp(53px, 16vw, 75px); line-height: 1.12; letter-spacing: -.04em; }
  .intro-copy { font-size: 16px; line-height: 1.6; }
  .case-study { padding: 56px var(--pad); }
  .case-heading { grid-template-columns: 1fr; gap: 28px; }
  .case-heading h2 { font-size: clamp(36px, 10.5vw, 46px); line-height: 1.12; letter-spacing: -.04em; }
  .story-layout, .guide-flow, .writing-flow { margin-top: 42px; }
  .story-stage { min-height: 310px; padding: 18px; }
  .topic-cloud { min-height: 180px; }
  .topic-cloud span, .topic-cloud strong { font-size: clamp(27px, 9vw, 39px); line-height: 1.12; }
  .topic-return b { font-size: 19px; }
  .story-step h3, .guide-step h3, .writing-flow h3 { font-size: clamp(34px, 10vw, 47px); line-height: 1.12; letter-spacing: -.04em; }
  .case-footnote { grid-template-columns: 1fr; gap: 13px; }
  .case-footnote strong { font-size: 25px; line-height: 1.18; }
  .guide-step { display: block; }
  .book-shape, .db-shape { height: 190px; }
  .book-shape { width: 76%; }
  .guide-step h3 { margin-top: 28px; }
  .case-note { grid-template-columns: 1fr; gap: 20px; margin-top: 36px; }
  .writing-sample { min-height: 155px; }
  .return-flow { min-height: 0; padding: 18px; gap: 17px; font-size: 17px; line-height: 1.3; }
  .return-symbol { font-size: 29px; }
  .return-explanation { font-size: 15px; }
  .loop-summary > h2 { font-size: clamp(50px, 15vw, 70px); line-height: 1.12; letter-spacing: -.04em; }
  .summary-lead { font-size: 16px; line-height: 1.65; }
  .format-band { display: grid; grid-template-columns: 1fr auto; font-size: clamp(31px, 10vw, 43px); line-height: 1.12; }
  .format-band b { justify-self: end; }
  .accumulation { grid-template-columns: 1fr; }
  .accumulation > div { min-height: 110px; }
  .accumulation > div + div { border-left: 0; border-top: 1px solid rgba(243,241,235,.55); }
  .zero-note { margin-top: 28px; }
}

@media (max-width: 340px) {
  .case-intro h2 { font-size: 50px; }
  .case-heading h2 { font-size: 39px; }
  .topic-cloud span, .topic-cloud strong { font-size: 26px; }
  .book-shape { width: 84%; }
}

@media (prefers-reduced-motion: reduce) {
  .topic-cloud span, .topic-cloud strong, .stage-progress i { transition: none; }
}
