:root {
  --bg: #ffffff;
  --surface: #f8fafc;
  --surface-raised: #ffffff;
  --text: #0f172a;
  --text-soft: #475569;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --header-bg: rgba(255, 255, 255, 0.9);
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

:root[data-theme="dark"] {
  --bg: #020617;
  --surface: #0f172a;
  --surface-raised: #111c31;
  --text: #e2e8f0;
  --text-soft: #cbd5e1;
  --text-muted: #94a3b8;
  --border: #1e293b;
  --border-strong: #334155;
  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --header-bg: rgba(2, 6, 23, 0.88);
  --shadow: 0 22px 45px rgba(2, 6, 23, 0.5);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Avenir Next", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 160ms ease, color 160ms ease;
}

a {
  color: inherit;
}

.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;
}

.site-header {
  background: var(--header-bg);
}

.site-brand {
  color: var(--text) !important;
  text-decoration: none;
}

.navbar-link {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.9rem;
  border-radius: 0.5rem;
  color: var(--text-soft) !important;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem;
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  color: var(--accent);
}

.theme-toggle:focus-visible,
.navbar-account-trigger:focus-visible,
.navbar-account-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle__icon {
  display: none;
}

:root[data-theme="light"] [data-theme-icon="sun"],
:root[data-theme="dark"] [data-theme-icon="moon"] {
  display: block;
}

.navbar-account-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 12.5rem;
  height: 2.75rem;
  padding: 0 1rem;
  border: 1px solid var(--border-strong);
  border-radius: 0.65rem;
  background: var(--surface-raised);
  color: var(--text-soft);
  font: inherit;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.navbar-account-trigger.is-open {
  background: var(--surface);
}

.navbar-account-panel {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 20;
  margin-top: 0.7rem;
  width: 13rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: var(--surface-raised);
  box-shadow: var(--shadow);
  padding: 0.45rem 0;
}

.navbar-account-link {
  display: block;
  padding: 0.8rem 1rem;
  color: var(--text-soft) !important;
  text-decoration: none;
}

.navbar-account-button {
  border: 0;
  background: transparent;
}

.navbar-account-form {
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border);
}

:root[data-theme="dark"] .bg-white {
  background-color: var(--surface-raised) !important;
}

:root[data-theme="dark"] .bg-slate-50,
:root[data-theme="dark"] .bg-blue-50,
:root[data-theme="dark"] .bg-emerald-50,
:root[data-theme="dark"] .bg-rose-50,
:root[data-theme="dark"] .bg-amber-50 {
  background-color: rgba(15, 23, 42, 0.88) !important;
}

:root[data-theme="dark"] .bg-slate-100 {
  background-color: rgba(30, 41, 59, 0.9) !important;
}

:root[data-theme="dark"] .border-slate-50,
:root[data-theme="dark"] .border-slate-100,
:root[data-theme="dark"] .border-slate-200,
:root[data-theme="dark"] .border-slate-300,
:root[data-theme="dark"] .border-slate-400 {
  border-color: var(--border) !important;
}

:root[data-theme="dark"] .text-slate-900,
:root[data-theme="dark"] .text-slate-800,
:root[data-theme="dark"] .text-slate-700 {
  color: var(--text) !important;
}

:root[data-theme="dark"] .text-slate-600,
:root[data-theme="dark"] .text-slate-500,
:root[data-theme="dark"] .text-slate-400,
:root[data-theme="dark"] .text-slate-300 {
  color: var(--text-muted) !important;
}

:root[data-theme="dark"] .hover\:bg-slate-50:hover,
:root[data-theme="dark"] .hover\:bg-slate-100:hover {
  background-color: rgba(30, 41, 59, 0.92) !important;
}

:root[data-theme="dark"] .text-blue-700,
:root[data-theme="dark"] .text-blue-800,
:root[data-theme="dark"] .text-blue-900,
:root[data-theme="dark"] .hover\:text-blue-700:hover,
:root[data-theme="dark"] .hover\:text-blue-800:hover {
  color: var(--accent) !important;
}

:root[data-theme="dark"] .bg-blue-600,
:root[data-theme="dark"] .bg-blue-700,
:root[data-theme="dark"] .hover\:bg-blue-500:hover,
:root[data-theme="dark"] .hover\:bg-blue-600:hover,
:root[data-theme="dark"] .hover\:bg-blue-700:hover {
  background-color: #2563eb !important;
}

:root[data-theme="dark"] .border-blue-200,
:root[data-theme="dark"] .border-blue-300,
:root[data-theme="dark"] .border-blue-400,
:root[data-theme="dark"] .border-blue-500,
:root[data-theme="dark"] .border-blue-600 {
  border-color: #3b82f6 !important;
}

:root[data-theme="dark"] .text-emerald-800,
:root[data-theme="dark"] .text-emerald-900,
:root[data-theme="dark"] .text-emerald-600,
:root[data-theme="dark"] .text-emerald-500 {
  color: #6ee7b7 !important;
}

:root[data-theme="dark"] .bg-emerald-100,
:root[data-theme="dark"] .bg-emerald-900,
:root[data-theme="dark"] .border-emerald-200,
:root[data-theme="dark"] .border-emerald-600 {
  background-color: rgba(6, 78, 59, 0.35) !important;
  border-color: rgba(16, 185, 129, 0.55) !important;
}

:root[data-theme="dark"] .text-rose-700,
:root[data-theme="dark"] .text-rose-800,
:root[data-theme="dark"] .text-rose-600,
:root[data-theme="dark"] .text-rose-500 {
  color: #fda4af !important;
}

:root[data-theme="dark"] .bg-rose-900,
:root[data-theme="dark"] .border-rose-200,
:root[data-theme="dark"] .border-rose-300,
:root[data-theme="dark"] .border-rose-400,
:root[data-theme="dark"] .border-rose-500,
:root[data-theme="dark"] .border-rose-600 {
  background-color: rgba(127, 29, 29, 0.3) !important;
  border-color: rgba(251, 113, 133, 0.5) !important;
}

:root[data-theme="dark"] .text-amber-900,
:root[data-theme="dark"] .text-amber-600,
:root[data-theme="dark"] .text-amber-500 {
  color: #fcd34d !important;
}

:root[data-theme="dark"] .border-amber-200,
:root[data-theme="dark"] .border-amber-300 {
  border-color: rgba(251, 191, 36, 0.45) !important;
}
