/* stephendebaun.com
   Palette from the portrait: blazer navy, shirt white, the ivy on the wall.
   Besley (a Clarendon revival) for the name, headings, and the year spine;
   Atkinson Hyperlegible Next for reading. */

@font-face {
  font-family: "Besley";
  src: url("/fonts/besley-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
/* Figures come from Besley everywhere: Atkinson's slashed zero reads as a
   letter in dates and amounts, and this ties body figures to the year spine. */
@font-face {
  font-family: "SD Figures";
  src: url("/fonts/besley-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0030-0039;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/atkinson-next-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/atkinson-next-italic-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light;
  --blazer: #1d2b4f;   /* ink, headings, contact band: 13.9:1 on paper */
  --blazer-2: #2c3f6c; /* primary button hover */
  --paper: #ffffff;
  --slate: #56617a;    /* dates, roles, secondary: 6.2:1 */
  --ivy: #3b6b2e;      /* links, the spine: 6.3:1 */
  --denim: #7a8aab;    /* year numerals only, large text: 3.5:1 */
  --mist: #e8ecf3;     /* hover wash, target wash */
  --shirt: #c9d3e8;    /* secondary text on blazer: 9.2:1 */

  --display: "Besley", Rockwell, "Clarendon", Georgia, serif;
  --text: "SD Figures", "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: 1.25rem;
  --wide: 72rem;
  --measure: 40rem;
  --rail: 0rem; /* left rail the content column hangs from; set on desktop */
  --bar: 3.25rem; /* the sticky nav's height */
  --land: calc(var(--bar) + 1rem); /* where anchored things land, clear of the bar */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--blazer);
  font: 400 1.0625rem/1.6 var(--text);
  font-kerning: normal;
}

h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 700; line-height: 1.1; }
p { margin: 0; }
ul, ol { margin: 0; }

a { color: var(--ivy); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ivy); outline-offset: 3px; border-radius: 2px; }

/* ---------- sticky nav ----------
   Pure CSS. Quiet text links that scroll sideways on their own when the
   row runs out of room, and two navy icon actions pinned at the right. */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--bar);
  background: var(--paper);
  border-bottom: 1px solid var(--mist);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: var(--wide);
  height: 100%;
  margin: 0 auto;
  /* "Me" and the icon squares line up with the content edges; the links'
     own 0.25rem padding and the icons' 4px of hit area sit outside them. */
  padding: 0 calc(var(--gutter) - 4px) 0 calc(var(--gutter) - 0.25rem);
}
.topbar-links {
  display: flex;
  flex: 1;
  min-width: 0;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  list-style: none;
  scrollbar-width: none;
}
.topbar-links::-webkit-scrollbar { display: none; }
.topbar-links a {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.25rem;
  color: var(--slate);
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.topbar-links a:hover { color: var(--blazer); text-decoration: underline; text-decoration-color: var(--ivy); }
.topbar-links a:focus-visible { outline-offset: -2px; }
.topbar-actions { display: flex; flex: none; }
.icon-btn { /* a 44px target around a 36px navy square */
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  color: var(--paper);
}
.icon-btn svg {
  box-sizing: content-box;
  padding: 8px;
  border-radius: 6px;
  background: var(--blazer);
}
.icon-btn:hover svg { background: var(--blazer-2); }
.icon-btn:focus-visible { outline-offset: -1px; }

/* Anything a link can land on clears the bar. */
.intro, section, .entry, .items li, .side-list li { scroll-margin-top: var(--land); }

/* ---------- intro ---------- */

.intro { display: grid; }

/* Phone: a small, uncropped square portrait above the name, so the whole
   head stays in frame and the name and intro reach the first screen. */
.portrait { order: -1; display: block; padding: 1.5rem var(--gutter) 0; }
.portrait img {
  display: block;
  width: 100%; /* the full content column on phones: 350px at 390, 280px at 320 */
  max-width: 24rem; /* tablets between phone and desktop don't get a giant circle */
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%; /* the inscribed circle clears his crown and skull; see plan doc */
}

.intro-text { padding: 1.25rem var(--gutter) 0; }

.intro h1 {
  font-size: clamp(2.75rem, 12.5vw, 6rem);
  font-weight: 800;
  /* Besley's p descends 0.257em and its B rises 0.75em, so the "p" in
     Stephen clears the "B" in DeBaun only above 1.007. 1.06 leaves ~0.05em. */
  line-height: 1.06;
  letter-spacing: -0.02em;
}

.lede {
  margin-top: 1rem;
  font-family: var(--display);
  font-size: clamp(1.375rem, 5.4vw, 2rem);
  font-weight: 500;
  line-height: 1.2;
}

.summary { margin-top: 0.875rem; max-width: 36rem; }
.where { margin-top: 0.5rem; color: var(--slate); }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

.button {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0.625rem 1.375rem;
  border: 2px solid var(--blazer);
  border-radius: 4px;
  color: var(--blazer);
  font-weight: 700;
  text-decoration: none;
}
.button:hover { background: var(--mist); }
.button.primary { background: var(--blazer); color: var(--paper); }
.button.primary:hover { background: var(--blazer-2); border-color: var(--blazer-2); }

/* ---------- highlights ---------- */

.highlights { max-width: var(--wide); margin: 0 auto; padding: 2.75rem var(--gutter) 0.5rem; }
.highlights ul { display: grid; gap: 1.25rem; padding: 0; list-style: none; }
.highlights a {
  display: block;
  padding-left: 0.875rem;
  border-left: 3px solid var(--ivy);
  color: var(--blazer);
  text-decoration: none;
}
.hl-org { display: block; font-family: var(--display); font-size: 1.0625rem; font-weight: 700; line-height: 1.3; }
.hl-text { display: block; margin-top: 0.125rem; }
.highlights a:hover .hl-text { text-decoration: underline; text-decoration-color: var(--ivy); text-underline-offset: 0.18em; }

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

.work, .side, .skills, .recs {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 3.5rem var(--gutter) 0;
}
.work > h2, .side > h2, .skills > h2, .recs > h2 {
  margin-bottom: 1.5rem;
  padding-left: var(--rail);
  font-size: clamp(1.625rem, 7.5vw, 2.5rem);
  font-weight: 800;
}

/* ---------- the year spine ---------- */

.spine { padding: 0; list-style: none; }

.year {
  position: relative;
  padding: 0 0 2.25rem 1.375rem;
  border-left: 2px solid var(--ivy);
}
.year:last-child { padding-bottom: 0.5rem; }

.year-num {
  position: relative;
  margin-bottom: 0.875rem;
  color: var(--denim);
  font-family: var(--display);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: proportional-nums; /* Besley's tabular zero is drawn light and narrow */
  letter-spacing: -0.01em;
}
.year-num.year-word { font-size: 2rem; } /* "Earlier": the undated group, same voice as the years */
.year-num::before { /* the year's node on the spine */
  content: "";
  position: absolute;
  top: calc(0.5em - 6px);
  left: calc(-1.375rem - 7px);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ivy);
}

.entry + .entry { margin-top: 2.25rem; }
.entry h3 { font-size: 1.4375rem; line-height: 1.15; }
.role { margin-top: 0.25rem; font-weight: 700; }
.when { margin-top: 0.125rem; color: var(--slate); font-size: 0.9375rem; }
.tag { text-transform: capitalize; }
.body { max-width: var(--measure); margin-top: 0.625rem; }

.links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin-top: 0.375rem; }

.items { max-width: var(--measure); margin-top: 0.75rem; padding-left: 1.125rem; }
.items ul { padding-left: 1.125rem; }
.items li { margin-top: 0.5rem; padding-left: 0.25rem; }
.items li::marker { color: var(--ivy); }
.item-h { display: block; font-weight: 700; }

/* A gap between paid roles: no numeral, no heading, no node, one small
   line; the spine runs dashed beside it. Slate on paper is 6.2:1. */
.gap { padding: 0 0 2.25rem 1.375rem; border-left: 2px dashed var(--ivy); }
.gap-line { color: var(--slate); font-size: 0.9375rem; }
.gap-line a { color: var(--slate); white-space: nowrap; }

/* ---------- personal projects ----------
   Everything that isn't a paid role, one line each: the section's compact
   structure does the quieting, so the text keeps the normal palette. */

.side-list { display: grid; gap: 1.125rem; padding: 0 0 0 var(--rail); list-style: none; }
.side-list li { position: relative; max-width: 52rem; }
.side-years { display: block; color: var(--slate); font-size: 0.9375rem; }
.side-name { font-family: var(--display); font-weight: 700; margin-right: 0.375rem; }
.side-links { display: inline-flex; flex-wrap: wrap; gap: 0 0.875rem; margin-left: 0.25rem; }
.side-links a { overflow-wrap: anywhere; } /* a long label may wrap; it never widens the page */

:target { background: var(--mist); box-shadow: 0 0 0 0.5rem var(--mist); }

/* ---------- skills ---------- */

.skill-groups { display: grid; gap: 1.5rem; padding-left: var(--rail); }
.skills h3 { margin-bottom: 0.375rem; font-size: 1.1875rem; }
.skills ul { max-width: var(--measure); padding: 0; list-style: none; }
.skills li { display: inline; }
.skills li:not(:last-child)::after { content: ", "; }

/* ---------- recommendations ---------- */

/* Above the timeline, full width like the highlights. Narrow screens get a
   swipe row: one quote per snap, the next one peeking in at the edge. CSS
   scroll-snap only, no timers; the row takes focus so arrow keys scroll it. */
.recs > h2 { padding-left: 0; }
.quotes {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 84%;
  gap: 1.25rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding: 0.25rem 0 0.75rem;
}
.quotes:focus-visible { outline-offset: 4px; }
.quotes figure { margin: 0; padding-left: 0.5em; scroll-snap-align: start; }
.quotes blockquote { margin: 0; font-family: var(--display); font-size: 1.1875rem; line-height: 1.45; }
.quotes blockquote p { text-indent: -0.42em; }
.quotes figcaption { margin-top: 0.5rem; color: var(--slate); font-size: 0.9375rem; }

/* ---------- contact ---------- */

.contact { margin-top: 4.5rem; padding: 3rem var(--gutter) 3.5rem; background: var(--blazer); color: var(--paper); }
.contact-inner { max-width: var(--wide); margin: 0 auto; padding-left: var(--rail); }
.contact h2 { color: var(--shirt); font-family: var(--text); font-size: 1.0625rem; font-weight: 700; }
.contact a { color: var(--paper); text-decoration-color: rgb(255 255 255 / 0.55); }
.contact a:hover { text-decoration-color: var(--paper); }
.contact :focus-visible { outline-color: var(--paper); }
.email { margin-top: 0.5rem; }
.email a {
  font-family: var(--display);
  font-size: clamp(1.25rem, 5.3vw, 2.75rem);
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.elsewhere { margin-top: 1rem; }

/* ---------- 404 ---------- */

.notfound { max-width: var(--wide); margin: 0 auto; padding: 5rem var(--gutter); }
.notfound h1 { margin-bottom: 1.5rem; font-size: clamp(2rem, 8vw, 3.5rem); }

/* ---------- wider screens ---------- */

@media (min-width: 40em) {
  :root { --gutter: 2rem; }
  .highlights ul { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 2.5rem; }
}

@media (min-width: 60em) {
  :root { --gutter: 2.5rem; --rail: calc(9rem + 2px + 2.5rem); }

  .intro {
    grid-template-columns: minmax(0, 1fr) 24rem;
    gap: 4rem;
    align-items: end;
    max-width: var(--wide);
    margin: 0 auto;
    padding: 5rem var(--gutter) 1rem;
  }
  .portrait { order: 0; padding: 0; }
  .portrait img { width: 100%; border-radius: 0; }
  .intro-text { padding: 0; }
  .summary { font-size: 1.1875rem; }

  .highlights { padding-top: 3.5rem; }

  .year {
    display: grid;
    grid-template-columns: 9rem minmax(0, 1fr);
    padding: 0;
    border-left: 0;
  }
  .year-num {
    position: sticky;
    top: calc(var(--bar) + 1.5rem);
    align-self: start;
    margin: 0;
    padding-right: 2rem;
    font-size: 3.25rem;
    text-align: right;
  }
  .year-num.year-word { font-size: 2rem; padding-top: 0.5rem; }
  .year-num::before { display: none; }
  .year-entries {
    position: relative;
    padding: 0.5rem 0 3.5rem 2.5rem;
    border-left: 2px solid var(--ivy);
  }
  .year-entries::before { /* the year's node on the spine */
    content: "";
    position: absolute;
    top: calc(0.5rem + 1.625rem - 6px);
    left: -7px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--ivy);
  }
  .year:last-child .year-entries { padding-bottom: 0.5rem; }
  .gap { display: grid; grid-template-columns: 9rem minmax(0, 1fr); padding: 0; border-left: 0; }
  .gap-line { grid-column: 2; padding: 0 0 3rem 2.5rem; border-left: 2px dashed var(--ivy); }
  /* Side years hang in the year gutter, small, right-aligned with the numerals above. */
  .side-years { position: absolute; top: 0.1em; left: calc(-1 * var(--rail)); width: 7rem; text-align: right; }

  .skill-groups { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem 3rem; }
  .quotes {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.5rem;
    overflow: visible;
    scroll-snap-type: none;
  }
}
