/* ------------------------------------------------------------
   Portfolio — plain, readable, one accent (label-tape yellow)
   ------------------------------------------------------------ */

:root {
  --bg:        #F2F3F1;
  --surface:   #FAFBF9;
  --ink:       #1B1D1C;
  --muted:     #555B57;
  --rule:      #D3D7D2;
  --rule-soft: #E4E7E3;
  --underline: #9AA19C;
  --tape:      #F2C230;
  --tape-ink:  #161616;

  --font-body: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Source Code Pro', ui-monospace, Consolas, Menlo, monospace;

  --measure: 760px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #161716;
    --surface:   #1D1F1D;
    --ink:       #E9EBE7;
    --muted:     #A3A9A4;
    --rule:      #343834;
    --rule-soft: #282B28;
    --underline: #626963;
  }
}
:root[data-theme="dark"] {
  --bg:        #161716;
  --surface:   #1D1F1D;
  --ink:       #E9EBE7;
  --muted:     #A3A9A4;
  --rule:      #343834;
  --rule-soft: #282B28;
  --underline: #626963;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
}

::selection { background: var(--tape); color: var(--tape-ink); }

h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--underline);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { text-decoration-color: currentColor; }
a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 1px;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 40px 16px 80px;
  display: flex;
  flex-direction: column;
  gap: 72px;
}

.content { display: flex; flex-direction: column; gap: inherit; }

.muted { color: var(--muted); }

/* Label tape — the one accent */
.tape {
  display: inline-block;
  background: var(--tape);
  color: var(--tape-ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  padding: 1px 8px;
  white-space: nowrap;
}
.tape.outline {
  background: transparent;
  color: var(--muted);
  border: 1px dashed var(--underline);
  padding: 0 7px;
}

/* Header */
.site-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
}
.brand {
  text-decoration: none;
  font-size: 15px;
  padding: 3px 10px;
}
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  font-size: 15px;
}
.site-nav a { text-decoration-color: transparent; }
.site-nav a:hover,
.site-nav a[aria-current="page"] { text-decoration-color: currentColor; }

/* Section headings */
.section-title {
  font-size: 21px;
  font-weight: 600;
  line-height: 1.3;
}

/* Intro */
.intro { display: flex; flex-direction: column; gap: 20px; }
.intro h1 {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.4px;
}
.intro p { max-width: 640px; }
.intro .meta { font-size: 14px; color: var(--muted); }

/* Projects */
.projects-list { list-style: none; margin-top: 12px; border-bottom: 1px solid var(--rule); }
.project {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  padding: 26px 0;
  border-top: 1px solid var(--rule);
}
.project-side {
  flex: 0 0 110px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 1px;
}
.project-num  { font-size: 17px; font-weight: 600; }
.project-date { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.project-body {
  flex: 1 1 420px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.project-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px 16px;
}
.project-cat { font-size: 14px; color: var(--muted); }
.project h3 { font-size: 19px; font-weight: 600; line-height: 1.35; }
.project-stack { font-size: 15px; color: var(--muted); }
.project-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

/* Project link button: quiet outline, firms up on hover */
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--underline);
  border-radius: 3px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s, background-color 0.15s;
}
.btn:hover {
  border-color: var(--ink);
  background: var(--bg);
}
@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}

/* Lab */
.lab { display: flex; flex-direction: column; gap: 16px; }
.lab-photo { display: flex; flex-direction: column; gap: 12px; }
.lab-photo a { display: block; line-height: 0; }
.lab-photo img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  background: var(--surface);
}
.lab-photo figcaption { font-size: 16px; color: var(--muted); max-width: 640px; }

.facts {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 8px 32px;
  font-size: 16px;
}
.facts dt { font-size: 14px; color: var(--muted); padding-top: 1px; }

/* Notes: hidden (with its nav link) until the list has at least one entry */
#notes:not(:has(li)),
body:not(:has(#notes li)) .nav-notes { display: none; }

/* Notes list */
.notes-list { list-style: none; margin-top: 12px; border-bottom: 1px solid var(--rule); }
.notes-list a {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 32px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
  text-decoration: none;
}
.notes-list .note-date {
  flex: 0 0 110px;
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}
.notes-list .note-title {
  flex: 1 1 400px;
  text-decoration: underline;
  text-decoration-color: var(--underline);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.notes-list a:hover .note-title { text-decoration-color: currentColor; }

/* Footer */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-size: 14px;
  color: var(--muted);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }

/* Single note page */
.note { display: flex; flex-direction: column; gap: 40px; }
.note-header { display: flex; flex-direction: column; gap: 14px; }
.note-header h1 {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.3px;
}
.note-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  font-size: 14px;
  color: var(--muted);
}
.back { font-size: 15px; }

.prose { display: flex; flex-direction: column; gap: 18px; }
.prose h2 {
  font-size: 22px;
  font-weight: 600;
  margin-top: 18px;
}
.prose ul, .prose ol { padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface);
  border: 1px solid var(--rule-soft);
  padding: 1px 5px;
}
.prose pre {
  margin: 0;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.55;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.prose blockquote {
  margin: 0;
  padding: 2px 0 2px 16px;
  border-left: 3px solid var(--tape);
  color: var(--muted);
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .wrap { padding-top: 28px; gap: 56px; }
  .intro h1 { font-size: 30px; }
  .note-header h1 { font-size: 26px; }
  .project-side { flex: 1 1 100%; flex-direction: row; gap: 12px; align-items: baseline; }
  .facts { grid-template-columns: 1fr; gap: 2px 0; }
  .facts dd { margin-bottom: 10px; }
}
