/* Codekeeper · Software Resilience · product site
   Dark launch aesthetic. 4px spacing scale, two text weights in body copy,
   one accent colour, WCAG 2.1 AA contrast. */

:root {
  /* colour */
  --bg: #000;
  --bg-card: #161617;
  --bg-card-hover: #1f1f21;
  --text: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary: #86868b;
  --accent: #2997ff;
  --accent-deep: #0071e3;
  --accent-hover: #0077ed;
  --accent-soft: rgba(41, 151, 255, 0.14);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --pro-border: rgba(41, 151, 255, 0.4);

  /* spacing (4px base) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px;
  --s8: 32px; --s10: 40px; --s12: 48px; --s16: 64px; --s20: 80px; --s24: 96px; --s30: 120px;

  --radius: 24px;
  --radius-sm: 16px;
  --nav-h: 52px;
  --max: 980px;
  --max-wide: 1120px;
  --gutter: 24px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.022em;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color 150ms ease, opacity 150ms ease; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img, video { max-width: 100%; display: block; }
strong { font-weight: 600; color: var(--text); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip-link {
  position: absolute; left: var(--s4); top: -100px; z-index: 200;
  background: var(--accent-deep); color: #fff; padding: var(--s2) var(--s4); border-radius: 8px;
}
.skip-link:focus { top: var(--s2); }

/* ─── Nav ─── */
.nav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 100;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--max-wide); margin: 0 auto; padding: 0 var(--gutter);
  height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; gap: var(--s6);
}
.nav-brand { display: flex; align-items: center; gap: var(--s2); color: var(--text); font-size: 14px; font-weight: 600; letter-spacing: -0.01em; flex-shrink: 0; }
.nav-brand:hover { text-decoration: none; }
.nav-brand img { height: 22px; width: auto; }

.nav-links { display: flex; align-items: center; gap: var(--s6); list-style: none; }
.nav-links a { color: var(--text-secondary); font-size: 12px; letter-spacing: -0.01em; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--text); }
.nav-links .is-new::after {
  content: "New"; margin-left: 6px; font-size: 10px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--accent); vertical-align: 1px;
}

.nav-cta {
  display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 980px;
  background: var(--accent-deep); color: #fff !important; font-size: 12px; font-weight: 500; white-space: nowrap;
}
.nav-cta:hover { background: var(--accent-hover); text-decoration: none; }

.nav-toggle {
  display: none; background: none; border: 0; color: var(--text); font: inherit; font-size: 14px;
  padding: var(--s2) var(--s3); border-radius: 8px; cursor: pointer;
}
.nav-mobile-actions { display: none; align-items: center; gap: var(--s2); }

/* ─── Layout ─── */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-wide { max-width: var(--max-wide); margin: 0 auto; padding: 0 var(--gutter); }

/* ─── Hero ─── */
.hero { padding: var(--s30) 0 var(--s24); text-align: center; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; top: -20%; left: 50%; transform: translateX(-50%);
  width: 800px; height: 600px; max-width: 100%;
  background: radial-gradient(ellipse, rgba(41, 151, 255, 0.16) 0%, transparent 70%);
  pointer-events: none;
}
.hero > * { position: relative; }
.eyebrow { font-size: 19px; font-weight: 600; color: var(--accent); letter-spacing: -0.01em; margin-bottom: var(--s3); }
.hero h1 { text-wrap: balance; font-size: clamp(40px, 7vw, 68px); font-weight: 700; letter-spacing: -0.045em; line-height: 1.05; margin-bottom: var(--s5); }
.hero-sub {
  font-size: clamp(20px, 2.6vw, 26px); color: var(--text-secondary); letter-spacing: -0.02em; line-height: 1.32;
  max-width: 680px; margin: 0 auto var(--s8);
}
.hero-actions { display: flex; gap: var(--s4); justify-content: center; align-items: center; flex-wrap: wrap; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; padding: 12px 24px; border-radius: 980px;
  font-size: 17px; font-weight: 500; letter-spacing: -0.01em; border: 0; cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent-deep); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { background: #006edb; }
.btn-link { color: var(--accent); padding: 12px var(--s2); }
.btn-link::after, .card-cta::after, .text-link::after { content: "\00a0›"; }
.btn-link:hover { text-decoration: underline; }

/* ─── Sections ─── */
.section { padding: var(--s24) 0; }
.section.tight-top { padding-top: 0; }
.section-label { font-size: 14px; font-weight: 600; color: var(--accent); margin-bottom: var(--s3); text-align: center; letter-spacing: -0.01em; }
.section-title { text-wrap: balance; font-size: clamp(34px, 5.4vw, 56px); font-weight: 700; letter-spacing: -0.04em; line-height: 1.08; text-align: center; margin-bottom: var(--s4); }
.section-lead { font-size: 21px; color: var(--text-secondary); text-align: center; max-width: 640px; margin: 0 auto var(--s12); line-height: 1.42; letter-spacing: -0.016em; }
.section-lead:last-child { margin-bottom: 0; }

.note { font-size: 15px; color: var(--text-tertiary); text-align: center; max-width: 640px; margin: var(--s12) auto 0; line-height: 1.5; }
.note strong { color: var(--text-secondary); }

/* ─── Grids & cards ─── */
.grid-2, .grid-3, .grid-4 { display: grid; gap: var(--s5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s10) var(--s8); }
.card h3 { font-size: 26px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; margin-bottom: var(--s3); }
.card p { color: var(--text-secondary); }
.card .tag { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); margin-bottom: var(--s3); }
.card .tag.accent { color: var(--accent); }
.card .kicker { font-size: 19px; font-weight: 600; color: var(--text); letter-spacing: -0.02em; margin-bottom: var(--s2); }

a.card { display: flex; flex-direction: column; color: inherit; transition: background 150ms ease, border-color 150ms ease; }
a.card:hover { background: var(--bg-card-hover); border-color: var(--border-strong); text-decoration: none; }
a.card .card-cta { margin-top: auto; padding-top: var(--s5); font-weight: 500; color: var(--accent); }
a.card:hover .card-cta { text-decoration: underline; text-underline-offset: 3px; }

.step-num {
  width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 600; margin-bottom: var(--s6);
}
.grid-4 .card { padding: var(--s8) var(--s6); }
.grid-4 .card h3 { font-size: 22px; }

/* ─── Film ─── */
.film { max-width: var(--max-wide); margin: 0 auto; padding: 0 var(--gutter); }
.film-frame { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: #000; aspect-ratio: 16 / 9; }
.film-frame video { width: 100%; height: 100%; object-fit: cover; }
.film-caption { margin-top: var(--s4); font-size: 14px; color: var(--text-tertiary); text-align: center; }

/* ─── Before / now ─── */
.shift { border-top: 1px solid var(--border); max-width: 880px; margin: 0 auto; }
.shift-row { display: grid; grid-template-columns: 160px 1fr 1fr; gap: var(--s6); padding: var(--s6) 0; border-bottom: 1px solid var(--border); align-items: baseline; }
.shift-row dt { font-size: 14px; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.06em; }
.shift-row .before { color: var(--text-tertiary); font-size: 17px; }
.shift-row .now { color: var(--text); font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.shift-head { display: grid; grid-template-columns: 160px 1fr 1fr; gap: var(--s6); padding-bottom: var(--s3); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-tertiary); max-width: 880px; margin: 0 auto; }
.shift-head span:last-child { color: var(--accent); }

/* ─── Compare ─── */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); }
.compare-col { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s12) var(--s10); position: relative; overflow: hidden; }
.compare-col.pro { border-color: var(--pro-border); }
.compare-col.pro::before {
  content: ""; position: absolute; top: -40%; right: -20%; width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(41, 151, 255, 0.18) 0%, transparent 70%); pointer-events: none;
}
.compare-col > * { position: relative; }
.compare-tag { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); margin-bottom: var(--s3); }
.compare-col.pro .compare-tag { color: var(--accent); }
.compare-col h3 { font-size: 30px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; margin-bottom: var(--s2); }
.compare-price { color: var(--text-secondary); margin-bottom: var(--s8); }
.compare-price strong { font-size: 21px; }
.compare-list { list-style: none; display: flex; flex-direction: column; gap: var(--s4); }
.compare-list li { color: var(--text-secondary); padding-left: 28px; position: relative; line-height: 1.4; }
.compare-list li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 600; }
.compare-list li.muted { color: var(--text-tertiary); }
.compare-list li.muted::before { content: "–"; color: var(--text-tertiary); }

/* ─── Feature rows ─── */
.feature-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s12); align-items: center; padding: var(--s16) 0; border-top: 1px solid var(--border); }
.feature-row:first-of-type { border-top: 0; padding-top: 0; }
.feature-row h3 { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; margin-bottom: var(--s3); }
.feature-row p { font-size: 19px; color: var(--text-secondary); line-height: 1.45; }
.feature-visual {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s12) var(--s10);
  min-height: 220px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden;
}
.feature-visual::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 70% 30%, rgba(41, 151, 255, 0.12) 0%, transparent 60%); pointer-events: none; }
.feature-visual > * { position: relative; }
.viz-label { font-size: 12px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: var(--s3); }
.viz-title { font-size: 24px; font-weight: 600; letter-spacing: -0.025em; margin-bottom: var(--s2); }
.viz-body { font-size: 15px; color: var(--text-secondary); }

/* ─── Who list ─── */
.who-list { list-style: none; display: flex; flex-direction: column; gap: var(--s4); max-width: 640px; margin: 0 auto; }
.who-list li { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--s6) var(--s8); color: var(--text-secondary); }
.who-list strong { display: block; font-size: 19px; letter-spacing: -0.02em; margin-bottom: var(--s1); }

/* ─── Pricing table ─── */
.price-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.price-table th, .price-table td { padding: var(--s6) var(--s8); border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.price-table tr:last-child th, .price-table tr:last-child td { border-bottom: 0; }
.price-table thead th { font-size: 14px; font-weight: 600; color: var(--text-secondary); background: rgba(255, 255, 255, 0.03); }
.price-table thead th.pro, .price-table td.pro { background: rgba(41, 151, 255, 0.06); }
.price-table thead th.pro { color: var(--accent); }
.price-table td { text-align: right; font-size: 34px; font-weight: 700; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.price-table thead th:not(:first-child) { text-align: right; }
.price-table td small { font-size: 15px; font-weight: 400; color: var(--text-tertiary); letter-spacing: -0.01em; }
.price-table tbody th { font-size: 21px; font-weight: 600; letter-spacing: -0.02em; }
.price-table tbody th span { display: block; font-size: 14px; font-weight: 400; color: var(--text-tertiary); margin-top: var(--s1); letter-spacing: -0.01em; }

.terms { max-width: 720px; margin: var(--s10) auto 0; display: grid; gap: var(--s3); }
.terms p { font-size: 15px; color: var(--text-tertiary); line-height: 1.5; }
.terms strong { color: var(--text-secondary); }

/* ─── Bands ─── */
.quiet-band { text-align: center; padding: var(--s16) var(--gutter); border-top: 1px solid var(--border); }
.quiet-band p { font-size: 19px; color: var(--text-secondary); max-width: 600px; margin: 0 auto; }

.cta-band { padding: var(--s30) var(--gutter); text-align: center; position: relative; overflow: hidden; }
.cta-band::before {
  content: ""; position: absolute; bottom: -30%; left: 50%; transform: translateX(-50%); width: 700px; height: 500px; max-width: 100%;
  background: radial-gradient(ellipse, rgba(41, 151, 255, 0.14) 0%, transparent 70%); pointer-events: none;
}
.cta-band > * { position: relative; }
.cta-band h2 { text-wrap: balance; font-size: clamp(34px, 5vw, 52px); font-weight: 700; letter-spacing: -0.04em; line-height: 1.1; margin-bottom: var(--s4); }
.cta-band p { font-size: 21px; color: var(--text-secondary); margin: 0 auto var(--s8); max-width: 600px; }

/* ─── Footer ─── */
.site-footer { border-top: 1px solid var(--border); padding: var(--s10) var(--gutter) var(--s8); text-align: center; }
.footer-brand { display: inline-flex; align-items: center; gap: var(--s2); color: var(--text-secondary); font-size: 13px; font-weight: 500; margin-bottom: var(--s4); }
.footer-brand:hover { text-decoration: none; }
.footer-brand img { height: 16px; width: auto; }
.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: var(--s3) var(--s6); list-style: none; }
.footer-links a { font-size: 12px; color: var(--text-tertiary); }
.footer-links a:hover { color: var(--text-secondary); }

/* ─── Responsive ─── */
@media (max-width: 1060px) {
  .nav-links { gap: var(--s4); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
  .nav-toggle, .nav-mobile-actions { display: inline-flex; }
  .nav-links {
    display: none; position: absolute; top: var(--nav-h); left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(0, 0, 0, 0.96); border-bottom: 1px solid var(--border); padding: var(--s2) var(--gutter) var(--s4);
  }
  .nav.open .nav-links { display: flex; }
  .nav-links a { display: block; font-size: 17px; padding: var(--s3) 0; border-bottom: 1px solid var(--border); }
  .nav-links li:last-child a { border-bottom: 0; }
  .nav-links .nav-cta-item { display: none; }
}
@media (max-width: 834px) {
  .grid-2, .grid-3, .compare, .feature-row { grid-template-columns: 1fr; }
  .feature-row .feature-visual { order: 2; }
  .hero { padding: var(--s20) 0 var(--s16); }
  .section { padding: var(--s20) 0; }
  .card { padding: var(--s8) var(--s6); }
  .compare-col { padding: var(--s10) var(--s6); }
  .compare-col h3 { font-size: 26px; }
  .feature-row { gap: var(--s6); padding: var(--s12) 0; }
  .shift-head { display: none; }
  .shift-row { grid-template-columns: 1fr; gap: var(--s1); }
  .shift-row .before::before { content: "Before: "; }
  .shift-row .now::before { content: "Now: "; color: var(--accent); }
  .price-table thead { display: none; }
  .price-table, .price-table tbody, .price-table tr, .price-table th, .price-table td { display: block; width: 100%; }
  .price-table tr { border-bottom: 1px solid var(--border); padding: var(--s5) var(--s6); }
  .price-table tr:last-child { border-bottom: 0; }
  .price-table th, .price-table td { padding: var(--s1) 0; border: 0; text-align: left; font-size: 26px; }
  .price-table tbody th { font-size: 21px; margin-bottom: var(--s2); }
  .price-table td.pro { background: none; }
  .price-table td::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-tertiary); }
  .price-table td.pro::before { color: var(--accent); }
  .cta-band { padding: var(--s20) var(--gutter); }
}
@media (max-width: 560px) {
  :root { --gutter: 16px; }
  .grid-4 { grid-template-columns: 1fr; }
  .cta-band p, .section-lead { font-size: 19px; }
}

/* ─── Utility ─── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.section-title + .grid-2, .section-title + .grid-3, .section-title + .grid-4,
.section-title + .compare, .section-title + .who-list, .section-title + .shift-head,
.section-title + .feature-row, .section-title + .price-table { margin-top: var(--s12); }
