/* ---- Design tokens ---- */
:root {
  --bg: #faf7f0;
  --bg-dark: #1c1712;
  --text: #2a241e;
  --text-muted: #8c8477;
  --accent: #c15f2c;
  --border: #ddd7c9;
  --border-dark: #3a332a;
  --card-bg: #f2ede1;

  --font-serif: "Instrument Serif", Georgia, serif;
  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.5;
  font-size: 16px;
}

a { color: inherit; text-decoration: none; }

/* ---- Header ---- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 40px;
  border-bottom: 1px solid var(--border);
  max-width: 1280px;
  margin: 0 auto;
}

.logo {
  font-family: var(--font-serif);
  font-size: 30px;
}

.site-nav {
  display: flex;
  gap: 32px;
  font-family: var(--font-sans);
  font-size: 14px;
}

.site-nav a { color: var(--text-muted); }
.site-nav a.active { color: var(--text); font-weight: 600; }

.crumb {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.crumb .sep { color: var(--text-muted); margin: 0 6px; }

/* ---- Hero (home) ---- */
.hero {
  max-width: 1280px;
  margin: 0 auto;
  padding: 60px 40px 70px;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin-bottom: 20px;
}

.hero h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 72px;
  margin: 0 0 20px;
}

.eyebrow-mono {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}

.hero p.lede {
  max-width: 560px;
  color: var(--text);
  font-size: 16px;
  margin-bottom: 22px;
}

.link-arrow {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 14px;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* ---- Section headings ---- */
.section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 70px 40px;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.section-label.accent { color: var(--accent); }

.section h2, .made-this-work-copy h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 38px;
  margin: 0 0 40px;
}

/* ---- Project grid ---- */
.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.project-card { display: block; }

.project-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--border);
  border-radius: 4px;
  object-fit: cover;
  display: block;
  margin-bottom: 16px;
}

.project-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.project-meta h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 22px;
  margin: 0;
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.project-desc {
  color: var(--text-muted);
  font-size: 14.5px;
  max-width: 520px;
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 40px 50px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  max-width: 1280px;
  margin: 0 auto;
}

.footer-email {
  font-family: var(--font-serif);
  font-size: 20px;
  margin-top: 6px;
}

.footer-links {
  display: flex;
  gap: 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ==================================================== */
/* Detail page                                           */
/* ==================================================== */

.detail-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  padding: 40px 40px 0;
  max-width: 1280px;
  margin: 0 auto;
}

.detail-hero-copy h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 72px;
  line-height: 1.15;
  margin: 18px 0 20px;
}

.detail-hero-copy p {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 480px;
  margin-bottom: 24px;
}

.detail-hero-copy strong { color: var(--text); }

.hero-toc {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.hero-toc a { color: var(--accent); }

.detail-hero-image {
  background: rgb(217, 217, 217);
  border-radius: 4px;
}

/* At a glance */
.glance {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-top: 50px;
}

.glance-label {
  text-align: center;
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--text);
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.glance-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  max-width: 1280px;
  margin: 0 auto;
}

.glance-item {
  padding: 24px 28px;
  border-left: 1px solid var(--border);
}
.glance-item:first-child { border-left: none; }

.glance-item .k {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.glance-item .v {
  font-family: var(--font-serif);
  font-size: 20px;
}

/* Results (dark) */
.results {
  background: var(--bg-dark);
  color: #f1ece0;
  padding: 60px 40px;
}

.results-inner { max-width: 1280px; margin: 0 auto; }

.results h2 { color: #f1ece0; margin: 6px 0 0; }

.results-header {
  display: flex;
  border: 1px solid var(--border-dark);
  margin-bottom: -1px;
}

.results-header-copy {
  flex: 0 0 300px;
  min-height: 180px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 26px 40px;
  border-right: 1px solid var(--border-dark);
}

.results-header-fill {
  flex: 1;
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.05) 0,
    rgba(255, 255, 255, 0.05) 1px,
    transparent 1px,
    transparent 11px
  );
}

.stat-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 0.6fr;
  gap: 1px;
  background: var(--border-dark);
  border: 1px solid var(--border-dark);
  margin-bottom: 1px;
}

.stat-row.three { grid-template-columns: 1fr 1fr 1fr 0.5fr; }

.stat-box {
  background: var(--bg-dark);
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 317px;
}

.stat-row.three .stat-box {
  min-height: 250px;
}

.stat-fill {
  background: var(--bg-dark);
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.05) 0,
    rgba(255, 255, 255, 0.05) 1px,
    transparent 1px,
    transparent 11px
  );
}

.stat-box .label {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: #f1ece0;
  margin-bottom: 18px;
}

.stat-box .big {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 84px;
  line-height: 1;
  color: var(--accent);
}

.stat-box .big.white { color: #f1ece0; }

.stat-row.three .big { font-size: 60px; }

.big-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.stat-box .sub {
  font-size: 15px;
  color: #f1ece0;
  margin-top: 18px;
}

.stat-box .growth {
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 300;
  color: #f1ece0;
  line-height: 1.25;
}

/* What shipped */
.shipped-backdrop {
  background-image:
    linear-gradient(rgba(250, 245, 236, 0.6), rgba(250, 245, 236, 0.6)),
    url("../assets/backdrop.png");
  background-size: auto, 640px;
  background-repeat: repeat, repeat;
}

.shipped-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.pager {
  display: flex;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.pager span { color: var(--text-muted); }
.pager span.active { color: var(--accent); font-weight: 600; }

.shipped-image {
  width: 100%;
  background: #efe9db;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-top: 30px;
  display: block;
}

/* Key stages */
.stages {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 0;
  border: 1px solid var(--border);
  max-width: 1280px;
  margin: 0 auto;
}

.stages-list { border-right: 1px solid var(--border); }

.stage-item {
  padding: 22px 26px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  width: 100%;
  text-align: left;
  border-left: none;
  border-right: none;
  border-top: none;
}

.stage-item:last-child { border-bottom: none; }

.stage-item.active {
  color: var(--text);
  font-weight: 700;
}

.stage-panel { padding: 40px 44px; }

.stage-panel h3 {
  font-size: 18px;
  margin: 0 0 18px;
  line-height: 1.4;
}

.stage-panel p {
  color: var(--text-muted);
  font-size: 14.5px;
  margin-bottom: 16px;
}

.stage-thumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.stage-thumb {
  width: 64px;
  height: 56px;
  background: var(--border);
  border-radius: 3px;
  flex-shrink: 0;
}

.stage-thumb-caption {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.35;
}

/* What made this work */
.made-this-work {
  display: flex;
  max-width: 1280px;
  margin: 0 auto;
  padding: 70px 0 70px 40px;
}

.made-this-work-copy {
  flex: 0 0 300px;
  padding-right: 20px;
}

.made-this-work-table {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
}

.mtw-band {
  height: 176px;
  background-image:
    linear-gradient(rgba(240, 217, 196, 0.5), rgba(240, 217, 196, 0.5)),
    url("../assets/backdrop.png");
  background-size: auto, 640px;
  background-repeat: repeat, repeat;
}

.principles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.principle {
  padding: 30px 40px;
  border-left: 1px solid var(--border);
}
.principle:nth-child(odd) { border-left: none; }
.principle:nth-child(3), .principle:nth-child(4) {
  border-top: 1px solid var(--border);
}

.principle h4 {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 15px;
  margin: 0 0 10px;
  font-weight: 600;
}

.principle p {
  font-size: 14.5px;
  color: #55493c;
  margin: 0;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .project-grid { grid-template-columns: 1fr; }
  .detail-hero { grid-template-columns: 1fr; }
  .detail-hero-image { aspect-ratio: 4 / 3; }
  .glance-grid { grid-template-columns: repeat(2, 1fr); }
  .glance-item { border-left: none; border-top: 1px solid var(--border); }
  .stat-row, .stat-row.three { grid-template-columns: 1fr; }
  .stat-fill, .results-header-fill { display: none; }
  .results-header-copy { flex: 1; border-right: none; }
  .stages { grid-template-columns: 1fr; }
  .stages-list { border-right: none; }
  .made-this-work { flex-direction: column; padding: 40px; gap: 20px; }
  .made-this-work-copy { flex: 1; padding-right: 0; }
  .principles-grid { grid-template-columns: 1fr; }
  .principle:nth-child(odd) { border-left: 1px solid var(--border); }
  .principle:nth-child(n+2) { border-top: 1px solid var(--border); }
  .site-footer { flex-direction: column; gap: 20px; }
  .hero h1 { font-size: 40px; }
}
