:root {
  --bg: #181818;
  --panel: #181818;
  --panel-solid: #181818;
  --ink: #fff;
  --muted: rgba(255, 255, 255, 0.65);
  --rule: #2f2f2f;
  --accent-down: #d73027;
  --accent-flat: rgba(255, 255, 255, 0.5);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background-color: var(--bg);
  color: var(--ink);
}

.page {
  width: min(1200px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 0 0 64px;
}

.site-header {
  margin-bottom: 3rem;
  font-weight: bold;
}

.hero {
  margin-bottom: 28px;
}

.eyebrow,
.hero h1 {
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.hero h1 {
  margin: 0;
  font-family: "SF Pro Display", sans-serif;
  font-weight: bold;
  font-size: 2rem;
  line-height: 1.1;
}

.byline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 0;
  max-width: 720px;
}

.byline-avatar {
  display: block;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--panel-solid);
  object-fit: cover;
  object-position: 35% 35%;
}

.byline-text {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
}

.byline-text a,
.byline-text a:visited {
  color: var(--ink);
  font-weight: bold;
  text-decoration: none !important;
  transition: opacity 0.3s;
}

.byline-text a:hover,
.byline-text a:focus-visible {
  color: var(--ink);
  opacity: 0.65;
  text-decoration: none !important;
}

.byline-separator {
  color: var(--muted);
}

.byline-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.follow-x {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  padding: 6px 10px 6px 7px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: bold;
  line-height: 1;
  text-decoration: none;
}

.follow-x:hover,
.follow-x:focus-visible {
  border-color: var(--ink);
  color: var(--ink);
  opacity: 1;
  text-decoration: none;
}

.dek {
  margin: 16px 0 0;
  width: 100%;
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--muted);
  column-count: 2;
  column-gap: 32px;
}

.dek p {
  margin: 0;
  break-inside: avoid;
}

.dek p + p {
  margin-top: 1rem;
}

.dek a,
.dek a:visited {
  color: var(--ink);
  font-weight: bold;
  text-decoration: none !important;
  transition: opacity 0.3s;
}

.dek a:hover,
.dek a:focus-visible {
  color: var(--ink);
  opacity: 0.65;
  text-decoration: none !important;
}

.moat-reference {
  border-radius: 4px;
  color: var(--ink);
  cursor: pointer;
  font-weight: bold;
  text-decoration: none;
  transition:
    background-color 120ms ease,
    opacity 120ms ease;
}

.moat-reference:hover,
.moat-reference:focus-visible,
.moat-reference.is-active {
  background: color-mix(in srgb, var(--ink) 12%, transparent);
  opacity: 1;
  outline: none;
  text-decoration: none;
}

.chart-shell {
  padding: 24px 22px 12px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--panel);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.chart-header {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 18px;
}

.chart-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.chart-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  font-size: 0.84rem;
  color: var(--muted);
}

.legend-scale {
  gap: 10px;
}

.chart-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 20px;
}

.tool-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.tool-label {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--muted);
  cursor: default;
}

.tooltip-label {
  outline: none;
}

.tooltip-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 10;
  width: 260px;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--panel-solid);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.45;
  text-transform: none;
  text-align: left;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px) scale(0.98);
  transform-origin: bottom center;
  transition:
    opacity 90ms ease-out,
    transform 120ms ease-out;
}

.tooltip-label:hover .tooltip-bubble,
.tooltip-label:focus-visible .tooltip-bubble {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.toggle-row,
.toggle-row * {
  cursor: pointer;
}

.toggle-side-label {
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1;
  color: var(--muted);
  cursor: default;
}

.layout-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  appearance: none;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 2px 3px;
  width: 60px;
  height: 23px;
  font: inherit;
  color: var(--ink);
  background: var(--panel-solid);
  cursor: pointer;
  transition:
    background-color 60ms ease-out,
    border-color 60ms ease-out,
    transform 180ms ease;
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 17px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--panel-solid);
  transition:
    transform 240ms ease,
    background-color 180ms ease;
}

.layout-toggle-icon {
  width: 12px;
  height: 8px;
  overflow: visible;
}

.layout-toggle-icon line {
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.layout-toggle:hover,
.layout-toggle:focus-visible {
  background: var(--panel-solid);
  border-color: var(--ink);
}

.layout-toggle:active {
  transform: translateY(1px);
}

.layout-toggle[aria-pressed="true"] {
  background: var(--panel-solid);
  border-color: var(--rule);
}

.layout-toggle[aria-pressed="true"] .toggle-thumb {
  transform: translateX(26px);
}

.swatch {
  display: inline-flex;
  width: 132px;
  height: 10px;
  overflow: hidden;
  border-radius: 4px;
  flex: 0 0 auto;
}

.status {
  min-height: 1.5rem;
  margin-bottom: 8px;
  font-size: 0.92rem;
  color: var(--muted);
}

.status:empty {
  min-height: 0;
  margin-bottom: 0;
}

.status.error {
  color: var(--accent-down);
}

.chart {
  position: relative;
  width: 100%;
  min-width: 820px;
  min-height: 620px;
}

.chart svg {
  display: block;
  width: 100%;
  height: auto;
  cursor: default;
  user-select: none;
}

.swatch-scale {
  display: block;
  width: 100%;
  height: 100%;
}

.axis-title {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
  fill: var(--muted);
  cursor: default;
}

.tick-label {
  fill: var(--muted);
  font-size: 0.78rem;
  cursor: default;
}

.connector {
  fill: none;
  stroke-width: 1.8px;
  stroke-linecap: round;
  transition: stroke-width 180ms ease;
}

.interaction-layer {
  cursor: pointer;
}

.endpoint-backdrop {
  fill: var(--panel-solid);
}

.endpoint {
  stroke: var(--panel-solid);
  stroke-width: 1.1px;
  transition: fill 180ms ease, stroke 180ms ease;
}

.name-label {
  font-size: 0.72rem;
  fill: var(--ink);
  font-weight: 500;
  dominant-baseline: middle;
  transition: fill 180ms ease;
  cursor: default;
}

.leader-line {
  stroke: var(--rule);
  stroke-width: 1px;
  stroke-linecap: round;
  transition: stroke 180ms ease;
}

.series {
  opacity: 1;
}

.connector-layer,
.connector-layer *,
.series,
.series *,
.interaction-layer {
  cursor: pointer;
}

.connector.is-active {
  stroke-width: 2.6px;
}

.series.is-dimmed .name-label {
  fill: color-mix(in srgb, var(--ink) 34%, var(--panel-solid));
}

.series.is-dimmed .leader-line {
  stroke: color-mix(in srgb, var(--ink) 10%, var(--panel-solid));
}

@media (max-width: 900px) {
  .byline {
    margin-top: 14px;
  }

  .dek {
    column-count: 1;
  }

  .page {
    width: min(100vw - 24px, 1200px);
    padding-top: 0;
  }

  .chart-shell {
    padding: 20px 14px 10px;
    border-radius: 4px;
  }

  .chart-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .chart-tools {
    justify-content: flex-start;
    align-items: flex-start;
  }

  .tool-group {
    align-items: flex-start;
    flex-direction: column;
  }

  .toggle-row {
    justify-content: flex-start;
  }

  .chart {
    min-height: 760px;
  }
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fff;
    --panel: #fff;
    --panel-solid: #fff;
    --ink: #181818;
    --muted: rgba(24, 24, 24, 0.65);
    --rule: #ededed;
    --accent-flat: rgba(24, 24, 24, 0.5);
  }

  .layout-toggle {
    border-color: #cfcfcf;
  }
}
