:root {
  --bg: #dfe3ea;
  --fg: #1a1a1a;
  --muted: #666;
  --rule: #c6ccd6;
  --link: #1a1a1a;
  --link-hover: #000;
  --max: 680px;

  --rainbow-1: #d96088;        --rainbow-1-hover: #c14770;
  --rainbow-2: #e07a3a;        --rainbow-2-hover: #c8611f;
  --rainbow-3: #c89820;        --rainbow-3-hover: #a87f10;
  --rainbow-4: #4ba668;        --rainbow-4-hover: #2e8a4c;
  --rainbow-5: #3f7fc8;        --rainbow-5-hover: #2864ad;
  --rainbow-6: #7e5ec9;        --rainbow-6-hover: #6443ae;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111;
    --fg: #e8e8e8;
    --muted: #9a9a9a;
    --rule: #2a2a2a;
    --link: #e8e8e8;
    --link-hover: #fff;

    --rainbow-1: #ef9bbf;      --rainbow-1-hover: #e57aa8;
    --rainbow-2: #f1b58a;      --rainbow-2-hover: #ec9866;
    --rainbow-3: #e8c97a;      --rainbow-3-hover: #d6b14a;
    --rainbow-4: #8fcf9f;      --rainbow-4-hover: #6cbe82;
    --rainbow-5: #8ab8e6;      --rainbow-5-hover: #6498d4;
    --rainbow-6: #b8a3e8;      --rainbow-6-hover: #9b80de;
  }
}

:root[data-theme="dark"] {
  --bg: #111;
  --fg: #e8e8e8;
  --muted: #9a9a9a;
  --rule: #2a2a2a;
  --link: #e8e8e8;
  --link-hover: #fff;

  --rainbow-1: #ef9bbf;        --rainbow-1-hover: #e57aa8;
  --rainbow-2: #f1b58a;        --rainbow-2-hover: #ec9866;
  --rainbow-3: #e8c97a;        --rainbow-3-hover: #d6b14a;
  --rainbow-4: #8fcf9f;        --rainbow-4-hover: #6cbe82;
  --rainbow-5: #8ab8e6;        --rainbow-5-hover: #6498d4;
  --rainbow-6: #b8a3e8;        --rainbow-6-hover: #9b80de;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 64px 24px 80px;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:hover { color: var(--link-hover); }

.socials li:nth-child(1) a,
.socials li:nth-child(1) .copy { color: var(--rainbow-1); }
.socials li:nth-child(1) a:hover,
.socials li:nth-child(1) .copy:hover { color: var(--rainbow-1-hover); }

.socials li:nth-child(2) a,
.socials li:nth-child(2) .copy { color: var(--rainbow-2); }
.socials li:nth-child(2) a:hover,
.socials li:nth-child(2) .copy:hover { color: var(--rainbow-2-hover); }

.socials li:nth-child(3) a,
.socials li:nth-child(3) .copy { color: var(--rainbow-3); }
.socials li:nth-child(3) a:hover,
.socials li:nth-child(3) .copy:hover { color: var(--rainbow-3-hover); }

.socials li:nth-child(4) a,
.socials li:nth-child(4) .copy { color: var(--rainbow-4); }
.socials li:nth-child(4) a:hover,
.socials li:nth-child(4) .copy:hover { color: var(--rainbow-4-hover); }

.socials li:nth-child(5) a,
.socials li:nth-child(5) .copy { color: var(--rainbow-5); }
.socials li:nth-child(5) a:hover,
.socials li:nth-child(5) .copy:hover { color: var(--rainbow-5-hover); }

.socials li:nth-child(6) a,
.socials li:nth-child(6) .copy { color: var(--rainbow-6); }
.socials li:nth-child(6) a:hover,
.socials li:nth-child(6) .copy:hover { color: var(--rainbow-6-hover); }

h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.role {
  margin: 0 0 16px;
  color: var(--muted);
}

.socials {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 0.95rem;
}

.copy {
  font: inherit;
  color: var(--link);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.copy:hover { color: var(--link-hover); }
.copy.copied::after {
  content: " (copied)";
  color: var(--muted);
  text-decoration: none;
}

section {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}

h2 {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 16px;
}

article { margin-bottom: 20px; }
article:last-child { margin-bottom: 0; }

.entry-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.entry-head h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}
.when {
  color: var(--muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.where {
  color: var(--muted);
  margin: 2px 0 8px;
  font-size: 0.95rem;
}
article ul {
  margin: 6px 0 0;
  padding-left: 20px;
}
article ul li { margin-bottom: 2px; }

.undercut {
  margin: 0 0 0 24px;
  padding-left: 1.75em;
  color: var(--muted);
  font-size: 0.95rem;
  list-style: lower-alpha;
}
.undercut li::marker {
  content: counter(list-item, lower-alpha) ") ";
}
.undercut li { margin-bottom: 2px; }

.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle:hover { border-color: var(--fg); }

@media print {
  .theme-toggle { display: none; }
  main { padding: 0; max-width: none; }
  section { border-color: #ccc; }
  .copy { text-decoration: none; }
  a { color: #000; }
}
