/* Lifecycle & challenges section. Extends brochure.css tokens. */
:root {
  --pressure: #e8b27d;
  --pressure-soft: #e8b27d1f;
}

.lifecycle {
  border-bottom: 1px solid var(--border);
}
.lifecycle-lede {
  display: grid;
  gap: 16px;
  max-width: 500px;
}
.lifecycle-lede p:first-child {
  color: var(--body);
}

/* At-a-glance figures */
.lifecycle-stats {
  margin: 56px 0 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.lifecycle-stats div {
  padding: 22px 20px 24px 0;
}
.lifecycle-stats div + div {
  padding-left: 24px;
  border-left: 1px solid var(--border);
}
.lifecycle-stats dt {
  color: var(--muted);
  font: 500 0.6875rem/1.6 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.lifecycle-stats dd {
  margin: 8px 0 0;
  color: var(--foreground);
  font-size: 2.25rem;
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.1;
}
.lifecycle-stats dd span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.875rem;
  letter-spacing: 0;
}

/* Timeline figure */
.lifecycle-map {
  position: relative;
  margin-top: 56px;
  padding: 24px 28px 22px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(160deg, #1b243066, var(--surface) 70%);
}
.lifecycle-map-head {
  margin-top: 0;
  padding-left: 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.lifecycle-scroll-hint {
  display: none;
  color: var(--muted);
  font: 0.6875rem/1.6 var(--mono);
}
.lifecycle-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
.lifecycle-svg {
  display: block;
  width: 100%;
  min-width: 980px;
  height: auto;
  overflow: visible;
  font-family: var(--sans);
}
.lc-mono {
  font-family: var(--mono);
}
.lc-orig-box {
  fill: #a0c3ec0d;
  stroke: #40536b;
  stroke-dasharray: 3 4;
}
.lc-orig-head {
  fill: var(--accent);
  font-size: 11px;
  letter-spacing: 0.1em;
}
.lc-orig-item text {
  fill: var(--body);
  font-size: 13.5px;
}
.lc-orig-key {
  fill: var(--accent);
  font-size: 12px;
  font-weight: 600;
}
.lc-orig-arrow {
  fill: none;
  stroke: #6f8fb3;
  stroke-width: 1.4;
}
.lc-arrowhead {
  fill: #6f8fb3;
}
.lc-axis {
  stroke: #59606c;
  stroke-width: 1.2;
}
.lc-gate-line path {
  stroke: #2c3240;
  stroke-width: 1;
  stroke-dasharray: 2 5;
}
.lc-gate-dot {
  fill: var(--foreground);
}
.lc-gate-open {
  fill: var(--surface);
  stroke: var(--foreground);
  stroke-width: 1.6;
}
.lc-gate-name {
  fill: var(--foreground);
  font-size: 13px;
  font-weight: 600;
}
.lc-gate-desc {
  fill: var(--muted);
  font-size: 12px;
}
.lc-month {
  fill: var(--muted);
  font-size: 11.5px;
}
.lc-sub {
  fill: var(--muted);
  font-size: 11.5px;
}
.lc-row-num {
  fill: var(--accent);
  font-size: 12px;
}
.lc-row-name {
  fill: var(--foreground);
  font-size: 14.5px;
  font-weight: 500;
}
.lc-row-name.lc-muted {
  fill: var(--muted);
  font-weight: 400;
}
.lc-strong {
  font-weight: 600;
}
.lc-bar {
  fill: #a0c3ec2e;
  stroke: #a0c3ec80;
  stroke-width: 1;
}
.lc-bar-critical {
  fill: var(--ice);
  stroke: var(--ice);
}
.lc-bar-label {
  fill: var(--surface);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
}
.lc-thread {
  stroke: var(--ice);
  stroke-width: 2;
  stroke-dasharray: 6 5;
}
.lc-check {
  fill: var(--surface);
  stroke: var(--ice);
  stroke-width: 2.2;
}
.lc-continuous {
  stroke: #59606c;
  stroke-width: 1.4;
  stroke-dasharray: 1 5;
  stroke-linecap: round;
}
.lc-band {
  fill: var(--pressure-soft);
  stroke: #e8b27d4d;
  stroke-dasharray: 4 4;
}
.lc-band-label {
  fill: var(--pressure);
  font-size: 11px;
  letter-spacing: 0.08em;
}
.lc-marker circle {
  fill: var(--pressure);
  stroke: var(--surface);
  stroke-width: 3;
  transition: r 160ms ease;
}
.lc-marker text {
  fill: #1a1208;
  font: 700 13px var(--mono);
  pointer-events: none;
}
.lc-marker:hover circle,
.lc-marker:focus-visible circle {
  r: 16;
}
.lc-marker:focus-visible {
  outline: none;
}

.lifecycle-legend {
  list-style: none;
  margin: 22px 0 0;
  padding: 18px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font: 0.6875rem/1.6 var(--mono);
  letter-spacing: 0.04em;
}
.lifecycle-legend li {
  display: flex;
  align-items: center;
  gap: 9px;
}
.lifecycle-legend i {
  display: inline-block;
  flex: none;
}
.lg-bar,
.lg-critical {
  width: 26px;
  height: 9px;
  border-radius: 5px;
  background: #a0c3ec2e;
  border: 1px solid #a0c3ec80;
}
.lg-critical {
  background: var(--ice);
  border-color: var(--ice);
}
.lg-thread {
  width: 26px;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--ice) 0 5px, transparent 5px 9px);
}
.lg-band {
  width: 18px;
  height: 12px;
  border: 1px dashed #e8b27d80;
  background: var(--pressure-soft);
  border-radius: 3px;
}
.lg-marker {
  display: grid !important;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--pressure);
  color: #1a1208;
  font-style: normal;
  font-weight: 700;
  font-size: 0.625rem;
}
.lg-key {
  margin-left: auto;
}

/* Five challenges */
.challenge-head {
  margin-top: 88px;
  display: grid;
  gap: 14px;
  max-width: 640px;
}
.challenge-head h3 {
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  letter-spacing: -0.04em;
  line-height: 1.15;
}
.challenge-list {
  list-style: none;
  margin: 36px 0 0;
  padding: 0;
  border-top: 1px solid var(--border);
}
.challenge {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr) minmax(0, 0.85fr);
  gap: 40px;
  padding: 30px 0;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 32px;
}
.challenge:target {
  background: linear-gradient(90deg, var(--pressure-soft), transparent 60%);
}
.challenge-title {
  display: grid;
  grid-template-columns: 38px 1fr;
  align-content: start;
  gap: 6px 14px;
}
.challenge-num {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--pressure);
  color: #1a1208;
  font: 700 0.6875rem/1 var(--mono);
}
.challenge-title h4 {
  margin: 0;
  color: var(--foreground);
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.25;
}
.challenge-where {
  color: var(--pressure);
  font: 500 0.6875rem/1.6 var(--mono);
  letter-spacing: 0.04em;
}
.challenge-body {
  display: grid;
  gap: 14px;
}
.challenge-body > p:first-child {
  color: var(--body);
}
.challenge-example {
  padding: 14px 16px;
  border-left: 2px solid #e8b27d80;
  background: #ffffff05;
  font-size: 0.875rem;
  line-height: 1.6;
}
.challenge-example span {
  display: block;
  margin-bottom: 4px;
  color: var(--pressure);
  font: 500 0.625rem/1.6 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.challenge-answer {
  align-self: start;
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--body);
  font-size: 0.9375rem;
  line-height: 1.5;
  transition: border-color 160ms ease, color 160ms ease;
}
.challenge-answer span {
  display: block;
  margin-bottom: 6px;
  color: var(--ice);
  font: 500 0.625rem/1.6 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.challenge-answer b {
  color: var(--ice);
  font-weight: 400;
  margin-left: 4px;
}
.challenge-answer:hover {
  border-color: #40536b;
  color: var(--foreground);
}
.lifecycle-note {
  margin-top: 28px;
  max-width: 760px;
  font: 0.6875rem/1.7 var(--mono);
  letter-spacing: 0.02em;
}

/* Origination A: link to the Discover map tool screen */
.lc-tool-link {
  cursor: pointer;
}
.lc-tool-hit {
  fill: transparent;
  stroke: transparent;
  transition: fill 160ms ease, stroke 160ms ease;
}
.lc-tool-link:hover .lc-tool-hit,
.lc-tool-link:focus-visible .lc-tool-hit {
  fill: #a0c3ec14;
  stroke: #a0c3ec66;
}
.lc-tool-link:focus-visible {
  outline: none;
}
.lc-tool-pill {
  fill: #a0c3ec1f;
  stroke: #a0c3ec80;
}
.lc-tool-link .lc-tool-pill-text {
  fill: var(--ice);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

/* Marker popover */
.lc-marker {
  cursor: pointer;
}
.lc-marker.is-open circle {
  r: 16;
  stroke: var(--foreground);
  stroke-width: 2;
}
.lc-pop {
  position: absolute;
  z-index: 5;
  width: min(420px, calc(100% - 32px));
  max-height: min(520px, 80vh);
  overflow-y: auto;
  padding: 16px 20px 20px;
  border: 1px solid #e8b27d66;
  border-radius: 12px;
  background: #11141b;
  box-shadow: 0 24px 60px #000000b3;
}
.lc-pop[hidden] {
  display: none;
}
.lc-pop-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.lc-pop-count {
  color: var(--muted);
  font: 500 0.625rem/1.6 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.lc-pop-nav {
  display: flex;
  gap: 6px;
}
.lc-pop-nav button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--body);
  font: 0.875rem/1 var(--mono);
  cursor: pointer;
}
.lc-pop-nav button:hover {
  border-color: #40536b;
  color: var(--foreground);
}
.lc-pop-content {
  display: grid;
  gap: 16px;
}
.lc-pop-content:focus,
.lc-pop-content:focus-visible {
  outline: none;
}
.lc-pop .challenge-body > p:first-child {
  font-size: 0.9375rem;
  line-height: 1.6;
}
.lc-pop .challenge-title h4 {
  font-size: 1.15rem;
}

@media (max-width: 1100px) {
  .challenge {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr);
    gap: 24px 36px;
  }
  .challenge-answer {
    grid-column: 2;
  }
}
@media (max-width: 760px) {
  .lifecycle-stats {
    grid-template-columns: 1fr 1fr;
  }
  .lifecycle-stats div:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }
  .lifecycle-stats div:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }
  .lifecycle-stats dd {
    font-size: 1.85rem;
  }
  .lifecycle-map {
    margin-top: 40px;
    padding: 18px 16px;
  }
  .lifecycle-map-head {
    flex-direction: column;
    gap: 4px;
  }
  .lifecycle-scroll-hint {
    display: block;
  }
  .lg-key {
    margin-left: 0;
  }
  .challenge-head {
    margin-top: 64px;
  }
  .challenge {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .challenge-answer {
    grid-column: auto;
  }
  .lc-pop {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    top: auto;
    width: auto;
    max-height: 72vh;
  }
}
@media (prefers-reduced-motion: reduce) {
  .lc-marker circle,
  .challenge-answer {
    transition: none;
  }
}
@media print {
  .lc-pop {
    display: none !important;
  }
  :root {
    --pressure: #9a5b1c;
    --pressure-soft: #9a5b1c14;
  }
  .lifecycle-map {
    background: none;
    break-inside: avoid;
  }
  .lifecycle-scroll {
    overflow: visible;
  }
  .lifecycle-svg {
    min-width: 0;
  }
  .lc-bar-label,
  .lc-marker text,
  .challenge-num,
  .lg-marker {
    fill: #fff;
    color: #fff;
  }
  .challenge {
    break-inside: avoid;
  }
}
