:root {
  color-scheme: dark;
  --bg: #030303;
  --panel: #0a0a0a;
  --panel-soft: #101010;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.2);
  --text: #f2f4f7;
  --muted: #a5adba;
  --faint: #69707d;
  --accent: #ffffff;
  --accent-warm: #e9c46b;
  --accent-cool: #92c7ff;
  --body-font:
    "SF Mono", "SFMono-Regular", ui-monospace, Menlo, Monaco, Consolas, monospace;
  --title-font:
    "SF Mono", "SFMono-Regular", ui-monospace, Menlo, Monaco, Consolas, monospace;
  --mono-font: "SFMono-Regular", "SF Mono", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.site-shell {
  width: min(100% - 32px, 1120px);
  margin: 0 auto;
  padding: 22px 0 72px;
  font-family: var(--body-font);
}

.site-shell[data-font="neat"] {
  --body-font: "Manrope", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --title-font:
    "Source Serif 4", "Iowan Old Style", "Apple Garamond", "Palatino Linotype", Georgia,
    serif;
}

.site-shell[data-font="atelier"] {
  --body-font: "Sora", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --title-font: "Fraunces", "Source Serif 4", "Iowan Old Style", Georgia, serif;
}

.site-shell[data-font="foundry"] {
  --body-font: "IBM Plex Sans", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --title-font:
    "IBM Plex Serif", "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Georgia,
    serif;
}

.site-shell[data-font="journal"] {
  --body-font: "Spectral", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --title-font:
    "Cormorant Garamond", "Source Serif 4", "Apple Garamond", "Times New Roman", serif;
}

.site-shell[data-font="instrument"] {
  --body-font: "Instrument Sans", "Manrope", "Avenir Next", Arial, sans-serif;
  --title-font:
    "Instrument Serif", "Source Serif 4", "Iowan Old Style", "Apple Garamond", serif;
}

.site-shell[data-font="clean-cut"] {
  --body-font: "Archivo", "Helvetica Neue", "Avenir Next", Arial, sans-serif;
  --title-font:
    "DM Serif Display", "Source Serif 4", "Iowan Old Style", "Palatino Linotype", serif;
}

.site-shell[data-font="mono-tech"] {
  --body-font:
    "IBM Plex Mono", "SFMono-Regular", "SF Mono", ui-monospace, Menlo, Consolas,
    monospace;
  --title-font:
    "IBM Plex Mono", "SFMono-Regular", "SF Mono", ui-monospace, Menlo, Consolas,
    monospace;
}

.site-shell[data-font="classic"] {
  --body-font: Georgia, "Times New Roman", Times, serif;
  --title-font: Georgia, "Times New Roman", Times, serif;
}

.site-shell[data-font="modern"] {
  --body-font: Charter, "Bitstream Charter", Cambria, Georgia, serif;
  --title-font: Charter, "Bitstream Charter", Cambria, Georgia, serif;
}

.site-shell[data-font="newsprint"] {
  --body-font: "New York", "Times New Roman", Times, Georgia, serif;
  --title-font: "New York", "Times New Roman", Times, Georgia, serif;
}

.site-shell[data-font="academic"] {
  --body-font: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --title-font: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}

.site-shell[data-font="humanist"] {
  --body-font: Seravek, Optima, Candara, "Gill Sans", "Trebuchet MS", sans-serif;
  --title-font: Optima, Seravek, Candara, "Gill Sans", "Trebuchet MS", sans-serif;
}

.site-shell[data-font="austere"] {
  --body-font: "Avenir Next", Avenir, "Helvetica Neue", Arial, sans-serif;
  --title-font: "Avenir Next", Avenir, "Helvetica Neue", Arial, sans-serif;
}

.site-shell[data-font="romantic"] {
  --body-font:
    "Baskerville", "Libre Baskerville", "Hoefler Text", Garamond, Georgia, serif;
  --title-font:
    "Baskerville", "Libre Baskerville", "Hoefler Text", Garamond, Georgia, serif;
}

.site-shell[data-font="apple-ui"] {
  --body-font:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", "Helvetica Neue", Arial,
    sans-serif;
  --title-font:
    "SF Pro Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial,
    sans-serif;
}

.site-shell[data-font="apple-serif"] {
  --body-font:
    "New York", "Iowan Old Style", "Apple Garamond", "Hoefler Text", Georgia, serif;
  --title-font:
    "New York", "Iowan Old Style", "Apple Garamond", "Hoefler Text", Georgia, serif;
}

.site-shell[data-font="apple-rounded"] {
  --body-font:
    ui-rounded, "SF Pro Rounded", "Avenir Next Rounded", -apple-system,
    BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --title-font:
    ui-rounded, "SF Pro Rounded", "Avenir Next Rounded", -apple-system,
    BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

.site-shell[data-font="apple-mono"] {
  --body-font:
    "SF Mono", "SFMono-Regular", ui-monospace, Menlo, Monaco, Consolas, monospace;
  --title-font:
    "SF Mono", "SFMono-Regular", ui-monospace, Menlo, Monaco, Consolas, monospace;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 48px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono-font);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: lowercase;
}

.brand,
.nav-links {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand {
  color: var(--text);
}

.brand-mark {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
  color: #000;
  font-family: var(--title-font);
  font-size: 16px;
  line-height: 1;
}

.nav-links a {
  color: var(--muted);
  transition: color 180ms ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 820px);
  column-gap: clamp(40px, 8vw, 96px);
  row-gap: 32px;
  align-items: end;
  padding: clamp(88px, 12vw, 150px) 0 clamp(52px, 8vw, 92px);
}

.hero .kicker,
.hero h1,
.hero .lede {
  grid-column: 1;
}

.kicker,
.essay-meta,
.panel-label,
.note time {
  margin: 0;
  color: var(--faint);
  font-family: var(--mono-font);
  font-size: 11px;
  letter-spacing: 0;
  line-height: 1.4;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 820px;
  margin: 16px 0 0;
  color: var(--accent);
  font-family: var(--title-font);
  font-size: clamp(44px, 7.4vw, 92px);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.02;
}

.lede {
  max-width: 610px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(19px, 2.1vw, 25px);
  line-height: 1.42;
}

.font-panel {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
  justify-self: end;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  width: 100%;
  max-height: min(64vh, 620px);
  overflow-y: auto;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.panel-label {
  grid-column: 1 / -1;
  padding: 0 2px 2px;
}

.font-choice {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  text-align: left;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.font-choice[data-font-choice="editorial"] {
  font-family: "Iowan Old Style", "Apple Garamond", Georgia, serif;
}

.font-choice[data-font-choice="neat"] {
  font-family: "Manrope", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
}

.font-choice[data-font-choice="atelier"] {
  font-family: "Sora", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
}

.font-choice[data-font-choice="foundry"] {
  font-family: "IBM Plex Sans", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
}

.font-choice[data-font-choice="journal"] {
  font-family: "Spectral", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}

.font-choice[data-font-choice="instrument"] {
  font-family: "Instrument Sans", "Manrope", "Avenir Next", Arial, sans-serif;
}

.font-choice[data-font-choice="clean-cut"] {
  font-family: "Archivo", "Helvetica Neue", "Avenir Next", Arial, sans-serif;
  font-weight: 600;
}

.font-choice[data-font-choice="mono-tech"] {
  font-family:
    "IBM Plex Mono", "SFMono-Regular", "SF Mono", ui-monospace, Menlo, Consolas,
    monospace;
  font-size: 12px;
}

.font-choice[data-font-choice="classic"] {
  font-family: Georgia, "Times New Roman", Times, serif;
}

.font-choice[data-font-choice="modern"] {
  font-family: Charter, Cambria, Georgia, serif;
}

.font-choice[data-font-choice="newsprint"] {
  font-family: "New York", "Times New Roman", Times, Georgia, serif;
}

.font-choice[data-font-choice="academic"] {
  font-family: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}

.font-choice[data-font-choice="humanist"] {
  font-family: Optima, Seravek, Candara, "Gill Sans", sans-serif;
}

.font-choice[data-font-choice="austere"] {
  font-family: "Avenir Next", Avenir, "Helvetica Neue", Arial, sans-serif;
}

.font-choice[data-font-choice="romantic"] {
  font-family: Baskerville, "Hoefler Text", Garamond, Georgia, serif;
}

.font-choice[data-font-choice="apple-ui"] {
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial,
    sans-serif;
}

.font-choice[data-font-choice="apple-serif"] {
  font-family:
    "New York", "Iowan Old Style", "Apple Garamond", "Hoefler Text", Georgia, serif;
}

.font-choice[data-font-choice="apple-rounded"] {
  font-family:
    ui-rounded,
    "SF Pro Rounded",
    "Avenir Next Rounded",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
}

.font-choice[data-font-choice="apple-mono"] {
  font-family:
    "SF Mono", "SFMono-Regular", ui-monospace, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.font-choice:hover,
.font-choice:focus-visible,
.font-choice.is-active {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.featured-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.65fr) minmax(0, 1.35fr);
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.section-heading,
.essay-card,
.note {
  background: rgba(5, 5, 5, 0.94);
}

.section-heading {
  padding: 22px;
}

.section-heading h2 {
  margin: 10px 0 0;
  color: var(--text);
  font-size: 26px;
  font-weight: 400;
  line-height: 1.05;
}

.essay-card {
  min-height: 340px;
}

.essay-card-large {
  grid-column: auto;
}

.essay-card a {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: flex-end;
  gap: 18px;
  padding: clamp(22px, 3.8vw, 42px);
  transition: background 180ms ease;
}

.essay-card a:hover,
.essay-card a:focus-visible {
  background:
    linear-gradient(180deg, transparent, rgba(233, 196, 107, 0.075)),
    rgba(255, 255, 255, 0.018);
}

.essay-card h3 {
  max-width: 780px;
  margin: 0;
  color: var(--text);
  font-size: clamp(30px, 4vw, 52px);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.06;
}

.essay-card:not(.essay-card-large) h3 {
  font-size: clamp(28px, 3.4vw, 42px);
}

.essay-card p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.48;
}

.notes {
  display: grid;
  grid-template-columns: minmax(180px, 0.25fr) minmax(0, 1fr);
  gap: 1px;
  margin-top: 1px;
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--line);
}

.note-list {
  display: grid;
  gap: 1px;
  background: var(--line);
}

.note {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 24px;
  padding: 24px;
}

.note p {
  margin: 0;
  color: var(--text);
  font-size: clamp(20px, 2vw, 29px);
  line-height: 1.28;
}

@media (max-width: 860px) {
  .site-shell {
    width: min(100% - 24px, 680px);
    padding-bottom: 48px;
  }

  .masthead {
    align-items: flex-start;
    padding-bottom: 14px;
  }

  .nav-links {
    gap: 10px;
  }

  .hero,
  .featured-grid,
  .notes {
    grid-template-columns: 1fr;
  }

  .hero .kicker,
  .hero h1,
  .hero .lede,
  .font-panel {
    grid-column: auto;
    grid-row: auto;
  }

  .hero {
    padding: 64px 0 42px;
  }

  .hero h1 {
    font-size: clamp(42px, 14vw, 72px);
  }

  .font-panel {
    justify-self: stretch;
    max-height: none;
    overflow-y: visible;
  }

  .essay-card-large {
    grid-column: auto;
  }

  .essay-card {
    min-height: 300px;
  }
}

@media (max-width: 560px) {
  .site-shell {
    width: min(100% - 20px, 440px);
    padding-top: 14px;
  }

  .masthead {
    flex-direction: column;
    gap: 12px;
  }

  .hero h1 {
    font-size: clamp(48px, 16vw, 68px);
    line-height: 0.94;
  }

  .lede {
    font-size: 18px;
  }

  .essay-card,
  .essay-card a {
    min-height: 280px;
  }

  .essay-card h3,
  .essay-card:not(.essay-card-large) h3 {
    font-size: 34px;
    line-height: 1;
  }

  .essay-card p {
    font-size: 17px;
  }

  .note {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 20px;
  }
}
