/* ===== Design tokens ===== */
:root {
  --bg:      #fbfaf7;   /* warm off-white */
  --text:    #1c1b19;   /* near-black     */
  --muted:   #6b6862;   /* secondary text */
  --accent:  #c2410c;   /* accent (change me to retheme) */
  --border:  #e7e4dd;
  --code-bg: #f4f2ec;
  --maxw:    720px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 5rem 1.5rem 4rem;
}

.section { margin-top: 3.5rem; }
.section.section-tight { margin-top: 1.25rem; }

/* ===== Typography ===== */
h1 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 2.2rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 0 0 0.6rem;
}

h2 {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 1.25rem;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* ===== Hero ===== */
.hero .tagline {
  font-size: 1rem;
  color: var(--text);
  margin: 0 0 0.35rem;
}
.hero .sub {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

/* Shared link rows (hero + footer) */
.links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* ===== Projects ===== */
.projects {
  list-style: none;
  padding: 0;
  margin: 0;
}
.projects { margin-top: -0.6rem; }
.projects li { margin-bottom: 0.5rem; }
.projects li:last-child { margin-bottom: 0; }

/* The whole card is the link: hovering anywhere tints it and lights the name up, no border. */
.projects a.proj {
  display: block;
  color: inherit;
  margin: 0 -1rem;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  transition: background-color 0.15s ease;
}
.projects a.proj:hover { background: var(--code-bg); text-decoration: none; }
.projects a.proj:hover .proj-name { color: var(--accent); }

.proj-name {
  display: block;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  color: var(--text);
  font-size: 1.15rem;
  transition: color 0.15s ease;
}

.projects p {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0.2rem 0 0;
}

/* ===== Awards ===== */
.awards { list-style: none; padding: 0; margin: 0; }
.awards li {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 0.85rem;
}
.awards li:last-child { margin-bottom: 0; }
.awards strong { color: var(--text); font-weight: 700; }

/* Standalone body link (e.g. awards on the homepage) */
.standalone-link { font-weight: 500; font-size: 0.95rem; }
.projects + .standalone-link { display: inline-block; margin-top: 1rem; }

/* ===== Latest-post feature (homepage) ===== */
.post-feature {
  display: block;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  color: var(--text);
  transition: border-color 0.15s ease;
}
.post-feature:hover { border-color: var(--accent); text-decoration: none; }
.post-feature-empty { color: var(--muted); font-size: 0.92rem; }
.post-feature-date {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 0.2rem;
}
.post-feature-title {
  display: block;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}
.post-feature-blurb { display: block; color: var(--muted); font-size: 0.92rem; }

/* Award groups (awards.html) */
.award-group { margin-bottom: 2.25rem; }
.award-group:last-child { margin-bottom: 0; }
.award-group-title {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.9rem;
}

/* ===== Footer ===== */
.footer {
  margin-top: 2.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}
.footer .links { margin-bottom: 0.6rem; }
.copyright {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0;
}

/* ===== Blog list ===== */
.back-link {
  display: inline-block;
  font-size: 0.85rem;
  margin-bottom: 2.5rem;
}
.post-cards { margin-top: 2.5rem; }
.post-feature + .post-feature { margin-top: 1rem; }

/* ===== Blog post ===== */
.post-meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 2.5rem;
}
.post-body { font-size: 0.95rem; }
.post-body h2 {
  font-family: "Fraunces", Georgia, serif;
  letter-spacing: normal;
  color: var(--text);
  font-size: 1.45rem;
  font-weight: 600;
  margin: 2.25rem 0 0.9rem;
}
.post-body p { margin: 0 0 1.2rem; }
.post-body ul, .post-body ol { margin: 0 0 1.2rem; padding-left: 1.4rem; }
.post-body li { margin-bottom: 0.6rem; }
.post-body a { text-decoration: underline; }
.post-body figure { margin: 2.75rem auto; max-width: 78%; }
.post-body img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.post-body figcaption {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.65rem;
  text-align: center;
}

/* Plot figure (blog/posts/seasoning.html). Add .is-pending to hold it undrawn; removing it draws it in. */
.post-body .fig-plot { max-width: 100%; margin: 2.25rem 0 2rem; }
.fig-plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.fig-plot .ax { stroke: var(--border); stroke-width: 1.5; }
.fig-plot .tick { stroke: var(--border); stroke-width: 1.5; }
.fig-plot .lbl { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12.5px; fill: var(--text); }
.fig-plot .lbl.muted { fill: var(--muted); font-size: 11px; }
.fig-plot .lbl.accent { fill: var(--accent); }
.fig-plot .pt { fill: var(--text); }
.fig-plot .pt.accent { fill: var(--accent); }
.fig-plot .curve { fill: none; stroke: var(--text); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.fig-plot .curve.risk { stroke: var(--muted); stroke-width: 2; }
.fig-plot .leader { stroke: var(--accent); stroke-width: 1; }
.fig-plot .bracket { stroke: var(--muted); stroke-width: 1; }
.fig-plot .allin { stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; }
.fig-plot .allin-head { fill: var(--accent); }
.fig-plot .pt.next { fill: var(--bg); stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 3 2; }
.post-body .fig-plot figcaption { margin-top: 0.9rem; }
.post-body .fig-plot figcaption sup { font-size: 0.75em; }

/* animation: the curve draws, then the annotations fade in */
.fig-plot .draw { stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke-dashoffset 1.6s cubic-bezier(0.3, 0.6, 0.3, 1); }
.fig-plot .fade { opacity: 1; transition: opacity 0.5s ease 1.5s; }
.fig-plot.is-pending .draw { stroke-dashoffset: 1; transition: none; }
.fig-plot.is-pending .fade { opacity: 0; transition: none; }

/* ===== Code ===== */
code {
  font-size: 0.9em;
  background: var(--code-bg);
  padding: 0.12em 0.38em;
  border-radius: 4px;
}
pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.15rem;
  overflow-x: auto;
  margin: 0 0 1.4rem;
  font-size: 0.88rem;
  line-height: 1.6;
}
pre code { background: none; padding: 0; border-radius: 0; }

/* ===== Mobile ===== */
@media (max-width: 600px) {
  .container { padding: 3rem 1.25rem; }
  h1 { font-size: 1.9rem; }
  .post-body figure { max-width: 100%; }
}
