/* 06 — one concrete failure, reconstructed as a before/after contract change. */
.failure-rebuild {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px minmax(0, 1fr);
  max-width: 1080px;
  border-top: 1px solid #ffffff35;
  border-bottom: 1px solid #ffffff35;
}

.failure-rebuild article { padding: 1rem 1.25rem; }
.before-path { border-right: 1px solid #ffffff35; }
.after-path { border-left: 1px solid #ffffff35; }

.failure-rebuild header {
  display: flex;
  justify-content: space-between;
  margin-bottom: .5rem;
  font-family: Inter, "Pretendard Variable", sans-serif;
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .1em;
}

.failure-rebuild header p { margin: 0; }
.failure-rebuild header span { color: #c3ccd9; }
.before-path header p { color: #d8958e; }
.after-path header p { color: #9db9ed; }

.failure-rebuild ol { display: grid; gap: .28rem; margin: 0; padding: 0; list-style: none; }

.failure-rebuild li,
.failure-rebuild code {
  position: relative;
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: .65rem;
  padding: .44rem .55rem;
  border: 1px solid #ffffff22;
  color: #e7e9ed;
  font-size: .71rem;
  line-height: 1.4;
}

.failure-rebuild li:not(:last-child)::after {
  content: '↓';
  position: absolute;
  bottom: -.78rem;
  left: 50%;
  z-index: 1;
  color: #9ca6b6;
  font-size: .7rem;
}

.failure-rebuild li b { color: #fff; font-size: .67rem; }
.failure-rebuild li span { color: #c3c9d3; }
.failure-rebuild .failure-node { border-color: #a95c58; background: #9b4d4717; }
.failure-rebuild .failure-node b { color: #f0aaa1; }
.failure-rebuild .success-node { border-color: #789ce0; background: #557ccc18; }
.failure-rebuild .success-node b { color: #a9c4fa; }
.failure-rebuild code { grid-template-columns: 1fr; color: #cae0ff; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .66rem; }

.reinterpretation {
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 1rem;
  text-align: center;
}

.reinterpretation p { margin: 0 0 .6rem; color: #d8958e; font-family: Inter, "Pretendard Variable", sans-serif; font-size: .61rem; font-weight: 700; letter-spacing: .1em; }
.reinterpretation strong { color: #fff; font-size: .93rem; line-height: 1.45; letter-spacing: -.025em; }

.failure-conclusion { max-width: 850px; margin: 1.05rem 0 0; }
.failure-conclusion strong { display: block; color: #fff; font-size: 1.03rem; line-height: 1.55; letter-spacing: -.03em; }
.failure-conclusion span { display: block; margin-top: .32rem; color: #bfc6d2; font-size: .72rem; }

/* 07 — product boundaries discovered in operation. */
.productization-intro { margin: .8rem 0 0; color: var(--muted); font-size: .86rem; }
.boundary-map { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 1120px; border-top: 1px solid var(--line); }

.boundary-map article { display: grid; grid-template-rows: auto 1fr auto 1fr auto; min-width: 0; padding: 1rem .95rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.boundary-map article:last-child { border-right: 0; }
.boundary-map header { display: flex; gap: .45rem; align-items: center; margin-bottom: .6rem; color: var(--accent); font-family: Inter, "Pretendard Variable", sans-serif; font-size: .61rem; font-weight: 700; letter-spacing: .075em; }
.boundary-map header p { margin: 0; }
.boundary-map header span { color: var(--muted); }
.boundary-map small { display: block; margin-bottom: .22rem; color: var(--accent); font-size: .61rem; font-weight: 700; letter-spacing: .08em; }
.boundary-map strong { display: block; font-size: .75rem; line-height: 1.52; letter-spacing: -.02em; }
.boundary-map i { padding: .28rem 0; color: var(--accent); font-style: normal; font-size: .82rem; }
.boundary-map em { align-self: end; margin-top: .65rem; padding-top: .55rem; border-top: 1px solid var(--line); color: var(--muted); font-family: Inter, "Pretendard Variable", sans-serif; font-size: .6rem; font-style: normal; line-height: 1.5; }
.boundary-map em b { color: var(--ink); }
.boundary-result { margin: .95rem 0 0; font-size: .95rem; letter-spacing: -.025em; }

/* 08 — the principles as the closing visual, not another card grid. */
.principle-statements { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 1120px; border-top: 1px solid var(--line); }
.principle-statements article { min-width: 0; padding: 1.1rem 1.35rem 1rem 0; border-right: 1px solid var(--line); }
.principle-statements article + article { padding-left: 1.35rem; }
.principle-statements article:last-child { border-right: 0; }
.principle-statements > article > span { color: var(--accent); font-family: Inter, "Pretendard Variable", sans-serif; font-size: .68rem; font-weight: 700; letter-spacing: .1em; }
.principle-statements h3 { margin: 1rem 0 .75rem; font-size: clamp(1.6rem, 2.45vw, 2.45rem); font-weight: 500; line-height: 1.18; letter-spacing: -.06em; }
.principle-statements h3 b { font-weight: 700; }
.principle-statements p { max-width: 260px; margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.65; }
.learning-section .closing-thought { margin-top: 1.4rem; font-size: clamp(1.35rem, 2.35vw, 2.15rem); line-height: 1.4; }
.learning-section .closing-thought b { color: var(--accent); }

@media (min-width: 801px) {
  .deck-mode.case-page main > .failure-section,
  .deck-mode.case-page main > .productization-section,
  .deck-mode.case-page main > .learning-section { padding: clamp(4.3rem, 7.2svh, 5.5rem) 0 clamp(1.4rem, 2.5svh, 2.2rem); }
  .deck-mode .failure-section .section-heading,
  .deck-mode .productization-section .section-heading,
  .deck-mode .learning-section .section-heading { margin-bottom: 1.2rem; }
  .deck-mode .failure-section .section-heading h2,
  .deck-mode .productization-section .section-heading h2,
  .deck-mode .learning-section .section-heading h2 { font-size: clamp(2.1rem, 2.75vw, 2.9rem) !important; line-height: 1.15 !important; }
}

@media (max-width: 800px) {
  .failure-rebuild { grid-template-columns: 1fr; }
  .before-path, .after-path { border-inline: 0; }
  .reinterpretation { min-height: 110px; border-block: 1px solid #ffffff35; }
  .boundary-map { grid-template-columns: 1fr 1fr; }
  .boundary-map article:nth-child(2) { border-right: 0; }
  .principle-statements { grid-template-columns: 1fr; }
  .principle-statements article, .principle-statements article + article { padding: 1.1rem 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .principle-statements article:last-child { border-bottom: 0; }
}

@media (max-width: 620px) {
  .failure-rebuild li { grid-template-columns: 102px 1fr; }
  .boundary-map { grid-template-columns: 1fr; }
  .boundary-map article { border-right: 0; }
}
