:root {
  --paper: #f5f2ea;
  --grid: #ebe5d7;
  --grid-strong: #e0d8c6;
  --ink: #21241f;
  --ink-soft: #5b5f55;
  --ink-faint: #94907f;
  --line: #e2dccc;
  --line-strong: #d3ccb8;
  --clay: #c05a37;
  --clay-deep: #8f3f24;
  --display: "Space Grotesk", system-ui, sans-serif;
  --sans: "Inter", system-ui, sans-serif;
  --mono: "IBM Plex Mono", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 27px 27px;
}

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 36px; width: 100%; }

/* Fill the viewport and center the content vertically, so the page adapts to
   any screen height instead of relying on fixed pixel spacing. */
.page { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.stage { flex: 1; display: flex; flex-direction: column; justify-content: safe center;
         gap: clamp(12px, 3vh, 44px); padding: clamp(6px, 1.5vh, 28px) 0; min-height: 0; }

/* Nav */
nav { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--display); font-weight: 500; font-size: 19px; letter-spacing: -0.01em; }
.brand svg { display: block; }
nav .contact { font-family: var(--sans); font-size: 14.5px; color: var(--ink-soft); text-decoration: none; padding: 9px 16px; border: 1px solid var(--line-strong); border-radius: 3px; transition: border-color .18s, color .18s; }
nav .contact:hover { border-color: var(--ink-soft); color: var(--ink); }

/* Hero */
.hero { text-align: center; }
h1 { font-family: var(--display); font-weight: 500; font-size: clamp(40px, 6.4vw, 72px); line-height: 1.0; letter-spacing: -0.035em; }
h1 .bend { color: var(--clay); }

/* Knowledge-graph figure — sized against viewport height so it scales to fit */
.figure { max-width: min(340px, 34vh); margin: clamp(12px, 2.4vh, 26px) auto 0; }
.figure svg { width: 100%; height: auto; display: block; }

/* Definition — set directly on the graph paper */
.def { text-align: center; }
.def .rule { width: 40px; height: 1px; background: var(--line-strong); margin: 0 auto 18px; }
.def-label { font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em; color: var(--ink-faint); margin-bottom: 12px; }
.def-main { font-family: var(--display); font-weight: 400; font-size: clamp(22px, 3vw, 32px); line-height: 1.25; letter-spacing: -0.02em; max-width: 22ch; margin: 0 auto; }
.def-main b { font-weight: 500; }
.def-sub { font-size: 16px; color: var(--ink-soft); max-width: 40ch; margin: 14px auto 0; line-height: 1.55; }

/* Footer */
footer { margin-top: auto; border-top: 1px solid var(--line-strong); }
.foot { display: flex; justify-content: space-between; align-items: center; padding: 26px 0; font-family: var(--mono); font-size: 12.5px; color: var(--ink-faint); flex-wrap: wrap; gap: 12px; }
.foot a { color: var(--ink-soft); text-decoration: none; }
.foot a:hover { color: var(--clay-deep); }

@media (max-width: 620px) {
  .wrap { padding: 0 20px; }
  nav { height: 62px; }
  .brand { gap: 8px; font-size: 15.5px; white-space: nowrap; }
  .brand svg { width: 22px; height: 22px; flex: 0 0 auto; }
  nav .contact { font-size: 13px; padding: 7px 12px; white-space: nowrap; }
  .figure { max-width: min(300px, 46vw); }
}
