/* KettleCore — exact screenshot additions, native responsive diagrams. */
.chapters .kc-visual[data-visual] {
  --kc-acid: var(--acid, #e7ff00);
  --kc-lilac: var(--lilac, #b9a3ff);
  --kc-muted: #bcbcc4;
  margin: 2.5rem 0;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid #313138;
  border-radius: 1.25rem;
  background: #111114;
  color: #f5f5f3;
  min-width: 0;
  scroll-margin-top: 6rem;
  container-type: inline-size;
  container-name: kettlecore-visual;
}
.chapters .kc-visual[data-visual] .kc-visual__eyebrow {
  margin: 0 0 1rem;
  color: var(--kc-lilac);
  font: 500 .875rem/1.45 Inter, Arial, sans-serif;
  letter-spacing: .06em;
}
.chapters .kc-visual[data-visual] .kc-visual__title {
  color: #f5f5f3;
  font: 700 clamp(1.45rem, 2.8vw, 2.15rem)/1.12 "Inter Tight", Inter, Arial, sans-serif;
  letter-spacing: -.025em;
  margin: 0 0 1.6rem;
  max-width: 28ch;
  text-wrap: balance;
}
.chapters .kc-visual[data-visual] .kc-visual__takeaway {
  display: block;
  border-top: 1px solid #3b3b42;
  padding-top: 1.35rem;
  margin: 1.6rem 0 0;
  color: var(--kc-acid);
  font: 700 clamp(1.2rem, 2.5vw, 1.7rem)/1.2 "Inter Tight", Inter, Arial, sans-serif;
  letter-spacing: -.015em;
  text-wrap: balance;
}
.chapters .kc-visual[data-visual] .kc-visual__note {
  font-size: .875rem;
  line-height: 1.55;
  color: var(--kc-muted);
  margin: 1.15rem 0 0;
}
.chapters .kc-visual[data-visual] p { max-width: none; }
.kc-visual__icon { width: 2.25rem; height: 2.25rem; display: block; flex: none; }
.kc-visual__arrow { display: block; text-align: center; font-size: 2rem; line-height: 1; padding: .75rem 0; color: var(--kc-lilac); }
.kc-visual__arrow--acid { color: var(--kc-acid); }

/* Eight foundations: compact overview, no hidden explanations. */
.chapters .kc-foundations__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.5rem; padding: 0; margin: 0; list-style: none; }
.chapters .kc-foundations__grid > li { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); gap: .85rem; margin: 0; padding: 1.25rem 0; border-top: 1px solid #34343b; min-width: 0; }
.kc-foundations__number { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: .7rem; background: var(--kc-acid); color: #101011; font-size: 1rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.kc-foundations__grid > li:nth-child(even) .kc-foundations__number { background: var(--kc-lilac); }
.chapters .kc-foundations__grid h4 { margin: .25rem 0 .45rem; font-size: .95rem; line-height: 1.25; letter-spacing: .005em; color: #f5f5f3; overflow-wrap: anywhere; }
.chapters .kc-foundations__grid p { margin: 0; font-size: .9rem; line-height: 1.55; color: var(--kc-muted); }

/* Coordinated movement: the three roles remain distinct at every width. */
.kc-architecture__source, .kc-architecture__result { padding: 1.4rem 1rem; border-radius: .8rem; text-align: center; color: #101011; }
.kc-architecture__source { background: var(--kc-lilac); }
.kc-architecture__source > .kc-visual__icon { margin: 0 auto .75rem; }
.kc-architecture__source > strong, .kc-architecture__result > strong { display: block; font: 700 clamp(1.15rem, 2.5vw, 1.7rem)/1.15 "Inter Tight", Inter, sans-serif; }
.chapters .kc-architecture__source p, .chapters .kc-architecture__result p { margin: .65rem 0 0; font-size: 1rem; line-height: 1.45; }
.kc-architecture__roles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
.kc-architecture__roles > div { padding: 1rem .55rem; border: 1px solid var(--kc-lilac); border-radius: .7rem; text-align: center; min-width: 0; }
.kc-architecture__roles .kc-visual__icon { margin: 0 auto .8rem; color: var(--kc-lilac); }
.kc-architecture__roles strong { display: block; font-size: .875rem; line-height: 1.2; }
.chapters .kc-architecture__roles p { font-size: .9rem; line-height: 1.45; color: var(--kc-muted); margin: .65rem 0 0; }
.kc-architecture__result { background: var(--kc-acid); }

/* Ten reps: numbers and captions carry meaning in addition to colour. */
.kc-reps__strategy + .kc-reps__strategy { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid #3b3b42; }
.chapters .kc-reps .kc-reps__label { margin: 0 0 .85rem; color: #cccbd3; font-size: 1rem; line-height: 1.45; }
.chapters .kc-reps__strategy--quality .kc-reps__label { color: var(--kc-lilac); font-weight: 600; }
.kc-reps__line { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: .35rem; }
.kc-reps__line > span { display: grid; place-items: center; min-height: 3.6rem; border-radius: .55rem; background: var(--kc-acid); color: #111112; font-size: 1rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.kc-reps__line > .kc-reps__degraded { background: #c9363c; color: #fff; }
.kc-reps__line--rest { grid-template-columns: repeat(7, minmax(0, 1fr)) minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); }
.kc-reps__line > .kc-reps__rest { display: flex; flex-direction: column; justify-content: center; gap: .2rem; background: var(--kc-lilac); }
.kc-reps__rest svg { width: 1.15rem; height: 1.15rem; }
.kc-reps__rest small { font-size: .875rem; line-height: 1.2; font-weight: 500; }
.chapters .kc-reps .kc-reps__caption { font-size: .9rem; line-height: 1.5; color: var(--kc-muted); margin: .85rem 0 0; }

/* The pyramid is read bottom-to-top; DOM order follows that learning order. */
.chapters .kc-pyramid__tiers { display: flex; flex-direction: column-reverse; align-items: center; gap: .4rem; padding: 0; margin: 1rem auto 0; max-width: 36rem; list-style: none; }
.chapters .kc-pyramid__tiers > li { display: grid; place-items: center; position: relative; isolation: isolate; min-height: 4.4rem; padding: .9rem .5rem .6rem; margin: 0; text-align: center; max-width: none; font-size: clamp(.875rem, 1.7vw, 1rem); font-weight: 600; line-height: 1.2; }
.kc-pyramid__tiers > li::before { content: ""; position: absolute; inset: 0; z-index: -1; clip-path: polygon(12% 0, 88% 0, 100% 100%, 0 100%); background: #303036; }
.kc-pyramid__base { width: 100%; }
.kc-pyramid__base::before { border-bottom: 2px solid var(--kc-lilac); }
.kc-pyramid__control { width: 78%; }
.kc-pyramid__tiers > .kc-pyramid__control::before { background: #645b78; }
.kc-pyramid__strength { width: 55%; color: #111112; }
.kc-pyramid__tiers > .kc-pyramid__strength::before { background: var(--kc-lilac); }
.chapters .kc-pyramid__tiers > .kc-pyramid__load { width: 30%; min-height: 6rem; padding-top: 2.9rem; color: #111112; }
.kc-pyramid__tiers > .kc-pyramid__load::before { background: var(--kc-acid); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.kc-pyramid .kc-visual__takeaway { text-align: center; }

/* Pareto is an illustration, not a performance measurement. */
.kc-pareto__pair { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(.8rem, 3vw, 2.5rem); max-width: 34rem; margin: 1.2rem auto 0; }
.kc-pareto__item { text-align: center; min-width: 0; color: var(--kc-lilac); }
.kc-pareto__item--results { color: var(--kc-acid); }
.kc-pareto__percentage { display: block; margin-bottom: .8rem; font: 700 clamp(2rem, 5vw, 3.3rem)/1 "Inter Tight", Inter, sans-serif; font-variant-numeric: tabular-nums; }
.kc-pareto__ring { position: relative; width: 100%; aspect-ratio: 1; }
.kc-pareto__ring > svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); }
.kc-pareto__track, .kc-pareto__arc { fill: none; stroke-width: 23; }
.kc-pareto__track { stroke: #303035; }
.kc-pareto__arc { stroke: currentColor; }
.chapters .kc-pareto__ring p { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; color: #f5f5f3; margin: 0; font-size: clamp(.875rem, 1.5vw, .95rem); line-height: 1.25; }
.kc-pareto__ring p strong { font-size: 1.05em; }
.kc-pareto .kc-visual__takeaway { text-align: center; }

/* The six movement names replace the corresponding prose list. */
.chapters .kc-arsenal__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; padding: 0; margin: 0; list-style: none; }
.chapters .kc-arsenal__grid > li { display: flex; flex-direction: column; gap: 1.3rem; padding: 1rem; margin: 0; min-width: 0; border: 1px solid #404047; border-radius: .65rem; background: #17171b; }
.kc-arsenal__grid > li > span { color: var(--kc-lilac); font: 500 .875rem/1 Inter, sans-serif; letter-spacing: .08em; }
.kc-arsenal__grid > li:nth-child(odd) > span { color: var(--kc-acid); }
.kc-arsenal__grid > li > strong { font: 700 1.2rem/1.15 "Inter Tight", Inter, sans-serif; text-transform: uppercase; overflow-wrap: anywhere; }
.kc-arsenal__swing { border-left: 2px solid var(--kc-lilac); padding: 0 0 0 .85rem; margin-top: 1.25rem; }
.kc-arsenal__swing > strong { font-size: .875rem; color: var(--kc-lilac); }
.chapters .kc-arsenal__swing p { font-size: .9rem; line-height: 1.5; margin: .4rem 0 0; color: var(--kc-muted); }

/* Side-by-side doctrine comparison keeps each corresponding row aligned. */
.chapters .kc-compare { padding: 0; overflow: hidden; }
.kc-compare > table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.kc-compare th, .kc-compare td { width: 50%; vertical-align: top; text-align: left; padding: .95rem 1.2rem; overflow-wrap: break-word; }
.kc-compare th { padding-block: 1.5rem; }
.kc-compare th + th, .kc-compare td + td { border-left: 1px solid #34343b; background: #171a12; }
.kc-compare th > span { display: block; font-size: .875rem; line-height: 1.4; color: #ff7f7f; font-weight: 500; margin-bottom: .8rem; }
.kc-compare th + th > span { color: var(--kc-lilac); }
.kc-compare th > strong { display: block; color: #f5f5f3; font: 700 clamp(1.15rem, 2.5vw, 1.6rem)/1.1 "Inter Tight", Inter, sans-serif; }
.kc-compare th + th > strong { color: var(--kc-acid); }
.kc-compare tbody tr { border-top: 1px solid #34343b; }
.kc-compare td { font-size: 1rem; line-height: 1.5; }

@media (max-width: 650px) {
  .chapters .kc-visual[data-visual] { margin-block: 2rem; }
  .chapters .kc-foundations__grid { grid-template-columns: 1fr; }
  .chapters .kc-foundations__grid h4 { overflow-wrap: normal; }
  .chapters .kc-foundations__grid > li { padding-block: 1rem; }
  .chapters .kc-arsenal__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kc-compare th, .kc-compare td { padding: .85rem .8rem; }
  .kc-compare td { font-size: .9rem; }
  .kc-reps__line { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .4rem; }
  .kc-reps__line > span { min-height: 2.75rem; }
  .kc-reps__line--rest { grid-template-columns: repeat(15, minmax(0, 1fr)); }
  .kc-reps__line--rest > span { grid-column: span 3; }
  .kc-reps__line--rest > .kc-reps__rest { grid-column: span 9; flex-direction: row; gap: .5rem; }
  .kc-reps__line--rest > span:nth-child(n+9) { grid-column: span 5; }
  .kc-pareto__ring { aspect-ratio: auto; }
  .kc-pareto__ring > svg { height: auto; aspect-ratio: 1; }
  .chapters .kc-pareto__ring p { position: static; margin-top: .7rem; font-size: .875rem; }

}
@media (max-width: 480px) {
  .kc-architecture__roles { grid-template-columns: 1fr; gap: .5rem; }
  .kc-architecture__roles > div { display: grid; grid-template-columns: 2rem 1fr; gap: .25rem .8rem; text-align: left; padding: .8rem; }
  .kc-architecture__roles .kc-visual__icon { width: 1.8rem; height: 1.8rem; grid-row: span 2; margin: 0; align-self: center; }
  .kc-architecture__roles strong { font-size: .875rem; }
  .chapters .kc-architecture__roles p { margin: 0; }
  .kc-reps__line { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .4rem; }
  .kc-reps__line > span { min-height: 2.75rem; }
  .kc-reps__line--rest { grid-template-columns: repeat(15, minmax(0, 1fr)); }
  .kc-reps__line--rest > span { grid-column: span 3; }
  .kc-reps__line--rest > .kc-reps__rest { grid-column: span 9; flex-direction: row; gap: .5rem; }
  .kc-reps__line--rest > span:nth-child(n+9) { grid-column: span 5; }
  .kc-reps__rest small { font-size: .875rem; }
  .chapters .kc-pyramid__tiers > li { min-height: 3.9rem; font-size: .875rem; }
  .chapters .kc-pyramid__tiers > .kc-pyramid__load { min-height: 5rem; padding-top: 2.5rem; }
  .kc-compare th > span { font-size: .875rem; letter-spacing: 0; }
  .kc-compare th, .kc-compare td { padding-inline: .65rem; }
}
@container kettlecore-visual (max-width: 600px) {
  .kc-reps__line { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .4rem; }
  .kc-reps__line > span { min-height: 2.75rem; }
  .kc-reps__line--rest { grid-template-columns: repeat(15, minmax(0, 1fr)); }
  .kc-reps__line--rest > span { grid-column: span 3; }
  .kc-reps__line--rest > .kc-reps__rest { grid-column: span 9; flex-direction: row; gap: .5rem; }
  .kc-reps__line--rest > span:nth-child(n+9) { grid-column: span 5; }
}
@container kettlecore-visual (max-width: 470px) {
  .chapters .kc-foundations__grid { grid-template-columns: 1fr; }
  .chapters .kc-foundations__grid h4 { overflow-wrap: normal; }
  .kc-architecture__roles { grid-template-columns: 1fr; gap: .5rem; }
  .kc-architecture__roles > div { display: grid; grid-template-columns: 2rem 1fr; gap: .25rem .8rem; text-align: left; padding: .8rem; }
  .kc-architecture__roles .kc-visual__icon { width: 1.8rem; height: 1.8rem; grid-row: span 2; margin: 0; align-self: center; }
  .chapters .kc-architecture__roles p { margin: 0; }
  .chapters .kc-arsenal__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kc-pareto__ring { aspect-ratio: auto; }
  .kc-pareto__ring > svg { height: auto; aspect-ratio: 1; }
  .chapters .kc-pareto__ring p { position: static; margin-top: .7rem; font-size: .875rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .kc-pareto.is-visible .kc-pareto__item--actions .kc-pareto__arc { animation: kc-pareto-actions 1.15s ease-out both; }
  .kc-pareto.is-visible .kc-pareto__item--results .kc-pareto__arc { animation: kc-pareto-results 1.15s ease-out both; }
  .kc-architecture.is-visible .kc-visual__arrow { animation: kc-flow-arrow .7s ease-out 2; }
  .kc-reps.is-visible .kc-reps__rest { animation: kc-pause-emphasis 1.5s ease-out 1; }
}
@keyframes kc-pareto-actions { from { stroke-dasharray: 0 100; } to { stroke-dasharray: 20 100; } }
@keyframes kc-pareto-results { from { stroke-dasharray: 0 100; } to { stroke-dasharray: 80 100; } }
@keyframes kc-flow-arrow { 0%,100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
@keyframes kc-pause-emphasis { 0%,100% { box-shadow: 0 0 0 0 transparent; } 40% { box-shadow: 0 0 0 3px #b9a3ff88; } }
@media print {
  .chapters .kc-visual[data-visual] { break-inside: avoid; }
  .kc-visual *, .kc-visual *::before { animation: none !important; }
}
