/* Report-specific styles, building on Superscript design system */

:root {
  --report-max: 1280px;
  --content-max: 760px;
  --sidebar-w: 240px;
  --good: #01CE91;
  --bad:  #FF426F;
  --warn: #FF8B4A;
}

html { scroll-behavior: smooth; }
body { background: var(--ss-paper); }

/* Anchor offsets for sticky-aware scroll */
section[id] { scroll-margin-top: 0; }

/* ---------- Layout ---------- */
.report-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}
@media (max-width: 960px) {
  .report-shell { grid-template-columns: 1fr; }
}

/* ---------- Sidebar nav ---------- */
.sidenav {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--ss-grey-5);
  padding: 24px 20px 24px 24px;
  background: var(--ss-paper);
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}
.sidenav__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: -0.03em;
  color: var(--ss-black);
  text-decoration: none;
  margin-bottom: 8px;
}
.sidenav__brand img { height: 16px; }
.sidenav__title {
  font-family: var(--font-display);
  font-weight: 350;
  font-size: 18px;
  line-height: 1.07;
  letter-spacing: -0.02em;
  color: var(--ss-black);
  margin: 0 0 8px;
}
.sidenav__list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.sidenav__link {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  padding: 6px 0;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: -0.02em;
  color: var(--ss-grey-2);
  text-decoration: none;
  border-top: 1px solid transparent;
  border-bottom: 1px solid transparent;
  transition: color 120ms ease;
}
.sidenav__link span:first-child { color: var(--ss-grey-3); }
.sidenav__link:hover { color: var(--ss-black); }
.sidenav__link.is-active { color: var(--ss-blue); }
.sidenav__link.is-active span:first-child { color: var(--ss-blue); }
.sidenav__foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--ss-grey-4);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 9px;
  letter-spacing: -0.02em;
  color: var(--ss-grey-3);
  line-height: 1.5;
}
@media (max-width: 960px) {
  .sidenav { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--ss-black); }
}

/* ---------- Main column ---------- */
.report-main { min-width: 0; }
.section {
  padding: 24px 64px 48px;
  border-bottom: 1px solid var(--ss-black);
  position: relative;
  max-width: var(--dbg-section-w, none);
}
.section:last-child { border-bottom: none; }
@media (max-width: 720px) {
  .section { padding: 48px 24px; }
}

.section__chrome {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: -0.02em;
  color: var(--ss-blue);
  margin-bottom: 20px;
  border-bottom: 1px solid var(--ss-black);
  padding-bottom: 12px;
}
.section__chrome .right { color: var(--ss-grey-3); }

.section__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--dbg-section-title, clamp(36px, 4.5vw, 56px));
  line-height: 0.92;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
  max-width: 1000px;
}
.section__title em { font-style: italic; color: var(--ss-blue); }
.section__lede {
  font-family: var(--font-display);
  font-weight: 350;
  font-size: var(--dbg-body-size, 15px);
  line-height: 1.35;
  letter-spacing: -0.02em;
  max-width: 720px;
  color: var(--ss-grey-1);
  margin: 0 0 24px;
}
.section__body {
  max-width: 720px;
  font-size: var(--dbg-body-size, 17px);
  line-height: 1.55;
  letter-spacing: -0.005em;
  color: var(--ss-grey-1);
}
.section__body p { margin: 0 0 16px; }
.section__body p:last-child { margin-bottom: 0; }
.section__body strong { color: var(--ss-black); font-weight: 600; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 40px 64px 96px;
  overflow: hidden;
  border-bottom: 1px solid var(--ss-black);
  background: var(--ss-paper);
}
.hero__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right,  rgba(0,163,255,0.10) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0,163,255,0.10) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
}
.hero__inner { position: relative; }
.hero__chyron {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: -0.02em;
  color: var(--ss-blue);
  margin-bottom: 32px;
  border-bottom: 1px dashed var(--ss-blue);
  padding-bottom: 12px;
}
.hero__chyron .right { color: var(--ss-grey-2); display: flex; gap: 24px; }
.hero__eyebrow {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: -0.02em;
  color: var(--ss-blue);
  margin-bottom: 16px;
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(44px, 7vw, 110px);
  line-height: 0.88;
  letter-spacing: -0.03em;
  margin: 0;
  max-width: 1500px;
}
.hero__title em { font-style: italic; color: var(--ss-blue); }
.hero__sub {
  margin-top: 32px;
  font-family: var(--font-display);
  font-weight: 350;
  font-size: clamp(15px, 1.2vw, 18px);
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--ss-grey-1);
  max-width: 760px;
}
.hero__counter {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.hero__counter-label {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: -0.02em;
  color: var(--ss-grey-2);
  margin-bottom: 12px;
}
.hero__counter-value {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(72px, 14vw, 200px);
  line-height: 0.85;
  letter-spacing: -0.04em;
  color: var(--ss-blue);
  font-variant-numeric: tabular-nums;
  margin-bottom: 12px;
}
.hero__counter-note {
  font-family: var(--font-display);
  font-weight: 350;
  font-style: italic;
  font-size: 18px;
  line-height: 1.3;
  color: var(--ss-grey-1);
  max-width: 560px;
  margin-top: 16px;
}
.hero__meta {
  margin-top: 32px;
  border-top: 1px solid var(--ss-black);
  padding-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.hero__meta-cell .k {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: -0.02em;
  color: var(--ss-grey-2);
  margin-bottom: 8px;
}
.hero__meta-cell .v {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 720px) {
  .hero { padding: 48px 24px 64px; }
  .hero__meta { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Stats / pull quotes ---------- */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--ss-black);
  margin: 32px 0;
}
.stat-strip__cell {
  padding: 20px;
  border-right: 1px solid var(--ss-black);
}
.stat-strip__cell:last-child { border-right: none; }
.stat-strip__k {
  font-family: var(--font-mono); font-weight: 700; font-size: 10px;
  letter-spacing: -0.02em; color: var(--ss-grey-2); margin-bottom: 12px;
  text-transform: uppercase;
}
.stat-strip__v {
  font-family: var(--font-display); font-weight: 350; font-size: var(--dbg-stat-value, 36px);
  line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
}
.stat-strip__sub {
  font-family: var(--font-mono); font-weight: 700; font-size: 10px;
  letter-spacing: -0.02em; color: var(--ss-grey-2); margin-top: 8px;
}
@media (max-width: 720px) {
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .stat-strip__cell:nth-child(2) { border-right: none; }
  .stat-strip__cell:nth-child(1), .stat-strip__cell:nth-child(2) { border-bottom: 1px solid var(--ss-black); }
}

.pullquote {
  margin: 16px 0;
  padding: 20px 24px;
  border-left: 3px solid var(--ss-blue);
  background: var(--ss-white);
  font-family: var(--font-display);
  font-weight: 350;
  font-size: 22px;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--ss-black);
  max-width: 880px;
}
.pullquote em { color: var(--ss-blue); font-style: italic; }

/* ---------- Tables ---------- */
.tbl-wrap {
  border: 1px solid var(--ss-black);
  margin: 24px 0;
  overflow-x: auto;
  background: var(--ss-white);
}
table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.tbl th, .tbl td {
  text-align: right;
  padding: 10px 12px;
  border-bottom: 1px solid var(--ss-grey-5);
  white-space: nowrap;
}
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl thead th {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: -0.02em;
  color: var(--ss-grey-2);
  border-bottom: 1px solid var(--ss-black);
  background: var(--ss-paper);
  position: sticky;
  top: 0;
}
.tbl tbody tr:nth-child(even) { background: var(--ss-paper); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .num { font-feature-settings: "tnum"; }
.tbl .em { font-weight: 600; color: var(--ss-black); }
.tbl .em-blue { color: var(--ss-blue); font-weight: 600; }

/* ---------- Chart frame ---------- */
.chart {
  margin: 16px 0;
  border: 1px solid var(--ss-black);
  background: var(--ss-white);
}
.chart__head {
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--ss-black);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}
.chart__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--dbg-chart-title, 18px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.chart__id {
  font-family: var(--font-mono); font-weight: 700; font-size: 10px;
  letter-spacing: -0.02em; color: var(--ss-blue);
}
.chart__sub {
  font-family: var(--font-mono); font-weight: 700; font-size: 10px;
  letter-spacing: -0.02em; color: var(--ss-grey-2);
}
.chart__body { padding: var(--dbg-chart-pad, 20px); min-height: 120px; }
.chart__legend {
  display: flex; flex-wrap: wrap; gap: 16px;
  font-family: var(--font-mono); font-weight: 700; font-size: 10px;
  letter-spacing: -0.02em; color: var(--ss-grey-1);
  padding: 0 20px 16px;
}
.chart__legend .swatch {
  display: inline-block; width: 14px; height: 8px; margin-right: 6px; vertical-align: middle;
}
.chart__note {
  border-top: 1px solid var(--ss-grey-5);
  padding: 12px 18px;
  font-family: var(--font-mono); font-weight: 700; font-size: 10px;
  letter-spacing: -0.02em; color: var(--ss-grey-2);
}

/* ---------- Two-column blocks ---------- */
.cols-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0;
}
@media (max-width: 720px) { .cols-2 { grid-template-columns: 1fr; } }

/* ---------- Takeaway cards ---------- */
.takeaways {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 32px;
}
@media (max-width: 720px) { .takeaways { grid-template-columns: 1fr; } }
.takeaway-col__head {
  font-family: var(--font-mono); font-weight: 700; font-size: 11px;
  letter-spacing: -0.02em; color: var(--ss-blue);
  padding-bottom: 12px; border-bottom: 1px solid var(--ss-black); margin-bottom: 12px;
}
.takeaway {
  padding: 20px;
  border: 1px solid var(--ss-black);
  background: var(--ss-white);
  margin-bottom: 8px;
}
.takeaway__index {
  font-family: var(--font-mono); font-weight: 700; font-size: 11px;
  letter-spacing: -0.02em; color: var(--ss-blue); margin-bottom: 12px;
}
.takeaway__title {
  font-family: var(--font-display); font-weight: 400; font-size: 22px;
  line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 12px;
}
.takeaway__body {
  font-size: 14px; line-height: 1.45; color: var(--ss-grey-1);
}

/* ---------- Footer chyron ---------- */
.footer-tape {
  background: var(--ss-black);
  color: var(--ss-white);
  padding: 24px 64px;
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono); font-weight: 700; font-size: 11px;
  letter-spacing: -0.02em;
}
.footer-tape__logo img { height: 18px; filter: invert(1); }
.footer-tape a { color: var(--ss-blue-light); text-decoration: none; }
@media (max-width: 720px) { .footer-tape { padding: 24px; } }

/* ---------- Counter animation root ---------- */
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- Reveal-on-scroll ---------- */
.reveal { opacity: 0; transform: translateY(8px); transition: opacity 600ms ease, transform 600ms ease; }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- Annotations on charts ---------- */
.annot {
  font-family: var(--font-mono); font-weight: 700; font-size: 10px;
  letter-spacing: -0.02em; fill: var(--ss-grey-1);
}
.annot--blue { fill: var(--ss-blue); }
.annot--alert { fill: var(--ss-red); }
.axis-label, text.axis {
  font-family: var(--font-mono); font-weight: 700; font-size: 10px;
  letter-spacing: -0.02em; fill: var(--ss-grey-2);
}

/* ---------- Highlight inline ---------- */
.hl-blue { color: var(--ss-blue); font-weight: 600; }
.hl-red  { color: var(--ss-red);  font-weight: 600; }
.hl-green { color: var(--ss-green); font-weight: 600; }

/* ============================================================
   MOBILE PHONE RULES (<=480px)
   The 720px breakpoint covers tablets; phones need tighter
   table behavior and a visible scroll affordance so wide
   content-heavy tables don't disappear off-screen.
   ============================================================ */
@media (max-width: 480px) {
  /* Allow table cells to wrap so the methodology + comparison
     tables fit without forcing a 600px scroll region. */
  .tbl th, .tbl td {
    white-space: normal;
    padding: 8px 10px;
    font-size: 12px;
    word-break: break-word;
  }
  .tbl thead th {
    font-size: 9px;
    padding: 8px 10px;
  }
  table.tbl { font-size: 12px; }

  /* For tables that still overflow (long code refs, dense
     numeric columns), provide a visible scroll-hint gradient
     on the right edge of the wrapper. */
  .tbl-wrap {
    position: relative;
    -webkit-overflow-scrolling: touch;
  }
  .tbl-wrap::after {
    content: "";
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 24px;
    background: linear-gradient(to right, rgba(255,255,255,0), var(--ss-white));
    pointer-events: none;
    opacity: 0.85;
  }

  /* Inline code refs in tables (e.g., prod_core.base_athena)
     are the main width offender; let them wrap on word boundaries. */
  .tbl code {
    word-break: break-all;
    font-size: 11px;
  }

  /* Section body code refs too. */
  .section__body code {
    word-break: break-all;
  }
}

