:root {
  --bg: #F1F5EE;
  --fg: #1C2A1A;
  --accent: #3D7C47;
  --muted: #5a6856;
  --rule: #d3dccc;
  --card: #e7ecdf;
  --ink-inv: #F1F5EE;

  --h: 'Playfair Display', Georgia, serif;
  --b: 'Source Sans 3', system-ui, -apple-system, sans-serif;
  --mono: 'SFMono-Regular', Menlo, Consolas, monospace;

  --maxw: 1180px;
  --gutter: clamp(1.2rem, 3vw, 2.4rem);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--b);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--h);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
}

h1 { font-size: clamp(2rem, 4.2vw, 3.4rem); font-weight: 500; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 500; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.1em; }
a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(61,124,71,0.3); transition: border-color .2s; }
a:hover { border-bottom-color: var(--accent); }

em { font-style: italic; }
code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--card);
  padding: 0.08em 0.35em;
  border-radius: 2px;
}

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

.wrap.narrow {
  max-width: 760px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--rule);
  padding: 1.4rem 0;
  position: sticky;
  top: 0;
  background: rgba(241,245,238,0.92);
  backdrop-filter: blur(6px);
  z-index: 10;
}
.site-header .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--h);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--fg);
  border-bottom: none;
}
.brand em { color: var(--accent); font-style: italic; font-weight: 500; }
.brand .mark { width: 28px; height: 28px; color: var(--accent); }

.site-header nav {
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
}
.site-header nav a {
  color: var(--fg);
  font-size: 0.95rem;
  border-bottom: none;
  padding-bottom: 2px;
}
.site-header nav a[aria-current="page"] {
  border-bottom: 1.5px solid var(--accent);
}
.site-header nav a:hover { color: var(--accent); }

/* Hero */
.hero {
  padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(2rem, 5vw, 4rem);
  border-bottom: 1px solid var(--rule);
}
.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.6rem;
  font-weight: 600;
}
.eyebrow a { color: var(--muted); border: none; }
.eyebrow a:hover { color: var(--accent); }

.hero h1 {
  max-width: 22ch;
  margin-bottom: 1.6rem;
}
.hero h1 em { color: var(--accent); font-style: italic; }
.lede {
  font-size: 1.15rem;
  max-width: 62ch;
  color: var(--fg);
}
.lede-sub {
  color: var(--muted);
  max-width: 62ch;
  font-size: 1rem;
}

/* Page intros */
.page-intro {
  padding: clamp(3rem, 7vw, 5rem) 0 clamp(1.5rem, 3vw, 2.5rem);
  border-bottom: 1px solid var(--rule);
}
.page-intro h1 { max-width: 22ch; }

/* Gallery */
.gallery {
  padding: clamp(3rem, 6vw, 5rem) 0;
}
.section-title {
  font-size: 0.82rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--b);
  font-weight: 600;
  border-top: 1px solid var(--fg);
  padding-top: 1rem;
  margin-bottom: 2.5rem;
}

.case {
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: clamp(1.5rem, 3vw, 3rem);
  padding: clamp(2rem, 4vw, 3rem) 0;
  border-bottom: 1px solid var(--rule);
  align-items: center;
}
.case:last-child { border-bottom: none; }

.case-visual {
  display: block;
  border: none;
  border-radius: 2px;
  overflow: hidden;
  aspect-ratio: 400 / 260;
  background: var(--card);
  transition: transform .3s ease;
}
.case-visual:hover { transform: translateY(-2px); }
.case-visual svg { display: block; width: 100%; height: 100%; }

.case-meta {
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
  font-weight: 600;
}
.case-body h3 {
  font-size: clamp(1.3rem, 2vw, 1.6rem);
  margin-bottom: 0.8rem;
}
.case-body h3 a { color: var(--fg); border-bottom: none; }
.case-body h3 a:hover { color: var(--accent); }
.stack {
  font-size: 0.9rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  border-top: 1px solid var(--rule);
  padding-top: 0.7rem;
  margin-top: 0.7rem;
}

/* Pullquote */
.pullquote {
  padding: clamp(3rem, 6vw, 5rem) 0;
  background: var(--fg);
  color: var(--ink-inv);
}
.pullquote blockquote {
  margin: 0;
  max-width: 42ch;
}
.pullquote p {
  font-family: var(--h);
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  font-style: italic;
  line-height: 1.35;
  margin-bottom: 1.2rem;
}
.pullquote cite {
  font-style: normal;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(241,245,238,0.7);
}

/* Status strip (home page) */
.status-strip {
  padding: clamp(2rem, 4vw, 3rem) 0;
  border-top: 1px solid var(--rule);
  background: var(--card);
}
.status-strip .wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.8rem;
}
.strip-label {
  font-size: 0.76rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.strip-item p:last-child { margin: 0; }

/* Columns (practice page) */
.columns {
  padding: clamp(2.5rem, 5vw, 4rem) 0;
  border-bottom: 1px solid var(--rule);
}
.columns .wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
}
.col h2 {
  font-size: 1.2rem;
  font-family: var(--b);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  border-top: 1px solid var(--accent);
  padding-top: 1rem;
}
.tight { margin: 0 0 1em; padding-left: 1.1em; }
.tight li { margin-bottom: 0.4em; }

/* Team */
.team {
  padding: clamp(2.5rem, 5vw, 4rem) 0;
  border-bottom: 1px solid var(--rule);
}
.member {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1.6rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}
.member:last-child { border-bottom: none; }
.portrait {
  width: 120px;
  height: 120px;
  border-radius: 2px;
  overflow: hidden;
}
.portrait svg { display: block; width: 100%; height: 100%; }
.member h3 { margin-bottom: 0.2em; }
.role {
  font-size: 0.85rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  margin-bottom: 0.9em;
}

/* Rates */
.rates {
  padding: clamp(2.5rem, 5vw, 4rem) 0;
}
.rates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(1.5rem, 3vw, 2.2rem);
}
.rate-title {
  font-family: var(--h);
  font-size: 1.15rem;
  color: var(--accent);
  margin-bottom: 0.4em;
  font-style: italic;
}

/* Method timeline */
.method-timeline {
  padding: clamp(2.5rem, 5vw, 4rem) 0;
  border-bottom: 1px solid var(--rule);
}
.phase {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: clamp(1.4rem, 3vw, 2.4rem);
  padding: 2rem 0;
  border-bottom: 1px dashed var(--rule);
  align-items: start;
}
.phase:last-child { border-bottom: none; }
.phase-marker svg {
  width: 64px;
  height: 64px;
  display: block;
}
.phase-weeks {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0.6rem 0 0;
  font-weight: 600;
}
.phase-body h3 {
  font-family: var(--h);
  font-size: 1.55rem;
  font-weight: 500;
  margin-bottom: 0.6rem;
}
.phase-artifact {
  font-size: 0.88rem;
  color: var(--muted);
  border-left: 2px solid var(--accent);
  padding: 0.2rem 0 0.2rem 0.9rem;
  margin-top: 0.6em;
}
.phase-artifact em {
  font-family: var(--mono);
  font-style: normal;
  font-size: 0.92em;
}

/* Benchmark grid */
.benchmark-discipline {
  padding: clamp(2.5rem, 5vw, 4rem) 0;
  border-bottom: 1px solid var(--rule);
}
.bench-grid {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
}
.bench-card {
  background: var(--card);
  border-left: 3px solid var(--accent);
  padding: 1.2rem 1.4rem;
  border-radius: 2px;
}
.bench-k {
  font-family: var(--h);
  font-size: 1.1rem;
  color: var(--accent);
  font-style: italic;
  margin-bottom: 0.3em;
}
.bench-card p:last-child { margin: 0; font-size: 0.94rem; }

/* Code sample section */
.code-sample {
  padding: clamp(2.5rem, 5vw, 4rem) 0;
}
.footnote {
  font-size: 0.9rem;
  color: var(--muted);
  border-top: 1px dashed var(--rule);
  padding-top: 0.9rem;
  margin-top: 1.4rem;
}

/* Notes */
.notes-list { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.note {
  padding: 2.2rem 0;
  border-bottom: 1px solid var(--rule);
  max-width: 68ch;
}
.note:last-child { border-bottom: none; }
.note-date {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
  font-weight: 600;
}
.note h2 {
  font-size: 1.55rem;
  margin-bottom: 0.7em;
}

/* Contact */
.contact-body { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.contact-body h2 {
  font-size: 1.15rem;
  font-family: var(--b);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-top: 2rem;
  margin-bottom: 0.7em;
}
.status-card {
  margin-top: 2rem;
  padding: 1.8rem 2rem;
  background: var(--card);
  border-left: 3px solid var(--accent);
  border-radius: 2px;
}
.status-label {
  font-family: var(--h);
  font-size: 1.1rem;
  margin: 1rem 0 0.2em;
  color: var(--accent);
  font-style: italic;
}
.status-label:first-child { margin-top: 0; }
.note-inline {
  margin-top: 2.4rem;
  padding: 1.1rem 1.4rem;
  border-left: 2px solid var(--muted);
  font-size: 0.95rem;
  color: var(--muted);
  font-style: italic;
  background: rgba(231,236,223,0.5);
}

/* Case detail */
.case-detail {
  padding: clamp(2.5rem, 5vw, 4.5rem) 0;
}
.case-detail h1 { margin-bottom: 1.2rem; }
.case-detail h2 {
  font-size: 1.15rem;
  font-family: var(--b);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-top: 2.4rem;
  margin-bottom: 0.8em;
}
.case-detail .lede { margin-bottom: 1.8rem; }
.case-detail .stack {
  display: inline-block;
  background: var(--card);
  padding: 0.6rem 1rem;
  border-radius: 2px;
  border-top: none;
  margin-top: 0;
}
.back {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

/* Footer */
.site-footer {
  background: var(--fg);
  color: var(--ink-inv);
  padding: clamp(2.5rem, 5vw, 4rem) 0 2rem;
  margin-top: 0;
}
.site-footer .foot-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin-bottom: 2.5rem;
}
.site-footer a {
  color: var(--ink-inv);
  border-bottom-color: rgba(241,245,238,0.3);
}
.site-footer a:hover { border-bottom-color: var(--ink-inv); }
.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.site-footer li { margin-bottom: 0.5em; }
.foot-brand {
  font-family: var(--h);
  font-size: 1.3rem;
  margin-bottom: 0.8rem;
}
.foot-label {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(241,245,238,0.6);
  margin-bottom: 1rem;
  font-weight: 600;
}
.colophon {
  font-size: 0.85rem;
  color: rgba(241,245,238,0.5);
  border-top: 1px solid rgba(241,245,238,0.15);
  padding-top: 1.4rem;
  margin: 0;
}

/* 404 */
.notfound {
  padding: clamp(4rem, 10vw, 7rem) 0;
}
.code {
  font-family: var(--mono);
  font-size: 0.88rem;
  background: var(--fg);
  color: var(--ink-inv);
  padding: 1.4rem 1.6rem;
  border-radius: 2px;
  overflow-x: auto;
  line-height: 1.7;
  white-space: pre;
}

/* Responsive */
@media (max-width: 720px) {
  .case { grid-template-columns: 1fr; }
  .member { grid-template-columns: 80px 1fr; gap: 1rem; }
  .portrait { width: 80px; height: 80px; }
  .phase { grid-template-columns: 70px 1fr; gap: 1rem; }
  .phase-marker svg { width: 48px; height: 48px; }
  .site-header nav { gap: 1rem; font-size: 0.9rem; }
  .hero h1 { max-width: none; }
}

@media (max-width: 420px) {
  body { font-size: 16px; }
  .site-header { padding: 1rem 0; }
  .site-header nav { width: 100%; }
  .code { font-size: 0.78rem; }
}