:root {
  --paper: #f3f3ed;
  --ink: #25332f;
  --muted: #66716a;
  --line: #d4d9cc;
  --green: #244938;
  --lime: #d2e577;
  --white: #fffef8;
  --dark: #23352e;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, summary { font: inherit; }
button { cursor: pointer; }
::selection { color: var(--ink); background: var(--lime); }
:focus-visible { outline: 3px solid #6a882e; outline-offset: 5px; border-radius: 3px; }

.skip { position: absolute; top: -70px; left: 16px; background: var(--ink); color: white; padding: 10px 20px; z-index: 9; }
.skip:focus { top: 12px; }
.shell { width: min(1200px, calc(100% - 96px)); margin-inline: auto; }
.eyebrow { font: 11px/1.5 var(--mono); letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }

.site-header { background: rgba(243, 243, 237, .95); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.header-inner { height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--ink);
  color: var(--lime);
  border-radius: 7px;
  font: 700 19px var(--mono);
  transform: rotate(-4deg);
}
.brand-name { font-size: 22px; font-weight: 750; letter-spacing: -.9px; }
.brand-label { border-left: 1px solid var(--line); padding-left: 16px; margin-left: 9px; color: var(--muted); font-size: 11px; letter-spacing: 2px; }
nav { display: flex; align-items: center; gap: 30px; font-size: 13px; }
nav a { transition: color .2s; }
nav a:hover { color: #50754a; }
nav a[aria-current="page"] { color: var(--green); font-weight: 650; }
.repo-link { border: 1px solid #abb7a5; border-radius: 5px; padding: 8px 14px; }
nav a[aria-current="page"].repo-link { color: inherit; font-weight: 500; }

.hero { display: grid; grid-template-columns: 1.12fr 1fr; gap: 68px; align-items: center; padding: 66px 0 58px; }
.hero-kicker { display: flex; align-items: center; gap: 9px; margin-bottom: 24px; }
.square { width: 7px; height: 7px; background: #6c883c; display: inline-block; }
.hero h1, .folio-hero h1 {
  font-size: clamp(42px, 4.3vw, 61px);
  line-height: 1.28;
  letter-spacing: -2px;
  margin: 0 0 24px;
  font-weight: 800;
}
.mark { position: relative; isolation: isolate; white-space: nowrap; }
.mark::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: -2px;
  right: -5px;
  height: 15px;
  bottom: 4px;
  background: var(--lime);
  transform: rotate(-1deg);
}
.hero-copy, .folio-copy { font-size: 15px; color: #59675e; line-height: 1.95; max-width: 490px; margin: 0; }
.hero-copy strong, .folio-copy strong { color: var(--ink); font-weight: 600; }
.actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  gap: 28px;
  padding: 10px 19px;
  border: 1px solid #b3bdad;
  border-radius: 5px;
  font-size: 13px;
  transition: transform .2s, background .2s;
}
.button.primary { background: var(--green); color: var(--white); border-color: var(--green); }
.button:hover { transform: translateY(-2px); background: #e7ebdd; }
.button.primary:hover { background: #315a45; }
.hero-meta { margin-top: 26px; display: flex; gap: 18px; flex-wrap: wrap; font: 10px/1.6 var(--mono); color: var(--muted); letter-spacing: .35px; }
.hero-meta span:not(:last-child)::after { content: "/"; margin-left: 18px; color: #a7aea0; }

.workbench {
  background: var(--dark);
  color: #f5f5e8;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 14px 0 -7px #dfe3d4;
  position: relative;
  overflow: hidden;
}
.bench-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #b6c4b7;
  font: 10px/1.6 var(--mono);
  padding-bottom: 20px;
  border-bottom: 1px solid #46594a;
}
.bench-top strong { color: #dce5d4; font-weight: 500; }
.bench-title { padding-top: 22px; display: flex; justify-content: space-between; align-items: center; }
.bench-title h2 { margin: 0; font-size: 19px; letter-spacing: .2px; font-weight: 550; }
.bench-title span { color: #aabda8; font: 9px var(--mono); }
.flow { padding-top: 23px; display: flex; flex-direction: column; }
.flow-row { display: flex; align-items: center; gap: 14px; min-height: 53px; position: relative; }
.flow-num {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  background: #344a3c;
  color: var(--lime);
  border: 1px solid #526548;
  border-radius: 5px;
  font: 10px var(--mono);
  position: relative;
  flex-shrink: 0;
}
.flow-row:not(:last-child) .flow-num::after {
  content: "";
  position: absolute;
  height: 23px;
  left: 13px;
  top: 29px;
  border-left: 1px dashed #6b7d5d;
}
.flow-text { width: 98px; flex-shrink: 0; font-size: 13px; color: #ecf0de; }
.flow-detail { margin-left: auto; font-size: 11px; color: #adbdac; text-align: right; }
.bench-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 17px 0 0;
  border-top: 1px solid #46594a;
  margin-top: 17px;
  font: 9px/1.7 var(--mono);
  color: #a9b8a5;
}
.loop { color: var(--lime); font-size: 10px; white-space: nowrap; }

.context-strip {
  display: grid;
  grid-template-columns: 1.02fr 1fr 1fr;
  gap: 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 23px 0;
}
.context-cell { display: flex; gap: 14px; align-items: baseline; }
.context-cell + .context-cell { border-left: 1px solid var(--line); padding-left: 28px; }
.context-cell .eyebrow { font-size: 9px; flex-shrink: 0; letter-spacing: .8px; }
.context-cell p { margin: 0; font-size: 12px; }

section { scroll-margin-top: 20px; }
.section { padding: 64px 0; }
.section-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 28px; }
.section-header h2 { margin: 5px 0 0; font-size: 30px; line-height: 1.35; letter-spacing: -.8px; }
.section-aside { color: var(--muted); font-size: 12px; margin: 0 0 3px; }

.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.project {
  padding: 25px 26px 18px;
  border: 1px solid #cbd3c3;
  border-radius: 7px;
  background: rgba(255, 255, 249, .45);
  transition: border-color .2s, box-shadow .2s;
  min-width: 0;
}
.project:hover { border-color: #8b9c7b; box-shadow: 0 6px 20px rgba(39, 60, 32, .05); }
.project-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.project-index { color: var(--muted); font: 10px var(--mono); letter-spacing: .8px; }
.status {
  font-size: 10px;
  border-radius: 20px;
  padding: 2px 9px;
  border: 1px solid #bdc8b3;
  color: #4b6350;
  background: #e9eee1;
  white-space: nowrap;
}
.status.progress { color: #6b643c; border-color: #d8d1ad; background: #f1edde; }
.status.study { color: #60675b; border-color: #d4d6c6; background: #eaebdf; }
.project h3 { font-size: 23px; line-height: 1.4; margin: 17px 0 9px; letter-spacing: -.5px; }
.project h3 a:hover { color: #50754a; }
.project-lead { color: #657063; font-size: 13px; line-height: 1.9; margin: 0; min-height: 74px; }
.project-tags { display: flex; gap: 7px; flex-wrap: wrap; padding: 19px 0 4px; }
.tag { color: #697260; font: 10px/1.6 var(--mono); border: 1px solid #dbe0d2; border-radius: 3px; padding: 2px 7px; align-self: center; }
.project-more {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: #496442;
}
.project-more:hover { color: #315a45; }

.about { border-top: 1px solid var(--line); display: grid; grid-template-columns: .77fr 1.23fr; gap: 95px; }
.about h2 { font-size: 34px; line-height: 1.5; margin: 13px 0 18px; letter-spacing: -1px; }
.about-caption { margin: 0; font: 11px/1.8 var(--mono); color: var(--muted); }
.about-copy p { font-size: 14px; color: #5c695e; line-height: 2; margin: 0 0 20px; }
.about-copy p:last-child { margin-bottom: 0; }
.about-copy strong { color: var(--ink); font-weight: 600; }
.about-note { margin-top: 24px; border-left: 3px solid #b6ca61; padding: 2px 0 2px 17px; font-size: 13px; color: #4d6449; }

.notes { border-top: 1px solid var(--line); }
.notes-list { border-top: 1px solid #cdd4c4; }
.note { display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: start; padding: 24px 0; border-bottom: 1px solid #cdd4c4; }
.note-index { font: 10px var(--mono); color: #7a856e; padding-top: 6px; }
.note h3 { font-size: 16px; font-weight: 600; margin: 0 0 7px; }
.note p { margin: 0; font-size: 13px; line-height: 1.9; color: #6a7365; max-width: 960px; }
.note-label { font: 9px var(--mono); letter-spacing: 1px; color: #7f8b72; margin-bottom: 7px; }

.closing {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  border: 1px solid #c8d1bd;
  background: #e8ecd9;
  border-radius: 7px;
  padding: 28px 32px;
  margin-bottom: 50px;
}
.closing h2 { font-size: 21px; margin: 3px 0 7px; font-weight: 650; }
.closing p { font-size: 12px; color: #66725b; margin: 0; }
.closing .button { flex-shrink: 0; }

footer { border-top: 1px solid var(--line); padding: 23px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; color: #7a826f; font: 10px/1.8 var(--mono); }
.footer-note { font-family: var(--sans); }

.folio-hero {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 64px;
  align-items: end;
  padding: 62px 0 42px;
}
.folio-hero h1 { margin-bottom: 18px; }
.legend { list-style: none; margin: 0; padding: 8px 0 8px 22px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.legend li { display: grid; grid-template-columns: 76px 1fr; gap: 12px; align-items: center; font-size: 13px; color: #5c695e; }
.legend .status { justify-self: start; }

.folio-index {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.folio-index a {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 108px;
  padding: 18px 18px 16px;
  border-left: 1px solid var(--line);
}
.folio-index a:first-child { border-left: 0; }
.folio-index a:hover { background: #e7ebdd; }
.folio-index strong { font-size: 15px; font-weight: 650; letter-spacing: -.2px; }
.folio-index em { font-style: normal; font: 10px/1.5 var(--mono); color: var(--muted); letter-spacing: .4px; }

.case-list { display: flex; flex-direction: column; gap: 22px; padding: 36px 0 8px; }
.case {
  border: 1px solid #cbd3c3;
  border-radius: 7px;
  background: rgba(255, 255, 249, .45);
  overflow: hidden;
  scroll-margin-top: 108px;
}
.case-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: var(--dark);
  color: #dce5d4;
  padding: 12px 22px;
  font: 10px/1.6 var(--mono);
  letter-spacing: .6px;
}
.case-kicker { color: var(--lime); }
.case-body { display: grid; grid-template-columns: 300px 1fr; gap: 42px; padding: 28px 28px 30px; }
.case h2 { margin: 14px 0 10px; font-size: 30px; line-height: 1.3; letter-spacing: -.8px; }
.case-lead { margin: 0; color: #657063; font-size: 14px; line-height: 1.85; }
.case-facts { margin: 22px 0 0; display: flex; flex-direction: column; gap: 12px; }
.case-facts div { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: baseline; }
.case-facts dt { font: 10px/1.5 var(--mono); letter-spacing: .8px; color: var(--muted); }
.case-facts dd { margin: 0; font-size: 13px; }
.case-tags { padding-top: 18px; }
.case-copy p { margin: 0 0 16px; font-size: 14px; color: #5c695e; line-height: 1.95; }
.case-copy p:last-child { margin-bottom: 0; }
.case-copy b { color: var(--ink); font-weight: 650; }

@media (min-width: 1600px) {
  .hero, .folio-hero { padding-block: 78px; }
}

@media (max-width: 1100px) {
  .shell { width: calc(100% - 64px); }
  .hero, .folio-hero { gap: 36px; }
  .hero h1, .folio-hero h1 { font-size: 48px; }
  .context-cell { flex-direction: column; gap: 6px; }
  .about { gap: 50px; }
  .brand-label { display: none; }
  .case-body { grid-template-columns: 240px 1fr; gap: 28px; }
}

@media (max-width: 800px) {
  .shell { width: calc(100% - 40px); }
  .header-inner { height: 72px; gap: 14px; }
  nav { gap: 17px; font-size: 12px; }
  nav .nav-notes { display: none; }
  .brand-name { font-size: 20px; }
  .brand-mark { width: 27px; height: 27px; font-size: 16px; }
  .repo-link { padding: 6px 9px; }
  .hero, .folio-hero { grid-template-columns: 1fr; padding: 40px 0; gap: 28px; align-items: start; }
  .hero h1, .folio-hero h1 { font-size: clamp(40px, 7.2vw, 60px); }
  .hero-copy, .folio-copy { max-width: 600px; }
  .legend { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); padding-top: 18px; }
  .workbench { max-width: none; }
  .context-strip { gap: 12px; }
  .context-cell + .context-cell { padding-left: 15px; }
  .context-cell p { font-size: 10px; }
  .context-cell .eyebrow { font-size: 8px; }
  .section { padding-block: 44px; }
  .section-header { display: block; }
  .section-aside { margin-top: 12px; }
  .project-grid { grid-template-columns: 1fr; }
  .project { padding-inline: 22px; }
  .project-lead { min-height: auto; }
  .folio-index { grid-template-columns: 1fr 1fr; }
  .folio-index a { border-left: 1px solid var(--line); min-height: 96px; }
  .folio-index a:nth-child(odd) { border-left: 0; }
  .folio-index a:nth-child(n+3) { border-top: 1px solid var(--line); }
  .case-body { grid-template-columns: 1fr; gap: 8px; padding: 22px; }
  .case h2 { font-size: 26px; }
  .about { grid-template-columns: 1fr; gap: 22px; }
  .about h2 { font-size: 30px; }
  .about-caption { display: none; }
  .about-copy p { font-size: 13px; }
  .closing { padding: 22px; gap: 21px; align-items: flex-start; flex-direction: column; margin-bottom: 35px; }
  .closing h2 { font-size: 20px; }
  .footer-inner { align-items: flex-start; flex-direction: column; gap: 5px; }
}

@media (max-width: 380px) {
  .shell { width: calc(100% - 32px); }
  nav { gap: 13px; }
  nav .repo-link { display: none; }
  .hero h1, .folio-hero h1 { font-size: 36px; }
  .flow-detail { font-size: 10px; }
  .flow-text { width: 88px; font-size: 12px; }
  .workbench { padding: 20px; }
  .folio-index { grid-template-columns: 1fr; }
  .folio-index a { border-left: 0; border-top: 1px solid var(--line); min-height: 0; }
  .folio-index a:first-child { border-top: 0; }
  .legend li { grid-template-columns: 1fr; gap: 6px; }
}

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

@media print {
  body { background: white; }
  .shell { width: 100%; }
  .site-header, .actions, .closing, footer, .folio-index { display: none; }
  .hero, .folio-hero { padding-top: 0; }
  .workbench { box-shadow: none; }
  .project, .case { break-inside: avoid; }
  .section { padding-block: 24px; }
  a { text-decoration: none; }
}
