:root {
  color-scheme: dark;
  --bg: #0f1419;
  --surface: #1a2332;
  --text: #e7ecf3;
  --muted: #9aa8bc;
  --border: #2a3544;
  --accent: #6eb5ff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #141922;
  --muted: #5c6b7f;
  --border: #d8dee8;
  --accent: #0b57d0;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1419;
  --surface: #1a2332;
  --text: #e7ecf3;
  --muted: #9aa8bc;
  --border: #2a3544;
  --accent: #6eb5ff;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bg: #f4f6f9;
    --surface: #ffffff;
    --text: #141922;
    --muted: #5c6b7f;
    --border: #d8dee8;
    --accent: #0b57d0;
  }
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
}

.site-header,
.site-footer {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-footer {
  border-bottom: 0;
  border-top: 1px solid var(--border);
}

.site-header__inner,
.site-main,
.site-footer__inner {
  width: min(42rem, 100%);
  margin-inline: auto;
  padding: 1.5rem 1.25rem;
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.25rem;
}

.site-header__brand {
  flex: 1 1 12rem;
  min-width: 0;
}

.theme-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  min-width: 2.75rem;
  padding: 0.5rem 0.875rem;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-toggle:focus {
  outline: none;
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle__icon {
  font-size: 1.125rem;
  line-height: 1;
}

.site-header__title {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 650;
}

.site-header__tagline {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.site-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.site-main__loading,
.site-main__message {
  margin: 0;
  color: var(--muted);
}

.sections {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.section,
.changelog__entry {
  padding: 1rem 1.125rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--surface);
}

.section__title,
.changelog__title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 650;
}

.section__body {
  margin: 0;
  color: var(--muted);
}

.changelog__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.changelog__entry {
  border-left: 0.35rem solid var(--accent);
}

.changelog__entry-meta {
  margin: 0 0 0.25rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.changelog__entry-version {
  font-weight: 600;
  color: var(--text);
}

.changelog__entry-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
}

.changelog__entry-summary {
  margin: 0.4rem 0 0;
  color: var(--muted);
}

.faq__title {
  margin: 0 0 0.75rem;
  font-size: 1.125rem;
  font-weight: 650;
}

.faq__list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq__item {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--surface);
  overflow-wrap: anywhere;
}

.faq__question {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.75rem;
  padding: 0.75rem 1.125rem;
  font-weight: 650;
  font-size: 1rem;
  line-height: 1.35;
  cursor: pointer;
  list-style: none;
}

.faq__question::-webkit-details-marker {
  display: none;
}

.faq__question::before {
  flex: 0 0 auto;
  content: "▸";
  color: var(--accent);
  font-size: 0.875rem;
  transition: transform 0.15s ease;
}

.faq__item[open] > .faq__question::before {
  transform: rotate(90deg);
}

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

.faq__question:focus {
  outline: none;
}

.faq__question:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 0.5rem;
}

.faq__answer {
  padding: 0 1.125rem 1rem;
  border-top: 1px solid var(--border);
}

.faq__answer p {
  margin: 0.75rem 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.site-footer__meta {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
  overflow-wrap: anywhere;
}

.site-footer__sep {
  user-select: none;
}

.site-footer__version {
  font-weight: 600;
  color: var(--text);
}

.site-footer__link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  text-underline-offset: 0.15em;
}

.site-footer__link:hover {
  text-decoration-color: var(--accent);
}

.site-footer__link:focus {
  outline: none;
}

.site-footer__link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 0.15rem;
}

.site-footer__meta code {
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 0.8125rem;
  color: var(--text);
  overflow-wrap: anywhere;
}
