/* KeelAI brand: Direction D (sloop crest) + blue & green palette */
:root {
  --abyss: #0A1F3C;
  --abyss-2: #10294D;
  --abyss-line: #1E3558;
  --ocean: #1F5FD1;
  --ocean-hover: #184FB0;
  --shoal: #7FB3F5;
  --reef: #17A36A;
  --reef-ink: #0F7A4D;
  --reef-bright: #2BC48A;
  --mist: #EEF4F2;
  --sky: #DCEBFF;
  --ink: #0F1C2E;
  --slate: #4B5A6B;
  --line: #D3DCE6;
  --white: #FFFFFF;
  --on-dark: #C5D3E6;
  --amber: #F2B35B;
  --red: #B2362E;

  --font-display: 'Instrument Sans', system-ui, -apple-system, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --max: 1180px;
  --radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--ocean); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--shoal); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.4rem, 5.5vw, 3.75rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.4rem); font-weight: 600; }
h3 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
code, .mono { font-family: var(--font-mono); font-size: 0.9em; }
code { background: var(--mist); padding: 0.1em 0.35em; border-radius: 4px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--white); padding: 8px 12px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--reef-ink);
  margin: 0 0 14px;
}
.dark .eyebrow { color: var(--reef-bright); }
.lede { font-size: 1.2rem; color: var(--slate); max-width: 46rem; }
.dark .lede { color: var(--on-dark); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 12px 20px;
  border-radius: 8px; border: 1px solid transparent;
  font-family: var(--font-display); font-size: 15px; font-weight: 600; line-height: 1;
  text-decoration: none; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-primary { background: var(--ocean); color: var(--white); }
.btn-primary:hover { background: var(--ocean-hover); color: var(--white); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--white); }
.dark .btn-ghost { color: var(--white); border-color: #5C7698; }
.dark .btn-ghost:hover { background: var(--white); color: var(--abyss); border-color: var(--white); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Header */
.site-header { background: var(--abyss); color: var(--white); position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--abyss-line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--white); text-decoration: none; }
.brand:hover { color: var(--white); }
.brand-word { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.brand-word span { color: var(--shoal); font-weight: 600; }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a { color: var(--on-dark); text-decoration: none; font-size: 15px; font-weight: 500; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--white); }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--reef); text-decoration-thickness: 2px; text-underline-offset: 8px; }
.nav .btn { color: var(--white); }
.nav-toggle { display: none; background: none; border: 1px solid #5C7698; color: var(--white); border-radius: 8px; min-width: 44px; min-height: 44px; cursor: pointer; }
@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav { display: none; position: absolute; top: 72px; left: 0; right: 0; background: var(--abyss); flex-direction: column; align-items: stretch; gap: 0; padding: 8px 16px 20px; border-bottom: 1px solid var(--abyss-line); }
  .nav.open { display: flex; }
  .nav a { padding: 14px 4px; border-bottom: 1px solid var(--abyss-line); }
  .nav a[aria-current="page"] { text-underline-offset: 6px; }
  .nav .btn { margin-top: 14px; border-bottom: 0; }
}

/* Sections */
section { padding: 96px 0; }
@media (max-width: 700px) { section { padding: 64px 0; } }
.dark { background: var(--abyss); color: var(--white); }
.tint { background: var(--mist); }
.section-head { max-width: 760px; margin-bottom: 48px; }

/* Hero */
.hero { padding: 88px 0 96px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.hero h1 { max-width: 13ch; }
.hero .lede { margin-bottom: 32px; }
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; gap: 40px; } }

.page-hero { padding: 80px 0 72px; }
.page-hero h1 { max-width: 20ch; }

/* Terminal */
.terminal {
  background: #071830; border: 1px solid var(--abyss-line); border-radius: 14px;
  font-family: var(--font-mono); font-size: 14px; line-height: 1.7; color: #EEF4F2;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35); overflow: hidden;
}
.terminal-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--abyss-line); color: #8FA3BD; font-size: 12px; }
.terminal-bar i { width: 10px; height: 10px; border-radius: 50%; background: #2A4166; display: inline-block; }
.terminal-bar span { margin-left: 8px; }
.terminal pre { margin: 0; padding: 18px 20px 20px; overflow-x: auto; white-space: pre; }
.t-prompt { color: var(--shoal); }
.t-key { color: var(--shoal); }
.t-dim { color: #8FA3BD; }
.t-pass { color: var(--reef-bright); }
.t-drift { color: var(--amber); }
.t-block { color: #FF8A80; }

/* Strip */
.strip { padding: 28px 0; border-bottom: 1px solid var(--line); }
.strip .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; color: var(--slate); font-size: 15px; }
.strip strong { font-family: var(--font-mono); font-weight: 500; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--slate); }
.strip .chip { font-family: var(--font-display); font-weight: 600; color: var(--ink); }

/* Grids & cards */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.card p:last-child { margin-bottom: 0; }
.card p { color: var(--slate); font-size: 16px; }
.dark .card { background: var(--abyss-2); border-color: var(--abyss-line); }
.dark .card p { color: var(--on-dark); }
.card .num { font-family: var(--font-mono); font-size: 13px; color: var(--reef-ink); margin-bottom: 10px; display: block; }
.dark .card .num { color: var(--reef-bright); }

.primitive { position: relative; padding-top: 32px; }
.primitive::before { content: ""; position: absolute; top: 0; left: 28px; width: 40px; height: 4px; border-radius: 0 0 3px 3px; background: var(--reef); }
.primitive .tag { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--slate); display: block; margin-bottom: 8px; }
.primitive-wide { grid-column: span 2; }
@media (max-width: 640px) { .primitive-wide { grid-column: auto; } }

/* Factory loop */
.loop { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; counter-reset: step; }
.loop li { background: var(--abyss-2); border: 1px solid var(--abyss-line); border-radius: 10px; padding: 20px 18px; position: relative; }
.loop li::before { counter-increment: step; content: "0" counter(step); font-family: var(--font-mono); font-size: 12px; color: var(--shoal); display: block; margin-bottom: 8px; }
.loop h3 { font-size: 1.1rem; margin-bottom: 6px; color: var(--white); }
.loop p { font-size: 14px; line-height: 1.5; color: var(--on-dark); margin: 0; }
.loop li.keel { border-color: var(--reef); }
@media (max-width: 1060px) { .loop { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .loop { grid-template-columns: 1fr; } }

.verdicts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 28px; }
@media (max-width: 860px) { .verdicts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .verdicts { grid-template-columns: 1fr; } }
.verdict { border-radius: 10px; padding: 16px 18px; font-size: 14px; line-height: 1.5; border: 1px solid; }
.verdict b { font-family: var(--font-mono); font-weight: 500; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; display: block; margin-bottom: 4px; }
.v-pass { background: rgba(43, 196, 138, 0.1); border-color: rgba(43, 196, 138, 0.45); color: #CFF3E2; }
.v-pass b { color: var(--reef-bright); }
.v-block { background: rgba(255, 138, 128, 0.08); border-color: rgba(255, 138, 128, 0.4); color: #FFD9D5; }
.v-block b { color: #FF8A80; }
.v-drift { background: rgba(242, 179, 91, 0.1); border-color: rgba(242, 179, 91, 0.45); color: #FBE6C6; }
.v-drift b { color: var(--amber); }
.v-error { background: rgba(127, 179, 245, 0.08); border-color: rgba(127, 179, 245, 0.4); color: #DCEBFF; }
.v-error b { color: var(--shoal); }

/* Analogy */
.analogy { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--white); }
.analogy div { padding: 24px 20px; border-right: 1px solid var(--line); }
.analogy div:last-child { border-right: 0; }
.analogy .k { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; margin-bottom: 4px; }
.analogy .is { font-family: var(--font-mono); font-size: 12px; color: var(--slate); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.analogy .v { color: var(--reef-ink); font-weight: 600; }
@media (max-width: 900px) {
  .analogy { grid-template-columns: 1fr; }
  .analogy div { border-right: 0; border-bottom: 1px solid var(--line); }
  .analogy div:last-child { border-bottom: 0; }
}

/* Questions */
.questions { counter-reset: q; }
.question { display: flex; gap: 18px; padding: 24px 0; border-top: 1px solid var(--line); }
.question:last-child { border-bottom: 1px solid var(--line); }
.question::before { counter-increment: q; content: counter(q); flex: 0 0 40px; height: 40px; border-radius: 50%; background: var(--sky); color: var(--ocean); font-family: var(--font-display); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.question h3 { margin-bottom: 4px; }
.question p { margin: 0; color: var(--slate); }

/* Split */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 36px; } }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 640px; }
th, td { text-align: left; vertical-align: top; padding: 16px 18px; border-bottom: 1px solid var(--line); }
th { font-family: var(--font-mono); font-weight: 500; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--slate); background: var(--mist); }
tr:last-child td { border-bottom: 0; }
td:first-child { font-family: var(--font-display); font-weight: 600; white-space: nowrap; }
td.with { color: var(--ink); }
td.without { color: var(--slate); }

/* Checklist */
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { position: relative; padding-left: 30px; margin-bottom: 12px; }
.checks li::before { content: ""; position: absolute; left: 2px; top: 0.45em; width: 14px; height: 8px; border-left: 2.5px solid var(--reef); border-bottom: 2.5px solid var(--reef); transform: rotate(-45deg); }
.dark .checks li::before { border-color: var(--reef-bright); }

/* Architecture diagram */
.arch { display: grid; gap: 14px; }
.plane { border-radius: var(--radius); padding: 22px 24px; border: 1px solid var(--line); background: var(--white); }
.plane h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.plane h3 small { font-family: var(--font-mono); font-weight: 400; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--slate); }
.plane .pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pill { font-size: 14px; padding: 6px 12px; border-radius: 999px; background: var(--mist); border: 1px solid var(--line); }
.plane.authority { border-color: var(--reef); background: #F1FAF5; }
.plane.authority .pill { background: var(--white); border-color: #B5E0CB; }
.plane.harness .pill { background: var(--sky); border-color: #B9D3F5; }
.arch .arrow { text-align: center; font-family: var(--font-mono); font-size: 12px; color: var(--slate); letter-spacing: 0.06em; text-transform: uppercase; }

/* Roadmap */
.roadmap { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.roadmap li { border-top: 4px solid var(--ocean); background: var(--white); border-radius: 0 0 var(--radius) var(--radius); padding: 22px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.roadmap .m { font-family: var(--font-mono); font-size: 12px; color: var(--slate); letter-spacing: 0.06em; text-transform: uppercase; }
.roadmap h3 { margin: 6px 0 8px; font-size: 1.1rem; }
.roadmap p { font-size: 15px; color: var(--slate); margin: 0; }
@media (max-width: 960px) { .roadmap { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .roadmap { grid-template-columns: 1fr; } }

/* Pricing */
.tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
@media (max-width: 960px) { .tiers { grid-template-columns: 1fr; max-width: 560px; } }
.tier { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 32px 28px; display: flex; flex-direction: column; }
.tier.featured { border: 2px solid var(--ocean); box-shadow: 0 18px 40px rgba(31, 95, 209, 0.12); }
.tier .badge { align-self: flex-start; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; background: var(--sky); color: var(--ocean); padding: 4px 10px; border-radius: 999px; margin-bottom: 14px; }
.tier h3 { font-size: 1.5rem; margin-bottom: 4px; }
.tier .price { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; color: var(--reef-ink); margin-bottom: 12px; }
.tier .for { color: var(--slate); font-size: 15px; min-height: 3.2em; }
.tier .checks { margin: 20px 0 28px; font-size: 15px; flex: 1 1 auto; }
.tier .btn { width: 100%; }

.faq details { border-top: 1px solid var(--line); padding: 20px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-mono); color: var(--ocean); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 12px 0 0; color: var(--slate); }

/* Quote band */
.pull { font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; max-width: 30ch; margin: 0; }
.pull em { font-style: normal; color: var(--reef-bright); }

/* CTA */
.cta { text-align: left; }
.cta .wrap { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.cta h2 { margin: 0 0 8px; }
.cta p { margin: 0; color: var(--on-dark); max-width: 40rem; }

/* Forms */
.form { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.field label { display: block; font-weight: 500; font-size: 15px; margin-bottom: 6px; }
.field .opt { color: var(--slate); font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--white); border: 1px solid #A9B7C7; border-radius: 8px;
  padding: 12px 14px; min-height: 48px;
}
.field textarea { min-height: 160px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid var(--sky); border-color: var(--ocean); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status { padding: 14px 16px; border-radius: 8px; font-size: 15px; display: none; }
.form-status.ok { display: block; background: #E6F3EC; border: 1px solid #B9DEC8; color: #175E3B; }
.form-status.err { display: block; background: #F8E6E4; border: 1px solid #ECBBB6; color: #8A251F; }
.form .btn[disabled] { opacity: 0.6; cursor: progress; }
.fine { font-size: 14px; color: var(--slate); }

.aside-card { background: var(--mist); border-radius: var(--radius); padding: 28px; }
.aside-card h3 { margin-top: 0; }
.aside-card ol { padding-left: 20px; margin: 0 0 1em; }
.aside-card li { margin-bottom: 10px; color: var(--slate); }
.aside-card li strong { color: var(--ink); }

/* Footer */
.site-footer { background: var(--abyss); color: var(--on-dark); padding: 56px 0 40px; font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(2, minmax(0, 1fr)); gap: 32px; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { font-family: var(--font-mono); font-weight: 500; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: #8FA3BD; margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: var(--on-dark); text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.footer-tag { margin-top: 14px; max-width: 34ch; }
.footer-base { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--abyss-line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 14px; color: #8FA3BD; }

.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.muted { color: var(--slate); }
