/**
 * NADIR Pitch Deck — vertical narrative, Q&A chapters, homepage-aligned magma palette
 */

body.nadir-pitch {
  font-family: var(--body);
  color: var(--text);
  background:
    radial-gradient(ellipse 60% 40% at 12% -8%, rgba(255, 90, 42, 0.1), transparent 50%),
    radial-gradient(ellipse 50% 35% at 88% 0%, rgba(255, 154, 82, 0.07), transparent 45%),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(255, 43, 43, 0.05), transparent 50%),
    #0b0c0f;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body.nadir-pitch::before,
body.nadir-pitch::after {
  pointer-events: none;
  z-index: 0;
}

html:has(body.nadir-pitch) {
  scroll-behavior: smooth;
  scroll-padding-top: 152px;
}

body.nadir-pitch .pd-wrap {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding-top: calc(var(--header-h, 72px) + 8px);
  position: relative;
  z-index: 1;
}

/* ─── Progress ─── */
.pd-progress {
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 960;
  background: rgba(255, 255, 255, 0.06);
}

.pd-progress__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--nadir-magma-600), var(--nadir-magma-300));
  transition: width 0.12s ease-out;
}

/* ─── Hero ─── */
.pd-hero {
  padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(2.5rem, 5vw, 3.5rem);
}

.pd-hero .eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--nadir-magma-300);
  margin-bottom: 1.25rem;
}

.pd-hero h1 {
  font-family: var(--display);
  font-size: clamp(2.25rem, 5.5vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 1.25rem;
  max-width: 18ch;
}

.pd-hero .pd-lead {
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  color: var(--text2);
  max-width: 62ch;
  margin-bottom: 2.5rem;
}

.pd-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 2.75rem;
}

.pd-stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--elev-shadow);
}

.pd-stat {
  background: color-mix(in srgb, var(--bg2) 94%, white 6%);
  padding: 1.35rem 1.25rem;
}

.pd-stat .k {
  font-family: var(--display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  line-height: 1;
  color: var(--nadir-magma-300);
  margin-bottom: 0.5rem;
}

.pd-stat .l {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text3);
}

/* ─── Sticky chapter nav ─── */
.pd-chapters {
  position: sticky;
  top: 78px;
  z-index: 900;
  margin-bottom: 3rem;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  background: rgba(11, 12, 15, 0.9);
  backdrop-filter: blur(18px) saturate(1.2);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.pd-chapters-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text3);
  margin-right: 8px;
}

.pd-chapter-link {
  font-family: var(--display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text2);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.pd-chapter-link:hover,
.pd-chapter-link.is-active {
  color: var(--text);
  background: rgba(249, 115, 22, 0.12);
  border-color: rgba(249, 115, 22, 0.35);
}

.pd-expand-tools {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.pd-tool-btn {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text3);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.pd-tool-btn:hover {
  color: var(--nadir-magma-300);
  border-color: rgba(249, 115, 22, 0.4);
}

/* ─── Chapters ─── */
.pd-chapter {
  scroll-margin-top: 168px;
  margin-bottom: clamp(4rem, 8vw, 6rem);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pd-chapter:last-of-type {
  border-bottom: none;
}

.pd-chapter-head {
  margin-bottom: 2rem;
}

.pd-chapter-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--nadir-magma-400);
  margin-bottom: 0.75rem;
  display: block;
}

.pd-chapter-head h2 {
  font-family: var(--display);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 0.85rem;
}

.pd-chapter-head .pd-chapter-desc {
  font-size: 1.05rem;
  color: var(--text2);
  max-width: 68ch;
  line-height: 1.7;
}

/* Insight cards row */
.pd-insights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 2rem;
}

.pd-insight {
  padding: 1.35rem 1.4rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.2));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.pd-insight strong {
  display: block;
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--nadir-magma-300);
  margin-bottom: 0.35rem;
}

.pd-insight span {
  font-size: 0.9rem;
  color: var(--text2);
  line-height: 1.55;
}

/* ─── Q&A accordion ─── */
.pd-qa-block {
  margin-top: 1.5rem;
}

.pd-qa-block > h3 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 1rem;
}

.pd-qa {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  margin-bottom: 10px;
  overflow: hidden;
  background: rgba(15, 17, 21, 0.65);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.pd-qa:hover {
  border-color: rgba(249, 115, 22, 0.22);
}

.pd-qa[open] {
  border-color: rgba(249, 115, 22, 0.35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.pd-qa summary {
  list-style: none;
  cursor: pointer;
  padding: 1.15rem 1.35rem;
  padding-right: 3rem;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  position: relative;
  user-select: none;
}

.pd-qa summary::-webkit-details-marker {
  display: none;
}

.pd-qa summary::after {
  content: "+";
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--nadir-magma-400);
  transition: transform 0.25s ease;
}

.pd-qa[open] summary::after {
  content: "−";
}

.pd-qa-body {
  padding: 0 1.35rem 1.35rem;
  color: var(--text2);
  font-size: 0.95rem;
  line-height: 1.72;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.pd-qa-body p {
  margin-bottom: 0.85rem;
}

.pd-qa-body p:last-child {
  margin-bottom: 0;
}

.pd-qa-body ul {
  list-style: none;
  margin: 0.75rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.pd-qa-body li {
  padding-left: 1.1rem;
  position: relative;
}

.pd-qa-body li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--nadir-magma-500);
}

.pd-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  margin-left: 8px;
  vertical-align: middle;
}

.pd-tag--ok { background: rgba(52, 199, 89, 0.15); color: #6cd5a0; }
.pd-tag--warn { background: rgba(255, 177, 74, 0.18); color: #f5c27a; }
.pd-tag--data { background: rgba(249, 115, 22, 0.15); color: var(--nadir-magma-300); }

/* Timeline (GTM / traction) */
.pd-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 2rem;
}

.pd-timeline-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  padding: 1.25rem 1.35rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(18, 20, 25, 0.8);
}

.pd-timeline-item .when {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--nadir-magma-300);
  letter-spacing: 0.06em;
}

.pd-timeline-item .what {
  font-size: 0.95rem;
  color: var(--text2);
  line-height: 1.65;
}

.pd-timeline-item .what strong {
  color: var(--text);
  font-weight: 600;
}

/* CTA close */
.pd-close {
  text-align: center;
  padding: 3rem 0 4rem;
}

.pd-close h2 {
  font-family: var(--display);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  margin-bottom: 1rem;
}

.pd-close p {
  color: var(--text2);
  margin-bottom: 1.5rem;
}

.pd-close-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.pd-footnote {
  text-align: center;
  font-size: 13px;
  color: var(--text3);
  padding-bottom: 2rem;
}

.pd-footnote a {
  color: var(--nadir-magma-300);
}

/* ─── Data charts (inline SVG) ─── */
.pd-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 2rem 0 2.5rem;
}

.pd-chart {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  padding: 1.25rem 1.35rem 1rem;
  background: linear-gradient(165deg, rgba(18, 20, 25, 0.95), rgba(8, 9, 11, 0.98));
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.32);
}

.pd-chart--wide {
  grid-column: 1 / -1;
}

.pd-chart h4 {
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.pd-chart .pd-chart-caption {
  font-size: 0.8rem;
  color: var(--text3);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.pd-chart svg {
  width: 100%;
  height: auto;
  display: block;
}

.pd-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 0.85rem;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text3);
}

.pd-chart-legend span::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}

.pd-legend-magma::before { background: var(--nadir-magma-500); }
.pd-legend-amber::before { background: #ffb14a; }
.pd-legend-red::before { background: #ff5a42; }
.pd-legend-muted::before { background: var(--nadir-gray-600); }

.pd-callout-danger {
  margin: 1.5rem 0 2rem;
  padding: 1.25rem 1.4rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 90, 42, 0.35);
  background: linear-gradient(135deg, rgba(219, 71, 34, 0.12), rgba(11, 12, 15, 0.9));
}

.pd-callout-danger h4 {
  font-family: var(--display);
  font-size: 1rem;
  color: var(--nadir-magma-300);
  margin-bottom: 0.5rem;
}

.pd-callout-danger p {
  font-size: 0.92rem;
  color: var(--text2);
  line-height: 1.65;
  margin-bottom: 0.5rem;
}

.pd-callout-danger p:last-child {
  margin-bottom: 0;
}

.pd-mono-layer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 1.5rem 0;
}

.pd-layer-card {
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 17, 21, 0.8);
}

.pd-layer-card strong {
  display: block;
  font-size: 0.85rem;
  color: var(--nadir-magma-300);
  margin-bottom: 0.35rem;
}

.pd-layer-card span {
  font-size: 0.82rem;
  color: var(--text3);
  line-height: 1.5;
}

/* ─── Calibration Lab embed (pitch deck) ─── */
.pd-lab-embed {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: center;
  margin: 28px 0;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 90, 42, 0.06), rgba(12, 14, 18, 0.9));
}

.pd-lab-visual {
  margin: 0;
}

.pd-lab-visual img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.pd-lab-visual figcaption {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text3);
}

.pd-lab-stats {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.pd-lab-stats li {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.85rem;
  color: var(--text2);
}

.pd-lab-copy p {
  font-size: 0.92rem;
  color: var(--text2);
  margin: 0 0 18px;
  line-height: 1.55;
}

.pd-lab-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pd-lab-video-wrap {
  margin: 0;
}

.pd-lab-video {
  width: 100%;
  max-height: 360px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #000;
}

.pd-lab-video-wrap figcaption {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text3);
}

@media (max-width: 900px) {
  .pd-lab-embed {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .pd-charts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .pd-stat-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pd-chapters {
    top: 72px;
  }

  .pd-expand-tools {
    width: 100%;
    margin-left: 0;
    margin-top: 8px;
  }

  .pd-timeline-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 560px) {
  body.nadir-pitch .pd-wrap {
    width: min(1120px, calc(100% - 24px));
  }

  .pd-stat-row {
    grid-template-columns: 1fr;
  }
}
