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

:root {
  --bg: #fcfcfb;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --line: #c8c8c8;
  --divider: #ebebea;
  --accent: #5d6cf9;       /* logo color */
  --link: #5161f9;         /* slightly deeper for 4.5:1 text contrast */
}

/* Dark theme. Applied by the toggle (data-theme="dark"), or by the system
   setting when JavaScript is off. */
:root[data-theme="dark"] {
  --bg: #121212;
  --text: #ededed;
  --muted: #9a9a9a;
  --line: #3a3a3a;
  --divider: #262626;
  --link: #7d89fa;         /* lighter purple for contrast on dark */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #121212;
    --text: #ededed;
    --muted: #9a9a9a;
    --line: #3a3a3a;
    --divider: #262626;
    --link: #7d89fa;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main {
  /* 65 characters per line for the text, plus the 24px side padding */
  max-width: calc(65ch + 48px);
  margin: 0 auto;
  padding: 56px 24px 96px;
}

h1, h2, p, ul { margin: 0; font-size: inherit; font-weight: 400; }

.muted { color: var(--muted); }

/* Medium weight for the name, section headings and row titles */
h1, h2, .ext-link { font-weight: 500; }

header { margin-bottom: 56px; }
header h1, header p { line-height: 1.4; }

section + section { margin-top: 56px; }
section h2 { margin-bottom: 12px; }

ul { list-style: none; padding: 0; }
li + li { margin-top: 16px; }
li p { line-height: 1.4; }

a { color: inherit; text-decoration: none; }
li > a:hover { text-decoration: underline; text-underline-offset: 3px; }

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-right: -6px; /* line the icon up with the text column edge */
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}
.theme-toggle:hover { color: var(--text); background: var(--divider); }
.theme-toggle:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Without JavaScript the toggle can't work, so hide it (the theme still follows the system). */
:root:not([data-theme]) .theme-toggle { display: none; }
/* Show the moon in light mode (switch to dark), the sun in dark mode. */
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }

.logo {
  display: block;
  height: 24px;
  width: auto;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

/* Two-column rows separated by dividers */
.rows li + li {
  margin-top: 0;
  border-top: 1px solid var(--divider);
}
.rows li { padding: 12px 0; }
.rows li:first-child { padding-top: 0; }
.rows li:last-child { padding-bottom: 0; }

.ext-link {
  color: var(--link);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ext-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.ext {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
