/* ==========================================================================
   Bradley Yarbrough — Curriculum Vitae
   Single column · EB Garamond throughout · one navy accent
   Fonts are self-hosted (SIL Open Font License; see /fonts).
   ========================================================================== */

@font-face {
  font-family: "EB Garamond";
  src: url("../fonts/EBGaramond-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("../fonts/EBGaramond-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("../fonts/EBGaramond-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---- Tokens ------------------------------------------------------------- */
:root {
  --paper: #ffffff;
  --ink: #222222;        /* 15.9:1 on paper */
  --muted: #555555;      /*  7.5:1 on paper */
  --accent: #1f3864;     /* 11.6:1 on paper — name, section heads, rules only */
  --rule: #c5cbd8;       /* decorative hairlines */

  --serif: "EB Garamond", "Iowan Old Style", Georgia, "Times New Roman", serif;

  --measure: 50rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14161a;
    --ink: #e7e6e2;     /* 14.5:1 */
    --muted: #a9adb7;   /*  8.1:1 */
    --accent: #9db6ea;  /*  8.9:1 */
    --rule: #3a4050;
  }
}

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

html {
  font-size: 105%; /* 16.8px: Garamond runs small, so the web size is larger than the print size */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.4;
  font-variant-numeric: lining-nums;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

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

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.5rem 0.9rem;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--accent);
  z-index: 10;
}
.skip:focus { top: 1rem; }

ul { margin: 0; padding: 0; list-style: none; }
p  { margin: 0; }

/* ---- Masthead ----------------------------------------------------------- */
.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1.5rem;
}

.masthead h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 2.4rem;
  line-height: 1.1;
  letter-spacing: -0.005em;
  color: var(--accent);
  white-space: nowrap;
}

.download {
  font-size: 0.92rem;
  color: var(--muted);
}

.contact {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem 1.6rem;
  margin-top: 0.15rem;
  color: var(--muted);
}

/* ---- Sections ----------------------------------------------------------- */
section { margin-top: 1.6rem; }

h2 {
  margin: 0 0 0.65rem;
  padding-bottom: 0.18rem;
  border-bottom: 1px solid var(--accent);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.08rem;
  line-height: 1.2;
  letter-spacing: 0.05em;
  font-variant-caps: small-caps;
  font-feature-settings: "smcp", "c2sc";
  color: var(--accent);
}

/* ---- Rows: content left, dates right-aligned (flex, never a table) -------- */
.row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  column-gap: 1.5rem;
}
.row > .what { flex: 1 1 auto; min-width: 0; }
.when {
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
  color: var(--muted);
  font-variant-numeric: lining-nums tabular-nums;
}

strong { font-weight: 600; }
em     { font-style: italic; }

.entry + .entry { margin-top: 0.7rem; }
.entry > .row + .row,
.entry > .row + .note,
.entry > .row + ul { margin-top: 0.12rem; }
.entry .indent { padding-left: 0.9rem; }
.note {
  padding-left: 0.9rem;
  color: var(--muted);
  font-style: italic;
}

/* Honors: one line per item */
.list > li + li { margin-top: 0.12rem; }

/* Coursework: label and content */
.terms > div {
  display: grid;
  grid-template-columns: 9.6rem 1fr;
  column-gap: 1rem;
}
.terms > div + div { margin-top: 0.2rem; }
.terms dt { font-style: italic; color: var(--muted); }
.terms dd { margin: 0; max-width: 40rem; }
.terms { margin: 0; }

/* Experience: employer once, titles stacked beneath a quiet rule */
.stack {
  margin: 0.2rem 0 0 0.15rem;
  padding-left: 0.85rem;
  border-left: 2px solid var(--rule);
}
.stack > li + li { margin-top: 0.05rem; }

.bullets {
  margin: 0.4rem 0 0 1.1rem;
  max-width: 42rem; /* keep prose lines under ~90 characters */
}
.bullets > li {
  position: relative;
  padding-left: 0.9rem;
}
.bullets > li + li { margin-top: 0.18rem; }
.bullets > li::before {
  content: "\2022";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ---- Narrow screens -------------------------------------------------------- */
@media (max-width: 34rem) {
  html { font-size: 100%; }
  .page { padding: 2rem 1.1rem 3rem; }
  .row { column-gap: 0.75rem; }
  .stack { padding-left: 0.6rem; }
  .masthead h1 { font-size: 2rem; }
  .terms > div { grid-template-columns: 1fr; }
  .terms dt { margin-bottom: 0.05rem; }
  .row { row-gap: 0.05rem; }
}

@media (prefers-reduced-motion: no-preference) {
  a { transition: text-decoration-color 0.15s ease; }
}

/* ==========================================================================
   Print / PDF
   ========================================================================== */
@page {
  size: letter;
  margin: 0.75in 0.9in;
}

@media print {
  :root {
    --paper: #ffffff;
    --ink: #1a1a1a;
    --muted: #4a4a4a;
    --accent: #1f3864;
    --rule: #b9c0cf;
  }

  html { font-size: 10.5pt; }
  body { background: #fff; line-height: 1.32; }
  .page { max-width: none; margin: 0; padding: 0; }

  .no-print, .skip { display: none !important; }

  .masthead h1 { font-size: 26pt; }
  h2 { font-size: 11.5pt; break-after: avoid; }
  section { margin-top: 12pt; }
  .entry, .row { break-inside: avoid; }
  section, .entry { orphans: 3; widows: 3; }

  a { text-decoration: none; }
}
