/* NM System — one stylesheet, no build step. Colours come from the logo's greens. */

:root {
  --bg: #f6f9f7;
  --surface: #ffffff;
  --tint: #edf4f0;
  --ink: #0c2a22;
  --muted: #4c665d;
  --line: #dbe6e0;
  --brand-deep: #0b4a3a;
  --brand: #12936a;
  --brand-bright: #34d17a;
  --grad: linear-gradient(120deg, #0b4a3a 0%, #13a170 55%, #3ddc84 100%);
  --glow: rgba(52, 209, 122, 0.22);
  --shadow: 0 1px 2px rgba(12, 42, 34, 0.05), 0 8px 24px rgba(12, 42, 34, 0.06);
  --radius: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #07130f;
    --surface: #0d1d18;
    --tint: #0a1814;
    --ink: #e4f1eb;
    --muted: #9bb4aa;
    --line: #1d332b;
    --brand: #2fc27f;
    --brand-bright: #4be38f;
    --grad: linear-gradient(120deg, #1fa874 0%, #34d17a 60%, #8ff0b5 100%);
    --glow: rgba(52, 209, 122, 0.16);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

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

html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
h2 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 28px; }
h3 { font-size: 19px; }
p { margin: 0 0 1em; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

.skip {
  position: absolute; left: 16px; top: -48px; z-index: 10;
  padding: 8px 14px; border-radius: 8px; background: var(--ink); color: var(--bg);
}
.skip:focus { top: 12px; }

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

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font-weight: 800; letter-spacing: 0.14em; font-size: 15px;
}
.brand img { width: 45px; height: 22px; }
.nav { display: flex; gap: 4px; }
.nav a {
  color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500;
  padding: 8px 12px; border-radius: 999px;
}
.nav a:hover { color: var(--ink); background: var(--tint); }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 72px 0 40px; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 70vw; height: 70vw; max-width: 900px; max-height: 900px;
  background: radial-gradient(closest-side, var(--glow), transparent 70%);
  pointer-events: none;
}
.hero__inner {
  position: relative;
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center;
}
.hero h1 { font-size: clamp(38px, 6vw, 64px); font-weight: 800; letter-spacing: -0.035em; margin-bottom: 20px; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow {
  margin: 0 0 12px; color: var(--brand);
  font-size: 13px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
}
.lede { font-size: clamp(18px, 2vw, 20px); color: var(--muted); max-width: 36em; }
.hero__art img { width: 100%; filter: drop-shadow(0 24px 40px rgba(11, 74, 58, 0.18)); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 16px; text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.btn--primary { background: var(--grad); border-color: transparent; color: #fff; }
@media (prefers-color-scheme: dark) { .btn--primary { color: #04140e; } }

.facts {
  list-style: none; margin: 56px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.facts li { background: var(--surface); padding: 20px 22px; display: grid; gap: 2px; }
.facts strong { font-size: 16px; }
.facts span { color: var(--muted); font-size: 15px; }

/* Sections */
.section { padding: 88px 0; }
.section--tint { background: var(--tint); border-block: 1px solid var(--line); }

.split { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 48px; }
.prose p { color: var(--muted); }
.prose strong { color: var(--ink); }
.principles { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 12px; }
.principles li {
  position: relative; padding: 14px 16px 14px 44px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--muted);
}
.principles li::before {
  content: ""; position: absolute; left: 16px; top: 20px; width: 14px; height: 14px; border-radius: 4px;
  background: var(--grad); transform: rotate(45deg) scale(0.8);
}

/* Projects */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-flow: row dense; gap: 20px; }
.card--wide { grid-column: span 2; }
.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; position: relative; overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--grad); opacity: 0;
  transition: opacity 0.2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card:hover::before { opacity: 1; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card p { color: var(--muted); font-size: 16px; flex: 1; }
.badge {
  flex: none; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent);
}
.badge--live::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%;
  background: var(--brand-bright); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-bright) 25%, transparent);
  vertical-align: 1px;
}
.tags, .chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
  font-size: 13px; font-weight: 500; color: var(--muted);
  padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line);
}

.card h3 a { color: inherit; text-decoration: none; }
.card h3 a:hover { color: var(--brand); }
.card h3 a::after { content: " ↗"; font-size: 0.8em; color: var(--muted); }
code { font: 0.92em ui-monospace, "Cascadia Code", Consolas, monospace; padding: 1px 5px; border-radius: 6px; background: var(--tint); }

/* Team */
.team { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; align-items: start; }
.person {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; display: grid; gap: 4px;
}
.person__head { display: flex; align-items: center; gap: 20px; margin-bottom: 16px; }
.person__photo {
  flex: none; width: 104px; height: 104px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px color-mix(in srgb, var(--brand) 55%, transparent);
}
.person h3 { font-size: 22px; }
.person__role { margin: 4px 0 8px; color: var(--brand); font-weight: 600; font-size: 15px; }
.person__links { list-style: none; margin: 0; padding: 0; display: flex; gap: 14px; font-size: 14px; font-weight: 600; }
.person__bio { color: var(--muted); font-size: 16px; }
.person h4 {
  margin: 14px 0 8px; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.cv { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cv li { display: grid; grid-template-columns: 104px 1fr; gap: 12px; font-size: 15px; }
.cv__when { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cv__what { color: var(--muted); }
.cv__what strong { color: var(--ink); font-weight: 600; }
.person .tags { margin-top: 18px; }
.person__certs { color: var(--muted); font-size: 15px; margin: 0; }

/* Stack */
.stack { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.stack__group { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.stack__group h3 { font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.chips li {
  font-size: 15px; font-weight: 600; padding: 6px 12px; border-radius: 10px;
  background: var(--tint); border: 1px solid var(--line);
}

/* Self-hosted */
.hosts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.host {
  display: grid; gap: 6px; padding: 22px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
a.host:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); box-shadow: var(--shadow); }
.host__name { font: 600 16px/1.3 ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace; color: var(--brand); }
.host__what { color: var(--muted); font-size: 15px; }

/* Contact */
.contact { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.contact h2 { margin-bottom: 12px; }
.contact .lede { margin: 0; }
.contact .actions { margin-top: 0; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: 14px; }
.footer__inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* 404 */
.notfound { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 64px 0; }
.notfound img { width: 160px; margin: 0 auto 28px; }
.notfound h1 { font-size: clamp(32px, 5vw, 48px); margin-bottom: 12px; }
.notfound .actions { justify-content: center; }

/* Narrow screens */
@media (max-width: 960px) {
  .grid, .stack, .hosts { grid-template-columns: repeat(2, 1fr); }
  .team { grid-template-columns: 1fr; }
  .hero__inner, .split { grid-template-columns: 1fr; gap: 28px; }
  .hero__art { order: -1; max-width: 360px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .brand span { display: none; }
  .nav a { padding: 6px 7px; font-size: 13.5px; }
  .person { padding: 22px 18px; }
  .person__photo { width: 84px; height: 84px; }
  .cv li { grid-template-columns: 1fr; gap: 0; }
  .hero { padding-top: 40px; }
  .hero__art { max-width: 240px; }
  .grid, .stack, .hosts, .facts { grid-template-columns: 1fr; }
  .card--wide { grid-column: auto; }
  .facts { margin-top: 40px; }
  .section { padding: 64px 0; }
  .btn { flex: 1 1 auto; justify-content: center; }
}
