/* andrewandjelic.com
   One typeface (Libre Franklin), one accent (the green of the Defender),
   one grid: a label column, a date column, and the text. The page needs no
   JavaScript; the only script is the easter egg (egg.js, egg.css).
   Light only, on purpose: it is meant to read like a printed page. */

@font-face {
  font-family: "Libre Franklin";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/libre-franklin-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Libre Franklin";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/libre-franklin-latin-italic.woff2") format("woff2");
}

:root {
  --paper: #ffffff;
  --ink: #141615;
  --ink-2: #5a605d;
  --rule: #d9dcd9;
  --link: #1c5a3a;
  --label-col: 11rem;
  --date-col: 9rem;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 "Libre Franklin", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.wrap {
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2rem);
}

a {
  color: var(--link);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, .skip:focus {
  outline: 2px solid var(--link);
  outline-offset: 3px;
}

h1, h2, h3, p, ul, dl, dd, figure, blockquote { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
strong { font-weight: 650; }
p { text-wrap: pretty; }

.skip {
  position: absolute;
  left: -100vw;
  top: 0.75rem;
  padding: 0.4rem 0.75rem;
  background: var(--paper);
}
.skip:focus { left: 0.75rem; }

/* Header */

.site-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 2rem;
  padding-block: 1.5rem 1.25rem;
}
.site-head::after {
  content: "";
  flex-basis: 100%;
  border-bottom: 1px solid var(--rule);
  margin-top: 0.75rem;
}
.site-name {
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}
.site-head nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  font-size: 0.9375rem;
}
.site-head nav a {
  color: var(--ink);
  text-decoration: none;
}
.site-name:hover, .site-head nav a:hover { text-decoration: underline; }

/* Intro */

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 15rem;
  gap: 4rem;
  align-items: start;
  padding-block: 3.5rem 4rem;
}
h1 {
  max-width: 17ch;
  font-size: clamp(2.125rem, 1.2rem + 3.6vw, 3.5rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.026em;
  text-wrap: balance;
}
.intro-text p { max-width: 39rem; margin-top: 1.1rem; }
.intro-text .lede {
  margin-top: 1.75rem;
  font-size: 1.3125rem;
  line-height: 1.45;
  letter-spacing: -0.005em;
}
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  margin-top: 1.75rem;
  font-weight: 600;
}

.portrait { width: 100%; aspect-ratio: 1; object-fit: cover; }
.facts { margin-top: 1rem; font-size: 0.875rem; line-height: 1.45; }
.facts div { padding-block: 0.6rem; border-top: 1px solid var(--rule); }
.facts div:last-child { border-bottom: 1px solid var(--rule); }
.facts dt { color: var(--ink-2); }

/* Figures */

figcaption {
  margin-top: 0.6rem;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--ink-2);
}
.wide img {
  width: 100%;
  aspect-ratio: 2.1;
  object-fit: cover;
  object-position: 50% 64%;
}

/* Sections: label column on the left, content on the right */

.section {
  display: grid;
  grid-template-columns: var(--label-col) minmax(0, 1fr);
  column-gap: 3rem;
  margin-top: 4.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 1rem;
}
.section > h2 {
  position: sticky;
  top: 1.25rem;
  align-self: start;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.6;
}
/* The photo grid runs full width under this label, so it must not ride over it. */
#outside > h2 { position: static; }
.section-intro { max-width: 39rem; }
.section-intro + .section-intro { margin-top: 0.85rem; }
.section-intro + .entry { margin-top: 2.75rem; }

/* Entries: date column, then the text */

.entry {
  display: grid;
  grid-template-columns: var(--date-col) minmax(0, 1fr);
  column-gap: 2rem;
  scroll-margin-top: 1.5rem;
}
.entry + .entry { margin-top: 2.75rem; }
.when {
  padding-top: 0.25rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.when span { display: block; }
.what { max-width: 39rem; }
.what h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.what h3 a { color: inherit; text-decoration-color: var(--rule); text-decoration-thickness: 2px; }
.what h3 a:hover { text-decoration-color: currentColor; }
.role {
  display: block;
  margin-top: 0.15rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0;
  color: var(--ink-2);
}
.what p { margin-top: 0.8rem; }
.entry > figure { grid-column: 1 / -1; margin-top: 1.5rem; }
.entry > figure img { width: 100%; outline: 1px solid var(--rule); outline-offset: -1px; }

blockquote {
  margin-top: 1.4rem;
  padding-left: 1.25rem;
  border-left: 2px solid var(--ink);
}
blockquote p { margin-top: 0; font-style: italic; }
blockquote footer {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--ink-2);
}

/* Skills: same grid as the entries */

.skills .entry + .entry { margin-top: 1.1rem; }
.skills dt { padding-top: 0.2rem; }

/* Photos */

.gallery {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.75rem 1.25rem;
  margin-top: 2.5rem;
}
.gallery img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }

/* Contact and footer */

.contact-line {
  max-width: 34rem;
  font-size: 1.3125rem;
  line-height: 1.45;
}
#contact .links { margin-top: 1.25rem; }

.site-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 2rem;
  margin-top: 5rem;
  padding-block: 1.5rem 3rem;
  font-size: 0.875rem;
  color: var(--ink-2);
}
.site-foot::before {
  content: "";
  flex-basis: 100%;
  border-top: 1px solid var(--rule);
  margin-bottom: 1.25rem;
}

/* Narrower screens */

@media (max-width: 56rem) {
  .section { grid-template-columns: minmax(0, 1fr); }
  .section > h2 { position: static; margin-bottom: 1.75rem; }
  .intro { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; padding-block: 2.5rem 3rem; }
  .intro-side {
    display: grid;
    grid-template-columns: 7rem minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
    max-width: 30rem;
  }
  .facts { margin-top: 0; }
  .facts div:first-child { border-top: 0; padding-top: 0; }
}

@media (max-width: 40rem) {
  body { font-size: 1rem; }
  .intro-text .lede, .contact-line { font-size: 1.1875rem; }
  .entry { grid-template-columns: minmax(0, 1fr); }
  .when { padding-top: 0; margin-bottom: 0.3rem; }
  .when span { display: inline; }
  .when span + span::before { content: " · "; }
  .section { margin-top: 3.5rem; }
  .wide img { aspect-ratio: 3 / 2; }
  .gallery { grid-template-columns: minmax(0, 1fr); }
  .skills dt { padding-top: 0; }
}

@media print {
  .site-head nav, .skip, .wide, .gallery, .entry > figure { display: none; }
  .section { margin-top: 2rem; break-inside: auto; }
  .entry { break-inside: avoid; }
  a { color: inherit; }
}
