:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #161616;
  --muted: #616161;
  --line: #e6e6e6;
  --soft: #f1f1f1;
  --button-bg: #161616;
  --button-fg: #f4f4f4;
  --band-bg: #161616;
  --band-text: #efefef;
  --band-muted: #a3a3a3;
  --band-line: #2c2c2c;
  --glow: rgba(138, 169, 220, 0.22);

  --blue: #3f6fb5;
  --violet: #6a58b8;
  --green: #3d8a52;
  --amber: #a8782a;
  --rose: #b0566a;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f0f;
    --surface: #171717;
    --text: #efefef;
    --muted: #a1a1a1;
    --line: #262626;
    --soft: #1d1d1d;
    --button-bg: #efefef;
    --button-fg: #161616;
    --band-bg: #171717;
    --band-line: #2c2c2c;
    --glow: rgba(138, 169, 220, 0.14);

    --blue: #8aa9dc;
    --violet: #a597dd;
    --green: #8bb795;
    --amber: #d2ad73;
    --rose: #cf929d;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
}

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
}

a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--muted); }

code, kbd, pre {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
}

code {
  font-size: 0.88em;
  background: var(--soft);
  padding: 1px 5px;
  border-radius: 4px;
}

pre {
  background: var(--soft);
  border: 1px solid var(--line);
  padding: 14px 16px;
  border-radius: 10px;
  overflow-x: auto;
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.6;
}

pre code { background: none; padding: 0; font-size: inherit; }

h1, h2, h3 { line-height: 1.2; }
p, ul, ol, table { margin: 0 0 16px; }
ul, ol { padding-left: 22px; }
li { margin-bottom: 6px; }

.muted { color: var(--muted); }
.small { font-size: 14px; }

/* Header and footer */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  min-height: 60px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 17px;
  text-decoration: none;
}

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

.site-header nav { display: flex; gap: 22px; font-size: 15px; }
.site-header nav a { text-decoration: none; color: var(--muted); }
.site-header nav a:hover { color: var(--text); }

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 96px;
  padding: 28px 0 40px;
  font-size: 14px;
  color: var(--muted);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

.site-footer nav { display: flex; flex-wrap: wrap; gap: 20px; }

/* Buttons */

.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  border: 1px solid var(--button-bg);
  background: var(--button-bg);
  color: var(--button-fg);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.button:hover { color: var(--button-fg); opacity: 0.9; transform: translateY(-1px); }

.button.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

.button.secondary:hover { color: var(--text); border-color: var(--muted); }

.button.small { padding: 7px 14px; font-size: 14px; border-radius: 8px; }

/* Hero */

.hero {
  position: relative;
  text-align: center;
  padding: 80px 0 0;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 320px at 50% 78%, var(--glow), transparent 70%),
    radial-gradient(circle at 1px 1px, var(--line) 1px, transparent 0) 0 0 / 24px 24px;
  mask-image: linear-gradient(to bottom, #000 40%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent);
  pointer-events: none;
}

.hero > * { position: relative; }

.pill {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  color: var(--muted);
}

.pill span::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--green);
  vertical-align: 2px;
}

.hero h1 {
  font-size: clamp(40px, 7vw, 68px);
  letter-spacing: -0.035em;
  line-height: 1.04;
  margin: 24px auto 18px;
  max-width: 12ch;
}

.hero .lede {
  font-size: clamp(17px, 2.2vw, 20px);
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 30px;
}

.hero .note { margin: 14px 0 56px; font-size: 13px; color: var(--muted); }

/* App mockup: decorative, always in Kern's dark theme */

.mock {
  --m-bg: #141414;
  --m-side: #181818;
  --m-card: #1f1f1f;
  --m-line: #2a2a2a;
  --m-text: #e6e6e6;
  --m-muted: #8a8a8a;
  max-width: 920px;
  margin: 0 auto;
  border: 1px solid #2c2c2c;
  border-bottom: none;
  border-radius: 14px 14px 0 0;
  background: var(--m-bg);
  color: var(--m-text);
  text-align: left;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 -10px 60px rgba(0, 0, 0, 0.12), 0 30px 80px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.mock-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid var(--m-line);
}

.mock-search {
  flex: 1;
  max-width: 340px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  padding: 5px 10px;
  border: 1px solid var(--m-line);
  border-radius: 7px;
  background: var(--m-side);
  color: var(--m-muted);
  font-size: 12px;
}

.mock-search kbd { font-size: 11px; color: var(--m-muted); }

.mock-win { display: flex; gap: 14px; color: var(--m-muted); font-size: 12px; }

.mock-body { display: grid; grid-template-columns: 190px 1fr; min-height: 330px; }

.mock-side {
  background: var(--m-side);
  border-right: 1px solid var(--m-line);
  padding: 14px 10px;
}

.mock-space {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 12px;
  font-weight: 600;
}

.mock-space i {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: linear-gradient(135deg, #8aa9dc, #a597dd);
}

.mock-nav { list-style: none; margin: 0; padding: 0; }

.mock-nav li {
  display: flex;
  justify-content: space-between;
  margin: 0 0 2px;
  padding: 5px 8px;
  border-radius: 6px;
  color: var(--m-muted);
}

.mock-nav li.on { background: #262626; color: var(--m-text); }
.mock-nav b { font-weight: 500; font-size: 11px; color: var(--m-muted); }

.mock-label {
  margin: 16px 8px 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b6b6b;
}

.mock-nav .dot { display: flex; align-items: center; gap: 8px; justify-content: flex-start; }
.mock-nav .dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }

.mock-main { padding: 18px 20px; min-width: 0; }

.mock-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; font-size: 16px; font-weight: 600; }

.mock-status {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  color: #8bb795;
  background: rgba(139, 183, 149, 0.14);
}

.mock-progress { height: 4px; border-radius: 4px; background: #262626; margin: 10px 0 18px; overflow: hidden; }
.mock-progress span { display: block; width: 62%; height: 100%; background: #8bb795; }

.mock-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.mock-col h4 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--m-muted);
}

.mock-card {
  background: var(--m-card);
  border: 1px solid var(--m-line);
  border-radius: 8px;
  padding: 9px 10px;
  margin-bottom: 8px;
}

.mock-card .tag {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  margin-bottom: 6px;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 16%, transparent);
}

.mock-card p { margin: 0; color: var(--m-text); }
.mock-card small { display: block; margin-top: 6px; color: var(--m-muted); font-size: 11px; }
.mock-card.done p { color: var(--m-muted); text-decoration: line-through; }

/* Sections */

.section { padding-top: 112px; }

.eyebrow {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.section h2 {
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.025em;
  margin: 0 0 14px;
  max-width: 18ch;
}

.section .intro { color: var(--muted); font-size: 18px; max-width: 560px; margin-bottom: 48px; }

/* Features */

.pillars {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 48px 56px;
  margin-bottom: 56px;
}

.pillar h3 { font-size: 20px; margin: 16px 0 6px; letter-spacing: -0.01em; }
.pillar p { color: var(--muted); margin: 0; max-width: 42ch; }

.glyph {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 13%, transparent);
}

.glyph svg { width: 22px; height: 22px; }

.also { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0; margin: 0; list-style: none; }
.also .label { margin-right: 6px; font-size: 14px; color: var(--muted); }

.also li:not(.label) {
  margin: 0;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  background: var(--surface);
}

/* Privacy band */

.band {
  margin-top: 112px;
  background: var(--band-bg);
  color: var(--band-text);
  border-top: 1px solid var(--band-line);
  border-bottom: 1px solid var(--band-line);
}

.band .wrap { padding-top: 80px; padding-bottom: 80px; }
.band .eyebrow, .band .intro { color: var(--band-muted); }
.band .section { padding: 0; }

.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.facts li { margin: 0; padding-top: 18px; border-top: 1px solid var(--band-line); }
.facts strong { display: block; font-size: 18px; margin-bottom: 6px; }
.facts span { color: var(--band-muted); font-size: 15px; }

/* Download */

.platforms { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 20px; }

.platform {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.platform h3 { font-size: 22px; margin: 0 0 4px; }
.platform p { color: var(--muted); margin-bottom: 20px; }
.platform .files { display: flex; flex-wrap: wrap; gap: 8px; }

details {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 20px;
  background: var(--surface);
}

summary {
  cursor: pointer;
  padding: 16px 0;
  font-weight: 600;
}

details[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 16px; }
details h4 { margin: 20px 0 8px; font-size: 16px; }

.table-scroll { overflow-x: auto; margin: 0 0 16px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 0; }
th, td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; }

/* Contribute */

.ways { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }

.way {
  display: block;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.way:hover { color: inherit; border-color: var(--muted); transform: translateY(-2px); }
.way h3 { font-size: 18px; margin: 14px 0 6px; }
.way p { color: var(--muted); margin: 0; font-size: 15px; }
.way .arrow { float: right; color: var(--muted); }

.build { display: grid; grid-template-columns: 1fr 1.3fr; gap: 32px; align-items: start; }
.build h3 { font-size: 20px; margin: 0 0 8px; }
.build p { color: var(--muted); }

/* Legal pages */

.legal { max-width: 720px; padding-top: 24px; }
.legal h1 { font-size: 40px; letter-spacing: -0.02em; margin: 48px 0 4px; }
.legal h2 { font-size: 22px; margin: 36px 0 12px; }

/* Motion */

@media (prefers-reduced-motion: no-preference) {
  .hero .pill, .hero h1, .hero .lede, .hero .actions, .hero .note, .mock {
    animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
  .hero h1 { animation-delay: 0.05s; }
  .hero .lede { animation-delay: 0.1s; }
  .hero .actions, .hero .note { animation-delay: 0.15s; }
  .mock { animation-delay: 0.25s; animation-duration: 0.9s; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button, .way { transition: none; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* Narrow screens */

@media (max-width: 860px) {
  .facts { grid-template-columns: repeat(2, 1fr); }
  .ways { grid-template-columns: 1fr; }
  .build { grid-template-columns: 1fr; gap: 8px; }
}

@media (max-width: 700px) {
  .mock-body { grid-template-columns: 1fr; }
  .mock-side { display: none; }
  .mock-win { display: none; }
  .pillars { grid-template-columns: 1fr; gap: 36px; }
  .platforms { grid-template-columns: 1fr; }
  .section { padding-top: 88px; }
}

@media (max-width: 520px) {
  .site-header nav { gap: 16px; font-size: 14px; }
  .hero { padding-top: 56px; }
  .mock-board { grid-template-columns: repeat(2, 1fr); }
  .mock-col:last-child { display: none; }
  .facts { grid-template-columns: 1fr; gap: 24px; }
  .platform { padding: 22px; }
}
