/* Lailara design system tokens */
:root {
  --canvas: #f5f3ee;
  --text-primary: #333333;
  --text-secondary: #595959;
  --gridline: #d9d9d9;
  --reference: #666666;
  --ink: #0d0d0d;
  --navy: #1f2e7a;
  --navy-hover: #141e52;
  --navy-light: #8e9ad0;
  --red: #cc100a;
  --hk-35: #158f75;
  --hk-55: #35b595;
  --hk-70: #6dcdb5;
  --sg-55: #ee8a2a;
  --tokyo-40: #b82d4a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--canvas);
  color: var(--text-primary);
  font-family: 'Source Sans 3', 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

.site-header {
  padding: 24px;
  border-bottom: 1px solid var(--gridline);
}

.brand-name {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.brand-subtitle {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.content {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 24px;
}

.hook, .interactive, .evidence {
  margin-bottom: 60px;
}

.chart-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 24px;
}

.scenario-switcher {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.scenario-btn {
  background: transparent;
  border: 1px solid var(--gridline);
  border-radius: 2px;
  padding: 8px 16px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.scenario-btn.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.blast-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
}

#graph-container {
  position: relative;
  background: #fff;
  border: 1px solid var(--gridline);
  border-radius: 2px;
  min-height: 520px;
  overflow: hidden;
}

#scope-panel {
  background: #1a1a1a;
  border-radius: 2px;
  padding: 24px;
  color: #fff;
  position: sticky;
  top: 24px;
}

/* ── Scenario description ── */
.scenario-desc {
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--gridline);
  border-radius: 2px;
}
.scenario-desc__badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 10px;
}
.scenario-desc__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.scenario-desc__text {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── Graph legend ── */
.graph-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 10px 14px;
  border-top: 1px solid var(--gridline);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 11px;
  color: var(--text-secondary);
}
.graph-legend__item {
  display: flex;
  align-items: center;
  gap: 5px;
}
.graph-legend__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Pin card ── */
.pin-card {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 200px;
  background: #1a1a1a;
  border-radius: 2px;
  padding: 14px 16px;
  font-family: 'Source Sans 3', sans-serif;
  z-index: 10;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.pin-card--hidden { display: none; }
.pin-card__close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: #9a9a9a;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.pin-card__close:hover { color: #fff; }
.pin-card__type {
  font-size: 10px;
  font-weight: 600;
  color: #9a9a9a;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.pin-card__id {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  word-break: break-all;
  margin-bottom: 4px;
}
.pin-card__label {
  font-size: 12px;
  color: #d8d8d8;
  margin-bottom: 4px;
}
.pin-card__depth {
  font-size: 11px;
  color: #9a9a9a;
  margin-top: 2px;
}

/* ── Scope panel additions ── */
.scope-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9a9a9a;
  margin-bottom: 14px;
  font-family: 'Source Sans 3', sans-serif;
}
.scope-headline {
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  font-family: 'Playfair Display', Georgia, serif;
  letter-spacing: -0.02em;
  line-height: 1;
}
.scope-sub {
  font-size: 13px;
  color: #d8d8d8;
  margin-top: 4px;
  margin-bottom: 12px;
  font-family: 'Source Sans 3', sans-serif;
}
.scope-sold-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
  font-family: 'Source Sans 3', sans-serif;
}
.scope-sold-num {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}
.scope-sold-pct {
  font-size: 11px;
  color: #9a9a9a;
}
.scope-bar {
  background: #333;
  border-radius: 2px;
  height: 4px;
  margin-bottom: 14px;
  overflow: hidden;
}
.scope-bar__fill {
  background: var(--hk-35);
  height: 100%;
  transition: width 250ms ease-out;
}
.scope-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.10);
  margin: 12px 0;
}
.scope-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #d8d8d8;
  font-family: 'Source Sans 3', sans-serif;
}
.scope-cost-label {
  font-size: 11px;
  color: #9a9a9a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
  font-family: 'Source Sans 3', sans-serif;
}
.scope-cost {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  font-family: 'Playfair Display', Georgia, serif;
}
.scope-notify-label {
  font-size: 11px;
  color: #9a9a9a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  font-family: 'Source Sans 3', sans-serif;
}
.scope-retailer {
  font-size: 13px;
  color: #ededed;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-family: 'Source Sans 3', sans-serif;
}
.scope-retailer:last-child { border-bottom: none; }

/* ── Hook section ── */
.hook-body {
  font-size: 17px;
  max-width: 660px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 28px;
}
.hook-stat {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 64px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
}
.hook-stat-label {
  font-size: 15px;
  color: var(--text-secondary);
  margin-top: 6px;
  margin-bottom: 24px;
}
.hook-insight {
  font-size: 15px;
  color: var(--text-secondary);
  border-left: 3px solid var(--gridline);
  padding-left: 16px;
  max-width: 600px;
  line-height: 1.6;
}

/* ── Graph loading / error states ── */
.graph-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  font-size: 14px;
  color: var(--text-secondary);
}
.graph-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  font-size: 14px;
  color: var(--red);
  text-align: center;
  padding: 32px;
  gap: 8px;
}
.graph-error small {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ── Narrative section ── */
.narrative {
  margin-bottom: 60px;
}
.narrative-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 40px;
}
.narrative-body {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}
.narrative-insight {
  font-size: 15px;
  color: var(--text-secondary);
  border-left: 3px solid var(--gridline);
  padding-left: 16px;
  line-height: 1.6;
}

/* ── Margin math ── */
.margin-math {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  background: #fff;
  border: 1px solid var(--gridline);
  border-radius: 2px;
  padding: 28px 32px;
}
.margin-math__label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.margin-math__value {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 6px;
}
.margin-math__sub {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.margin-math__divider {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 0 8px;
}

/* ── Evidence section ── */
.evidence-block {
  margin-bottom: 56px;
}
.evidence-intro {
  font-size: 16px;
  max-width: 660px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 28px;
}
.evidence-footnote {
  font-size: 11px;
  color: var(--reference);
  font-style: italic;
  line-height: 1.5;
  margin-top: 16px;
  border-top: 1px solid var(--gridline);
  padding-top: 12px;
}

/* ── KDE/CTE table ── */
.kde-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--gridline);
  border-radius: 2px;
}
.kde-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 13px;
}
.kde-table th {
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.kde-table td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--gridline);
  color: var(--text-primary);
  vertical-align: middle;
}
.kde-table tr:last-child td {
  border-bottom: none;
}
.kde-table__group-header td {
  background: #f0efea;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  padding: 8px 14px;
}
.kde-table code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  background: #f0efea;
  padding: 1px 5px;
  border-radius: 2px;
  color: var(--navy);
}
.kde-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.kde-status--pass {
  background: #e4f5f0;
  color: #0e6e5a;
}
.kde-status--warn {
  background: #fdeee0;
  color: #7a3d10;
}

/* ── Readiness checklist ── */
.checklist {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--gridline);
  border-radius: 2px;
  overflow: hidden;
}
.checklist-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  border-bottom: 1px solid var(--gridline);
  background: #fff;
}
.checklist-item:last-child {
  border-bottom: none;
}
.checklist-item:nth-child(even) {
  background: #fafaf8;
}
.checklist-num {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 16px 12px 16px 16px;
  border-right: 1px solid var(--gridline);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  line-height: 1.4;
}
.checklist-content {
  padding: 14px 16px;
}
.checklist-q {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 5px;
  line-height: 1.4;
}
.checklist-detail {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── Mobile ── */
@media (max-width: 640px) {
  .blast-layout { grid-template-columns: 1fr; }
  #scope-panel { position: static; }
  .narrative-cols { grid-template-columns: 1fr; gap: 0; }
  .margin-math {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 20px;
  }
  .margin-math__divider { padding: 4px 0; }
  .content { padding: 32px 16px; }
  .brand-name { font-size: 20px; }
  .chart-title { font-size: 18px; }
  #graph-container svg { height: 380px !important; }
  .pin-card { width: 160px; top: 8px; right: 8px; }
}
