/* TEACH workshop site.
   Layout: a chalkboard header carrying the name as an acrostic, then a paper
   handout below it, with margin headings on the left and running text in a
   65-character column on the right. */

@font-face {
  font-family: "Besley";
  src: url("fonts/besley-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("fonts/atkinson-hyperlegible-next-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Mono";
  src: url("fonts/atkinson-hyperlegible-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* Paper (page body) */
  --paper: #fafbf7;
  --ink: #15221c;
  --muted: #536259;
  --rule: #d3dbd1;
  --accent: #1b5e47;
  --mark-bg: #fbe58a;
  --mark-ink: #15221c;

  /* Chalkboard (header) */
  --board: #1d4435;
  --board-ink: #f1f4ec;
  --board-muted: #b7c7bb;
  --board-rule: rgba(241, 244, 236, 0.22);
  --chalk: #f4d35e;
  --chalk-ink: #15221c;

  --font-display: "Besley", Rockwell, "Rockwell Nova", "Roboto Slab", Georgia, serif;
  --font-body: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Atkinson Hyperlegible Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --gutter: 1.25rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #101814;
    --ink: #e9eee6;
    --muted: #9eada2;
    --rule: #2a3a31;
    --accent: #f0cf63;
    --mark-bg: rgba(244, 211, 94, 0.16);
    --mark-ink: #f6dd82;
    --board: #1b3d30;
  }
}

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
}

h1,
h2,
h3,
p,
ul,
dl,
dd {
  margin: 0;
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

.wrap {
  max-width: 68rem;
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 0.9rem;
  background: var(--chalk);
  color: var(--chalk-ink);
  font-weight: 700;
}

.skip:focus {
  top: 0.75rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Chalkboard header ---------- */

.board {
  background: var(--board);
  color: var(--board-ink);
}

.board a {
  color: inherit;
}

.board :focus-visible {
  outline-color: var(--chalk);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav a {
  text-decoration: none;
}

.nav a:hover {
  text-decoration: underline;
}

.nav__home {
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--chalk);
}

.board .nav__home {
  color: var(--chalk);
}

.nav__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
  color: var(--board-muted);
}

.nav__links a:hover {
  color: var(--board-ink);
}

.hero {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: end;
  gap: 2.5rem clamp(2.5rem, 6vw, 5rem);
  padding-block: clamp(2rem, 6vw, 4.5rem) clamp(3rem, 7vw, 5rem);
}

.acrostic {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.125rem, 1rem + 5.4vw, 4.25rem);
  line-height: 1.1;
  letter-spacing: -0.012em;
}

/* Each word sits on its own ruled line, as on a penmanship board.
   The bottom padding keeps the rule clear of descenders. */
.acrostic__line {
  display: block;
  padding-block: 0.06em 0.2em;
  border-bottom: 1px solid var(--board-rule);
}

.acrostic__line b {
  font-weight: 800;
  color: var(--chalk);
}

.hero__body {
  display: grid;
  gap: 1.75rem;
  justify-items: start;
  min-width: 0;
  max-width: 30rem;
}

.hero__lede {
  font-size: clamp(1.125rem, 1rem + 0.55vw, 1.3125rem);
  line-height: 1.45;
  text-wrap: pretty;
}

.facts {
  display: grid;
  width: 100%;
}

.facts > div {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 0.25rem 1rem;
  align-items: baseline;
  padding-block: 0.6rem;
  border-top: 1px solid var(--board-rule);
}

.facts > div:last-child {
  border-bottom: 1px solid var(--board-rule);
}

.facts dt {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--board-muted);
}

.button {
  display: inline-block;
  padding: 0.8rem 1.25rem;
  background: var(--chalk);
  color: var(--chalk-ink);
  font-weight: 700;
  text-decoration: none;
  border-radius: 3px;
}

.board .button {
  color: var(--chalk-ink);
}

.button:hover {
  background: var(--board-ink);
}

/* The same button on the paper sections, where chalk yellow would not carry. */
.button--paper {
  background: var(--accent);
  color: var(--paper);
}

.button--paper:hover {
  background: var(--ink);
}

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

.section {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: 1.25rem 3rem;
  padding-block: clamp(2.5rem, 6vw, 4.25rem);
  border-top: 1px solid var(--rule);
}

.section:first-child {
  border-top: 0;
}

.section > h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.625rem;
  line-height: 1.2;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

.section__body {
  display: grid;
  gap: 1.15rem;
  min-width: 0;
  max-width: 42rem;
}

.lead {
  font-family: var(--font-display);
  font-size: clamp(1.1875rem, 1rem + 0.7vw, 1.4375rem);
  line-height: 1.45;
  text-wrap: pretty;
}

.section h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
}

.note {
  color: var(--muted);
  font-size: 0.9375rem;
}

mark {
  padding: 0.1em 0.25em;
  white-space: nowrap;
  background: var(--mark-bg);
  color: var(--mark-ink);
  border-radius: 2px;
}

/* Two-up lists that share the same ruled rows */
.format,
.topics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 2rem;
}

.format > li,
.topics > li {
  padding-block: 0.8rem;
  border-top: 1px solid var(--rule);
}

.format {
  margin-top: 0.5rem;
}

.format p {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.topics > li {
  font-size: 1rem;
  line-height: 1.45;
}

.subhead {
  margin-top: 1rem;
}

/* Dates */
.dates > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.25rem 2rem;
  align-items: baseline;
  padding-block: 0.8rem;
  border-top: 1px solid var(--rule);
}

.dates > div:last-child {
  border-bottom: 1px solid var(--rule);
}

.dates dt {
  font-weight: 700;
}

.dates dd {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

/* People */
.people {
  display: grid;
}

.people > li {
  display: grid;
  gap: 0.6rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--rule);
}

.people > li:first-child {
  padding-top: 0;
  border-top: 0;
}

.people > li:last-child {
  padding-bottom: 0;
}

.people h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3125rem;
  line-height: 1.2;
}

.people__role {
  margin-top: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.875rem;
}

.footer .wrap {
  padding-block: 1.75rem 2.5rem;
}

/* ---------- Narrow screens ---------- */

@media (max-width: 58rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero__body {
    max-width: 34rem;
  }
}

@media (max-width: 52rem) {
  .section {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 36rem) {
  .format,
  .topics {
    grid-template-columns: minmax(0, 1fr);
  }

  .facts > div {
    grid-template-columns: minmax(0, 1fr);
  }

  .dates > div {
    grid-template-columns: minmax(0, 1fr);
  }
}
