
:root {
  color-scheme: light;
  --canvas: #f5f1e8;
  --paper: #fffdf7;
  --ink: #171a1f;
  --muted: #626873;
  --cobalt: #2855d9;
  --cobalt-dark: #1d43b4;
  --coral: #c23b31;
  --healthy: #287c5f;
  --pale-blue: #e6ebfa;
  --pale-coral: #fbe5e1;
  --rule: #d9d3c7;
  --rule-dark: #b9b2a5;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --shadow: 0 18px 50px rgba(24, 27, 32, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 86% 8%, rgba(40, 85, 217, 0.06), transparent 24rem),
    var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
a { color: inherit; }
svg { display: block; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  transform: translateY(-160%);
  padding: 10px 14px;
  background: var(--ink);
  color: white;
}
.skip-link:focus { transform: none; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.shell { width: min(100% - 48px, 1384px); margin-inline: auto; }
.site-header {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--rule);
}
.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  font-weight: 750;
  letter-spacing: -0.025em;
  font-size: 21px;
}
.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 3px solid var(--cobalt);
  border-radius: 50%;
  color: var(--cobalt);
  font: 700 20px/1 var(--mono);
  transform: rotate(-10deg);
}
.nav { display: flex; align-items: center; gap: clamp(18px, 3vw, 42px); }
.nav a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
}
.nav a:hover { color: var(--cobalt); }
.nav .nav-cta {
  border: 1px solid var(--ink);
  padding: 9px 14px;
  border-radius: 3px;
  background: transparent;
  color: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}
.nav .nav-cta:hover { color: var(--cobalt); border-color: var(--cobalt); }
.logout-form { margin: 0; }
.link-button {
  appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}
.link-button:hover { color: var(--cobalt); }

.repo-strip {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 14px;
}
.repo-name { font-size: 18px; font-weight: 650; letter-spacing: -0.03em; }
.repo-owner { color: var(--cobalt); }
.demo-pill, .status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.demo-pill {
  margin-left: 12px;
  padding: 4px 8px;
  border: 1px solid var(--rule-dark);
  border-radius: 99px;
  color: var(--muted);
  font: 600 11px/1.2 var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.status { color: var(--healthy); }
.demo-status { color: var(--muted); }
.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  background: currentColor;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(40, 124, 95, 0.1);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(410px, 0.88fr);
  border-bottom: 1px solid var(--rule);
}
.hero-copy {
  padding: clamp(30px, 3.3vw, 42px) clamp(28px, 4vw, 60px) 30px 20px;
  border-right: 1px solid var(--rule);
}
.eyebrow {
  margin: 0 0 18px;
  color: var(--cobalt);
  font: 700 12px/1.2 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
h1 {
  max-width: 820px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(50px, 4.8vw, 68px);
  font-weight: 500;
  line-height: 0.92;
  letter-spacing: -0.055em;
}
.hero-lede {
  max-width: 660px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 1.35vw, 20px);
  line-height: 1.45;
  letter-spacing: -0.015em;
}
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: 22px; }
.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: var(--cobalt);
  color: white;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}
.button:hover { background: var(--cobalt-dark); transform: translateY(-1px); }
.button.secondary { background: transparent; color: var(--ink); border-color: var(--rule-dark); }
.button.secondary:hover { border-color: var(--ink); background: rgba(255,255,255,.45); }
.text-link {
  color: var(--cobalt);
  font-size: 14px;
  font-weight: 750;
  text-underline-offset: 4px;
}

.hero-evidence {
  padding: 30px clamp(20px, 3vw, 46px);
  display: grid;
  align-content: center;
  gap: 28px;
  overflow: hidden;
}
.evidence-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
  font-weight: 700;
}
.evidence-label strong { color: var(--cobalt); font: 700 22px/1 var(--mono); }
.interval-container {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: center;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule);
}
.interval-visual {
  position: relative;
  width: 140px;
  height: 70px;
}
.interval-arc {
  position: absolute;
  width: 100%;
  aspect-ratio: 2/1;
  left: 0;
  bottom: 0;
  border: 4px solid var(--cobalt);
  border-bottom: 0;
  border-radius: 140px 140px 0 0;
}
.interval-axis {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 4px;
  background: var(--cobalt);
}
.interval-axis::before, .interval-axis::after {
  content: "";
  position: absolute;
  top: -7px;
  width: 3px;
  height: 18px;
  background: var(--cobalt);
}
.interval-axis::before { left: 0; }
.interval-axis::after { right: 0; }
.interval-point {
  position: absolute;
  left: 32%;
  bottom: -7px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--cobalt);
  transform: translateX(-50%);
}
.formula {
  color: var(--muted);
  font: 12.5px/1.5 var(--mono);
}
.formula strong { display: block; margin-bottom: 4px; color: var(--ink); font-size: 14.5px; font-family: var(--sans); }
.impact-number {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 24px;
}
.impact-number strong { color: var(--coral); font: 500 clamp(42px, 5vw, 66px)/.9 var(--mono); }
.impact-number span { color: var(--muted); font-size: 14px; text-align: right; }

.dashboard { padding: 28px 0 10px; }
.section-heading-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}
h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(34px, 3.5vw, 48px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.035em;
}
.ranking-note { color: var(--muted); font: 12px var(--mono); }
.table-wrap { overflow-x: auto; border-top: 1px solid var(--rule); }
.table-wrap:focus-visible { outline-offset: 5px; }
.flake-table { width: 100%; border-collapse: collapse; min-width: 900px; }
.flake-table th {
  padding: 12px 14px;
  color: var(--muted);
  font: 500 12px/1.2 var(--mono);
  text-align: left;
  white-space: nowrap;
}
.flake-table th:first-child, .flake-table td:first-child { padding-left: 10px; }
.flake-table td { padding: 12px 14px; border-top: 1px solid var(--rule); vertical-align: middle; }
.flake-table tbody tr { transition: background 160ms ease; }
.flake-table tbody tr:hover, .flake-table tbody tr:focus-within { background: rgba(230, 235, 250, 0.72); }
.rank { color: var(--coral); font: 500 25px/1 var(--mono); }
.test-link { display: inline-block; color: var(--ink); font: 600 15px/1.4 var(--mono); text-decoration: none; }
.test-link:hover { color: var(--cobalt); text-decoration: underline; text-underline-offset: 4px; }
.test-meta { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.metric-main { display: block; font: 600 18px/1.2 var(--mono); }
.metric-sub { display: block; margin-top: 4px; color: var(--muted); font: 12px/1.2 var(--mono); }
.waste { color: var(--coral); }
.spark { width: 170px; height: 44px; overflow: visible; }
.spark .area { fill: rgba(233, 85, 72, 0.1); }
.spark .line { fill: none; stroke: var(--coral); stroke-width: 2; vector-effect: non-scaling-stroke; }
.heatmap { display: grid; grid-template-columns: repeat(14, 10px); gap: 3px; }
.heatmap span { width: 10px; height: 10px; background: var(--pale-blue); border: 1px solid rgba(40,85,217,.12); }
.heatmap .h1 { background: #f7cbc5; }
.heatmap .h2 { background: #f18d82; }
.heatmap .h3 { background: var(--coral); }
.disclosure {
  margin: 18px 0 0;
  padding: 13px 16px;
  border: 1px solid var(--rule);
  background: rgba(255, 253, 247, 0.55);
  color: var(--muted);
  font-size: 13px;
}
.section-note { margin: 12px 0 0; color: var(--muted); font-size: 13px; }

.content-section { padding: 100px 0; border-top: 1px solid var(--rule); }
.section-grid {
  display: grid;
  grid-template-columns: minmax(250px, .7fr) minmax(0, 1.3fr);
  gap: clamp(48px, 8vw, 120px);
}
.section-intro p { color: var(--muted); font-size: 18px; }
.method-cards { display: grid; gap: 16px; }
.method-card {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--rule);
  background: rgba(255, 253, 247, 0.55);
}
.method-index { color: var(--cobalt); font: 600 14px/1.2 var(--mono); }
.method-card h3 { margin: 0 0 8px; font-size: 20px; letter-spacing: -.02em; }
.method-card p { margin: 0; color: var(--muted); }
.math-note { margin-top: 16px; padding: 22px; background: var(--ink); color: #f6f3eb; font: 13px/1.7 var(--mono); }
.math-note strong { color: #9db4ff; }

.architecture {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 34px;
}
.architecture article {
  position: relative;
  min-height: 150px;
  padding: 20px;
  border: 1px solid var(--rule-dark);
  background: var(--paper);
}
.architecture article:not(:last-child)::after {
  content: "→";
  position: absolute;
  z-index: 2;
  right: -18px;
  top: 50%;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  background: var(--canvas);
  color: var(--cobalt);
  font-family: var(--mono);
}
.architecture small { color: var(--cobalt); font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.architecture h3 { margin: 14px 0 6px; font-size: 18px; }
.architecture p { margin: 0; color: var(--muted); font-size: 13px; }

.health-card {
  margin-bottom: 0;
  padding: 0;
  margin-top: 34px;
  display: grid;
  grid-template-columns: 1.1fr repeat(3, .7fr);
  border: 1px solid var(--rule-dark);
  background: var(--paper);
}
.health-card > div { padding: 20px; border-left: 1px solid var(--rule); }
.health-card > div:first-child { border-left: 0; }
.health-label { display: block; color: var(--muted); font: 12px var(--mono); }
.health-value { display: block; margin: 8px 0 0; font-size: 20px; font-weight: 750; }

.site-footer {
  padding: 32px 0 44px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--rule);
}
.site-footer a { color: var(--ink); text-underline-offset: 3px; }

.detail-header { padding: 54px 0 38px; border-bottom: 1px solid var(--rule); }
.back-link { color: var(--cobalt); font-weight: 700; text-decoration: none; }
.detail-header h1 { margin-top: 28px; font-size: clamp(42px, 6vw, 74px); overflow-wrap: anywhere; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 22px; color: var(--muted); font: 13px var(--mono); }
.detail-metrics { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--rule); }
.detail-metrics article { padding: 26px 20px; border-right: 1px solid var(--rule); }
.detail-metrics article:last-child { border-right: 0; }
.detail-metrics small { display: block; color: var(--muted); font: 12px var(--mono); }
.detail-metrics strong { display: block; margin-top: 8px; font: 500 28px var(--mono); }
.run-table { width: 100%; border-collapse: collapse; margin-top: 30px; }
.run-table th, .run-table td { padding: 14px; border-bottom: 1px solid var(--rule); text-align: left; }
.run-table th { color: var(--muted); font: 12px var(--mono); }
.outcome { display: inline-flex; align-items: center; gap: 8px; font-weight: 750; }
.outcome::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.outcome.pass { color: var(--healthy); }
.outcome.fail { color: var(--coral); }

.app-panel { margin: 54px 0; padding: 28px; border: 1px solid var(--rule); background: var(--paper); }
.repo-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.field { display: grid; gap: 6px; flex: 1; min-width: 180px; }
.field label { color: var(--muted); font-size: 12px; font-weight: 700; }
.field input {
  min-height: 46px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--rule-dark);
  border-radius: 3px;
  background: white;
}
.repo-list { display: grid; gap: 12px; margin-top: 28px; }
.repo-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; border: 1px solid var(--rule); }
.repo-card p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.repo-card strong { overflow-wrap: anywhere; }
.action-status { display: block; min-height: 1.4em; margin-top: 7px; color: var(--muted); font: 12px/1.4 var(--mono); }
.empty { padding: 42px; border: 1px dashed var(--rule-dark); text-align: center; color: var(--muted); }

dialog {
  width: min(92vw, 520px);
  padding: 0;
  border: 1px solid var(--rule-dark);
  border-radius: 4px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(23, 26, 31, .54); backdrop-filter: blur(3px); }
.dialog-body { padding: 28px; }
.dialog-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.dialog-head h2 { font-size: 34px; }
.icon-button { width: 40px; height: 40px; border: 1px solid var(--rule); background: transparent; cursor: pointer; font-size: 24px; }
.scope-list { margin: 24px 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.scope-list li { padding-left: 28px; position: relative; color: var(--muted); }
.scope-list li::before { content: "✓"; position: absolute; left: 0; color: var(--healthy); font-weight: 800; }
.dialog-note { padding: 12px; background: var(--pale-blue); color: #34405f; font-size: 13px; }

:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { border-right: 0; padding-left: 20px; }
  .hero-evidence { border-top: 1px solid var(--rule); padding-left: 20px; padding-right: 20px; }
  .section-grid { grid-template-columns: 1fr; }
  .architecture { grid-template-columns: repeat(2, 1fr); }
  .architecture article:nth-child(2)::after { display: none; }
  .health-card { grid-template-columns: repeat(2, 1fr); }
  .health-card > div:nth-child(3) { border-left: 0; border-top: 1px solid var(--rule); }
  .health-card > div:nth-child(4) { border-top: 1px solid var(--rule); }
}

@media (max-width: 700px) {
  .shell { width: min(100% - 28px, 1384px); }
  .nav a:not(.nav-cta) { display: none; }
  .repo-strip { align-items: flex-start; flex-direction: column; padding: 12px 0; }
  .demo-pill { margin-left: 0; }
  h1 { font-size: clamp(48px, 15vw, 68px); }
  .hero-copy { padding: 38px 20px 30px; }
  .hero-evidence { padding-inline: 20px; }
  .interval-container { grid-template-columns: 1fr; gap: 16px; }
  .interval-visual { width: 170px; margin: 0 auto; }
  .impact-number { grid-template-columns: 1fr; }
  .impact-number span { text-align: left; }
  .section-heading-row { align-items: flex-start; flex-direction: column; }
  .trend-column, .intensity-column { display: none; }
  .flake-table { min-width: 550px; }
  .architecture, .health-card, .detail-metrics { grid-template-columns: 1fr; }
  .architecture article::after { display: none; }
  .health-card > div, .detail-metrics article { border-left: 0; border-right: 0; border-top: 1px solid var(--rule); }
  .health-card > div:first-child, .detail-metrics article:first-child { border-top: 0; }
  .site-footer { flex-direction: column; }
  .repo-card { align-items: stretch; flex-direction: column; }
  .repo-card .actions { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
