:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1b1d21;
  --muted: #5d636e;
  --line: #e4e1da;
  --accent: #1f5c4d;
  --accent-ink: #ffffff;
  --accent-soft: #e6f0ec;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Charter, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121416;
    --surface: #1a1d20;
    --text: #eceae5;
    --muted: #a2a8b1;
    --line: #2b2f34;
    --accent: #7fcdb4;
    --accent-ink: #0d1412;
    --accent-soft: #1d2b27;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); letter-spacing: -0.02em; max-width: 16ch; }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; }
p { margin: 0; }
a { color: inherit; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
@media (max-width: 480px) { .wrap { padding: 0 16px; } }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--surface); padding: 8px 12px; z-index: 20; }

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

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--serif); font-size: 0.95rem; letter-spacing: 0.02em;
}
nav { display: flex; align-items: center; gap: 22px; font-size: 0.95rem; }
nav a { text-decoration: none; color: var(--muted); }
nav a:hover { color: var(--text); }
nav .nav-cta { color: var(--accent); font-weight: 600; }
@media (max-width: 560px) {
  .brand-name { display: none; }
  nav { gap: 16px; font-size: 0.9rem; }
}

/* Hero */
.hero { padding-top: clamp(56px, 10vw, 120px); padding-bottom: clamp(48px, 8vw, 96px); }
.eyebrow {
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 16px;
}
.lede { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--muted); max-width: 60ch; margin-top: 24px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.btn {
  display: inline-block; padding: 12px 22px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  text-decoration: none; font-weight: 600; font-size: 0.98rem;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  margin: clamp(48px, 8vw, 88px) 0 0; padding-top: 32px; border-top: 1px solid var(--line);
}
.stats div { margin: 0; }
.stats dt { font-family: var(--serif); font-size: clamp(1.6rem, 3.5vw, 2.3rem); font-weight: 600; }
.stats dd { margin: 6px 0 0; color: var(--muted); font-size: 0.95rem; max-width: 28ch; }
@media (max-width: 640px) { .stats { grid-template-columns: 1fr; gap: 20px; } }

/* Clients */
.clients-block { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); }
.clients-label {
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 16px;
}
.clients {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 10px 0;
  font-family: var(--serif); font-size: 1.05rem; line-height: 1.35; color: var(--muted);
  /* Shift left by one item's divider + padding, then clip it, so no row starts with a divider. */
  margin-left: -19px; clip-path: inset(0 0 0 19px);
}
.clients li { padding: 0 18px; border-left: 1px solid var(--line); }
@media (max-width: 560px) {
  .clients { display: grid; grid-template-columns: 1fr; gap: 8px; margin-left: 0; clip-path: none; }
  .clients li { padding: 0 0 0 14px; border-left: 2px solid var(--line); }
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Sections */
.section { padding-top: clamp(56px, 8vw, 96px); padding-bottom: clamp(24px, 4vw, 48px); }
.section-head { margin-bottom: 36px; }
.section-note { color: var(--muted); margin-top: 12px; font-size: 0.98rem; }

/* Services */
.services {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
.services li { padding: 28px 24px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.services p { color: var(--muted); margin-top: 10px; font-size: 0.98rem; }
@media (max-width: 860px) { .services { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .services { grid-template-columns: 1fr; } }

/* First-project steps */
.steps { list-style: none; margin: 0; padding: 0; max-width: 760px; counter-reset: step; border-top: 1px solid var(--line); }
.steps li {
  counter-increment: step;
  display: grid; grid-template-columns: 56px 1fr; column-gap: 16px;
  padding: 24px 0; border-bottom: 1px solid var(--line);
}
.steps li::before {
  content: counter(step);
  grid-row: span 2;
  font-family: var(--serif); font-size: 1.9rem; line-height: 1; color: var(--accent);
}
.steps p { grid-column: 2; color: var(--muted); margin-top: 8px; max-width: 64ch; }
@media (max-width: 480px) { .steps li { grid-template-columns: 36px 1fr; column-gap: 12px; } .steps li::before { font-size: 1.5rem; } }

/* Projects */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filter {
  font: inherit; font-size: 0.9rem; font-weight: 500; cursor: pointer;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
}
.filter:hover { color: var(--text); border-color: var(--muted); }
.filter[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }

.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 800px) { .projects { grid-template-columns: 1fr; } }

.project {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 28px; display: flex; flex-direction: column; gap: 20px;
}
.project-client {
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px;
}
.project h3 { font-size: 1.4rem; }
.project-metric {
  display: inline-block; margin-top: 14px; padding: 5px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 0.88rem;
}
.project-body { margin: 0; display: grid; gap: 14px; }
.project-body div { display: grid; grid-template-columns: 88px 1fr; gap: 12px; }
.project-body dt {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); padding-top: 4px;
}
.project-body dd { margin: 0; font-size: 0.97rem; }
@media (max-width: 480px) { .project { padding: 22px; } .project-body div { grid-template-columns: 1fr; gap: 2px; } }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: auto 0 0; padding: 0; }
.chips li {
  font-size: 0.8rem; padding: 3px 10px; border-radius: 6px;
  border: 1px solid var(--line); color: var(--muted);
}

/* About */
.about { display: grid; grid-template-columns: 1.3fr 1fr; gap: 56px; align-items: start; }
.about-text { display: grid; gap: 18px; font-size: 1.05rem; }
.skills { margin: 0; display: grid; border-top: 1px solid var(--line); }
.skills div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.skills dt { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.skills dd { margin: 4px 0 0; }
@media (max-width: 800px) { .about { grid-template-columns: 1fr; gap: 32px; } }

/* Contact */
.contact { padding-bottom: clamp(72px, 10vw, 120px); }
.contact h2 { max-width: 20ch; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; padding-top: 24px; padding-bottom: 24px; }

/* 404 */
.notfound { min-height: 70vh; display: grid; align-content: center; gap: 8px; }
