[data-theme="dark"] {
  --bg: #06060a;
  --bg-elevated: #0e0e14;
  --bg-card: #12121a;
  --bg-card-hover: #18182a;
  --bg-glow: radial-gradient(ellipse 80% 60% at 50% -20%, rgba(245, 158, 11, 0.15), transparent 55%);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;
  --accent: #f59e0b;
  --accent-2: #ec4899;
  --accent-soft: rgba(245, 158, 11, 0.12);
  --green: #34d399;
  --green-soft: rgba(52, 211, 153, 0.12);
  --orange: #fb923c;
  --orange-soft: rgba(251, 146, 60, 0.1);
  --shadow-glow: 0 0 80px rgba(245, 158, 11, 0.06);
  --header-shadow: none;
}

[data-theme="light"] {
  --bg: #f6f5f2;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #fafaf9;
  --bg-glow: radial-gradient(ellipse 95% 60% at 50% -18%, rgba(245, 158, 11, 0.16), transparent 58%),
    radial-gradient(ellipse 55% 45% at 92% 8%, rgba(236, 72, 153, 0.07), transparent 52%);
  --border: #e8e7e4;
  --border-strong: #d6d3cd;
  --text: #1c1917;
  --text-muted: #57534e;
  --text-dim: #78716c;
  --accent: #d97706;
  --accent-2: #db2777;
  --accent-soft: rgba(217, 119, 6, 0.12);
  --green: #059669;
  --green-soft: rgba(5, 150, 105, 0.12);
  --orange: #ea580c;
  --orange-soft: rgba(234, 88, 12, 0.1);
  --shadow-glow: 0 24px 56px rgba(28, 25, 23, 0.07);
  --header-shadow: 0 1px 0 rgba(28, 25, 23, 0.06);
}

:root {
  --radius: 18px;
  --radius-sm: 10px;
  --transition: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.5s cubic-bezier(0.34, 1.15, 0.64, 1);
  --transition-smooth: 0.38s cubic-bezier(0.22, 1, 0.36, 1);
  --font-hero: "Syne", system-ui, sans-serif;
  --font-display: "Manrope", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  font-optical-sizing: auto;
}

body {
  font-family: var(--font-body);
  font-size: 1.125rem;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background var(--transition), color var(--transition);
}

main {
  flex: 1;
}

a {
  color: inherit;
}

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

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 22px;
}

/* Aurora mesh backdrop */
.body-mesh {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: var(--bg-glow);
  opacity: 1;
}

/* Aurora mesh + soft motion (reduced globally if prefers-reduced-motion) */
.body-mesh::before {
  content: "";
  position: absolute;
  inset: -5%;
  background: radial-gradient(ellipse 58% 48% at 78% -5%, rgba(245, 158, 11, 0.22), transparent 62%),
    radial-gradient(ellipse 45% 38% at 12% 35%, rgba(236, 72, 153, 0.14), transparent 58%);
  animation: meshPulse 22s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

[data-theme="light"] .body-mesh::before {
  background: radial-gradient(ellipse 58% 48% at 78% -5%, rgba(245, 158, 11, 0.2), transparent 62%),
    radial-gradient(ellipse 45% 38% at 8% 40%, rgba(236, 72, 153, 0.1), transparent 58%);
}

.body-mesh::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

body > header,
body > main,
body > footer {
  position: relative;
  z-index: 1;
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--header-shadow, 0 0 transparent);
  animation: headerEnter 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 68px;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.22rem;
  letter-spacing: -0.04em;
  flex-shrink: 0;
  transition: transform var(--transition-smooth), opacity var(--transition);
}

.header__logo:hover {
  transform: translateY(-2px);
}

.header__logo:active {
  transform: translateY(0);
}

.header__logo-img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: cover;
}

.header__search {
  flex: 1;
  max-width: 380px;
  position: relative;
}

.header__search i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 0.9rem;
  pointer-events: none;
}

.header__search input {
  width: 100%;
  padding: 13px 16px 13px 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.98rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition-smooth);
}

.header__search input::placeholder {
  color: var(--text-dim);
}

.header__search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  transform: translateY(-1px);
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.header__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all var(--transition);
}

.header__toggle:hover {
  border-color: var(--accent);
  color: var(--text);
}

.header__toggle i {
  font-size: 1.05rem;
}

.header__link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1.25rem;
  transition: color var(--transition);
  display: flex;
  align-items: center;
}

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

.header__link--back {
  gap: 6px;
  font-size: 0.92rem;
  font-weight: 500;
}

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

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.footer__credit a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.footer__credit a:hover {
  text-decoration: underline;
}

@keyframes fadeRise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes meshPulse {
  0% {
    opacity: 0.75;
    transform: scale(1) translate(0, 0);
  }
  100% {
    opacity: 1;
    transform: scale(1.04) translate(1.5%, 2%);
  }
}

@keyframes headerEnter {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .body-mesh::before {
    animation: none;
    transform: none;
  }

  .header {
    animation: none;
  }
}
