/* ---------------------------------------------------------------
   Shared styles. Colours and sizes live in the :root block below —
   change them there and every page follows.
   --------------------------------------------------------------- */

:root {
  --ink: #15181c;
  --paper: #f6f7f8;
  --muted: #6a7078;
  --rule: #dfe3e6;
  --accent: #1e43be;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --measure: 64ch;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.62;
  font-variant-numeric: oldstyle-nums;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

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

/* --- Page frame --------------------------------------------- */

.page {
  max-width: 66rem;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 6rem;
  display: grid;
  gap: 3rem;
}

@media (min-width: 56rem) {
  .page {
    grid-template-columns: 15rem minmax(0, 1fr);
    gap: 5.5rem;
    padding: 5rem 2.5rem 8rem;
  }
}

/* --- Left rail ---------------------------------------------- */

.rail { align-self: start; }

@media (min-width: 56rem) {
  .rail {
    position: sticky;
    top: 5rem;
  }
}

.name {
  display: block;
  font-size: 2rem;
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.015em;
  text-decoration: none;
  margin: 0 0 0.6rem;
}

.rail-role {
  margin: 0 0 1.75rem;
  font-style: italic;
  font-weight: 300;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
  max-width: 22ch;
}

.rail nav ul,
.rail-contact {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rail nav {
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
}

.rail nav li { margin-bottom: 0.35rem; }

.rail nav a {
  font-family: var(--sans);
  font-size: 0.9375rem;
  text-decoration: none;
  color: var(--muted);
  padding-left: 0.9rem;
  display: inline-block;
  position: relative;
}

.rail nav a:hover { color: var(--ink); }

.rail nav a[aria-current="page"] { color: var(--ink); }

.rail nav a[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 5px;
  background: var(--accent);
}

.rail-contact {
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.875rem;
}

.rail-contact li { margin-bottom: 0.3rem; }

.rail-contact a {
  color: var(--muted);
  text-decoration: none;
}

.rail-contact a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --- Content ------------------------------------------------ */

.content { min-width: 0; }

.lede {
  font-size: 1.375rem;
  line-height: 1.45;
  font-weight: 300;
  margin: 0 0 3rem;
  max-width: 34ch;
}

@media (min-width: 56rem) {
  .lede { font-size: 1.625rem; }
}

.section { margin-bottom: 3.25rem; }

.section > h2 {
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  margin: 0 0 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
}

/* Entry: a hanging date column beside the body.
   Used for résumé entries and article lists alike. */

.entry {
  display: grid;
  gap: 0.15rem 1.5rem;
  margin-bottom: 1.9rem;
}

@media (min-width: 40rem) {
  .entry { grid-template-columns: 7.5rem minmax(0, 1fr); }
}

.entry-when {
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0;
  padding-top: 0.35rem;
  font-variant-numeric: lining-nums;
  white-space: nowrap;
}

.entry-body > * { margin: 0 0 0.4rem; }
.entry-body > *:last-child { margin-bottom: 0; }

.entry-body h3 {
  font-size: 1.1875rem;
  font-weight: 500;
  line-height: 1.3;
}

.entry-body h3 a {
  text-decoration: none;
  text-decoration-color: var(--rule);
}

.entry-body h3 a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.entry-where {
  color: var(--muted);
  font-style: italic;
  font-weight: 300;
}

.entry-body p { max-width: var(--measure); }

.entry-body ul {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  max-width: var(--measure);
}

.entry-body li { margin-bottom: 0.25rem; }

.dek {
  color: var(--muted);
  font-weight: 300;
}

/* Skills / short facts */

.facts {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: var(--measure);
}

.facts li {
  display: grid;
  gap: 0.15rem 1.5rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
}

@media (min-width: 40rem) {
  .facts li { grid-template-columns: 7.5rem minmax(0, 1fr); }
}

.facts span {
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--muted);
  padding-top: 0.2rem;
}

/* --- Article pages ------------------------------------------ */

.post-header { margin-bottom: 2.5rem; }

.post-header h1 {
  font-size: 2.25rem;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 0.75rem;
  max-width: 22ch;
}

.post-when-line {
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0;
}

.prose { max-width: var(--measure); }

.prose p { margin: 0 0 1.25rem; }

.prose h2 {
  font-size: 1.3125rem;
  font-weight: 500;
  margin: 2.5rem 0 0.75rem;
}

.prose blockquote {
  margin: 1.75rem 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--accent);
  font-style: italic;
  color: var(--muted);
}

.prose a {
  color: var(--accent);
  text-underline-offset: 2px;
}

.back {
  display: inline-block;
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: none;
}

.back:hover { color: var(--accent); }

/* --- Print: the résumé should print cleanly ------------------ */

@media print {
  body { background: #fff; font-size: 11pt; }
  .page { display: block; max-width: none; padding: 0; }
  .rail nav, .back { display: none; }
  .rail { margin-bottom: 1.5rem; }
  .entry { break-inside: avoid; }
}

.portrait {
  display: block;
  width: 100%;
  max-width: 9rem;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  margin: 0 0 1.25rem;
  background: var(--rule);
}
