/* Fraunces for the name and titles, Inter for everything else. Both are
   variable fonts, served from this site (SIL Open Font License). */

@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f9f7f0;
  --ink: #18201c;
  --muted: #5f6b64;
  --rule: #dfdccf;
  --accent: #1f5c45;
  --chip: #e6efe9;
  --chip-ink: #1d4a38;
  --display: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
  --text: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial,
    sans-serif;
  --rail: 11rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1412;
    --ink: #e8e9e2;
    --muted: #98a39c;
    --rule: #25302b;
    --accent: #8fcfae;
    --chip: #17251f;
    --chip-ink: #bfe3d0;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.6 var(--text);
  font-feature-settings: "cv11", "ss03";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* A band of the accent color across the top of the sheet. */
body::before {
  content: "";
  display: block;
  height: 6px;
  background: var(--accent);
}

.resume {
  max-width: 58rem;
  margin: 0 auto;
  padding: 4.5rem 2.5rem 6rem;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition:
    color 0.15s,
    text-decoration-color 0.15s;
}

a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

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

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

p,
h1,
h2,
h3 {
  margin: 0;
}

/* Name, a line about me, and how to reach me */

.eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

h1 {
  margin-top: 0.75rem;
  font-family: var(--display);
  font-size: clamp(2.9rem, 9vw, 5.6rem);
  font-weight: 560;
  font-variation-settings: "opsz" 144;
  line-height: 0.98;
  letter-spacing: -0.03em;
}

h1 span {
  color: var(--accent);
}

.lede {
  max-width: 36rem;
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.55;
}

.contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.75rem;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.92rem;
}

.contact .screen-only {
  margin-left: auto;
}

button {
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--paper);
  font: 600 0.85rem/1 var(--text);
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}

button:hover {
  background: transparent;
  color: var(--accent);
}

/* Each section: its name in a rail on the left, its contents on the right. */

section {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  margin-top: 3.5rem;
}

h2 {
  padding-top: 0.3rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* Jobs, schools and programs run down a line, one dot each. */

.entries {
  border-left: 1px solid var(--rule);
}

.entry {
  position: relative;
  padding-left: 1.75rem;
}

.entry + .entry {
  margin-top: 2.25rem;
}

.entry::before {
  content: "";
  position: absolute;
  top: 0.55rem;
  left: -5px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--paper);
}

.entry:first-child::before {
  background: var(--accent);
}

.entry header {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 1.5rem;
  align-items: baseline;
}

h3 {
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 560;
  font-variation-settings: "opsz" 30;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.dates {
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.org {
  grid-column: 1 / -1;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.org strong {
  color: var(--accent);
  font-weight: 600;
}

.entry > ul {
  margin-top: 0.8rem;
}

.entry > ul li {
  position: relative;
  padding-left: 1.1rem;
}

.entry > ul li + li {
  margin-top: 0.35rem;
}

.entry > ul li::before {
  content: "";
  position: absolute;
  top: 0.72em;
  left: 0;
  width: 0.4rem;
  height: 1px;
  background: var(--muted);
}

/* Skills: a label, then what's in it. */

.skills {
  display: grid;
  gap: 0.9rem;
  margin: 0;
  padding-left: 1.75rem;
  border-left: 1px solid var(--rule);
}

.skills > div {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  align-items: baseline;
}

.skills dt {
  font-size: 0.92rem;
  font-weight: 600;
}

.skills dd {
  margin: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chips li {
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: var(--chip);
  color: var(--chip-ink);
  font-size: 0.85rem;
  font-weight: 500;
}

/* The sheet settles into place as it loads. */

@media (prefers-reduced-motion: no-preference) {
  .masthead,
  section {
    animation: settle 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  section:nth-of-type(1) {
    animation-delay: 0.1s;
  }

  section:nth-of-type(2) {
    animation-delay: 0.18s;
  }

  section:nth-of-type(3) {
    animation-delay: 0.26s;
  }

  section:nth-of-type(4) {
    animation-delay: 0.34s;
  }
}

@keyframes settle {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

/* Phones and narrow windows: the rail moves above its section. */

@media (max-width: 46rem) {
  .resume {
    padding: 2.75rem 1.4rem 4rem;
  }

  .lede {
    font-size: 1.05rem;
  }

  .contact {
    flex-direction: column;
    align-items: flex-start;
  }

  .contact .screen-only {
    margin: 0.6rem 0 0;
  }

  section {
    grid-template-columns: 1fr;
    margin-top: 2.75rem;
  }

  h2 {
    margin-bottom: 1.1rem;
    padding-top: 0;
  }

  .entry {
    padding-left: 1.25rem;
  }

  .entry header {
    grid-template-columns: 1fr;
  }

  h3 {
    font-size: 1.2rem;
  }

  .dates {
    order: 3;
    margin-top: 0.15rem;
  }

  .skills {
    padding-left: 1.25rem;
  }

  .skills > div {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

/* Printed or saved as a PDF: one letter page, white paper, the accent kept. */

@page {
  size: letter;
  margin: 0.5in 0.6in;
}

@media print {
  :root {
    --paper: #fff;
    --ink: #111;
    --muted: #4a524d;
    --rule: #cfd4d0;
    --accent: #1f5c45;
    --chip-ink: #111;
    --rail: 8.5rem;
    --gap: 0.6rem;
  }

  /* Everything is sized in rem, so this scales the whole sheet. */
  html {
    font-size: 9pt;
  }

  body {
    line-height: 1.34;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Applicant-tracking software reads the PDF's text, so nothing here is
     positioned (positioned boxes are written out of order), the wide letter
     spacing goes, and the "Résumé" label can't be mistaken for my name. */
  body::before,
  .eyebrow,
  .entry::before,
  .screen-only {
    display: none;
  }

  .masthead,
  section {
    animation: none;
  }

  .resume {
    max-width: none;
    padding: 0;
  }

  a {
    text-decoration: none;
  }

  h1 {
    margin-top: 0;
    font-size: 3.1rem;
    letter-spacing: -0.015em;
    word-spacing: 0.08em;
  }

  .lede {
    max-width: 46rem;
    margin-top: 0.6rem;
    font-size: 1.05rem;
    line-height: 1.4;
  }

  .contact {
    margin-top: 0.8rem;
    padding-top: 0.55rem;
  }

  section {
    margin-top: 0.95rem;
  }

  h2 {
    padding-top: 0.25rem;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
  }

  /* The line and its dots are drawn as backgrounds instead. */
  .entries,
  .skills {
    border-left: 0;
  }

  .entry {
    --dot: 0.72rem;
    position: static;
    padding-left: 1.4rem;
    background:
      radial-gradient(
        circle at 3.5px var(--dot),
        var(--paper) 0 1.9px,
        var(--accent) 2.1px 3.3px,
        transparent 3.6px
      )
      no-repeat,
      linear-gradient(var(--rule), var(--rule)) 3px 0 / 1px 100% no-repeat;
    break-inside: avoid;
  }

  .entry:first-child {
    background:
      radial-gradient(
        circle at 3.5px var(--dot),
        var(--accent) 0 3.3px,
        transparent 3.6px
      )
      no-repeat,
      linear-gradient(var(--rule), var(--rule)) 3px 0 / 1px 100% no-repeat;
  }

  .entry + .entry {
    --dot: calc(0.72rem + var(--gap));
    margin-top: 0;
    padding-top: var(--gap);
  }

  .entry > ul li {
    position: static;
  }

  .entry > ul li::before {
    position: static;
    float: left;
    width: 0.4rem;
    margin: 0.68em 0 0 -1.1rem;
  }

  h3 {
    font-size: 1.12rem;
  }

  .entry > ul {
    margin-top: 0.3rem;
  }

  .entry > ul li + li {
    margin-top: 0.1rem;
  }

  .skills {
    gap: 0.3rem;
    padding-left: 1.4rem;
    background: linear-gradient(var(--rule), var(--rule)) 3px 0 / 1px 100%
      no-repeat;
  }

  /* Chips become a plain run of words; filled shapes waste ink. */
  .chips {
    gap: 0;
  }

  .chips li {
    padding: 0;
    background: none;
    font-size: 0.95rem;
    font-weight: 400;
  }

  .chips li:not(:last-child)::after {
    content: "·";
    margin: 0 0.45rem;
    color: var(--muted);
  }
}
