/* Atlas of Lie Groups and Representations — site stylesheet */

:root {
  --paper: #f6f7f9;
  --surface: #ffffff;
  --ink: #16171c;
  --muted: #595d6b;
  --rule: #d9dbe2;
  --accent: #b1221a;      /* the red of the E8 plane figure */
  --link: #1f4b8f;
  --link-hover: #b1221a;
  --figure-ground: #ffffff;

  --serif: "Spectral", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Public Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: clamp(1.9rem, 1.4rem + 2.2vw, 2.9rem);

  --measure: 64ch;
  --wide: 72rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #111318;
    --surface: #1a1d24;
    --ink: #e8e9ee;
    --muted: #a3a7b5;
    --rule: #2e323d;
    --accent: #e8675c;
    --link: #9dbbf2;
    --link-hover: #f08a80;
    --figure-ground: #f4f5f7;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #111318;
  --surface: #1a1d24;
  --ink: #e8e9ee;
  --muted: #a3a7b5;
  --rule: #2e323d;
  --accent: #e8675c;
  --link: #9dbbf2;
  --link-hover: #f08a80;
  --figure-ground: #f4f5f7;
  color-scheme: dark;
}

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

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

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

img, svg { max-width: 100%; height: auto; }

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

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.2;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: var(--step-3); letter-spacing: -0.01em; }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
p { margin: 0; }

code, pre { font-family: var(--mono); font-size: 0.92em; }

.wrap {
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 40px);
}

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

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 1.1rem;
}
.wordmark {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.25;
}
.wordmark span { color: var(--muted); font-weight: 400; }
.wordmark:hover { color: var(--ink); }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  padding-block: 0.2rem;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--accent); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--accent); }

/* ---------- main ---------- */

main { padding-block: clamp(2rem, 5vw, 4rem); }

.eyebrow {
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero {
  display: grid;
  grid-template-columns: minmax(min-content, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.hero-text { display: grid; gap: 1.25rem; }
.hero-text > p, .hero-text .actions { max-width: var(--measure); }
.hero-text h1 { text-wrap: pretty; }
@media (min-width: 761px) {
  .hero-text h1 { white-space: nowrap; }
}
.hero-text .lede { font-size: var(--step-1); line-height: 1.55; }
.hero-text .follow { color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.5rem; }
.button {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--ink);
  border-radius: 3px;
  color: var(--ink);
  font-size: var(--step--1);
  font-weight: 600;
  text-decoration: none;
}
.button.primary { background: var(--ink); color: var(--paper); }
.button:hover { border-color: var(--accent); color: var(--accent); }
.button.primary:hover { background: var(--accent); color: #fff; }

.figure { margin: 0; display: grid; gap: 0.75rem; justify-items: center; }
.figure .disc {
  width: min(100%, 26rem);
  aspect-ratio: 1;
}
.figure .disc img { display: block; width: 100%; height: 100%; }
.figure figcaption { font-size: var(--step--1); color: var(--muted); text-align: center; }

.section { margin-top: clamp(3rem, 7vw, 5.5rem); display: grid; gap: 1.5rem; }
.section-head { display: grid; gap: 0.4rem; border-top: 1px solid var(--rule); padding-top: 1.25rem; }

.index-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 2.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.index-list li { padding-block: 0.9rem; border-bottom: 1px solid var(--rule); display: grid; gap: 0.15rem; }
.index-list a { font-family: var(--serif); font-size: var(--step-1); font-weight: 500; text-decoration: none; }
.index-list p { color: var(--muted); font-size: var(--step--1); }
.index-list .new { font-family: var(--sans); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent); margin-left: 0.5rem; vertical-align: 0.2em; }

.archive { display: grid; gap: 0.75rem; max-width: var(--measure); }
.archive .figures { font-variant-numeric: tabular-nums; }

.prose { display: grid; gap: 1.1rem; max-width: var(--measure); }
.prose h2 { margin-top: 1rem; }
.note {
  border-left: 3px solid var(--accent);
  padding: 0.25rem 0 0.25rem 1rem;
  color: var(--muted);
}

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

.site-footer { border-top: 1px solid var(--rule); color: var(--muted); font-size: var(--step--1); }
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-block: 1.75rem 2.5rem;
}
.site-footer ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; list-style: none; margin: 0; padding: 0; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

@media (max-width: 1000px) {
  .index-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .index-list { grid-template-columns: minmax(0, 1fr); }
  .figure { order: -1; }
  .figure .disc { width: min(70%, 18rem); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* numbered setup steps */
.steps { display: grid; gap: 1rem; padding-left: 1.4rem; margin: 0; }
.steps li { display: list-item; }
.steps li > * + * { margin-top: 0.6rem; }
.steps li::marker { font-weight: 600; color: var(--accent); }
.prose pre {
  margin: 0;
  padding: 0.8rem 1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
}
.prose ul { margin: 0; padding-left: 1.4rem; display: grid; gap: 0.4rem; }

/* displayed formula in running text */
.prose .display { text-align: center; font-family: var(--serif); font-size: var(--step-1); overflow-x: auto; }
