/* melvinlim.org
   Static. No framework, no webfont request, no tracking script.
   Roughly 9 KB uncompressed. */

:root {
  --ink:        #16181d;
  --ink-soft:   #4a4f59;
  /* #7b828e read as "faint" but measured 3.71:1 on --paper, a WCAG 2.2 AA
     failure at the 14px this token is used at (33 elements). #676e7b is
     4.92:1: still visibly lighter than --ink-soft, now passing. */
  --ink-faint:  #676e7b;
  --rule:       #e2e0da;
  --paper:      #fbfaf7;
  --paper-lift: #ffffff;
  --accent:     #8a2f22;
  --accent-ink: #6d2419;
  --measure:    34rem;
  --step--1: 0.875rem;
  --step-0:  1.0625rem;
  --step-1:  1.375rem;
  --step-2:  1.875rem;
  --step-3:  clamp(2.25rem, 6vw, 3.25rem);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: var(--step-0);
  line-height: 1.65;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

.wrap {
  width: min(100% - 3rem, 62rem);
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem; top: 1rem;
  background: var(--ink); color: var(--paper);
  padding: .6rem 1rem; z-index: 10;
  font-family: ui-sans-serif, system-ui, sans-serif; font-size: var(--step--1);
}

/* ---------- masthead ---------- */

.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.masthead .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 1rem 2rem;
  padding: 1.5rem 0;
}

.wordmark {
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
  /* WCAG 2.2 Target Size (Minimum) is 24x24 CSS px. A bare 14px line box
     renders ~23px tall, under the floor. The padding buys the height
     without changing the visual position. */
  display: inline-block;
  padding-block: .35rem;
  min-height: 24px;
}

.masthead nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: var(--step--1);
}

.masthead nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.masthead nav a:hover,
.masthead nav a:focus-visible,
.masthead nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* ---------- hero ---------- */

.hero {
  padding: clamp(3rem, 9vw, 6rem) 0 clamp(2rem, 5vw, 3.5rem);
}

.hero h1 {
  font-size: var(--step-3);
  line-height: 1.08;
  letter-spacing: -.02em;
  margin: 0 0 1rem;
  font-weight: 400;
  max-width: 20ch;
}

.hero .role {
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: var(--step--1);
  letter-spacing: .02em;
  color: var(--ink-faint);
  margin: 0 0 2rem;
}

.hero .lede {
  max-width: var(--measure);
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0;
}

/* ---------- the standing line ---------- */

.standing {
  border-left: 3px solid var(--accent);
  padding: .25rem 0 .25rem 1.5rem;
  margin: 3rem 0 0;
  max-width: var(--measure);
  font-size: var(--step-1);
  line-height: 1.5;
}
.standing p { margin: 0; }
.standing cite {
  display: block;
  margin-top: .75rem;
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: var(--step--1);
  font-style: normal;
  letter-spacing: .02em;
  color: var(--ink-faint);
}

/* ---------- generic section ---------- */

section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
section + section { border-top: 1px solid var(--rule); }

h2 {
  font-size: var(--step-2);
  line-height: 1.2;
  letter-spacing: -.015em;
  font-weight: 400;
  margin: 0 0 .5rem;
  max-width: 24ch;
}

h3 {
  font-size: var(--step-1);
  line-height: 1.3;
  font-weight: 400;
  margin: 2.5rem 0 .5rem;
}

.section-note {
  max-width: var(--measure);
  color: var(--ink-soft);
  margin: 0 0 2rem;
}

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

a {
  color: var(--accent-ink);
  text-underline-offset: .18em;
  /* Colour and border only. No layout property animates, so nothing here can
     cause a reflow or a layout shift on hover. */
  transition: color .15s ease, border-color .15s ease;
}
a:hover { color: var(--accent); }

/* Keyboard focus gets the same signal as hover. The user-agent ring is left
   intact on purpose: nothing in this sheet sets outline:none, so there is
   always a visible indicator even if these rules are stripped. */
a:focus-visible {
  color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 1px;
}

/* ---------- video list ---------- */

.video-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1px;
  background: var(--rule);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.video-grid li { background: var(--paper); }

.video-grid a {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 1rem;
  align-items: baseline;
  padding: 1.15rem 0;
  text-decoration: none;
  color: var(--ink);
}
.video-grid a:hover { color: var(--accent-ink); }

.video-grid .num {
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: var(--step--1);
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.video-grid .t { line-height: 1.4; }

/* ---------- single video ---------- */

.player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  margin: 2rem 0;
  border-radius: 2px;
  overflow: hidden;
}
.player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.series-tag {
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: var(--step--1);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .75rem;
}

.prevnext {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: var(--step--1);
}
.prevnext a { text-decoration: none; }
.prevnext .dir { display: block; color: var(--ink-faint); }

/* ---------- bio / prose ---------- */

.prose p + p { margin-top: 1.25rem; }

.factlist {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.factlist li {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.5rem;
  padding: .9rem 0;
  border-bottom: 1px solid var(--rule);
}
.factlist .k {
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: var(--step--1);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-faint);
  flex: 0 0 10rem;
}
.factlist .v { flex: 1 1 18rem; }

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--rule);
  padding: 2.5rem 0 4rem;
  margin-top: 2rem;
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: var(--step--1);
  color: var(--ink-faint);
}
.footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
}
/* Wrap so the 24px minimum in WCAG 2.2 Target Size (Minimum) is met without
   moving the text: a 14px line box alone renders ~23px tall. */
.footer a {
  color: var(--ink-soft);
  display: inline-block;
  min-height: 24px;
  padding-block: .1rem;
}
.footer nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }

/* ---------- misc ---------- */

.notice {
  background: var(--paper-lift);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  padding: 1.25rem 1.5rem;
  max-width: var(--measure);
  margin: 0 0 2rem;
}
.notice p { margin: 0; font-size: var(--step--1); }

@media (max-width: 34rem) {
  .video-grid a { grid-template-columns: 2.5rem 1fr; gap: .75rem; }
  .factlist .k { flex-basis: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* Colour fades are not motion, but a reader who has asked for less
     animation should not get a moving interface element either. */
  a { transition: none; }
}

@media print {
  .masthead nav, .prevnext, .footer nav { display: none; }
  body { background: #fff; }
}
