:root {
  --bg: #080807;
  --bg-2: #0d0d0b;
  --paper: #11110f;
  --paper-2: #171715;
  --paper-3: #1d1d1a;
  --ink: #f4f1e8;
  --muted: #a9a49a;
  --dim: #746f66;
  --line: rgba(244, 241, 232, 0.11);
  --line-strong: rgba(244, 241, 232, 0.22);
  --teal: #3dd6c6;
  --green: #66d37e;
  --blue: #77a7ff;
  --orange: #ffb454;
  --red: #ff6b5d;
  --gold: #e6c55a;
  --shadow: 0 18px 54px rgba(0, 0, 0, 0.32);
  --radius: 8px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(rgba(244, 241, 232, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 241, 232, 0.028) 1px, transparent 1px),
    linear-gradient(180deg, var(--bg) 0%, #0b0b0a 54%, var(--bg-2) 100%);
  background-size: 48px 48px, 48px 48px, auto;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  letter-spacing: 0;
}

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 max(20px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(8, 8, 7, 0.86);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
}

.brand::before {
  content: "AF";
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper-2);
  color: var(--teal);
  font-family:
    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  font-weight: 600;
}

.nav {
  display: flex;
  gap: 8px;
}

.nav a,
.area-node a,
.panel-header a,
.footer a,
.entry-card a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 10px;
  background: rgba(244, 241, 232, 0.035);
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.nav a:hover,
.area-node a:hover,
.panel-header a:hover,
.footer a:hover,
.entry-card a:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  background: rgba(244, 241, 232, 0.07);
}

main {
  overflow: hidden;
}

.overview,
.section-band {
  padding: clamp(52px, 8vw, 96px) max(20px, calc((100vw - 1180px) / 2));
}

.overview {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(460px, 1.1fr);
  gap: 36px;
  align-items: center;
  min-height: calc(100vh - 64px);
}

.overview-copy {
  max-width: 710px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--teal);
  font-family:
    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(42px, 7vw, 78px);
  font-weight: 650;
  line-height: 0.98;
}

.nowrap {
  white-space: nowrap;
}

h2 {
  margin: 0;
  font-size: clamp(30px, 4.5vw, 52px);
  font-weight: 620;
  line-height: 1.05;
}

h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.2;
}

.overview-copy p:not(.eyebrow),
.section-heading p:not(.eyebrow) {
  max-width: 760px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.overview-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: minmax(182px, auto);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(61, 214, 198, 0.08), transparent 38%),
    var(--paper);
  box-shadow: var(--shadow);
}

.overview-grid::before {
  content: "";
  position: absolute;
  inset: 32px;
  border: 1px dashed rgba(244, 241, 232, 0.1);
  border-radius: var(--radius);
  pointer-events: none;
}

.area-node {
  position: relative;
  z-index: 1;
  min-height: 182px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: rgba(23, 23, 21, 0.9);
}

.area-node:nth-child(3) {
  grid-column: 1 / -1;
  min-height: 148px;
}

.area-node h2 {
  margin: 8px 0 10px;
  font-size: 28px;
}

.area-node p {
  min-height: 54px;
  margin: 0 0 18px;
  color: var(--muted);
}

.node-kicker {
  color: var(--dim);
  font-family:
    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.fitness-node {
  border-top: 4px solid var(--green);
}

.knowledge-node {
  border-top: 4px solid var(--blue);
}

.boundary-node {
  border-top: 4px solid var(--orange);
}

.section-band {
  border-top: 1px solid var(--line);
  background: rgba(8, 8, 7, 0.62);
}

.knowledge-band {
  background: rgba(10, 10, 9, 0.72);
}

.network-band,
.source-band {
  background: rgba(13, 13, 11, 0.72);
}

.section-heading {
  margin-bottom: 28px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 26px 0;
}

.metric {
  min-height: 122px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--paper);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.metric strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-family:
    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 600;
  line-height: 1;
}

.metric span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.metric small {
  display: block;
  margin-top: 10px;
  color: var(--dim);
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 14px;
  align-items: stretch;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--paper);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.2);
}

.wide-panel {
  margin-top: 14px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.bar-stack {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) 90px;
  gap: 12px;
  align-items: center;
  min-height: 38px;
}

.bar-label,
.strength-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.bar-track {
  display: block;
  height: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(244, 241, 232, 0.05);
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.bar-value,
.strength-value {
  color: var(--ink);
  font-family:
    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  font-weight: 500;
  text-align: right;
}

.timeline {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 76px 16px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 46px;
}

.timeline-date {
  color: var(--dim);
  font-family:
    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  font-weight: 500;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  margin-top: 7px;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(244, 241, 232, 0.05);
}

.timeline-copy strong {
  display: block;
  font-size: 14px;
}

.timeline-copy span {
  color: var(--muted);
  font-size: 13px;
}

.strength-chart {
  display: grid;
  gap: 12px;
}

.strength-row {
  display: grid;
  grid-template-columns: minmax(116px, 0.9fr) minmax(0, 1.4fr) 78px;
  gap: 12px;
  align-items: center;
}

.strength-track {
  display: block;
  height: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(244, 241, 232, 0.05);
}

.strength-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.entry-grid,
.principle-grid,
.source-layout {
  display: grid;
  gap: 14px;
}

.entry-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.entry-card {
  min-height: 214px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--paper);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18);
}

.entry-card:nth-child(2) {
  border-top-color: var(--green);
  background: var(--paper-2);
}

.entry-card:nth-child(3) {
  border-top-color: var(--orange);
}

.entry-card:nth-child(4) {
  border-top-color: var(--teal);
}

.entry-card span {
  color: var(--dim);
  font-family:
    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.entry-card h3 {
  margin-top: 10px;
}

.entry-card p {
  min-height: 72px;
  margin: 12px 0 16px;
  color: var(--muted);
}

.principle-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
}

.principle-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: rgba(23, 23, 21, 0.72);
}

.principle-grid p {
  margin: 10px 0 0;
  color: var(--muted);
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.pipeline-step {
  position: relative;
  min-height: 142px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--paper-2);
}

.pipeline-step::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -15px;
  width: 18px;
  height: 2px;
  background: var(--line-strong);
}

.pipeline-step:last-child::after {
  display: none;
}

.pipeline-step strong {
  display: block;
  margin-bottom: 12px;
  font-family:
    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
}

.pipeline-step h4 {
  margin: 0 0 8px;
  font-size: 15px;
}

.pipeline-step p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.graph-panel {
  overflow: hidden;
}

.agent-graph {
  min-height: 520px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(244, 241, 232, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 241, 232, 0.02) 1px, transparent 1px),
    #0b0b0a;
  background-size: 32px 32px;
}

.agent-graph svg {
  display: block;
  width: 100%;
  min-width: 860px;
  height: 520px;
}

.graph-edge {
  stroke: rgba(244, 241, 232, 0.22);
  stroke-width: 2;
}

.graph-node rect {
  fill: #11110f;
  stroke-width: 2;
  rx: 8;
}

.graph-node text {
  fill: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 13px;
  font-weight: 700;
}

.graph-node .subtext {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.topic-header {
  align-items: flex-start;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.segmented button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 10px;
  background: rgba(244, 241, 232, 0.035);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.segmented button[aria-pressed="true"] {
  border-color: var(--teal);
  color: var(--ink);
  background: rgba(61, 214, 198, 0.12);
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.topic-card {
  min-height: 94px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--radius);
  padding: 14px;
  background: var(--paper-2);
}

.topic-card a {
  display: block;
  color: var(--ink);
  font-weight: 700;
}

.topic-card span {
  display: block;
  margin-top: 8px;
  color: var(--dim);
  font-size: 12px;
  font-weight: 600;
}

.source-layout {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.check-list,
.link-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.check-list li,
.link-list li {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
}

.check-list li::before,
.link-list li::before {
  content: "";
  position: absolute;
  top: 0.72em;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.muted-list li::before {
  background: var(--orange);
}

.link-list li::before {
  background: var(--blue);
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 86px;
  padding: 0 max(20px, calc((100vw - 1180px) / 2));
  border-top: 1px solid var(--line);
  color: var(--muted);
}

@media (max-width: 980px) {
  .overview {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .overview-grid,
  .split-layout,
  .principle-grid,
  .entry-grid,
  .source-layout {
    grid-template-columns: 1fr;
  }

  .metric-grid,
  .pipeline,
  .topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pipeline-step::after {
    display: none;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    min-height: 104px;
    padding: 16px;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .overview,
  .section-band {
    padding: 44px 16px;
  }

  h1 {
    font-size: clamp(38px, 12vw, 52px);
  }

  .metric-grid,
  .pipeline,
  .topic-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 18px;
  }

  .bar-row,
  .strength-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .bar-value,
  .strength-value {
    text-align: left;
  }

  .timeline-item {
    grid-template-columns: 68px 14px minmax(0, 1fr);
  }
}
