:root { color-scheme: dark; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(900px 420px at 100% -8%, rgba(196,165,116,0.14), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
main, footer { width: min(1080px, calc(100% - 48px)); margin-inline: auto; }
header.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  width: 100%;
  margin: 0;
  padding: 14px max(20px, calc((100% - 1080px) / 2));
  background: rgba(12, 27, 51, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 500;
  transition: color 0.2s ease;
}
.brand img { width: 32px; height: 32px; transition: transform 0.25s ease; }
.brand:hover img { transform: rotate(-6deg); }
nav { display: flex; flex-wrap: wrap; gap: 4px; font-size: 0.92rem; }
nav a {
  position: relative;
  text-decoration: none;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease;
}
nav a:hover { color: var(--ink); background: rgba(244,241,234,0.06); }
nav a:active { transform: translateY(1px); }
nav a[aria-current="page"] { color: var(--ink); background: rgba(196,165,116,0.14); }
main section { animation: rise 0.6s ease both; }
main section:nth-child(2) { animation-delay: 0.06s; }
main section:nth-child(3) { animation-delay: 0.12s; }
main section:nth-child(4) { animation-delay: 0.18s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.hero { padding: 72px 0 20px; }
.eyebrow {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  margin: 0 0 14px;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.08; margin: 0 0 16px; max-width: 14ch; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.2; margin: 0 0 12px; }
h3 { font-size: 1.25rem; line-height: 1.3; margin: 0 0 8px; }
.lede, .prose p, .cards p, .project p, .cta p { color: var(--muted); font-size: 1.05rem; }
.lede { max-width: 38em; margin: 0; }
.btn {
  display: inline-block;
  margin-top: 22px;
  padding: 12px 18px;
  border: 1px solid var(--accent);
  border-radius: 2px;
  color: var(--ink);
  text-decoration: none;
  background: transparent;
  font: inherit;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.btn:hover { background: var(--accent); color: #1c160e; box-shadow: 0 8px 24px rgba(196,165,116,0.18); }
.btn:active { transform: translateY(1px) scale(0.99); box-shadow: none; }
.btn:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.stats ul, .grid, .stack { list-style: none; padding: 0; margin: 0; }
.stats { padding: 12px 0 8px; }
.stats ul { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stats li { border-top: 1px solid var(--line); padding: 16px 2px 4px; transition: border-color 0.2s ease; }
.stats li:hover { border-color: var(--accent); }
.stats strong { display: block; font-family: var(--serif); font-size: 1.35rem; font-weight: 400; margin-bottom: 4px; }
.stats span, .meta, .fine, .status, .form-note { color: var(--muted); font-size: 0.92rem; }
.cards, .projects, .prose, .cta, .form-wrap { padding: 40px 0 64px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid article, .project, form {
  background: rgba(19, 39, 67, 0.7);
  border: 1px solid var(--line);
  padding: 22px;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.grid article:hover, .project:hover {
  border-color: rgba(196,165,116,0.7);
  background: rgba(19, 39, 67, 0.95);
  transform: translateY(-3px);
}
.stack { display: grid; gap: 14px; }
.status { letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.72rem; color: var(--accent); margin: 0 0 10px; }
.meta { margin: 0 0 8px; }
.cta {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: end;
  border-top: 1px solid var(--line);
  padding-top: 36px;
}
.cta p { max-width: 36em; margin: 0; }
.prose { max-width: 40em; }
.prose p + p { margin-top: 1em; }
form { display: grid; gap: 14px; max-width: 640px; }
label { display: grid; gap: 6px; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(12, 27, 51, 0.55);
  color: var(--ink);
  font: 1rem/1.5 var(--sans);
  letter-spacing: 0;
  text-transform: none;
  padding: 12px 14px;
  transition: border-color 0.18s ease, background 0.18s ease;
}
input:hover, textarea:hover { border-color: rgba(196,165,116,0.45); }
input:focus, textarea:focus { border-color: var(--accent); background: rgba(12, 27, 51, 0.85); outline: none; }
.form-note { min-height: 1.2em; margin: 0; }
.fine { margin: 0; }
footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}
footer p { margin: 6px 0 0; }
footer a { text-decoration: none; border-bottom: 1px solid transparent; transition: border-color 0.2s ease, color 0.2s ease; }
footer a:hover { color: var(--ink); border-bottom-color: var(--accent); }
footer strong { color: var(--ink); font-weight: 500; letter-spacing: 0.03em; }
@media (max-width: 720px) {
  header.top, .cta, footer, .stats ul, .grid { display: grid; grid-template-columns: 1fr; }
  header.top { position: static; align-items: start; padding-inline: 16px; }
  main, footer { width: min(1080px, calc(100% - 32px)); }
  h1 { font-size: clamp(1.85rem, 8vw, 2.4rem); max-width: none; }
  .hero { padding-top: 40px; }
  .lede, .prose p, .cards p, .project p, .cta p { font-size: 1rem; }
  .cta { align-items: start; }
  .grid article:hover, .project:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
