:root {
  --theme-focus: rgba(6, 182, 212, .24);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f8fafc;
  --panel: rgba(255, 255, 255, .82);
  --panel-strong: rgba(255, 255, 255, .96);
  --text: #0f172a;
  --muted: #475569;
  --line: rgba(15, 23, 42, .14);
  --accent: #6d28d9;
  --accent-2: #0891b2;
  --good: #15803d;
  --warn: #b45309;
  --danger: #be123c;
  --shadow: 0 30px 90px rgba(15, 23, 42, .16);
}

html[data-theme="light"] body {
  background:
    radial-gradient(circle at top left, rgba(124, 58, 237, .18), transparent 34rem),
    radial-gradient(circle at 82% 8%, rgba(6, 182, 212, .16), transparent 30rem),
    linear-gradient(145deg, #f8fafc 0%, #eef2ff 48%, #ecfeff 100%);
}

html[data-theme="light"] body::before {
  background-image:
    linear-gradient(rgba(15, 23, 42, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, .055) 1px, transparent 1px);
}

/* Keep the header visually locked in place across pages with different content widths. */
.nav {
  width: min(1120px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  margin-inline: auto;
  min-height: 44px;
}

.brand {
  flex: 0 0 auto;
  min-height: 44px;
}

.nav-links {
  align-items: center;
}

.nav-links .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 15px;
  border: 1px solid var(--line);
  text-align: center;
  line-height: 1.15;
  white-space: nowrap;
}

.nav-links .btn.primary {
  border-color: transparent;
}

.theme-toggle,
.language-toggle {
  gap: 8px;
}

.language-toggle {
  position: relative;
  padding-right: 34px;
  cursor: pointer;
}

.language-toggle span {
  white-space: nowrap;
}

.language-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 0;
  opacity: 0;
  cursor: pointer;
  font: inherit;
  outline: none;
  appearance: auto;
}

.language-toggle::after {
  content: "▾";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-52%);
  pointer-events: none;
  font-size: 12px;
  opacity: .8;
}

.language-select:focus-visible {
  outline: 3px solid var(--theme-focus);
  outline-offset: 3px;
  border-radius: 8px;
}

.theme-toggle .theme-icon {
  width: 1.1em;
  text-align: center;
}

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

html[data-theme="light"] .gradient {
  background: linear-gradient(110deg, #111827, #0891b2 42%, #6d28d9 78%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

html[data-theme="light"] .eyebrow,
html[data-theme="light"] .pill {
  color: #5b21b6;
  background: rgba(124, 58, 237, .10);
}

html[data-theme="light"] .btn,
html[data-theme="light"] .chip,
html[data-theme="light"] .mode,
html[data-theme="light"] .answer,
html[data-theme="light"] .card,
html[data-theme="light"] .app,
html[data-theme="light"] .stat {
  background: rgba(255, 255, 255, .62);
}

html[data-theme="light"] .btn.primary,
html[data-theme="light"] .mark {
  color: #fff;
}

html[data-theme="light"] .btn.primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-color: transparent;
  box-shadow: 0 10px 28px rgba(8, 145, 178, .18);
}

html[data-theme="light"] .stat,
html[data-theme="light"] .counter,
html[data-theme="light"] .footer-links a,
html[data-theme="light"] .footer-bottom,
html[data-theme="light"] .mini,
html[data-theme="light"] .chip,
html[data-theme="light"] .app-desc {
  color: #475569;
}

html[data-theme="light"] .stat strong,
html[data-theme="light"] .chip.active,
html[data-theme="light"] .card h2,
html[data-theme="light"] .card h3,
html[data-theme="light"] .distro h3,
html[data-theme="light"] .combo strong {
  color: #0f172a;
}

html[data-theme="light"] .question-type,
html[data-theme="light"] .category,
html[data-theme="light"] .meta,
html[data-theme="light"] .rank,
html[data-theme="light"] .combo small {
  color: #0e7490;
}

html[data-theme="light"] .tag,
html[data-theme="light"] .term-links a,
html[data-theme="light"] .links a {
  color: #1e3a8a;
  background: rgba(59, 130, 246, .10);
}

html[data-theme="light"] .notice,
html[data-theme="light"] .callout {
  color: #92400e;
  background: rgba(245, 158, 11, .12);
}

html[data-theme="light"] input,
html[data-theme="light"] select {
  background: rgba(255, 255, 255, .72);
}

html[data-theme="light"] .language-select {
  background: transparent;
}

html[data-theme="light"] .term {
  color: #0e7490;
}

html[data-theme="light"] .term:hover::before,
html[data-theme="light"] .term:focus::before {
  background: rgba(255, 255, 255, .98);
  color: #0f172a;
}
