@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/JetBrainsMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/JetBrainsMono-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Inter;
  src: url("fonts/Inter-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Inter;
  src: url("fonts/Inter-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0b0e12;
  --panel: #181a1d;
  --border: #303235;
  --text: #f7f7f7;
  --body: #bababb;
  --muted: #5d5e61;
  --muted-aa: #8e9094;
  --accent: #00d892;
  --font: "JetBrains Mono", ui-monospace, "Cascadia Code", "SFMono-Regular",
    Menlo, Consolas, monospace;
  --font-sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

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

html {
  background: var(--bg);
}

html:focus-within {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

:focus {
  outline: none;
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 10;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--bg);
  font-size: 13px;
  font-weight: 700;
  transform: translateY(-200%);
}

.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;
}

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 40px 96px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.logo {
  display: block;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
}

.wordmark {
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 3px;
}

.nav-link {
  color: var(--body);
  font-size: 14px;
  letter-spacing: 2px;
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link:hover {
  color: var(--text);
  text-decoration: none;
}

.nav-link.is-current,
.nav-link[aria-current="page"] {
  color: var(--accent);
  text-decoration: none;
}

.hero {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 72px;
}

.copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 28px;
  min-width: 0;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 3px;
  text-transform: none;
}

.headline {
  margin: 0;
  color: var(--text);
  font-size: 60px;
  font-weight: 700;
  line-height: 1.1;
}

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

.lede {
  margin: 0;
  max-width: 42rem;
  color: var(--body);
  font-size: 18px;
  line-height: 1.6;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 26px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 15px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.btn-ghost {
  border-color: var(--border);
  background: transparent;
  color: var(--text);
  font-weight: 400;
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.status {
  display: flex;
  width: 520px;
  flex-shrink: 0;
  flex-direction: column;
  gap: 20px;
  padding: 28px;
  border: 1px solid var(--border);
  background: var(--panel);
}

.status-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.status-title {
  color: var(--body);
  font-size: 13px;
  letter-spacing: 2px;
}

.status-note {
  color: var(--muted-aa);
  font-size: 13px;
}

.treemap {
  width: 100%;
  height: 200px;
  overflow: visible;
  background: var(--bg);
}

.treemap-svg {
  width: 100%;
  height: 100%;
}

.stats-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
}

.stat-row dt {
  margin: 0;
  color: var(--body);
  font-weight: 400;
}

.stat-row dd {
  margin: 0;
  color: var(--text);
  text-align: right;
}

.stat-row dd.accent {
  color: var(--accent);
}

.stats-grid {
  display: none;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--body);
  font-size: 13px;
}

.site-footer a {
  color: inherit;
}

.site-footer a:hover {
  color: var(--text);
}

.footer-compact {
  display: none;
}

/* Manifesto */
.doc {
  flex: 1;
  width: 100%;
  max-width: 760px;
  padding: 64px 0 48px;
}

.doc-eyebrow {
  margin: 0 0 16px;
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 3px;
}

.doc h1 {
  margin: 0 0 16px;
  font-size: 42px;
  font-weight: 700;
  line-height: 1.15;
}

.doc .deck {
  margin: 0 0 40px;
  color: var(--body);
  font-size: 18px;
  line-height: 1.6;
}

.doc h2 {
  margin: 40px 0 16px;
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
}

.doc h3 {
  margin: 28px 0 12px;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.doc p,
.doc li {
  color: var(--body);
  font-size: 16px;
  line-height: 1.7;
}

.doc p {
  margin: 0 0 16px;
}

.doc strong {
  color: var(--text);
  font-weight: 700;
}

.doc ol,
.doc ul {
  margin: 0 0 16px;
  padding-left: 1.4em;
}

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

.doc hr {
  margin: 36px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.doc table {
  width: 100%;
  margin: 0 0 24px;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.5;
}

.doc th,
.doc td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.doc th {
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
}

.doc td {
  color: var(--body);
}

.doc code {
  padding: 0.1em 0.35em;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92em;
}

.not-found {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 20px;
}

.not-found h1 {
  margin: 0;
  font-size: 42px;
  font-weight: 700;
  line-height: 1.1;
}

.not-found p {
  margin: 0;
  max-width: 36rem;
  color: var(--body);
  font-size: 18px;
  line-height: 1.6;
}

@media (max-width: 1100px) {
  .page {
    padding: 32px 48px;
  }

  .hero {
    gap: 40px;
  }

  .headline {
    font-size: 48px;
  }

  .status {
    width: 440px;
  }
}

@media (max-width: 900px) {
  .page {
    gap: 40px;
    min-height: 0;
    padding: 24px 22px;
  }

  .wordmark {
    font-size: 16px;
  }

  .nav-link {
    font-size: 12px;
  }

  .hero {
    flex-direction: column;
    flex: 0 0 auto;
    align-items: stretch;
    gap: 40px;
  }

  .copy {
    gap: 20px;
  }

  .eyebrow {
    font-size: 12px;
    letter-spacing: 2px;
  }

  .wide-only {
    display: none;
  }

  .headline {
    font-size: 36px;
    line-height: 1.1;
  }

  .lede {
    font-size: 15px;
  }

  .actions {
    flex-direction: column;
    gap: 12px;
  }

  .btn {
    width: 100%;
    height: 48px;
    padding: 0 26px;
  }

  .status {
    width: 100%;
    gap: 14px;
    padding: 18px;
  }

  .status-note,
  .treemap,
  .stats-rows {
    display: none;
  }

  .status-title {
    font-size: 12px;
  }

  .stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 0;
  }

  .stats-grid div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
  }

  .stats-grid dt {
    margin: 0;
    color: var(--body);
    font-size: 12px;
    font-weight: 400;
  }

  .stats-grid dd {
    margin: 0;
    color: var(--text);
    font-size: 18px;
  }

  .stats-grid dd.accent {
    color: var(--accent);
  }

  .site-footer {
    display: block;
    padding-top: 16px;
    font-size: 12px;
    line-height: 1.6;
  }

  .footer-split {
    display: none;
  }

  .footer-compact {
    display: block;
    margin: 0;
  }

  .doc {
    padding: 12px 0 8px;
  }

  .doc h1 {
    font-size: 32px;
  }

  .doc .deck,
  .doc p,
  .doc li {
    font-size: 15px;
  }

  .doc table {
    display: block;
    overflow-x: auto;
  }
}

@media (max-width: 420px) {
  .stats-grid dd {
    font-size: 16px;
  }
}

/* Manifesto page (Kite: Manifesto / Desktop) */
.page-manifesto {
  gap: 56px;
}

.manifesto-layout {
  display: flex;
  flex: 1;
  align-items: flex-start;
  gap: 96px;
}

.toc-desktop {
  position: sticky;
  top: 40px;
  display: flex;
  width: 260px;
  flex-shrink: 0;
  flex-direction: column;
  gap: 14px;
  font-size: 14px;
}

.toc-label {
  margin: 0;
  color: var(--muted-aa);
  font-size: 12px;
  letter-spacing: 2px;
}

.toc-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.toc-list a {
  color: var(--muted-aa);
  padding-left: 14px;
  border-left: 2px solid transparent;
  text-decoration: none;
  line-height: 1.4;
}

.toc-list a:hover {
  color: var(--text);
  text-decoration: none;
}

.toc-list a.is-active,
.toc-list a[aria-current="location"],
body:has(#what-this-is:target) .toc-list a[href="#what-this-is"],
body:has(#why:target) .toc-list a[href="#why"],
body:has(#rules-of-the-experiment:target) .toc-list a[href="#rules-of-the-experiment"],
body:has(#scope:target) .toc-list a[href="#scope"],
body:has(#definition-of-success:target) .toc-list a[href="#definition-of-success"],
body:has(#how-progress-is-measured:target) .toc-list a[href="#how-progress-is-measured"],
body:has(#licensing-and-credits:target) .toc-list a[href="#licensing-and-credits"] {
  color: var(--accent);
  border-left-color: var(--accent);
  padding-left: 12px;
}

.toc-mobile {
  display: none;
}

.article {
  display: flex;
  width: 700px;
  max-width: 100%;
  flex-direction: column;
  gap: 28px;
  min-width: 0;
}

.article .doc-eyebrow {
  margin: 0;
}

.manifesto-title {
  margin: 0;
  color: var(--text);
  font-size: 48px;
  font-weight: 700;
  line-height: 1.15;
}

.callout {
  margin: 0;
  padding: 14px 18px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--body);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
}

.article-rule {
  width: 100%;
  height: 1px;
  margin: 0;
  border: 0;
  background: var(--border);
}

.doc-section {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.article h2 {
  margin: 0;
  padding-top: 16px;
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  scroll-margin-top: 24px;
}

.doc-section:first-of-type h2 {
  padding-top: 0;
}

.sec-num {
  color: var(--muted-aa);
}

.article h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font);
}

.article p,
.article li {
  color: var(--body);
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.7;
}

.article p {
  margin: 0;
}

.article strong {
  color: var(--text);
  font-weight: 700;
}

.article ol,
.article ul {
  margin: 0;
  padding-left: 1.35em;
}

.article li + li {
  margin-top: 10px;
}

.article code {
  padding: 0.1em 0.35em;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.86em;
}

.pullquote {
  margin: 0;
  padding: 4px 0 4px 24px;
  border: 0;
  border-left: 2px solid var(--accent);
  color: var(--text);
  font-family: var(--font);
  font-size: 20px;
  line-height: 1.5;
}

.scope-note {
  margin: 0;
  color: var(--muted-aa);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
}

.scope-table {
  min-width: 640px;
  font-size: 14px;
}

.scope-row {
  display: grid;
  grid-template-columns: 260px 200px 1fr;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  color: var(--body);
}

.scope-row:first-child {
  border-top: 0;
}

.scope-head {
  background: var(--panel);
  color: var(--muted-aa);
  letter-spacing: 1px;
}

.scope-name {
  color: var(--text);
}

@media (max-width: 1100px) {
  .manifesto-layout {
    gap: 48px;
  }

  .toc-desktop {
    width: 220px;
  }
}

@media (max-width: 900px) {
  .page-manifesto {
    gap: 40px;
  }

  .nav-links {
    gap: 16px;
  }

  .nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .manifesto-layout {
    flex-direction: column;
    gap: 28px;
  }

  .toc-desktop {
    display: none;
  }

  .toc-mobile {
    display: block;
    border: 1px solid var(--border);
    background: var(--panel);
  }

  .toc-mobile summary {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 14px;
    color: var(--muted-aa);
    font-size: 12px;
    font-family: var(--font);
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    list-style: none;
  }

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

  .toc-mobile .toc-list {
    gap: 0;
    padding: 0 0 8px;
  }

  .toc-mobile .toc-list a {
    display: flex;
    align-items: center;
    min-height: 44px;
  }

  .article {
    width: 100%;
    gap: 24px;
  }

  .manifesto-title {
    font-size: 32px;
  }

  .article p,
  .article li {
    font-size: 18px;
  }

  .sec-num {
    color: var(--muted-aa);
  }

  .pullquote {
    font-size: 18px;
  }

  .manifesto-cta .btn {
    min-height: 48px;
  }
}
