:root {
  --brand: #1761a0;
  --brand-ink: #0f4573;
  --bg: #ffffff;
  --bg-alt: #f5f7fa;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #16202c;
  --muted: #5a6b7d;
  --code-bg: #0f1720;
  --code-text: #e6edf3;
  --radius: 12px;
  --maxw: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #55a3e0;
    --brand-ink: #7cbcec;
    --bg: #0b0f14;
    --bg-alt: #111820;
    --surface: #121a23;
    --border: #23303d;
    --text: #e8eef5;
    --muted: #9aacbd;
    --code-bg: #05080c;
    --code-text: #d7e3ef;
  }
  /* The wordmark is a single flat colour, so flattening it to white is lossless. */
  .logo { filter: brightness(0) invert(1); }
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

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

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

.skip {
  position: absolute; left: -9999px;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 var(--radius) 0;
}
.skip:focus { left: 0; top: 0; z-index: 10; }

/* ---------- header ---------- */
header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 28px; height: 68px; }
.logo { height: 26px; width: auto; display: block; }
.nav ul { display: flex; gap: 24px; list-style: none; margin: 0 0 0 auto; padding: 0; }
.nav a { color: var(--muted); font-size: 15px; font-weight: 500; }
.nav a:hover { color: var(--text); text-decoration: none; }

/* ---------- hero ---------- */
.hero { padding: 88px 0 72px; }
.hero h1 {
  margin: 0 0 20px;
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  max-width: 17ch;
}
.lede { margin: 0 0 14px; font-size: clamp(1.05rem, 2vw, 1.22rem); color: var(--muted); max-width: 62ch; }
.claim { font-weight: 600; color: var(--text); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.btn {
  display: inline-block; padding: 11px 22px; border-radius: 8px;
  font-size: 15px; font-weight: 600; border: 1px solid var(--brand);
  background: var(--brand); color: #fff;
}
.btn:hover { background: var(--brand-ink); border-color: var(--brand-ink); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--brand); }
.btn.ghost:hover { background: color-mix(in srgb, var(--brand) 10%, transparent); }

/* ---------- sections ---------- */
section { padding: 72px 0; border-top: 1px solid var(--border); }
section > .wrap > h2 {
  margin: 0 0 8px; font-size: 1.85rem; letter-spacing: -0.02em;
}
.section-sub { margin: 0 0 40px; color: var(--muted); max-width: 62ch; }
.alt { background: var(--bg-alt); }

/* ---------- project cards ---------- */
.cards { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px;
}
.card h3 { margin: 0 0 4px; font-size: 1.2rem; letter-spacing: -0.01em; }

/* Logo lockup. The three marks come from different sources — one has a dark
   navy half, one ships its own dark tile, one has a white matte — so each sits
   on the same white tile to read consistently in both themes. */
.card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.logo-tile {
  flex: 0 0 auto; width: 52px; height: 52px; padding: 7px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
}
.logo-tile img { width: 100%; height: 100%; object-fit: contain; display: block; }
.card-head h3 { margin: 0 0 6px; }
.card-head .badge { margin-bottom: 0; }
.card .tagline { margin: 0 0 16px; font-size: 0.92rem; color: var(--muted); font-style: italic; }
.card p { margin: 0 0 16px; font-size: 0.96rem; }
.card ul { margin: 0 0 20px; padding-left: 20px; font-size: 0.92rem; color: var(--muted); }
.card li { margin-bottom: 6px; }
.card .links { margin-top: auto; display: flex; flex-wrap: wrap; gap: 14px; font-size: 0.9rem; font-weight: 500; }

.badge {
  display: inline-block; margin-bottom: 14px; padding: 3px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand-ink);
  border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
}
@media (prefers-color-scheme: dark) { .badge { color: var(--brand); } }

pre {
  margin: 0 0 18px; padding: 14px 16px; border-radius: 8px; overflow-x: auto;
  background: var(--code-bg); color: var(--code-text);
  font-size: 0.83rem; line-height: 1.55;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- chain ---------- */
.chain {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-top: 36px; font-size: 0.9rem; color: var(--muted);
}
.chain span {
  padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
}
.chain .arrow { border: 0; padding: 0 2px; background: none; color: var(--brand); font-weight: 700; }

/* ---------- principles ---------- */
.principles { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); list-style: none; margin: 0; padding: 0; }
.principles li { border-left: 3px solid var(--brand); padding: 4px 0 4px 18px; }
.principles strong { display: block; margin-bottom: 2px; }
.principles span { color: var(--muted); font-size: 0.94rem; }

.note {
  margin-top: 36px; padding: 20px 24px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.note p:first-child { margin-top: 0; }
.note p:last-child { margin-bottom: 0; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--border); padding: 48px 0 56px; color: var(--muted); font-size: 0.92rem; }
.foot-grid { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; }
.foot-links { display: flex; flex-wrap: wrap; gap: 20px; }
.tagline-foot { margin: 32px 0 0; font-style: italic; }

@media (max-width: 640px) {
  .nav { gap: 16px; }
  .nav ul { gap: 16px; }
  .nav li.hide-sm { display: none; }
  .hero { padding: 60px 0 48px; }
  section { padding: 56px 0; }
}
