:root {
  color-scheme: light;
  --paper: #e7decf;
  --paper-ink: #1b1b1b;
  --paper-soft: rgba(0, 0, 0, 0.08);
  --accent: #1b1b1b;
  --paper-grain: rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] {
  color-scheme: dark;
  --paper: #101010;
  --paper-ink: #f2f2f2;
  --paper-soft: rgba(255, 255, 255, 0.18);
  --accent: #f2f2f2;
  --paper-grain: rgba(255, 255, 255, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "EB Garamond", "Garamond", "Times New Roman", serif;
  color: var(--paper-ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.4), transparent 40%),
    radial-gradient(circle at 80% 10%, rgba(255, 255, 255, 0.22), transparent 35%),
    radial-gradient(circle at 30% 80%, rgba(0, 0, 0, 0.12), transparent 45%),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.03) 1px, transparent 1px, transparent 3px),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.02) 1px, transparent 1px, transparent 2px);
}

.page {
  width: min(86vw, 560px);
  text-align: center;
  padding: 64px 24px 72px;
}

.hero {
  margin-bottom: 36px;
}

.title {
  font-family: "Uncial Antiqua", "Cinzel", "Times New Roman", serif;
  letter-spacing: 0.08em;
  font-size: clamp(48px, 9vw, 86px);
  margin: 0 0 8px;
}

.subtitle {
  margin: 0;
  font-size: clamp(18px, 3vw, 24px);
  letter-spacing: 0.04em;
}

.toc {
  display: flex;
  justify-content: center;
  margin: 40px 0 48px;
}

.toc-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  width: min(360px, 82vw);
  text-decoration: none;
  color: inherit;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 16px;
}

.toc-row:focus-visible {
  outline: 2px dashed var(--paper-ink);
  outline-offset: 4px;
}

.toc-leader {
  position: relative;
  height: 8px;
  transform: translateY(2px);
  background-image: radial-gradient(var(--paper-ink) 1px, transparent 1.2px);
  background-size: 8px 8px;
  background-repeat: repeat-x;
  background-position: left center;
  opacity: 0.85;
}

.footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  margin-bottom: 48px;
}

.refresh,
.mode-toggle {
  background: none;
  border: none;
  font-family: inherit;
  color: var(--paper-ink);
  letter-spacing: 0.12em;
  text-transform: lowercase;
  cursor: pointer;
}

.refresh {
  font-size: 16px;
  padding: 6px 12px;
}

.refresh:hover {
  color: var(--accent);
}

.mode-toggle {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
}

.mode-icon {
  width: 28px;
  height: 28px;
}
