:root {
  --bg: #0e0f12;
  --surface: #17191f;
  --border: #262a33;
  --text: #e8e9ed;
  --muted: #a3a8b4;
  --accent: #8aaeff;
  --max: 880px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fafafa;
    --surface: #ffffff;
    --border: #e3e5ea;
    --text: #15171c;
    --muted: #596070;
    --accent: #2350c8;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: var(--bg); padding: 0.6rem 1rem; z-index: 10;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

.site-header, main, .site-footer { width: min(var(--max), 100% - 3rem); margin-inline: auto; }

.site-header {
  display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem;
  justify-content: space-between; align-items: center;
  padding: 1.5rem 0;
}
.brand { color: var(--text); font-weight: 650; letter-spacing: -0.01em; text-decoration: none; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.site-header nav a { color: var(--muted); text-decoration: none; }
.site-header nav a:hover { color: var(--text); text-decoration: underline; }

.hero { padding: 5rem 0 4rem; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.8rem; margin: 0 0 1rem; }
h1 { font-size: clamp(2.25rem, 6vw, 3.75rem); line-height: 1.08; margin: 0 0 1.25rem; letter-spacing: -0.03em; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 38rem; margin: 0 0 1.5rem; }

section { padding: 2.75rem 0; border-top: 1px solid var(--border); }
.hero { border-top: none; }
h2 { font-size: 1.5rem; margin: 0 0 1.25rem; letter-spacing: -0.02em; }
h3 { margin: 0 0 0.25rem; font-size: 1.1rem; }
h4 { margin: 1rem 0 0.25rem; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

.muted, .meta { color: var(--muted); font-weight: 400; }
.meta { margin: 0 0 0.5rem; font-size: 0.9rem; }

.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a:hover { color: var(--accent); text-decoration: underline; }
.card p { margin: 0.4rem 0 0; color: var(--muted); }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0; margin: 0.9rem 0 0; }
.tags li { font-size: 0.8rem; padding: 0.15rem 0.6rem; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); }

.role { margin-bottom: 2rem; }
.role ul { margin: 0.25rem 0 0; padding-left: 1.2rem; }

.project section { padding: 1.5rem 0 0; border-top: none; }
.project h2 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.facts { display: flex; flex-wrap: wrap; gap: 1.5rem; margin: 1.5rem 0; }
.facts dt { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.facts dd { margin: 0; }
figure { margin: 1.5rem 0; }
figure img { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--border); }

/* Contact form */
#contact-form { max-width: 34rem; margin-top: 1.25rem; }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
.req, .opt { font-weight: 400; color: var(--muted); font-size: 0.85rem; }
.field input, .field textarea {
  width: 100%; padding: 0.65rem 0.8rem; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
}
.field textarea { resize: vertical; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #e5484d; }
.error { color: #e5484d; margin: 0.3rem 0 0; font-size: 0.9rem; }
@media (prefers-color-scheme: light) { .error { color: #c2262b; } }
.notice { color: var(--muted); font-size: 0.9rem; margin: 0 0 1.1rem; }
button.button { border: 0; font: inherit; font-weight: 600; cursor: pointer; color: #fff; background: #2350c8; }
button.button:disabled { opacity: 0.6; cursor: not-allowed; }
#cf-status { margin: 0.9rem 0 0; min-height: 1.5em; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.site-footer { padding: 2rem 0 3rem; color: var(--muted); border-top: 1px solid var(--border); font-size: 0.9rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
