/* Outfit (SIL OFL 1.1, see /assets/fonts/outfit-LICENSE.txt). Self-hosted so
   pages inside the shell iframe don't fall back to Courier when Google Fonts
   is blocked or not loaded. */
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/outfit-latin-wght.woff2") format("woff2");
}

/* Shared design tokens. Themes only change colour; type, radius and spacing
   stay the same everywhere. */
:root {
  --font-sans: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
    monospace;

  --text-xs: 12px;
  --text-sm: 14px;
  --text-md: 16px;
  --text-lg: 20px;
  --text-xl: 28px;
  --text-2xl: 40px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  --surface-1: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.07);
  --surface-3: rgba(255, 255, 255, 0.11);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text-muted: rgba(229, 231, 235, 0.64);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.4);
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

:root[theme="dark"], body[theme="dark"] {
  --text-color: #e5e5e5;
  --background: linear-gradient(135deg, #0f0f0f 0%, #161616 40%, #0a0a0a 100%);
  --bg-color: #0f0f0f;
  --navbar: #0a0a0a;
  --accent: #6b7280;
  --sidebar-bg: linear-gradient(
    180deg,
    rgba(20, 20, 22, 0.97),
    rgba(10, 10, 12, 0.98)
  );
  --sidebar-border: rgba(255, 255, 255, 0.055);
  --sidebar-top-bg: rgba(255, 255, 255, 0.025);
  --surface-hover: rgba(255, 255, 255, 0.055);
  --surface-active: linear-gradient(110deg, rgba(90, 95, 105, 0.98), rgba(170, 176, 186, 0.98));
  --nav-text: rgba(240, 242, 246, 0.8);
  --nav-active-text: #0f1117;
  --sidebar-handle-bg: rgba(18, 18, 22, 0.97);
  --sidebar-handle-color: #d1d5db;
  --active-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --sidebar-divider: rgba(255, 255, 255, 0.055);
  --sidebar-inner-line: rgba(255, 255, 255, 0.03);
  --logo-glow: rgba(255, 255, 255, 0.08);
}

:root[theme="charcoal-gold"], body[theme="charcoal-gold"] {
  --text-color: #e5e5e5;
  --background: linear-gradient(135deg, #0f0f0f 0%, #161616 40%, #0a0a0a 100%);
  --bg-color: #0f0f0f;
  --navbar: #0a0a0a;
  --accent: #c4955c;
  --sidebar-bg: linear-gradient(
    180deg,
    rgba(20, 20, 22, 0.97),
    rgba(10, 10, 12, 0.98)
  );
  --sidebar-border: rgba(196, 149, 92, 0.15);
  --sidebar-top-bg: rgba(196, 149, 92, 0.04);
  --surface-hover: rgba(196, 149, 92, 0.1);
  --surface-active: linear-gradient(110deg, rgba(150, 105, 55, 0.98), rgba(196, 149, 92, 0.98));
  --nav-text: rgba(240, 238, 230, 0.8);
  --nav-active-text: #1a0f00;
  --sidebar-handle-bg: rgba(18, 18, 22, 0.97);
  --sidebar-handle-color: #c4955c;
  --active-shadow: 0 8px 24px rgba(140, 100, 60, 0.2);
  --sidebar-divider: rgba(196, 149, 92, 0.08);
  --sidebar-inner-line: rgba(196, 149, 92, 0.04);
  --logo-glow: rgba(196, 149, 92, 0.08);
}

:root[theme="dark-blue"], body[theme="dark-blue"] {
  --text-color: #e5e7eb;
  --background:
    radial-gradient(circle at top left,  #020617 0, #020617 35%, #02061700 60%),
    radial-gradient(circle at top right, #020617 0, #020617 35%, #02061700 60%),
    linear-gradient(#020617, #000);
  --bg-color: #020617;
  --navbar: #020617;
  --accent: #60a5fa;
  --sidebar-bg: linear-gradient(
    180deg,
    rgba(6, 15, 32, 0.97),
    rgba(2, 8, 20, 0.99)
  );
  --sidebar-border: rgba(96, 165, 250, 0.13);
  --sidebar-top-bg: rgba(96, 165, 250, 0.04);
  --surface-hover: rgba(96, 165, 250, 0.1);
  --surface-active: linear-gradient(110deg, #6aacf5 0%, #bdd8ff 100%);
  --nav-text: rgba(230, 242, 255, 0.8);
  --nav-active-text: #0c2244;
  --sidebar-handle-bg: rgba(6, 15, 32, 0.97);
  --sidebar-handle-color: #7ab8ff;
  --active-shadow: 0 8px 24px rgba(96, 165, 250, 0.2);
  --sidebar-divider: rgba(96, 165, 250, 0.1);
  --sidebar-inner-line: rgba(96, 165, 250, 0.05);
  --logo-glow: rgba(96, 165, 250, 0.08);
}

:root[theme="halloween"], body[theme="halloween"] {
  --text-color: #f6ecdf;
  --background:
    radial-gradient(ellipse at 50% 120%, rgba(255, 106, 0, 0.12) 0, transparent 55%),
    linear-gradient(180deg, #120a1b 0%, #0c0712 60%, #070409 100%);
  --bg-color: #0d0715;
  --navbar: #0a0510;
  --accent: #ff7a18;
  --sidebar-bg: linear-gradient(
    180deg,
    rgba(24, 12, 34, 0.97),
    rgba(10, 5, 16, 0.99)
  );
  --sidebar-border: rgba(255, 122, 24, 0.16);
  --sidebar-top-bg: rgba(255, 122, 24, 0.05);
  --surface-hover: rgba(168, 85, 247, 0.12);
  --surface-active: linear-gradient(110deg, #e85d04 0%, #ffb347 100%);
  --nav-text: rgba(246, 236, 223, 0.82);
  --nav-active-text: #1f0a00;
  --sidebar-handle-bg: rgba(24, 12, 34, 0.97);
  --sidebar-handle-color: #ff9a3c;
  --active-shadow: 0 8px 24px rgba(255, 106, 0, 0.25);
  --sidebar-divider: rgba(255, 122, 24, 0.1);
  --sidebar-inner-line: rgba(168, 85, 247, 0.06);
  --logo-glow: rgba(255, 122, 24, 0.14);
}

/* drifting bats layer - decorative only */
body[theme="halloween"]::after {
  content: "";
  position: fixed;
  inset: -20px;
  pointer-events: none;
  z-index: -2;
  --bat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 32'%3E%3Cpath fill='%23a78bfa' d='M32 9c-1.5-3-3.5-4.5-3.5-4.5l.6 4.6c-2.6.2-4.6 1.3-5.6 3C20.6 7.3 13.2 5.4 6 7.6c3.8 1.9 5.9 4.9 6.2 8.7 2.9-1.8 6.6-1.7 8.8 1 1.2-2.6 3.9-3.6 6.6-2.3.9 2.4 2.3 4.4 4.4 6 2.1-1.6 3.5-3.6 4.4-6 2.7-1.3 5.4-.3 6.6 2.3 2.2-2.7 5.9-2.8 8.8-1 .3-3.8 2.4-6.8 6.2-8.7-7.2-2.2-14.6-.3-17.5 4.7-1-1.7-3-2.8-5.6-3l.6-4.6S33.5 6 32 9z'/%3E%3C/svg%3E");
  background-image: var(--bat), var(--bat), var(--bat), var(--bat), var(--bat);
  background-repeat: no-repeat;
  background-size: 54px auto, 34px auto, 26px auto, 42px auto, 22px auto;
  background-position: 78% 20%, 70% 9%, 91% 27%, 14% 64%, 24% 58%;
  opacity: 0.2;
  animation: aetheris-bats 16s ease-in-out infinite alternate;
}

@keyframes aetheris-bats {
  0% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(-14px, -10px, 0); }
  100% { transform: translate3d(10px, 6px, 0); }
}

body[theme="halloween"] .dark-search:focus {
  border-color: rgba(255, 122, 24, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 122, 24, 0.16);
}

body[theme="halloween"] ::selection {
  background: rgba(255, 122, 24, 0.35);
}

html.power-saving body[theme="halloween"]::after {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  body[theme="halloween"]::after {
    animation: none;
  }
}

body {
  transition: background-color 0.22s ease, color 0.22s ease;
}

.dark-home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: min(800px, 90%);
  margin: 0 auto;
  text-align: center;
}

.dark-title {
  font-family: var(--font-sans);
  font-size: 64px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
  margin-bottom: var(--space-3);
  color: var(--text-color);
}

@media (max-width: 520px) {
  .dark-title {
    font-size: 44px;
  }
}

.dark-subtitle {
  font-size: var(--text-md);
  color: var(--text-muted);
  margin-bottom: var(--space-5);
}

.dark-search-wrap {
  width: 100%;
  margin-bottom: 22px;
}

.dark-search {
  width: 100%;
  max-width: 720px;
  height: 56px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--surface-1);
  color: var(--text-color);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  padding: 0 var(--space-5);
  outline: none;
  margin: 0 auto;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}

.dark-search:focus {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: var(--surface-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.dark-search::placeholder {
  color: rgba(229, 231, 235, 0.5);
}
