@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Source+Serif+4:opsz,wght@8..60,400;8..60,500&display=swap');

:root {
  --paper: #f6f4ee;
  --paper-line: rgba(16, 35, 59, 0.08);
  --ink: #14243a;
  --ink-soft: #3a4c62;
  --blue: #2f5d82;
  --blue-deep: #10233b;
  --amber: #d98e2b;
  --slate: #6b7a84;
  --max: 880px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    linear-gradient(var(--paper-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--paper-line) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px, 32px 32px;
  color: var(--ink);
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .mono-label, nav, .brand {
  font-family: 'Space Grotesk', Helvetica, Arial, sans-serif;
}

a {
  color: var(--blue-deep);
  text-decoration-color: var(--amber);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:hover { color: var(--amber); }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 28px;
}

/* ---- header ---- */

header.site {
  border-bottom: 1px solid var(--paper-line);
  background: rgba(246, 244, 238, 0.88);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 10;
}

header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.brand .mark {
  width: 26px;
  height: 26px;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--blue-deep);
}

nav.primary {
  display: flex;
  gap: 26px;
}

nav.primary a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
}

nav.primary a:hover { color: var(--ink); }

nav.primary a.active {
  color: var(--ink);
  border-bottom-color: var(--amber);
}

section[id] {
  scroll-margin-top: 76px;
}

/* ---- hero ---- */

.hero {
  padding: 76px 0 56px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: center;
}

.kicker {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--blue);
  margin: 0 0 14px;
}

.hero h1 {
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.02;
  margin: 0 0 20px;
  font-weight: 700;
  color: var(--blue-deep);
}

.hero p.lede {
  max-width: 54ch;
  color: var(--ink-soft);
  font-size: 19px;
}

.diagram {
  justify-self: center;
}

.diagram svg { width: 100%; max-width: 260px; height: auto; }

.diagram path.trace {
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: draw 1.6s ease forwards 0.2s;
}

.diagram circle.node {
  opacity: 0;
  animation: fadein 0.5s ease forwards 1.5s;
}

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadein { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .diagram path.trace { animation: none; stroke-dashoffset: 0; }
  .diagram circle.node { animation: none; opacity: 1; }
}

/* ---- sections ---- */

section.block {
  padding: 40px 0;
}

section.block h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--blue);
  margin: 0 0 28px;
  letter-spacing: 0.01em;
}

.bio {
  max-width: 62ch;
  font-size: 17.5px;
  color: var(--ink);
}

.bio p + p { margin-top: 18px; }

.pursuits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
}

.pursuit h3 {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 600;
  color: var(--blue-deep);
}

.pursuit p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 16px;
}

/* ---- footer ---- */

footer.site {
  border-top: 1px solid var(--paper-line);
  padding: 32px 0 48px;
}

footer.site .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  align-items: baseline;
  justify-content: space-between;
}

.contact-links {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

.contact-links a {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
}

footer.site .stamp {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12.5px;
  color: var(--slate);
}

/* ---- projects page ---- */

.page-intro {
  padding: 8px 0 8px;
}

.page-intro .kicker { margin-bottom: 10px; }

.page-intro h1 {
  font-size: clamp(32px, 5vw, 46px);
  color: var(--blue-deep);
  margin: 0 0 16px;
}

.page-intro p {
  max-width: 58ch;
  color: var(--ink-soft);
  font-size: 17.5px;
}

.spec-list {
  padding: 8px 0 40px;
}

.spec {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 28px;
  padding: 28px 0;
}

.spec .ref {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--slate);
  padding-top: 4px;
}

.spec h3 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
  color: var(--blue-deep);
}

.spec .tagline {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  color: var(--blue);
  margin: 0 0 14px;
  font-weight: 500;
}

.spec p.desc {
  margin: 0 0 16px;
  color: var(--ink);
  font-size: 16.5px;
  max-width: 62ch;
}

.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.stack li {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12.5px;
  color: var(--ink-soft);
  border: 1px solid var(--paper-line);
  border-radius: 3px;
  padding: 3px 9px;
}

.spec a.view {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 500;
}

.spec .role {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  color: var(--blue);
  margin: 0 0 14px;
  font-weight: 500;
}

/* ---- responsive ---- */

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; }
  .diagram { justify-self: start; max-width: 200px; }
  .pursuits { grid-template-columns: 1fr; }
  .spec { grid-template-columns: 1fr; gap: 8px; }
  .spec .ref { padding-top: 0; }
  footer.site .wrap { flex-direction: column; align-items: flex-start; }
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}
