/* ──────────────────────────────────────────────────────────────
   Jade & coral.  Edit the variables in this block to recolour the
   whole site — nothing below hard-codes a colour.

     --accent   deep jade.  Links and section headings.
     --accent2  coral.      The short bar under each heading only.

   Measured against their own backgrounds:
     light  links 6.04:1   bar 4.02:1   muted text 5.53:1
     dark   links 8.80:1   body 15.08:1 muted text 6.39:1
   WCAG AA needs 4.5:1 for text and 3:1 for a graphic element.
   ────────────────────────────────────────────────────────────── */
:root {
  --bg: #FFFDF8;
  --fg: #1B1A17;
  --muted: #6B6760;
  --accent: #0E6E60;
  --accent2: #D9502F;
  --rule: #E4DFD4;
  --chip: #F6F2E9;
  --todo: #FFF3C4;
}
:root[data-theme="dark"] {
  --bg: #14171A;
  --fg: #EDEBE4;
  --muted: #9C9A93;
  --accent: #46C9B4;
  --accent2: #FF8A63;
  --rule: #2C3134;
  --chip: #1C2024;
  --todo: #4A4220;
}
/* Visitors who have never touched the button follow their system setting. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171A;
    --fg: #EDEBE4;
    --muted: #9C9A93;
    --accent: #46C9B4;
    --accent2: #FF8A63;
    --rule: #2C3134;
    --chip: #1C2024;
    --todo: #4A4220;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 16.5px;
  line-height: 1.68;
  -webkit-text-size-adjust: 100%;
}
.wrap { max-width: 62rem; margin: 0 auto; padding: 0 32px; }

/* ── header ── */
header { border-bottom: 1px solid var(--rule); padding: 32px 0 16px; }
.topline { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; justify-content: space-between; }
.name { font-family: Fraunces, Georgia, serif; font-weight: 500; font-size: 27px; line-height: 1.2; margin: 0; }
.name a { color: inherit; text-decoration: none; }
.tag { color: var(--muted); margin: 4px 0 0; font-size: 14.5px; }
nav { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 18px; }
nav a { color: var(--fg); text-decoration: none; font-size: 15px; padding-bottom: 3px; border-bottom: 2px solid transparent; }
nav a:hover, nav a[aria-current] { color: var(--accent); border-color: var(--accent); }

/* ── theme button ── */
.theme-btn {
  font: inherit; font-size: 13.5px;
  background: var(--chip); color: var(--fg);
  border: 1px solid var(--rule); border-radius: 999px;
  padding: 8px 14px; min-height: 44px;
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
}
.theme-btn:hover { border-color: var(--accent); color: var(--accent); }
.theme-btn svg { width: 15px; height: 15px; }

/* ── body ── */
main { padding: 36px 0 52px; }
h1 { font-family: Fraunces, Georgia, serif; font-weight: 400; font-size: 31px; line-height: 1.2; margin: 0 0 14px; }
h2 { font-family: Fraunces, Georgia, serif; font-weight: 500; font-size: 20px; color: var(--accent); margin: 0 0 4px; }
h3 { font-family: Fraunces, Georgia, serif; font-weight: 500; font-size: 16px; color: var(--muted); margin: 32px 0 14px; }
.section { margin-top: 44px; }
/* the first section on a page that opens with a line of intro text */
main .wrap > div:not(.section):not(.hero) > h2 { margin-top: 32px; }
.mark { height: 2px; width: 34px; background: var(--accent2); border-radius: 2px; margin-bottom: 18px; }
a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }
p { margin: 0 0 14px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* ── hero ── */
.hero { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.photo {
  flex: none; width: 260px; height: 260px; border-radius: 50%;
  background: var(--chip); border: 3px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  text-align: center; font-size: 11.5px; color: var(--muted);
  padding: 0; overflow: hidden;
}
.photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.hero-text { flex: 999 1 20rem; min-width: 0; max-width: 42rem; }

/* ── lists ── */
ul.refs { list-style: none; padding: 0; margin: 0; }
ul.refs li { margin: 0 0 24px; }
.item-title { font-family: Fraunces, Georgia, serif; font-weight: 600; font-size: 17.5px; line-height: 1.45; margin: 0; }
.item-meta { color: var(--muted); font-size: 13.5px; margin: 4px 0 0; }
.item-body { font-size: 15.5px; margin: 8px 0 0; }
.item-links { font-size: 14px; margin: 8px 0 0; }
.item-links a { margin-right: 16px; }
.repo-name { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14.5px; font-weight: 600; color: var(--accent); margin: 0; }

/* ── chips ── */
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip { background: var(--chip); border: 1px solid var(--rule); border-radius: 999px; padding: 6px 14px; font-size: 13.5px; }
.chip-sm { padding: 3px 11px; font-size: 12px; }

/* ── timeline (CV page) ── */
.entry { border-left: 1px solid var(--rule); padding: 0 0 24px 22px; position: relative; }
.entry::before { content: ""; position: absolute; left: -4.5px; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent2); }
.entry:last-child { padding-bottom: 0; }
.entry h4 { font-size: 16px; font-weight: 600; margin: 0; }
.entry .when { color: var(--accent); font-size: 13px; margin: 4px 0 0; }
.entry ul { margin: 10px 0 0; padding-left: 20px; font-size: 15px; }
.entry ul li { margin-bottom: 6px; }

/* a highlight for anything still to fill in — delete the span, not the rule */
.todo { background: var(--todo); padding: 0 .25em; border-radius: 3px; }

footer { border-top: 1px solid var(--rule); padding: 20px 0 44px; color: var(--muted); font-size: 13.5px; }
footer a { color: var(--accent); }

li, p, h1, h2, .item-title { overflow-wrap: anywhere; }

@media (max-width: 30rem) {
  header { padding-top: 24px; }
  .name { font-size: 23px; }
  h1 { font-size: 26px; }
  .photo { width: 150px; height: 150px; }
  main { padding-top: 28px; }
}

/* ── theme-button icons: CSS picks the right one, so there is no flicker ── */
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: inline; }
:root[data-theme="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: inline; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}

/* ── contact: brand icon links ──────────────────────────────────────
   Icons are Font Awesome Free 7 brand marks (fontawesome.com), CC BY 4.0.
   They take their colour from --accent and need no stylesheet or CDN.
   The glyph is 20px; the 12px padding makes the clickable area 44px,
   which is the minimum comfortable touch target. Shrink the glyph if
   you want them smaller still, but leave the padding alone. */
.icon-row { display: flex; flex-wrap: wrap; gap: 6px; margin-left: -12px; }
.icon-link {
  padding: 12px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent); text-decoration: none;
  transition: color .15s ease, background .15s ease;
}
.icon-link svg { height: 20px; width: auto; display: block; }
.icon-link:hover, .icon-link:focus-visible { color: var(--accent2); background: var(--chip); }
.icon-link:focus-visible { outline: 2px solid var(--accent2); outline-offset: 1px; }
