:root {
  --bg: #f6f4ef;
  --ink: #172022;
  --muted: #5c666a;
  --line: #d7d3c9;
  --panel: #fffefb;
  --panel-2: #ede8dd;
  --teal: #0c6f6d;
  --blue: #293f8f;
  --red: #a33e35;
  --gold: #b18424;
  --green-soft: #e8f1ed;
  --blue-soft: #e8ecf8;
  --red-soft: #f7eae7;
  --shadow: 0 18px 50px rgba(28, 34, 32, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

.hero {
  min-height: 92vh;
  padding: 24px clamp(18px, 5vw, 70px);
  display: grid;
  grid-template-rows: auto 1fr;
  background:
    linear-gradient(90deg, rgba(246, 244, 239, 0.96), rgba(246, 244, 239, 0.72)),
    url("data:image/svg+xml,%3Csvg width='1200' height='700' viewBox='0 0 1200 700' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='1200' height='700' fill='%23ebe6dc'/%3E%3Cg fill='none' stroke='%230c6f6d' stroke-opacity='.28' stroke-width='2'%3E%3Cpath d='M84 517 C 228 323, 372 594, 500 379 S 799 215, 1058 382'/%3E%3Cpath d='M108 190 C 298 105, 400 257, 546 185 S 785 112, 1034 190'/%3E%3Cpath d='M170 616 C 356 474, 511 529, 658 403 S 908 276, 1109 312'/%3E%3C/g%3E%3Cg fill='%23ffffff' stroke='%23293f8f' stroke-opacity='.5'%3E%3Ccircle cx='174' cy='500' r='19'/%3E%3Ccircle cx='416' cy='424' r='26'/%3E%3Ccircle cx='596' cy='350' r='20'/%3E%3Ccircle cx='820' cy='298' r='30'/%3E%3Ccircle cx='1000' cy='371' r='21'/%3E%3Ccircle cx='274' cy='155' r='18'/%3E%3Ccircle cx='548' cy='185' r='25'/%3E%3Ccircle cx='934' cy='164' r='23'/%3E%3C/g%3E%3Cg fill='%23a33e35' fill-opacity='.82'%3E%3Ccircle cx='172' cy='501' r='5'/%3E%3Ccircle cx='819' cy='299' r='6'/%3E%3Ccircle cx='936' cy='165' r='5'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  text-decoration: none;
  border: 1px solid rgba(23, 32, 34, 0.18);
  border-radius: 8px;
  background: rgba(255, 254, 251, 0.75);
}

.hero-grid {
  align-self: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: clamp(24px, 8vw, 96px);
  align-items: center;
}

.hero-copy {
  max-width: 790px;
}

.kicker,
.section-title span,
.eyebrow {
  color: var(--red);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 800;
}

.hero h1 {
  margin: 14px 0 18px;
  font-size: clamp(44px, 7.2vw, 92px);
  line-height: 0.95;
  max-width: 900px;
}

.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 680px;
  font-size: 18px;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.primary-action,
.secondary-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 800;
}

.primary-action {
  color: #fff;
  background: var(--teal);
}

.secondary-action {
  border: 1px solid var(--line);
  background: rgba(255, 254, 251, 0.9);
}

.signal-panel {
  display: grid;
  gap: 12px;
}

.signal {
  min-height: 104px;
  padding: 18px;
  background: rgba(255, 254, 251, 0.84);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  box-shadow: var(--shadow);
}

.signal strong {
  color: var(--muted);
  font-size: 13px;
}

.signal span {
  font-size: 21px;
  font-weight: 850;
  line-height: 1.1;
}

.signal.active {
  border-color: var(--teal);
  background: #f8fffb;
}

main {
  padding: 0 clamp(18px, 5vw, 70px) 70px;
}

.overview-strip {
  transform: translateY(-28px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.overview-strip article,
.side-card,
.paper-detail,
.node-detail,
.graph-card,
.reader-card,
.matrix,
.flow-step {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.overview-strip article {
  padding: 18px;
}

.overview-strip strong {
  display: block;
  font-size: 28px;
  line-height: 1;
}

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

.section {
  padding: 48px 0;
}

.intro-section {
  padding-top: 20px;
}

.section-title {
  max-width: 780px;
  margin-bottom: 22px;
}

.section-title.compact {
  margin-bottom: 18px;
}

.section-title h2 {
  margin: 8px 0 0;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.03;
}

.intro-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
  gap: 18px;
}

.prose-card,
.focus-card,
.bridge-card,
.path-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.prose-card,
.focus-card {
  padding: 24px;
}

.prose-card h3,
.focus-card h3 {
  margin: 0 0 12px;
  font-size: 28px;
  line-height: 1.08;
}

.prose-card p,
.focus-card p {
  color: var(--muted);
  line-height: 1.58;
}

.area-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0;
}

.area-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f6f0;
  padding: 13px;
  display: grid;
  gap: 6px;
}

.area-grid strong {
  line-height: 1.2;
}

.area-grid span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.inline-action {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  text-decoration: none;
  font-weight: 850;
}

.focus-switcher {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.focus-switcher button,
.bridge-flow button,
.path-card button {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 13px;
  cursor: pointer;
}

.focus-switcher button strong,
.bridge-flow button strong {
  display: block;
  margin-bottom: 5px;
}

.focus-switcher button span,
.bridge-flow button span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.bridge-section {
  padding-top: 22px;
}

.bridge-card {
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 24px;
  background: var(--ink);
  color: #fff;
}

.bridge-card h2 {
  margin: 8px 0 0;
  font-size: clamp(26px, 3.4vw, 44px);
  line-height: 1.05;
}

.bridge-flow {
  display: grid;
  gap: 10px;
}

.bridge-flow button {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.bridge-flow button span {
  color: rgba(255, 255, 255, 0.72);
}

.paper-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.paper-tab {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
}

.paper-tab span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 800;
}

.paper-tab strong {
  display: block;
  margin-top: 6px;
  font-size: 21px;
  line-height: 1.15;
}

.paper-tab.is-active {
  border-color: var(--teal);
  background: var(--green-soft);
}

.paper-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 18px;
}

.paper-detail,
.node-detail {
  padding: 24px;
}

.paper-detail h3,
.node-detail h3 {
  margin: 8px 0 4px;
  font-size: 32px;
  line-height: 1.05;
}

.paper-detail h4 {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 18px;
}

.authors {
  font-size: 13px;
  color: var(--muted);
}

.paper-detail p,
.node-detail p,
.reader-card p,
.flow-step p {
  color: var(--muted);
  line-height: 1.55;
}

.contribution-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.contribution-grid div {
  background: #f8f6f0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  line-height: 1.4;
}

.scenario-list {
  margin-top: 24px;
}

.scenario-list button,
.node-meta button,
.filter {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  padding: 8px 11px;
  cursor: pointer;
}

.scenario-list button {
  margin: 0 8px 8px 0;
  text-align: left;
}

.paper-side {
  display: grid;
  align-content: start;
  gap: 16px;
}

.side-card,
.reader-card {
  padding: 18px;
}

.side-card h3,
.reader-card h3 {
  margin: 0 0 12px;
}

.side-card li {
  margin-bottom: 10px;
  color: var(--muted);
  line-height: 1.4;
}

.link-stack {
  display: grid;
  gap: 8px;
}

.link-stack a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--teal);
  border-radius: 8px;
  text-decoration: none;
  color: var(--teal);
  font-weight: 800;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
}

.graph-card {
  padding: 16px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr);
  gap: 12px;
  margin-bottom: 12px;
}

.toolbar input {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
}

.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter.is-active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.graph {
  min-height: 560px;
}

.graph svg {
  width: 100%;
  height: 100%;
}

.edge {
  stroke: #bfc5bd;
  stroke-width: 1.5;
}

.edge.is-active {
  stroke: var(--teal);
  stroke-width: 3;
}

.node {
  fill: #fff;
  stroke: var(--blue);
  stroke-width: 2;
  cursor: pointer;
}

.paper-node {
  fill: var(--blue-soft);
  stroke: var(--blue);
}

.node.is-active {
  fill: var(--teal);
  stroke: var(--teal);
}

.node.is-related {
  fill: var(--green-soft);
  stroke: var(--teal);
}

.map-node text {
  text-anchor: middle;
  fill: var(--muted);
  font-size: 10px;
  pointer-events: none;
}

.concept-note {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 14px;
  display: grid;
  gap: 5px;
}

.concept-note span {
  color: var(--muted);
  line-height: 1.45;
}

.node-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.matrix {
  overflow: auto;
}

.matrix-row {
  min-width: 760px;
  display: grid;
  grid-template-columns: 1.2fr repeat(2, 1fr);
  border-bottom: 1px solid var(--line);
}

.matrix-row:last-child {
  border-bottom: 0;
}

.matrix-row > * {
  padding: 14px;
  border-right: 1px solid var(--line);
}

.matrix-row > *:last-child {
  border-right: 0;
}

.matrix-head {
  background: var(--panel-2);
  font-weight: 850;
}

.matrix button {
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.matrix button span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.covered {
  background: var(--green-soft);
  color: var(--teal);
  font-weight: 850;
}

.not-covered {
  color: var(--muted);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

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

.path-card {
  padding: 18px;
}

.path-card h3 {
  margin: 0 0 10px;
  line-height: 1.15;
}

.path-card p {
  color: var(--muted);
  line-height: 1.45;
}

.path-card div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.path-card button {
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 13px;
}

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

.flow-step {
  padding: 18px;
}

.flow-step span {
  color: var(--gold);
  font-weight: 850;
}

.flow-step h3 {
  margin: 10px 0 8px;
}

.reader-card textarea {
  width: 100%;
  min-height: 230px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  line-height: 1.45;
}

.reader-card button {
  margin-top: 10px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-weight: 850;
  padding: 0 14px;
  cursor: pointer;
}

@media (max-width: 1100px) {
  .hero-grid,
  .intro-layout,
  .bridge-card,
  .paper-workspace,
  .map-layout,
  .split {
    grid-template-columns: 1fr;
  }

  .overview-strip,
  .area-grid,
  .reader-paths,
  .assurance-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .hero {
    min-height: auto;
    padding-bottom: 60px;
  }

  .nav {
    justify-content: flex-start;
  }

  .overview-strip,
  .area-grid,
  .reader-paths,
  .paper-tabs,
  .contribution-grid,
  .assurance-flow,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .paper-detail h3,
  .node-detail h3 {
    font-size: 25px;
  }
}
