:root {
  --color-text: #1f2328;
  --color-text-muted: #59636e;
  --color-bg: #ffffff;
  --color-bg-subtle: #f6f8fa;
  --color-border: #d1d9e0;
  --color-link: #0969da;
  --font-sans:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial,
    sans-serif;
  --font-mono:
    ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --content-width: 1200px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-text: #e6edf3;
    --color-text-muted: #9198a1;
    --color-bg: #0d1117;
    --color-bg-subtle: #161b22;
    --color-border: #30363d;
    --color-link: #4493f8;
    color-scheme: dark;
  }
}

:root[data-theme="light"] {
  --color-text: #1f2328;
  --color-text-muted: #59636e;
  --color-bg: #ffffff;
  --color-bg-subtle: #f6f8fa;
  --color-border: #d1d9e0;
  --color-link: #0969da;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --color-text: #e6edf3;
  --color-text-muted: #9198a1;
  --color-bg: #0d1117;
  --color-bg-subtle: #161b22;
  --color-border: #30363d;
  --color-link: #4493f8;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

a {
  color: var(--color-link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 0.2em 0.4em;
  background: var(--color-bg-subtle);
  border-radius: 4px;
}

main {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

header {
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

header > a {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
}

header nav {
  color: var(--color-text-muted);
}

.theme-switcher {
  margin-left: auto;
  position: relative;
}

.theme-switcher > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-bg-subtle);
  color: var(--color-text);
}

.theme-switcher > summary::-webkit-details-marker {
  display: none;
}

.theme-switcher > summary::marker {
  content: "";
}

.theme-switcher > summary:hover {
  background: var(--color-bg);
}

.theme-switcher > summary svg {
  display: none;
}

:root[data-theme-pref="system"]
  .theme-switcher
  > summary
  svg[data-icon="system"],
:root[data-theme-pref="light"] .theme-switcher > summary svg[data-icon="light"],
:root[data-theme-pref="dark"] .theme-switcher > summary svg[data-icon="dark"] {
  display: inline-block;
}

:root:not([data-theme-pref]) .theme-switcher > summary svg[data-icon="system"] {
  display: inline-block;
}

.theme-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10;
  min-width: 40px;
}

.theme-menu li {
  margin: 0;
  padding: 0;
}

.theme-menu button {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.theme-menu button:hover {
  background: var(--color-bg-subtle);
  color: var(--color-text);
}

.theme-menu button[aria-pressed="true"] {
  background: var(--color-bg-subtle);
  color: var(--color-link);
}

footer {
  border-top: 1px solid var(--color-border);
  margin-top: 4rem;
  padding: 2rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.hero {
  padding: 2rem 0;
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.hero-intro {
  font-size: 1rem;
  color: var(--color-text-muted);
  max-width: 720px;
}

.hero-intro p {
  margin: 0;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  column-count: 4;
  column-gap: 2rem;
}

.link-list li {
  break-inside: avoid;
  padding: 0.25rem 0;
  font-size: 0.9375rem;
}

@media (max-width: 900px) {
  .link-list {
    column-count: 3;
  }
}

@media (max-width: 640px) {
  .link-list {
    column-count: 2;
  }
}

@media (max-width: 400px) {
  .link-list {
    column-count: 1;
  }
}

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