/* ============================================================
   Layer 2 deep-dive pages — scrollable prose with structured callouts
   Same Inter typography & palette as Layer 1, A4-friendly content width.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #F4F5F7;
  --paper: #FFFFFF;
  --ink: #0A0A0F;
  --ink2: #1F2128;
  --blue: #1E5DEB;
  --cyan: #5BC8FF;
  --tint: #E6EEFE;
  --grey1: #5A5F6A;
  --grey2: #6B7180;
  --grey3: #9CA1AB;
  --grey4: #A6ABB6;
  --line1: #D9DCE3;
  --line2: #E4E6EC;
  --line3: #F0F1F4;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "tnum";
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: none; color: var(--ink); }

/* ---------- Page chrome ---------- */

.l2-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--ink);
  color: white;
  padding: 14px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 500;
}
.l2-topbar a { color: var(--cyan); font-weight: 600; }
.l2-topbar .crumb { color: var(--grey4); }
.l2-topbar .crumb b { color: white; font-weight: 700; margin-left: 8px; }

.l2-page {
  max-width: 920px;
  margin: 0 auto;
  padding: 56px 56px 96px;
  background: var(--paper);
  min-height: calc(100vh - 50px);
  box-shadow: 0 0 0 1px var(--line2);
}

.l2-eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--blue);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.l2-title {
  font-size: 48px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  color: var(--ink);
}

.l2-lede {
  font-size: 21px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--grey1);
  margin: 0 0 36px;
}

.l2-section {
  margin: 40px 0 0;
}
.l2-section h2 {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 12px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.l2-section h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 24px 0 8px;
  color: var(--ink);
}
.l2-section p {
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink2);
  margin: 0 0 14px;
}
.l2-section ul, .l2-section ol {
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink2);
  margin: 0 0 18px;
  padding-left: 22px;
}
.l2-section li { margin-bottom: 6px; }
.l2-section li::marker { color: var(--blue); }

/* ---------- Building blocks ---------- */

.callout {
  background: var(--tint);
  border-left: 4px solid var(--blue);
  border-radius: 0 10px 10px 0;
  padding: 18px 22px;
  margin: 22px 0;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
}
.callout .lbl {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 6px;
}

.callout-dark {
  background: var(--ink);
  color: white;
  border-radius: 12px;
  padding: 22px 26px;
  margin: 26px 0;
  font-size: 16px;
  line-height: 1.55;
}
.callout-dark .lbl {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 6px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 22px 0;
}
.metric-card {
  background: var(--bg);
  border: 1px solid var(--line2);
  border-radius: 12px;
  padding: 18px 20px;
}
.metric-card .num {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
}
.metric-card .lab {
  font-size: 13px;
  color: var(--grey1);
  margin-top: 8px;
}

table.l2 {
  width: 100%;
  border-collapse: collapse;
  margin: 22px 0;
  font-size: 15px;
}
table.l2 thead th {
  text-align: left;
  background: var(--ink);
  color: white;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
table.l2 thead th:first-child { border-radius: 10px 0 0 0; }
table.l2 thead th:last-child { border-radius: 0 10px 0 0; }
table.l2 tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line2);
  vertical-align: top;
  line-height: 1.5;
  color: var(--ink2);
}
table.l2 tbody tr:last-child td { border-bottom: none; }
table.l2 tbody td.num { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
table.l2 tbody tr:hover { background: var(--line3); }

.formula {
  background: var(--ink);
  color: white;
  border-radius: 12px;
  padding: 22px 26px;
  font-size: 18px;
  font-weight: 500;
  margin: 22px 0;
  text-align: center;
  line-height: 1.5;
}
.formula b { color: var(--cyan); }

.peer-links {
  margin: 60px 0 0;
  padding: 24px 0 0;
  border-top: 1px solid var(--line2);
}
.peer-links h4 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--grey3);
  text-transform: uppercase;
  margin: 0 0 14px;
}
.peer-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}
.peer-links li a {
  display: block;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--line2);
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
}
.peer-links li a:hover { background: var(--tint); border-color: var(--blue); text-decoration: none; }

.l2-foot {
  text-align: center;
  padding: 36px 0;
  font-size: 13px;
  color: var(--grey3);
}

/* ============================================================
   MOBILE Layer 2
   ============================================================ */
@media (max-width: 720px) {
  .l2-topbar {
    padding: 12px 16px;
    font-size: 12px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .l2-topbar .crumb { display: none; }
  .l2-topbar a { font-size: 13px; }
  .l2-topbar > span { font-size: 11px; opacity: .7; }

  .l2-page {
    padding: 28px 18px 56px;
    box-shadow: none;
  }
  .l2-title { font-size: 30px; line-height: 1.15; }
  .l2-lede { font-size: 17px; line-height: 1.5; margin-bottom: 24px; }

  .l2-section { margin-top: 32px; }
  .l2-section h2 { font-size: 22px; }
  .l2-section h3 { font-size: 17px; }
  .l2-section p, .l2-section ul, .l2-section ol { font-size: 15px; line-height: 1.6; }

  /* tables: wrap in horizontal scroll */
  table.l2 {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  table.l2 thead th, table.l2 tbody td { white-space: normal; font-size: 13px; padding: 10px 12px; }

  .metric-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { padding: 14px 16px; }
  .metric-card .num { font-size: 28px; }
  .metric-card .lab { font-size: 12px; }

  .callout, .callout-dark { padding: 14px 16px; font-size: 14px; margin: 16px 0; }

  .formula { font-size: 15px; padding: 16px; }

  .peer-links ul { grid-template-columns: 1fr; }
  .peer-links li a { font-size: 14px; padding: 10px 14px; }
}

@media (max-width: 480px) {
  .l2-page { padding: 22px 14px 44px; }
  .l2-title { font-size: 26px; }
  .metric-row { grid-template-columns: 1fr; }
}

/* sample-frame donut block: stack vertically on mobile */
@media (max-width: 720px) {
  .donut-block { grid-template-columns: 1fr !important; gap: 18px !important; padding: 20px !important; }
  .donut-block svg { width: 200px !important; height: 200px !important; margin: 0 auto; }
}
