.guide-chapter {
  --chapter-ink: #183329;
  --chapter-muted: #516358;
  --chapter-line: #cad3c5;
  color: var(--chapter-ink);
  padding-block: clamp(3.75rem, 8vw, 7.25rem);
}

.chapter-header {
  margin-bottom: clamp(1.75rem, 4vw, 3.5rem);
}

.chapter-header h2 {
  font-size: clamp(2.65rem, 5.5vw, 5.25rem);
  line-height: .96;
  letter-spacing: -.038em;
  max-width: 15ch;
  margin: 0 0 1rem;
}

.chapter-header p {
  max-width: 54ch;
  margin: 0;
  color: var(--chapter-muted);
}

.chapter-interactive [hidden] {
  display: none;
}

.chapter-interactive :focus-visible {
  outline: 2px solid var(--chapter-ink);
  outline-offset: 4px;
}

.advice-chapter {
  background: #eef0e8;
}

.advice-interactive {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 5.5rem);
}

.advice-figure {
  margin: 0;
}

.advice-figure figcaption {
  color: var(--chapter-muted);
  text-align: center;
  font-size: .78rem;
  margin: 1rem 0 0;
}

.advice-figure a {
  text-decoration: underline;
  text-underline-offset: .18em;
}

.advice-pyramid {
  display: grid;
  grid-template-rows: minmax(0, 51fr) minmax(0, 27fr) minmax(0, 22fr);
  gap: 4px;
  justify-items: center;
  width: min(100%, 29rem);
  height: clamp(14.25rem, 25vw, 19.5rem);
  margin-inline: auto;
}

.pyramid-layer {
  --layer-fill: #e0e7d8;
  --layer-shape: polygon(50% 0, 100% 100%, 0 100%);
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  text-align: center;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--chapter-ink);
  font: inherit;
  font-size: clamp(.92rem, 2.15vw, 1.35rem);
  font-weight: 550;
  cursor: pointer;
}

.pyramid-layer::before,
.pyramid-layer::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  clip-path: var(--layer-shape);
  transition: background-color 180ms ease;
}

.pyramid-layer::before {
  background: var(--layer-fill);
}

.pyramid-layer::after {
  inset: 3px;
}

.pyramid-layer:hover,
.pyramid-layer[aria-selected="true"] {
  color: #fffdf6;
}

.pyramid-layer:hover::before {
  background: #365449;
}

.pyramid-layer[aria-selected="true"]::before {
  background: #1e3c31;
}

.pyramid-layer:focus-visible {
  outline: none;
  color: #fffdf6;
}

.pyramid-layer:focus-visible::before {
  background: #b38f54;
}

.pyramid-layer:focus-visible::after {
  background: #1e3c31;
}

.pyramid-apex {
  width: 51%;
  padding-top: 4.5rem;
  clip-path: var(--layer-shape);
}

.pyramid-middle {
  --layer-fill: #bdccb4;
  --layer-shape: polygon(24.5% 0, 75.5% 0, 89% 100%, 11% 100%);
  clip-path: var(--layer-shape);
}

.pyramid-base {
  --layer-fill: #9eb396;
  --layer-shape: polygon(11% 0, 89% 0, 100% 100%, 0 100%);
  clip-path: var(--layer-shape);
}

.advice-panel {
  background: #f9f9f3;
  border: 1px solid #dde3d7;
  padding: clamp(1.3rem, 3vw, 2.65rem);
  min-height: 20rem;
}

.chapter-panel + .chapter-panel:not([hidden]) {
  margin-top: 1rem;
}

.advice-panel h3,
.timeline-panel h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 400;
  font-size: clamp(2.1rem, 3.5vw, 3.2rem);
  line-height: 1;
  margin: 0 0 .65rem;
}

.chapter-panel p {
  color: var(--chapter-muted);
  margin: 0;
}

.advice-topics,
.timeline-tasks {
  margin: 1.35rem 0 0;
  padding: 0;
  list-style: none;
}

.advice-topics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1.2rem;
}

.advice-topics li,
.timeline-tasks li {
  position: relative;
  font-size: .9rem;
  line-height: 1.45;
  border-top: 1px solid var(--chapter-line);
  padding: .55rem 0 .55rem .9rem;
}

.advice-topics li::before,
.timeline-tasks li::before {
  position: absolute;
  left: 0;
  top: 1.08em;
  content: "";
  width: .26rem;
  height: .26rem;
  border-radius: 50%;
  background: #58745f;
}

.timeline-chapter {
  background: #f7f6ee;
}

.timeline-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.75rem 4rem;
}

.timeline-range {
  flex: 0 0 auto;
  color: var(--chapter-ink);
  border-inline-start: 1px solid #abb9a6;
  padding-inline-start: clamp(.9rem, 2.5vw, 2rem);
}

.timeline-range strong,
.timeline-range span {
  display: block;
}

.timeline-range strong {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  font-size: clamp(2.3rem, 4.8vw, 4rem);
  line-height: .95;
  font-variant-numeric: lining-nums;
}

.timeline-range span {
  margin-top: .45rem;
  color: var(--chapter-muted);
  font-size: .8rem;
}

.timeline-stages {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  position: relative;
  isolation: isolate;
  margin-bottom: 1.4rem;
}

.timeline-stages::before,
.timeline-stages::after {
  content: "";
  position: absolute;
  top: 1.175rem;
  left: 12.5%;
  right: 12.5%;
  border-top: 1px solid #a9b9a6;
  z-index: -1;
}

.timeline-stages::after {
  left: 62.5%;
  border-top: 1px dashed #879b86;
  background: #f7f6ee;
}

.timeline-stage {
  color: var(--chapter-ink);
  background: transparent;
  border: 0;
  font: inherit;
  font-size: clamp(.83rem, 1.8vw, 1rem);
  display: grid;
  justify-items: center;
  justify-self: center;
  gap: .55rem;
  cursor: pointer;
  padding: 0 .2rem .35rem;
}

.timeline-marker {
  background: #f7f6ee;
  border: 1px solid #8da187;
  border-radius: 50%;
  color: var(--chapter-ink);
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  font-size: .86rem;
  font-weight: 600;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.timeline-marker-ongoing::before {
  content: "→";
  font-size: 1.1rem;
  line-height: 1;
}

.timeline-stage:hover .timeline-marker {
  background: #dbe4d5;
}

.timeline-stage[aria-selected="true"] {
  text-decoration: underline;
  text-underline-offset: .3em;
  font-weight: 700;
}

.timeline-stage[aria-selected="true"] .timeline-marker {
  color: #fffdf6;
  background: #1e3c31;
  border-color: #1e3c31;
}

.timeline-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  align-items: start;
  gap: clamp(1.2rem, 4vw, 3.25rem);
  min-height: 13.25rem;
  background: #edefe5;
  border: 1px solid #dde3d7;
  padding: clamp(1.25rem, 3vw, 2.6rem);
}

.timeline-tasks {
  margin: 0;
}

.timeline-tasks li:first-child {
  border-top: 0;
}

.timeline-note {
  color: var(--chapter-muted);
  font-size: .83rem;
  margin: 1.05rem 0 0;
}

[data-chapter-tabs]:not(.chapter-ready) .advice-figure {
  grid-column: 1 / -1;
  grid-row: 2;
}

[data-chapter-tabs]:not(.chapter-ready) .advice-figure figcaption {
  text-align: left;
  margin: 0;
}

[data-chapter-tabs]:not(.chapter-ready) .advice-panels {
  grid-column: 1 / -1;
}

@media (max-width: 48rem) {
  .advice-interactive {
    grid-template-columns: 1fr;
  }

  .advice-panel {
    min-height: auto;
  }

  .timeline-header {
    flex-direction: column;
    align-items: start;
  }

  .timeline-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 38rem) {
  .timeline-stages {
    grid-template-columns: 1fr;
    gap: .42rem;
    margin-bottom: 1.25rem;
  }

  .timeline-stages::before,
  .timeline-stages::after {
    left: 1.175rem;
    top: 1.175rem;
    bottom: 1.175rem;
    right: auto;
    border: 0;
    border-inline-start: 1px solid #a9b9a6;
  }

  .timeline-stages::after {
    top: auto;
    height: 2.77rem;
    border-inline-start: 1px dashed #879b86;
  }

  .timeline-stage {
    align-items: center;
    grid-template-columns: 2.35rem 1fr;
    justify-items: start;
    justify-self: stretch;
    gap: .9rem;
    padding: 0;
  }
}

@media (max-width: 23rem) {
  .advice-topics {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pyramid-layer::before,
  .pyramid-layer::after,
  .timeline-marker {
    transition: none;
  }
}
