:root {
  color-scheme: light;
  --bg: #f7faf8;
  --surface: #ffffff;
  --surface-strong: #eef6f2;
  --text: #111412;
  --muted: #5b665f;
  --line: #dce6df;
  --accent: #13b89a;
  --accent-dark: #087b6a;
  --ink: #101412;
  --code: #151917;
  --shadow: 0 24px 70px rgba(17, 20, 18, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid rgba(220, 230, 223, 0.78);
  background: rgba(247, 250, 248, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand img {
  width: 34px;
  height: 34px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--muted);
  font-size: 0.95rem;
}

.nav a:hover,
.footer a:hover {
  color: var(--accent-dark);
}

.header-cta,
.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 700;
}

.header-cta,
.button.secondary {
  border: 1px solid var(--line);
  background: var(--surface);
}

.button.primary {
  background: var(--ink);
  color: #ffffff;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.98fr);
  gap: clamp(36px, 7vw, 86px);
  align-items: center;
  padding: clamp(56px, 9vw, 116px) clamp(20px, 5vw, 72px) 70px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 22px;
  font-size: clamp(3rem, 8vw, 6.7rem);
  line-height: 0.93;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1.02;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.18rem;
}

.hero-lede {
  max-width: 700px;
  color: var(--muted);
  font-size: clamp(1.1rem, 1.8vw, 1.35rem);
}

.command-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(100%, 560px);
  margin: 28px 0 22px;
  padding: 12px 12px 12px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--code);
  color: #f2fff9;
  box-shadow: var(--shadow);
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.copy-button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: var(--accent);
  color: #06201b;
  font-weight: 800;
  cursor: pointer;
}

.copy-button:hover {
  background: #30d2b4;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}

.proof-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: 760px;
  margin: 0;
}

.proof-strip div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.proof-strip dt {
  margin-bottom: 4px;
  font-weight: 800;
}

.proof-strip dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.hero-visual {
  position: relative;
  min-height: 560px;
}

.terminal {
  position: relative;
  z-index: 2;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: #101412;
  color: #dffcf3;
  box-shadow: var(--shadow);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #9ccdc0;
}

.terminal-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2dd4bf;
}

.terminal-bar span:nth-child(2) {
  background: #f6c453;
}

.terminal-bar span:nth-child(3) {
  background: #e46b64;
}

.terminal pre {
  margin: 0;
  padding: 22px;
  overflow: auto;
  font-size: clamp(0.78rem, 1.2vw, 0.95rem);
  white-space: pre-wrap;
}

.graph-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 88%;
  min-height: 310px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #eef7f3 100%);
  box-shadow: var(--shadow);
}

.graph-panel svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.graph-panel path {
  fill: none;
  stroke: rgba(19, 184, 154, 0.42);
  stroke-width: 2;
}

.node {
  position: absolute;
  z-index: 2;
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
  box-shadow: 0 14px 34px rgba(17, 20, 18, 0.12);
}

.node-a { top: 54px; left: 42px; }
.node-b { top: 34px; right: 64px; }
.node-c { bottom: 58px; left: 70px; }
.node-d { bottom: 38px; right: 52px; }
.node-e {
  top: 118px;
  left: 50%;
  width: 92px;
  height: 92px;
  transform: translateX(-50%);
  background: #11201b;
  color: #dffcf3;
}

.section {
  padding: clamp(56px, 8vw, 100px) clamp(20px, 5vw, 72px);
  border-top: 1px solid var(--line);
}

.two-column,
.install {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(320px, 1fr);
  gap: clamp(28px, 6vw, 80px);
  align-items: start;
}

.two-column p:last-child,
.studio-copy p {
  color: var(--muted);
  font-size: 1.15rem;
}

.steps,
.privacy-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.steps article,
.privacy-grid article {
  min-height: 210px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.steps span {
  display: inline-flex;
  margin-bottom: 28px;
  color: var(--accent-dark);
  font-weight: 900;
}

.steps p,
.privacy-grid p {
  color: var(--muted);
}

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

.agent-grid span {
  display: flex;
  min-height: 68px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 18px;
  background: var(--surface);
  font-weight: 800;
}

.studio-section {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(360px, 1.3fr);
  gap: clamp(30px, 5vw, 70px);
  align-items: center;
  background: #111412;
  color: #f7faf8;
}

.studio-section .eyebrow {
  color: #55dbc2;
}

.studio-copy p {
  color: #b9c9c2;
}

.studio-shots {
  display: grid;
  gap: 16px;
}

.studio-shots img {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: #0c0f0e;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
}

.install-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.install-card .command-card {
  width: 100%;
  margin-top: 0;
}

.command-list {
  display: grid;
  gap: 10px;
}

.command-list code {
  display: block;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

/* Real KawnGraph diagrams (self-contained dark cards) */
.diagram {
  margin: 36px 0 0;
}

.diagram img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.diagram figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

/* Layer chips under the architecture diagram */
.layers {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.layers div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.layers strong {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.layers p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 50%;
  vertical-align: middle;
}

.dot-code { background: #2563eb; }
.dot-data { background: #b45309; }
.dot-config { background: #475569; }
.dot-docs { background: #059669; }
.dot-test { background: #0d9488; }

/* Context Pack: flow diagram + terminal side by side */
.context-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 44px);
  align-items: center;
  margin-top: 28px;
}

.diagram.flow {
  margin: 0;
}

.context-grid .terminal {
  width: 100%;
}

.context-grid .terminal pre {
  white-space: pre;
}

/* MCP retrieval tools */
.tools {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.tools article {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.tools code {
  display: inline-block;
  margin-bottom: 10px;
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--surface-strong);
  color: var(--accent-dark);
  font-weight: 700;
}

.tools p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

/* Benchmarks */
.bench-lede {
  max-width: 760px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 1.12rem;
}

/* Inline code inside dark studio copy */
.studio-copy code {
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  color: #dffcf3;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 34px clamp(20px, 5vw, 72px);
  background: #101412;
  color: #f7faf8;
}

.footer p {
  margin: 4px 0 0;
  color: #b9c9c2;
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: #dffcf3;
}

@media (max-width: 980px) {
  .site-header {
    align-items: flex-start;
  }

  .nav {
    display: none;
  }

  .hero,
  .two-column,
  .install,
  .studio-section {
    grid-template-columns: minmax(0, 1fr);
  }

  /* let grid/flex children shrink below their content's min-width so
     wide elements (terminals, images) never force horizontal overflow */
  .hero > *,
  .two-column > *,
  .install > *,
  .studio-section > *,
  .context-grid > * {
    min-width: 0;
  }

  .terminal,
  .terminal pre,
  .diagram img {
    max-width: 100%;
  }

  .terminal pre {
    overflow-x: auto;
  }

  .hero-visual {
    min-height: 510px;
  }

  .steps,
  .agent-grid,
  .privacy-grid,
  .tools,
  .layers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 640px) {
  .site-header {
    padding: 14px 18px;
  }

  .header-cta {
    display: none;
  }

  .hero,
  .section {
    padding-left: 18px;
    padding-right: 18px;
  }

  h1,
  h2 {
    overflow-wrap: break-word;
  }

  .proof-strip,
  .steps,
  .agent-grid,
  .privacy-grid,
  .tools,
  .layers {
    grid-template-columns: 1fr;
  }

  .context-grid .terminal pre {
    white-space: pre-wrap;
  }

  .hero-actions,
  .footer {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .command-card {
    align-items: stretch;
    flex-direction: column;
  }

  .copy-button {
    width: 100%;
  }

  .graph-panel {
    width: 100%;
  }
}
