/* mathagents.org
   A definition and a figure, as at the start of a paper, then the schedule.
   Serif (Source Serif 4) carries the content; sans (Source Sans 3) carries
   dates, names and navigation. Yellow marks what to look at: the next
   workshop (and, in dark mode, the term being defined). */

/* ---------- Fonts (self-hosted, SIL Open Font License: fonts/OFL.txt) ---------- */

@font-face {
  font-family: "Source Serif 4 Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url(fonts/source-serif-4-latin-opsz-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4 Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url(fonts/source-serif-4-latin-ext-opsz-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4 Variable";
  font-style: italic;
  font-display: swap;
  font-weight: 200 900;
  src: url(fonts/source-serif-4-latin-opsz-italic.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4 Variable";
  font-style: italic;
  font-display: swap;
  font-weight: 200 900;
  src: url(fonts/source-serif-4-latin-ext-opsz-italic.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Sans 3 Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url(fonts/source-sans-3-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Sans 3 Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url(fonts/source-sans-3-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens ---------- */

:root {
  --hero: #dcebe2;        /* the band at the top */
  --hero-ink: #143f33;    /* text and figure on it */
  --hero-soft: #2f5045;   /* paragraphs and navigation on it */
  --yellow: #f4cf58;      /* highlighter */
  --yellow-ink: #2b2204;  /* text on yellow */
  --blue: #3f7fd6;        /* the second agent in the figure */
  --term-ink: inherit;    /* the defined term: plain italic in light mode... */

  --paper: #fbfcfa;
  --ink: #17211e;
  --heading: #143f33;
  --muted: #56645f;
  --rule: #d5ddd8;
  --link: #1d5a4b;
  --foot: #edf4ef;

  --serif: "Source Serif 4 Variable", "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Source Sans 3 Variable", "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --date-col: 11.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --hero: #1f3a33;
    --hero-ink: #f1f3ee;
    --hero-soft: #cfd8d2;
    --yellow: #f2d06b;
    --blue: #86b7f2;
    --term-ink: var(--yellow);  /* ...and written in yellow in dark mode */

    --paper: #111917;
    --ink: #e4e9e5;
    --heading: #e4e9e5;
    --muted: #9aa8a2;
    --rule: #27332f;
    --link: #9bd3c1;
    --foot: #16201d;
  }
}

/* ---------- Base ---------- */

*, *::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(--serif);
  font-size: 1.125rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.2em;
}
a:hover { text-decoration-thickness: 0.12em; }

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

abbr[title] { text-decoration: none; }
cite { font-style: italic; }
::selection { background: var(--yellow); color: var(--yellow-ink); }

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

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 1;
  padding: 0.5rem 0.75rem;
  background: var(--yellow);
  color: var(--yellow-ink);
  font-family: var(--sans);
  font-weight: 600;
}
.skip:focus { top: 1rem; }

/* ---------- The figure's parts (also used by the mark beside the name) ---------- */

.fig-talk { fill: none; stroke: var(--hero-ink); stroke-width: 1.1; opacity: 0.4; }
.fig-own { fill: none; stroke: var(--hero-ink); stroke-width: 1.6; stroke-linecap: round; }
.fig-person { fill: var(--hero-ink); }
.fig-a { fill: var(--yellow); stroke: var(--hero-ink); stroke-width: 1.4; }
.fig-b { fill: var(--blue); stroke: var(--hero-ink); stroke-width: 1.4; }

/* ---------- The top band ---------- */

.hero {
  background: var(--hero);
  color: var(--hero-ink);
  padding-block: 1.5rem clamp(3rem, 7vw, 4.5rem);
}
.hero a { color: inherit; }
.hero :focus-visible { outline-color: var(--hero-ink); }

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  font-family: var(--sans);
}
.wordmark {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.wordmark a { display: inline-flex; align-items: center; gap: 0.45rem; text-decoration: none; }
.mark { width: 1.75rem; height: 1.4rem; flex: none; }
.top ul {
  display: flex;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 1.0625rem;
}
.top ul a { color: var(--hero-soft); text-decoration: none; }
.top ul a:hover { color: var(--hero-ink); text-decoration: underline; }

.lede {
  display: grid;
  gap: 2rem 3rem;
  align-items: center;
  margin-top: clamp(2.25rem, 5vw, 3.75rem);
}
@media (min-width: 60rem) {
  .lede { grid-template-columns: minmax(0, 1fr) 20rem; }
}

.definition {
  max-width: 21em;
  margin: 0;
  font-size: clamp(1.75rem, 1.1rem + 2vw, 2.625rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
.definition strong { font-weight: 700; }
.definition em {
  color: var(--term-ink);
  white-space: nowrap;  /* keep the term on one line */
}

.fig { margin: 0; max-width: 18rem; }
.fig svg { display: block; width: 100%; height: auto; }
.fig figcaption {
  margin-top: 0.25rem;
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--hero-soft);
  text-align: center;
  text-wrap: balance;
}
.fig figcaption b { font-weight: 600; }
@media (min-width: 60rem) {
  .fig { max-width: none; }
}

.about {
  display: grid;
  gap: 1rem 3.5rem;
  max-width: 62rem;
  margin-top: clamp(2rem, 5vw, 3rem);
  color: var(--hero-soft);
}
.about p { margin: 0; max-width: 36rem; }
@media (min-width: 54rem) {
  .about { grid-template-columns: 1fr 1fr; }
}

/* ---------- The schedule ---------- */

main { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(3rem, 7vw, 5rem); }
main > section + section { margin-top: clamp(3rem, 7vw, 5rem); }

h2 {
  margin: 0 0 1rem;
  color: var(--heading);
  font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  scroll-margin-top: 1.5rem;
}

.events {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}
.event {
  display: grid;
  gap: 0.5rem 2rem;
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.when {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
}
.when span { display: block; font-weight: 400; color: var(--muted); }
.next .when::before {
  content: "Next";
  display: block;
  width: fit-content;
  margin-bottom: 0.4rem;
  padding: 0.05rem 0.5rem;
  border-radius: 2px;
  background: var(--yellow);
  color: var(--yellow-ink);
  font-size: 0.875rem;
  font-weight: 600;
}

.event h3 {
  margin: 0 0 0.25rem;
  color: var(--heading);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.what p { margin: 0; max-width: 34rem; line-height: 1.5; text-wrap: pretty; }

.who {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.45;
  color: var(--muted);
  text-wrap: pretty;
}

#past-list .when { font-weight: 400; }

.none { margin: 0; color: var(--muted); }

@media (min-width: 44rem) {
  .event { grid-template-columns: var(--date-col) minmax(0, 1fr); }
  .who { grid-column: 2; }
}
@media (min-width: 64rem) {
  .event { grid-template-columns: var(--date-col) minmax(0, 1fr) 17rem; }
  .who { grid-column: 3; padding-top: 0.3rem; }
}

.software p { margin: 0; max-width: 40rem; }

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

footer {
  background: var(--foot);
  padding-block: 1.75rem 2.25rem;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--muted);
}
footer p { margin: 0; }

@media print {
  .hero, footer { background: none; }
  .top ul, .skip { display: none; }
}
