

:root {
  --ink:      #3a3733;  /* body text — warm charcoal, not black */
  --ink-soft: #57534c;  /* dates, institutions, footnotes        */
  --rule:     #cdc7bb;  /* hairline dividers                     */
  --strong:   #8a8377;  /* masthead rule, heavier borders        */
  --paper:    #f8f6f2;  /* warm off-white                        */
  --accent:   #375566;  /* links — muted slate blue              */

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:      #dcd8d1;
    --ink-soft: #aea89f;
    --rule:     #413e38;
    --strong:   #75716a;
    --paper:    #1b1a18;
    --accent:   #97b9d0;
  }
}

/* Readers who ask their OS for more contrast get the sharper palette back. */
@media (prefers-contrast: more) {
  :root {
    --ink:      #1a1a1a;
    --ink-soft: #3a3733;
    --rule:     #8a8377;
    --strong:   #57534c;
    --paper:    #ffffff;
    --accent:   #1f3a4d;
  }
}

@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root {
    --ink:      #f5f3ef;
    --ink-soft: #d8d3cb;
    --rule:     #7d786f;
    --strong:   #a8a29a;
    --paper:    #101010;
    --accent:   #b9d6ea;
  }
}

/* Font stacks are written out in full rather than stored in custom properties
   so that they survive in browsers that lack them. */

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

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

body {
  /* 42rem holds the measure to roughly 75 characters — WCAG 1.4.8 (AAA)
     asks for 80 or fewer. */
  margin: 0 auto;
  max-width: 42rem;
  padding: 4rem 1.5rem 3rem;

  background: #f8f6f2;
  background: var(--paper);
  color: #3a3733;
  color: var(--ink);

  font-family: Georgia, "Iowan Old Style", "Times New Roman", "Liberation Serif",
               "Noto Serif", serif;
  font-size: 1.0625rem;
  line-height: 1.65;

  /* Long institution names and URLs must never force a sideways scroll. */
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Real underlines rather than a border-bottom: they inherit the link colour,
   so the underline is always as visible as the text, and browsers that do not
   support the offset/thickness properties still render a plain underline. */
a {
  color: #375566;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

a:hover,
a:focus { text-decoration-thickness: 2px; }

a:focus-visible {
  outline: 2px solid #375566;
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Browsers style <abbr> inconsistently — dotted underline, no underline, or a
   different one again in print. Normalise it to plain text; the title stays
   available to assistive technology and on hover. */
abbr[title] {
  text-decoration: none;
  cursor: help;
}

/* ---------- masthead ---------- */

.masthead {
  border-bottom: 1px solid #8a8377;
  border-bottom: 1px solid var(--strong);
  padding-bottom: 1.25rem;
  margin-bottom: 2.5rem;
}

h1 {
  margin: 0;
  font-size: 2.125rem;
  font-weight: normal;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.strapline {
  margin: 0.35rem 0 1rem;
  color: #57534c;
  color: var(--ink-soft);
  font-style: italic;
}

.contact {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Helvetica, Arial, "Noto Sans", sans-serif;
  font-size: 0.9375rem;
  color: #57534c;
  color: var(--ink-soft);
}

.contact li { display: inline; }

/* Padding brings each contact link up to the 24px minimum pointer target
   of WCAG 2.5.8 without changing how the line looks. */
.contact a {
  display: inline-block;
  padding: 0.25rem 0;
}

.contact li + li::before {
  content: "\00B7";
  margin: 0 0.5rem;
  color: #8a8377;
  color: var(--strong);
}

/* ---------- sections ---------- */

section { margin-bottom: 2.5rem; }

h2 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Helvetica, Arial, "Noto Sans", sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #57534c;
  color: var(--ink-soft);
  margin: 0 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #cdc7bb;
  border-bottom: 1px solid var(--rule);
}

h3 {
  font-size: 1.0625rem;
  font-weight: bold;
  line-height: 1.35;
  margin: 0;
}

.org {
  font-weight: normal;
  color: #57534c;
  color: var(--ink-soft);
}

.entry { margin-bottom: 1.5rem; }
.entry:last-child { margin-bottom: 0; }

.meta {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Helvetica, Arial, "Noto Sans", sans-serif;
  font-size: 0.875rem;
  color: #57534c;
  color: var(--ink-soft);
  margin: 0.2rem 0 0.55rem;
}

.meta-inline {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Helvetica, Arial, "Noto Sans", sans-serif;
  font-size: 0.875rem;
  color: #57534c;
  color: var(--ink-soft);
}

p { margin: 0 0 0.75rem; }
p:last-child { margin-bottom: 0; }

ul { margin: 0 0 0.75rem; padding-left: 1.25rem; }
li { margin-bottom: 0.35rem; }

ul.plain,
.publications { list-style: none; padding-left: 0; }

/* Hanging indents, done with padding + negative text-indent rather than
   flexbox, so wrapped lines align in every browser back to IE8. */

.publications li {
  padding-left: 1.1rem;
  text-indent: -1.1rem;
  margin-bottom: 0.6rem;
}

.awards li {
  padding-left: 3.25rem;
  text-indent: -3.25rem;
  margin-bottom: 0.45rem;
}

.awards .meta-inline {
  display: inline-block;
  width: 3.25rem;
  text-indent: 0;
}

/* ---------- education ---------- */

.education { margin: 0; }

.education dt {
  font-weight: bold;
  margin-top: 0.85rem;
}

.education dt:first-child { margin-top: 0; }

.education dd {
  margin: 0;
  color: #57534c;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

/* ---------- notes and footer ---------- */

/* Set upright rather than italic: extended italic runs are measurably harder
   to read, particularly for dyslexic readers. Colour and size carry the
   demotion instead. */
.note {
  font-size: 0.9375rem;
  color: #57534c;
  color: var(--ink-soft);
}

.entry .note { margin-bottom: 0.6rem; }

footer {
  border-top: 1px solid #cdc7bb;
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Helvetica, Arial, "Noto Sans", sans-serif;
  font-size: 0.875rem;
  color: #57534c;
  color: var(--ink-soft);
}

/* ---------- small screens ---------- */

@media screen and (max-width: 34em) {
  body {
    padding: 2.25rem 1.125rem 2.25rem;
    font-size: 1rem;
  }

  h1 { font-size: 1.75rem; }

  section { margin-bottom: 2rem; }

  /* One contact detail per line reads better than a wrapped dot-separated run,
     and gives each link a full-width tap target. */
  .contact li { display: block; }
  .contact li + li::before { content: none; margin: 0; }
  .contact a { padding: 0.35rem 0; }

  /* Reclaim the indent; the year sits on its own line above each award. */
  .awards li {
    padding-left: 0;
    text-indent: 0;
    margin-bottom: 0.8rem;
  }

  .awards .meta-inline { display: block; width: auto; }

  .publications li {
    padding-left: 0.9rem;
    text-indent: -0.9rem;
  }
}

/* ---------- print ---------- */

@page { margin: 15mm; }

@media print {
  body {
    max-width: none;
    margin: 0;
    padding: 0;
    background: #fff;
    color: #000;
    font-size: 10.5pt;
    line-height: 1.45;
  }

  h1 { font-size: 20pt; }
  h2 { color: #000; border-bottom-color: #999; }

  .masthead { border-bottom-color: #666; }

  .strapline,
  .contact,
  .meta,
  .meta-inline,
  .org,
  .note,
  .education dd,
  footer { color: #333; }

  a {
    color: #000;
    text-decoration: none;
  }

  section {
    margin-bottom: 1.5rem;
    page-break-inside: avoid;
         break-inside: avoid;
  }

  .entry,
  .publications li,
  .awards li {
    page-break-inside: avoid;
         break-inside: avoid;
  }

  h2, h3 {
    page-break-after: avoid;
         break-after: avoid;
  }
}
