:root {
  --ink: #111d17;
  --canvas: #f3f2ec;
  --canvas-raised: #ffffff;
  --forest: #1f4a3d;
  --forest-dim: #2c5c4c;
  --brass: #a9822f;
  --brass-bright: #c49a3c;
  --slate: #5b655f;
  --line: #dcd8cb;
  --shadow: 0 1px 2px rgba(17, 29, 23, 0.06), 0 8px 24px rgba(17, 29, 23, 0.05);

  /* Fixed brand-mark surface — the forest badge always stays dark-on-light-text,
     independent of the page theme (unlike --forest, which flips for contrast). */
  --badge-bg: #1f4a3d;
  --badge-bg-alt: #173b30;
  --badge-border: #2c5c4c;
  --badge-text: #f3f2ec;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eef0ea;
    --canvas: #10160f;
    --canvas-raised: #171f16;
    --forest: #8fcab0;
    --forest-dim: #6fa88f;
    --brass: #d8b158;
    --brass-bright: #e8c470;
    --slate: #9aa39a;
    --line: #2a332a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

h1, h2, h3 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  line-height: 1.15;
  text-wrap: balance;
  margin: 0;
}

.eyebrow {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 12px;
}

/* ---- layout ---- */
.shell { max-width: 880px; margin: 0 auto; padding: 0 24px; }

/* ---- nav ---- */
.site-nav {
  border-bottom: 1px solid var(--line);
  background: var(--canvas);
}
.site-nav .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--badge-bg);
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.brand-word {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: 16.5px;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.nav-links { display: flex; gap: 28px; font-size: 14.5px; }
.nav-links a { text-decoration: none; color: var(--slate); }
.nav-links a[aria-current="page"] { color: var(--ink); font-weight: 500; }
.nav-links a:hover { color: var(--ink); }

@media (max-width: 480px) {
  .site-nav .shell { flex-wrap: wrap; height: auto; padding: 14px 24px; gap: 12px 0; }
  .brand-word { font-size: 15px; }
  .nav-links { width: 100%; gap: 18px; font-size: 13.5px; }
}

/* ---- footer ---- */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 96px;
}
.site-footer .shell {
  padding: 28px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--slate);
}

/* ---- hero ---- */
.hero {
  margin: 40px 0 8px;
  padding: 56px 40px;
  border-radius: 22px;
  background: var(--badge-bg);
  color: var(--badge-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
}
.hero-word {
  font-size: clamp(28px, 4.4vw, 40px);
  letter-spacing: -0.01em;
  color: var(--badge-text);
}
.hero-tagline { font-size: 16.5px; color: #cfe0d5; margin: 0; max-width: 38ch; }
.hero-lede { font-size: 15px; color: #b9d0c3; margin: 0; max-width: 52ch; }

/* ---- sections ---- */
section.block { margin-top: 72px; }
.section-note { font-size: 14.5px; color: var(--slate); max-width: 60ch; margin: 0 0 24px; }

.card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--canvas-raised);
  box-shadow: var(--shadow);
  padding: 30px 32px;
}
.card p { font-size: 16px; margin: 0 0 16px; }
.card p:last-child { margin-bottom: 0; }

/* ---- portfolio card ---- */
.pcard {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--canvas-raised);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.pcard-top { padding: 28px 30px 24px; display: flex; gap: 18px; align-items: flex-start; }
.pcard-mark {
  flex: none; width: 48px; height: 48px; border-radius: 11px;
  background: var(--badge-bg);
  display: flex; align-items: center; justify-content: center;
}
.pcard-head { flex: 1; min-width: 0; }
.pcard-eyebrow { font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brass); margin: 0 0 6px; }
.pcard-name { font-family: "Fraunces", Georgia, serif; font-weight: 500; font-size: 24px; margin: 0 0 8px; }
.pcard-tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 4px; }
.pcard-tag { font-size: 12px; font-family: "IBM Plex Mono", monospace; color: var(--forest-dim); background: var(--canvas); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; }
.pcard-loc { font-size: 13px; color: var(--slate); margin: 8px 0 0; }
.pcard-body { padding: 0 30px 26px; }
.pcard-oneliner { font-family: "Fraunces", Georgia, serif; font-size: 18px; font-weight: 500; margin: 0 0 12px; text-wrap: balance; }
.pcard-desc { font-size: 15px; color: var(--ink); opacity: 0.88; margin: 0 0 22px; max-width: 64ch; }
.pcard-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1px; background: var(--line); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 0 20px; }
.pcard-metric { background: var(--canvas-raised); padding: 14px 16px; }
.pcard-metric-value { font-family: "IBM Plex Mono", monospace; font-variant-numeric: tabular-nums; font-size: 17px; font-weight: 500; margin: 0 0 2px; }
.pcard-metric-label { font-size: 11.5px; color: var(--slate); margin: 0; }
.pcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pcard-link { font-family: "IBM Plex Mono", monospace; font-size: 12.5px; color: var(--forest-dim); text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 1px; }
.pcard-badge { font-family: "IBM Plex Mono", monospace; font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brass); }
.portfolio-list { display: flex; flex-direction: column; gap: 22px; }
.portfolio-empty { font-size: 14.5px; color: var(--slate); }

/* ---- form ---- */
.form-grid { display: flex; flex-direction: column; gap: 18px; }
.field label { display: block; font-size: 13px; font-weight: 500; margin: 0 0 6px; }
.field .hint { font-size: 12.5px; color: var(--slate); margin: 4px 0 0; }
.field input, .field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
}
.field input:focus, .field textarea:focus {
  outline: 2px solid var(--forest-dim);
  outline-offset: 1px;
}
.field textarea { resize: vertical; min-height: 130px; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.btn-primary {
  align-self: flex-start;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 14.5px;
  font-weight: 500;
  color: #f3f2ec;
  background: var(--forest);
  border: none;
  border-radius: 10px;
  padding: 12px 26px;
  cursor: pointer;
}
.btn-primary:hover { background: var(--forest-dim); }
#form-status { font-size: 14px; min-height: 1.4em; }
#form-status[data-state="success"] { color: var(--forest-dim); }
#form-status[data-state="error"] { color: #a9432f; }
