:root {
  --bg: #f4f6f8; --surface: #ffffff; --surface-2: #eaf0f4; --ink: #15212e; --muted: #536274; --line: #d8e0e8;
  --navy: #14324f; --accent: #1a9e8f; --accent-ink: #0e6d62; --gold: #9a6f12; --hull: #14324f; --bars: #1a9e8f;
  --band: #14324f; --band-ink: #eaf1f6; --band-muted: #a8bccd; --band-line: #2a4a68; --on-accent: #ffffff;
  --neg: #b42318;
  --sans: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", Consolas, "SFMono-Regular", monospace;
  --wrap: 1160px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0c1520; --surface: #122132; --surface-2: #182b40; --ink: #e3eaf1; --muted: #9db0c3; --line: #253a50;
    --navy: #cfe0ef; --accent: #2cc4b1; --accent-ink: #5fd9c9; --gold: #d8ae4c; --hull: #ffffff; --bars: #2cc4b1;
    --band: #0f2941; --band-ink: #eaf1f6; --band-muted: #9fb5c9; --band-line: #264663; --on-accent: #06221e; --neg: #f28b82;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c1520; --surface: #122132; --surface-2: #182b40; --ink: #e3eaf1; --muted: #9db0c3; --line: #253a50;
  --navy: #cfe0ef; --accent: #2cc4b1; --accent-ink: #5fd9c9; --gold: #d8ae4c; --hull: #ffffff; --bars: #2cc4b1;
  --band: #0f2941; --band-ink: #eaf1f6; --band-muted: #9fb5c9; --band-line: #264663; --on-accent: #06221e; --neg: #f28b82;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--ink); font: 16px/1.65 var(--sans); padding-inline: 0; }
h1, h2, h3 { text-wrap: balance; color: var(--navy); margin: 0; letter-spacing: -0.015em; }
h1 { font-size: clamp(34px, 5vw, 56px); line-height: 1.08; font-weight: 700; }
h2 { font-size: clamp(26px, 3.2vw, 36px); line-height: 1.15; font-weight: 700; }
h3 { font-size: 19px; line-height: 1.3; font-weight: 600; }
p { margin: 0; }
a { color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: 20px; }
.eyebrow { font: 500 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); }
.lead { font-size: 19px; color: var(--muted); max-width: 62ch; }
.muted { color: var(--muted); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* header */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { display: flex; align-items: center; }
.brand svg { height: 30px; width: auto; display: block; }
.logo-hull { fill: var(--hull); } .logo-bars { fill: var(--bars); }
.nav { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 15px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent-ink); }
.btn { display: inline-flex; align-items: center; gap: 8px; font: 600 15px/1 var(--sans); padding: 13px 20px; border-radius: 8px; border: 1px solid transparent; text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { border-color: var(--accent); }
.nav .btn { padding: 10px 16px; color: var(--on-accent); }
.menu-btn { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; color: var(--ink); font: 500 14px var(--sans); }
@media (max-width: 860px) {
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 20px 16px; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav .btn { margin-top: 12px; justify-content: center; border-bottom: 0; }
}

/* sections */
section { padding-block: 88px; }
.sec-head { display: grid; gap: 14px; margin-bottom: 40px; max-width: 760px; }
.band { background: var(--band); color: var(--band-ink); }
.band h2, .band h3 { color: #ffffff; }
.band .lead, .band .muted { color: var(--band-muted); }
.band .eyebrow { color: #5fd9c9; }
.alt { background: var(--surface); border-block: 1px solid var(--line); }

/* hero */
.hero { padding-block: 72px 88px; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.hero h1 .hl { color: var(--accent-ink); }
.hero .lead { margin-top: 22px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-note { margin-top: 22px; font-size: 14px; color: var(--muted); }
@media (max-width: 960px) { .hero .wrap { grid-template-columns: 1fr; gap: 40px; } }

/* ledger trace card */
.ledger { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: 0 1px 0 var(--line), 0 24px 48px -28px rgba(20, 50, 79, .35); }
.ledger-head { display: flex; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); font: 500 12px/1.4 var(--mono); color: var(--muted); letter-spacing: .04em; flex-wrap: wrap; }
.ledger-body { padding: 6px 18px 4px; }
.stage { padding: 14px 0; border-bottom: 1px dashed var(--line); animation: rise .5s ease both; }
.stage:nth-child(2) { animation-delay: .15s; } .stage:nth-child(3) { animation-delay: .3s; } .stage:nth-child(4) { animation-delay: .45s; }
.stage:last-child { border-bottom: 0; }
.stage-label { font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 8px; }
.row { display: flex; align-items: baseline; gap: 8px; font-size: 14px; }
.row .k { white-space: nowrap; }
.row .dots { flex: 1; border-bottom: 1px dotted var(--line); transform: translateY(-4px); min-width: 12px; }
.row .v { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.row + .row { margin-top: 3px; }
.ledger-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; background: var(--surface-2); border-top: 1px solid var(--line); font: 500 13px/1.3 var(--mono); }
.stamp { border: 1.5px solid var(--accent); color: var(--accent-ink); padding: 5px 10px; border-radius: 6px; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; transform: rotate(-2deg); animation: stamp .4s .8s ease both; }
@keyframes rise { from { opacity: .001; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes stamp { from { opacity: .001; transform: rotate(-2deg) scale(1.25); } to { opacity: 1; transform: rotate(-2deg) scale(1); } }
@media (prefers-reduced-motion: reduce) { .stage, .stamp { animation: none; } html { scroll-behavior: auto; } }

/* proof strip */
.proof { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.proof > div { background: var(--surface); padding: 26px 24px; display: grid; gap: 8px; align-content: start; }
.proof .big { font: 500 28px/1.1 var(--mono); color: var(--navy); font-variant-numeric: tabular-nums; }
.proof p { color: var(--muted); font-size: 15px; }
@media (max-width: 760px) { .proof { grid-template-columns: 1fr; } }

/* process */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: s; }
.step { position: relative; padding-top: 18px; border-top: 2px solid var(--accent); display: grid; gap: 8px; align-content: start; }
.step::before { counter-increment: s; content: "Stage " counter(s); font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); }
.step p { color: var(--muted); font-size: 15px; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* cards */
.grid { display: grid; gap: 16px; }
.g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); } .g2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1000px) { .g4 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 860px) { .g3, .g4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.card { display: grid; gap: 10px; align-content: start; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px; text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; }
a.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card p { color: var(--muted); font-size: 15px; }
.card .meta { font: 500 12px/1.4 var(--mono); color: var(--accent-ink); letter-spacing: .02em; }
.card .more { font-weight: 600; font-size: 14px; color: var(--accent-ink); margin-top: 4px; }
.band .card { background: #173a5b; border-color: var(--band-line); color: var(--band-ink); }
.band .card p { color: var(--band-muted); }
.band .card h3 { color: #fff; }
.role-card h3 { font-size: 17px; }
.role-card .q { font-style: italic; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: 500 13px/1 var(--mono); padding: 7px 10px; border-radius: 6px; background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); text-decoration: none; }
a.chip:hover { border-color: var(--accent); color: var(--accent-ink); }

/* platform */
.feat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px 40px; }
.feat > div { display: grid; gap: 8px; align-content: start; padding-top: 16px; border-top: 1px solid var(--band-line); }
.feat p { color: var(--band-muted); font-size: 15px; }
@media (max-width: 860px) { .feat { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .feat { grid-template-columns: 1fr; } }

/* detail pages */
.crumbs { font: 500 13px/1.4 var(--mono); color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--muted); }
.detail-hero { padding-block: 56px 40px; }
.detail-hero .lead { margin-top: 18px; }
.two { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; }
@media (max-width: 900px) { .two { grid-template-columns: 1fr; gap: 36px; } }
.block { display: grid; gap: 14px; align-content: start; }
.block + .block { margin-top: 36px; }
.qlist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.qlist li { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 0; padding: 14px 16px; font-weight: 500; }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.ticks li { padding-left: 26px; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 12px; height: 7px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.chain { display: grid; gap: 0; counter-reset: c; }
.chain li { list-style: none; position: relative; padding: 0 0 22px 40px; }
.chain li::before { counter-increment: c; content: counter(c); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font: 600 13px/26px var(--mono); text-align: center; }
.chain li::after { content: ""; position: absolute; left: 12.5px; top: 28px; bottom: 2px; width: 1.5px; background: var(--line); }
.chain li:last-child::after { display: none; }
.chain li:last-child { padding-bottom: 0; }
.chain b { display: block; color: var(--navy); }
.chain span { color: var(--muted); font-size: 15px; }
.callout { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; display: grid; gap: 8px; }
.callout .num { color: var(--navy); font-weight: 500; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 26px; }

/* explorer */
.explorer { display: grid; grid-template-columns: 300px 1fr; gap: 32px; align-items: start; }
@media (max-width: 860px) { .explorer { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 14px; }
select, input, textarea { font: 400 15px/1.4 var(--sans); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; width: 100%; }
textarea { min-height: 110px; resize: vertical; }
.filters { display: grid; gap: 18px; position: sticky; top: 84px; }
.result-count { font: 500 13px/1 var(--mono); color: var(--muted); margin-bottom: 14px; }
.err { color: var(--neg); font-size: 13px; min-height: 1em; }
.form { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.form .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form { grid-template-columns: 1fr; } }
.notice { border: 1px solid var(--accent); background: var(--surface-2); border-radius: 10px; padding: 14px 16px; }

/* sample dashboard */
.mock { margin: 0; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: 0 24px 48px -28px rgba(0, 0, 0, .5); }
.mock-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); font: 500 13px/1.3 var(--mono); color: var(--muted); flex-wrap: wrap; }
.mock-btn { border: 1px solid var(--line); border-radius: 6px; padding: 4px 9px; color: var(--ink); font-family: var(--sans); }
.mock-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.mt { background: var(--surface); padding: 12px 14px; display: grid; gap: 2px; }
.mt span { font-size: 12px; color: var(--muted); }
.mt b { font-size: 17px; font-weight: 500; color: var(--navy); }
@media (max-width: 520px) { .mock-tiles { grid-template-columns: repeat(2, 1fr); } }
.mock-chart { padding: 14px 16px 6px; }
.mock-title { font-weight: 600; font-size: 14px; color: var(--navy); }
.mock-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin: 4px 0 2px; }
.mock-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.mock svg { width: 100%; height: auto; display: block; }
.mb-total { fill: var(--navy); background: var(--navy); } .mb-up { fill: var(--accent); background: var(--accent); } .mb-down { fill: var(--gold); background: var(--gold); }
.mb-link { stroke: var(--line); stroke-dasharray: 3 3; } .mb-base { stroke: var(--line); }
.mb-val { font: 500 10px var(--mono); fill: var(--ink); } .mb-lab { font: 400 10px var(--sans); fill: var(--muted); }
.mock figcaption { padding: 10px 16px 14px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.sec-card h3 { margin-bottom: 4px; }
.sec-card .ticks { font-size: 15px; }

footer { padding-block: 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
footer h4 { margin: 0 0 10px; font-size: 13px; color: var(--ink); letter-spacing: .04em; }
footer a { color: var(--muted); text-decoration: none; display: block; padding: 3px 0; }
footer a:hover { color: var(--accent-ink); }
@media (max-width: 760px) { footer .wrap { grid-template-columns: 1fr 1fr; } }
@media (max-width: 440px) { footer .wrap { grid-template-columns: 1fr; } }
footer .wrap > div { min-width: 0; }

/* articles */
.wrap.narrow { max-width: 780px; }
.article-meta { font: 500 13px/1.4 var(--mono); color: var(--muted); margin-top: 12px; }
.prose { font-size: 17px; line-height: 1.75; }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: 24px; margin-top: 1.8em; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose strong { color: var(--navy); font-weight: 600; }
.prose code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; font-variant-numeric: tabular-nums; }
.prose th, .prose td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.prose td[align="right"], .prose th[align="right"] { text-align: right; font-family: var(--mono); font-size: 14px; }
.prose th { background: var(--surface-2); font-weight: 600; color: var(--navy); }
.prose tr:last-child td { border-bottom: 0; }
.article-related { margin-top: 40px; }
.article-cta { margin-top: 32px; }

/* concise layout */
section.tight { padding-block: 0 56px; }
.link-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px 40px; }
.link-col { display: flex; flex-direction: column; gap: 2px; }
.link-col h3 { margin-bottom: 8px; } .link-col h3 a { color: var(--navy); text-decoration: none; }
.link-col a { color: var(--ink); text-decoration: none; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.link-col a:hover { color: var(--accent-ink); }
.link-col a.all { border-bottom: 0; color: var(--accent-ink); font-weight: 600; font-size: 14px; padding-top: 10px; }
.cta-band { padding-block: 40px; background: var(--surface); border-top: 1px solid var(--line); }
.cta-band .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.cta-band h2 { font-size: clamp(20px, 2.4vw, 26px); }
.btn.on-dark { background: transparent; color: #fff; border-color: var(--band-line); }
@media (max-width: 760px) {
  section { padding-block: 52px; }
  .hero { padding-block: 36px 48px; }
  .detail-hero { padding-block: 36px 24px; }
  .sec-head { margin-bottom: 24px; }
  .lead { font-size: 17px; }
  .link-cols { grid-template-columns: 1fr; gap: 28px; }
  .link-col a:not(.all):nth-of-type(n+7) { display: none; }
  .steps { gap: 16px; }
  .proof > div { padding: 18px; }
  .ledger-body .stage:nth-child(3) .row:nth-child(n+3) { display: none; }
}

/* why ProfitKeel */
.why-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.why-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 12px 40px; padding-block: 26px; border-bottom: 1px solid var(--line); }
.why-row h2 { font-size: 22px; }
.why-row p { color: var(--muted); font-size: 17px; }
.compare { display: grid; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.compare-head, .compare-row { display: grid; grid-template-columns: 1fr 1.3fr 1.3fr; gap: 24px; padding: 18px 22px; }
.compare-head { background: var(--surface-2); font: 500 12px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.compare-row { border-top: 1px solid var(--line); }
.compare-row p { color: var(--muted); font-size: 15px; }
.compare-row p.us { color: var(--ink); }
@media (max-width: 760px) {
  .why-row { grid-template-columns: 1fr; padding-block: 20px; }
  .compare-head { display: none; }
  .compare-row { grid-template-columns: 1fr; gap: 8px; }
  .compare-row p::before { display: block; font: 500 11px/1.6 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .compare-row p:not(.us)::before { content: "Usually"; }
  .compare-row p.us::before { content: "With ProfitKeel"; color: var(--accent-ink); }
}
