/* Jua van Zyl: personal site. Colours are tokens; dark mode follows the visitor's device. WCAG 2.2 AA. */
:root {
  --paper: #f6f3ec;
  --card: #fffdf8;
  --ink: #1c2329;
  --muted: #56616b;
  --line: #ddd5c6;
  --navy: #12324a;
  --navy-soft: #2a5675;
  --ochre: #8e5418;          /* accent for text: 5.6:1 on paper */
  --ochre-bright: #c98a3d;   /* decoration only */
  --sage: #45624f;
  --chip: #ece6da;
  --shadow: 0 1px 2px rgba(20, 30, 40, .06), 0 8px 24px rgba(20, 30, 40, .06);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Charter, "Bitstream Charter", Cambria, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 1080px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1a22; --card: #14232e; --ink: #e9e5dd; --muted: #a9b3bb; --line: #263744;
    --navy: #9cc7e4; --navy-soft: #7fb3d5; --ochre: #e3a660; --ochre-bright: #e3a660; --sage: #9cc3a6;
    --chip: #1c2e3b; --shadow: none;
  }
}
:root[data-theme="dark"] {
  --paper: #0f1a22; --card: #14232e; --ink: #e9e5dd; --muted: #a9b3bb; --line: #263744;
  --navy: #9cc7e4; --navy-soft: #7fb3d5; --ochre: #e3a660; --ochre-bright: #e3a660; --sage: #9cc3a6;
  --chip: #1c2e3b; --shadow: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 17px/1.65 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--navy-soft); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--ochre); }
:focus-visible { outline: 3px solid var(--ochre-bright); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 14px; z-index: 10; }
.skip:focus { left: 16px; }

/* ---------- site header ---------- */
.site-head { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 5; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { font-family: var(--serif); font-size: 1.25rem; color: var(--ink); text-decoration: none; letter-spacing: .01em; }
.brand span { color: var(--ochre); }
.site-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.site-nav a, .site-nav span {
  font-size: .9rem; padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--ink);
  border: 1px solid transparent; white-space: nowrap;
}
.site-nav a[aria-current="page"] { border-color: var(--line); background: var(--card); font-weight: 600; }
.site-nav .soon { color: var(--muted); cursor: default; }
.site-nav .soon small { font-size: .72rem; margin-left: 4px; color: var(--ochre); }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: 72px 0 56px; }
.hero-art {
  position: absolute; inset: -10% -18% -10% 38%; background: var(--navy-soft); opacity: .17;
  -webkit-mask: url("../img/contours.svg") no-repeat center / contain; mask: url("../img/contours.svg") no-repeat center / contain;
  pointer-events: none;
}
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.35fr .9fr; gap: 48px; align-items: center; }
.eyebrow { font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ochre); font-weight: 600; margin: 0 0 14px; }
h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(2.6rem, 6vw, 4.2rem); line-height: 1.04; margin: 0 0 18px; letter-spacing: -.01em; color: var(--navy); }
.lead { font-size: 1.2rem; line-height: 1.6; margin: 0 0 26px; max-width: 34em; }
.portrait {
  justify-self: center; width: min(340px, 80%); aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  box-shadow: 0 0 0 6px var(--paper), 0 0 0 7px var(--line), var(--shadow);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 34px 0 0; padding: 0; list-style: none; }
.facts li { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); }
.facts b { display: block; font-family: var(--serif); font-size: 1.55rem; color: var(--navy); line-height: 1.15; font-weight: 600; }
.facts span { font-size: .88rem; color: var(--muted); line-height: 1.35; display: block; margin-top: 4px; }

/* ---------- page sections ---------- */
.toc { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--card); }
.toc ul { display: flex; gap: 22px; list-style: none; margin: 0 auto; padding: 12px 24px; max-width: var(--wrap); overflow-x: auto; }
.toc a { font-size: .92rem; color: var(--muted); text-decoration: none; white-space: nowrap; }
.toc a:hover { color: var(--ink); }
section { padding: 64px 0 8px; scroll-margin-top: 72px; }
h2 { font-family: var(--serif); font-weight: 600; font-size: 2rem; margin: 0 0 8px; color: var(--navy); }
.section-intro { color: var(--muted); margin: 0 0 28px; max-width: 46em; }
h3 { font-size: 1.08rem; margin: 0; }
.prose p { max-width: 44em; margin: 0 0 1.1em; }
.prose p:first-of-type::first-letter { font-family: var(--serif); float: left; font-size: 3.4em; line-height: .9; margin: 6px 10px 0 0; color: var(--ochre); }

/* timeline */
.era { margin: 0 0 40px; }
.era-head { display: flex; align-items: baseline; gap: 14px; margin: 0 0 18px; }
.era-head h3 { font-family: var(--serif); font-size: 1.45rem; font-weight: 600; }
.era-head span { color: var(--muted); font-size: .95rem; }
.jobs { list-style: none; margin: 0; padding: 0 0 0 26px; border-left: 2px solid var(--line); }
.job { position: relative; margin: 0 0 22px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow); }
.job::before { content: ""; position: absolute; left: -35px; top: 24px; width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 3px solid var(--ochre-bright); }
.job-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.job h3 { font-size: 1.12rem; }
.org { color: var(--muted); font-style: italic; margin: 2px 0 10px; }
.when { color: var(--ochre); font-weight: 600; font-size: .92rem; white-space: nowrap; }
.job ul { margin: 0; padding-left: 1.1em; }
.job li { margin: 0 0 4px; }
.job .note { font-size: .92rem; color: var(--muted); margin: 10px 0 0; }

/* quotes */
.quotes { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
figure.quote { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 26px 26px 22px; box-shadow: var(--shadow); position: relative; }
figure.quote::before { content: "\201C"; font-family: var(--serif); position: absolute; top: -6px; left: 18px; font-size: 4.4rem; color: var(--ochre-bright); line-height: 1; }
.quote blockquote { margin: 18px 0 14px; font-family: var(--serif); font-size: 1.16rem; line-height: 1.55; }
.quote figcaption { font-size: .92rem; color: var(--muted); }
.quote figcaption b { color: var(--ink); display: block; }

/* cards grid */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 8px; font-family: var(--serif); font-size: 1.2rem; font-weight: 600; }
.card ul { margin: 0; padding-left: 1.1em; }
.card li { margin: 0 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.chips li { background: var(--chip); border-radius: 999px; padding: 5px 12px; font-size: .9rem; margin: 0; }
.year { color: var(--ochre); font-weight: 600; font-variant-numeric: tabular-nums; margin-right: 6px; }

/* footer */
.site-foot { margin-top: 72px; border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: .92rem; }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .hero { padding: 40px 0 36px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 28px; }
  .portrait { grid-row: 1; width: min(220px, 60%); }
  .hero-art { inset: 0 -30% 40% -30%; }
  .facts { grid-template-columns: 1fr 1fr; }
  .quotes, .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .jobs { padding-left: 18px; }
  .job::before { left: -27px; }
  .site-nav .soon { display: none; }
}

/* ---------- print: a clean one-column resume ---------- */
@media print {
  :root { --paper: #fff; --card: #fff; --shadow: none; }
  .site-head, .toc, .hero-art, .skip, .site-foot nav { display: none !important; }
  body { font-size: 10.5pt; }
  .hero { padding: 0 0 8pt; }
  .hero .wrap { grid-template-columns: 1fr 110pt; gap: 16pt; }
  .portrait { width: 110pt; box-shadow: none; }
  .facts { grid-template-columns: repeat(4, 1fr); }
  section { padding: 12pt 0 0; break-inside: auto; }
  .job, figure.quote, .card { break-inside: avoid; box-shadow: none; }
  a { color: inherit; text-decoration: none; }
}
