:root {
  --bg: #ffffff;
  --paper: #ffffff;
  --surface: #f6faf7;
  --border: #d9d9d9;
  --ink: #000000;
  --ink-2: #333333;
  --ink-3: #6e6e6e;
  --brand: #00875a;
  --brand-soft: #eaf6ee;
  --orange: #ed5b2c;
  --green: #00875a;
  --amber: #b15c00;
  --teal: #0c6fa6;
  --pink: #b8326b;
  --sans: "OpenAI Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: var(--sans);
  --max-w: 1120px;
  --article-w: 760px;
  --radius: 8px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

strong {
  color: var(--ink);
  font-weight: 700;
}

code {
  font-family: var(--sans);
  font-size: 0.92em;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
}

.accent {
  color: var(--brand);
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

.nav-inner {
  max-width: var(--max-w);
  height: 64px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  flex: 0 0 auto;
}

.nav-logo {
  width: 25px;
  height: 25px;
  object-fit: contain;
  flex: 0 0 auto;
}

.nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
}

.nav-link {
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
  padding: 5px 9px;
  border-radius: 5px;
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover {
  color: var(--ink);
  background: var(--surface);
}

.hero {
  max-width: var(--article-w);
  margin: 0 auto;
  padding: 76px 24px 56px;
  text-align: left;
}

.hero-logo {
  display: block;
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin: 0 0 26px;
}

.hero-title {
  margin: 0 0 18px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(56px, 8vw, 88px);
  line-height: 0.96;
  font-weight: 600;
  letter-spacing: -0.035em;
}

.hero-subtitle {
  margin: 0 0 26px;
  max-width: 680px;
  color: var(--ink);
  font-size: 27px;
  line-height: 1.2;
  font-weight: 400;
}

.hero-authors {
  margin: 0 0 18px;
  max-width: var(--article-w);
  color: var(--ink-3);
  display: flex;
  justify-content: flex-start;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 15px;
  line-height: 1.45;
}

.hero-actions {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 32px;
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--ink);
  background: #f2f2f2;
  border: 0;
  border-radius: 999px;
  min-height: 31px;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
  transition: background 0.15s ease;
}

.external-arrow {
  font-size: 17px;
  line-height: 0.7;
  transform: translateY(-0.5px);
}

.action-button:hover {
  background: #e9e9e9;
}

.hero-authors > span:not(.hero-affiliation) {
  color: var(--ink);
  font-weight: 500;
}

.author-link,
.author-link:visited {
  color: var(--ink);
  border-bottom: 1px dotted rgba(0, 0, 0, 0.65);
}

.author-link:hover {
  border-bottom-color: var(--ink);
}

.text-link,
.text-link:visited {
  color: var(--ink);
  border-bottom: 1px dotted rgba(0, 0, 0, 0.65);
}

.text-link:hover {
  border-bottom-color: var(--ink);
}

.hero-affiliation {
  flex-basis: 100%;
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 14px;
}

.tldr {
  max-width: var(--article-w);
  margin: 0;
  text-align: left;
  background: transparent;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 22px 0;
}

.tldr ul {
  margin: 8px 0 0;
  padding-left: 19px;
}

.tldr li + li {
  margin-top: 8px;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px 88px;
}

.section-header {
  max-width: var(--article-w);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto 22px;
}

.section-label {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(34px, 4.8vw, 52px);
  line-height: 1.03;
  font-weight: 600;
  letter-spacing: -0.025em;
  text-transform: none;
}

.section-note {
  color: var(--ink-3);
  font-size: 14px;
  text-align: right;
}

.chart-panel,
.figure-block,
.image-figure {
  background: var(--paper);
  border: 0;
  border-radius: 0;
}

.chart-panel {
  margin: 0;
  padding: 0;
}

.cash-plot {
  position: relative;
  width: 100%;
  min-height: 0;
}

.cash-plot svg {
  display: block;
  width: 100%;
  height: auto;
}

.plot-tooltip {
  position: absolute;
  top: 18px;
  left: 18px;
  min-width: 210px;
  max-width: 300px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--border);
  border-radius: 7px;
  box-shadow: 0 12px 28px rgba(10, 37, 64, 0.14);
  color: var(--ink);
  pointer-events: none;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.12s, transform 0.12s;
}

.plot-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.tooltip-day {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.tooltip-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  font-size: 12px;
  line-height: 1.35;
}

.tooltip-row + .tooltip-row {
  margin-top: 4px;
}

.tooltip-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.tooltip-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tooltip-value {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.cash-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 10px 2px 0;
  color: var(--ink-3);
  font-size: 13px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.narrative {
  padding-top: 10px;
}

.prose {
  max-width: var(--article-w);
  margin: 0 auto 34px;
}

.prose h3 {
  margin: 46px 0 16px;
  color: var(--ink);
  font-size: 30px;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.prose p,
.prose ol {
  color: var(--ink);
  margin: 0 0 20px;
  font-size: 19px;
  line-height: 1.55;
}

.prose ol {
  padding-left: 22px;
}

.prose .core-skills-list {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 22px 16px 42px;
}

.core-skills-list li + li {
  margin-top: 6px;
}

.example-label {
  display: block;
  margin-bottom: 3px;
}

.image-figure {
  overflow: hidden;
  margin: 36px auto 56px;
}

.image-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.apple-figure {
  max-width: 860px;
}

.figure-block {
  overflow: visible;
  margin: 42px auto 64px;
}

.figure-block.teaser-block {
  margin-bottom: 18px;
}

.fig-caption {
  position: relative;
  z-index: 2;
  color: var(--ink-3);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  margin: 4px 0 0;
}

.chart-panel .fig-caption {
  margin-top: 8px;
}

.frame-wrap + .fig-caption {
  margin-top: 4px;
}

.results-table-block {
  max-width: var(--max-w);
  margin: 8px auto 0;
}

.table-scroll {
  overflow-x: auto;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.results-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
}

.results-table th,
.results-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  vertical-align: top;
  white-space: nowrap;
}

.results-table thead th {
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 500;
  text-align: right;
}

.results-table th:first-child,
.results-table td:first-child {
  text-align: left;
  white-space: normal;
}

.results-table tbody th {
  font-weight: 500;
}

.citation-placeholder {
  max-width: var(--article-w);
  margin: 18px auto 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.citation-title {
  color: var(--ink-3);
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
}

.citation-placeholder pre {
  margin: 8px 0 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.results-table tbody tr:last-child th,
.results-table tbody tr:last-child td {
  border-bottom: 0;
}

.pre-estimate-row th,
.pre-estimate-row td {
  border-bottom: 0;
}

.estimate-row th,
.estimate-row td {
  border-top: 1px solid var(--ink);
  font-weight: 500;
}

.frame-wrap {
  width: 100%;
  overflow: hidden;
  background: #ffffff;
}

.frame-wrap iframe {
  display: block;
  border: 0;
  transform-origin: 0 0;
  background: #ffffff;
}

.frame-wrap.compact {
  display: block;
}

.plot-error {
  padding: 24px;
  color: var(--orange);
  font-family: var(--sans);
  font-size: 13px;
}

.details-list {
  max-width: var(--article-w);
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 18px auto 0;
}

.details-list details {
  border-top: 1px solid var(--border);
}

.details-list details:last-child {
  border-bottom: 1px solid var(--border);
}

.details-list summary {
  cursor: pointer;
  list-style: none;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 500;
  padding: 18px 0;
}

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

.details-list summary::before {
  content: "+";
  display: inline-block;
  width: 21px;
  color: var(--brand);
  font-weight: 700;
}

.details-list details[open] summary::before {
  content: "-";
}

.details-body {
  padding: 0 0 16px 21px;
  max-width: var(--article-w);
}

.details-body p {
  margin: 0 0 16px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.62;
}

.details-body ol {
  margin: 0 0 16px;
  padding-left: 22px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.62;
}

.details-body li + li {
  margin-top: 6px;
}

.details-figure {
  margin: 18px 0 22px;
}

.details-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.action-table-wrap {
  margin: 18px 0 4px;
  overflow-x: auto;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.action-space-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.28;
}

.action-space-table th,
.action-space-table td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.action-space-table thead th {
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 500;
}

.action-space-table tbody th {
  width: 22%;
  font-weight: 600;
}

.action-space-table td:nth-child(2) {
  width: 39%;
}

.action-space-table td:nth-child(3) {
  width: 39%;
}

.action-space-table tbody tr:last-child th,
.action-space-table tbody tr:last-child td {
  border-bottom: 0;
}

.action-space-table code {
  background: transparent;
  border: 0;
  padding: 0;
  font-size: inherit;
}

.two-up {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin: 32px 0 38px;
}

.two-up .figure-block {
  margin: 0;
}

.two-up .fig-caption {
  margin-bottom: 20px;
}

.if-examples {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  align-items: start;
  gap: 18px;
  margin-top: 32px;
}

.if-examples .figure-block {
  margin: 0;
}

.if-frequency {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

@media (max-width: 760px) {
  .nav-inner {
    height: 58px;
    align-items: center;
    flex-direction: row;
    gap: 8px;
    padding: 0 12px;
  }

  .nav-links {
    margin-left: auto;
    width: auto;
    overflow-x: auto;
    padding-bottom: 0;
  }

  .nav-link {
    padding-left: 6px;
    padding-right: 6px;
    white-space: nowrap;
  }

  .hero {
    padding-top: 46px;
  }

  .hero-title {
    font-size: 48px;
  }

  .hero-subtitle {
    font-size: 23px;
  }

  .section-header {
    display: block;
  }

  .section-note {
    display: block;
    text-align: left;
    margin-top: 4px;
  }

  .chart-panel {
    padding: 0;
  }

  .cash-plot {
    min-height: 0;
  }

  .plot-tooltip {
    max-width: calc(100% - 24px);
  }

  .prose h3 {
    font-size: 25px;
  }

  .if-examples {
    grid-template-columns: 1fr;
  }

  .if-frequency {
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
  }

}

.tldr .section-label {
  color: var(--ink-3);
  font-size: 14px;
  line-height: 1.2;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
