:root {
  color-scheme: dark light;
  --bg: #050607;
  --bg-alt: #0b0d0f;
  --card: #11151b;
  --accent: #f0b376;
  --accent-soft: rgba(240,179,118,0.12);
  --accent-strong: #ff8a2a;
  --text: #f5f5f5;
  --muted: #b4b8c3;
  --border-subtle: rgba(255,255,255,0.06);
  --shadow-soft: 0 18px 50px rgba(0,0,0,0.55);
  --radius-lg: 18px;
  --radius-xl: 28px;
  --max: 1120px;
}

/* базова типографіка + фон */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(circle at top left, #111522 0, #050607 55%, #020203 100%);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  line-height: 1.6;
  letter-spacing: 0.01em;
}

a {
  color: inherit;
  text-decoration: none;
}

p {
  margin: 0 0 0.7rem;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
}

/* ================= LIGHT THEME – теплий крем + карамель ================= */

html[data-theme="light"] body {
  background:
    radial-gradient(circle at 0% 0%, #fff7ee 0, transparent 42%),
    radial-gradient(circle at 100% 14%, #fde4c8 0, transparent 42%),
    linear-gradient(180deg, #f7efe4 0%, #f2e7da 52%, #efe1d2 100%);
  color: #2b2119;
}

html[data-theme="light"] p {
  color: #5f5146;
}

/* ================= TOPBAR + MENU ================= */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
  background: linear-gradient(to bottom, rgba(5, 6, 7, 0.94), rgba(5, 6, 7, 0.7));
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 8px;
  gap: 16px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: inherit;
}

.brand-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.brand strong {
  letter-spacing: 0.18em;
  font-size: 0.98rem;
}

.brand span.sub {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  opacity: 0.9;
  white-space: nowrap;
}

.menu {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(5, 7, 10, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.menu-group {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(15, 18, 24, 0.9);
}

.menu a {
  padding: 4px 8px;
  border-radius: 999px;
  color: #8f93a0;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}

.menu a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.menu a.menu-primary {
  color: var(--text);
  font-weight: 500;
}

.menu a.menu-highlight {
  color: var(--accent);
  border: 1px solid rgba(240, 179, 118, 0.4);
}

.menu a.menu-highlight:hover {
  background: rgba(240, 179, 118, 0.12);
  color: #ffffff;
}

.menu-dropdown {
  position: relative;
}

.menu-dropbtn {
  border: none;
  background: transparent;
  color: #8f93a0;
  padding: 4px 8px;
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
}

.menu-dropbtn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.menu-dropcontent {
  position: absolute;
  right: 0;
  top: 110%;
  min-width: 160px;
  background: rgba(9, 11, 16, 0.98);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  padding: 6px;
  display: none;
  z-index: 50;
}

.menu-dropcontent a {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
}

.menu-dropcontent a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

/* ---- LIGHT для topbar + menu ---- */

html[data-theme="light"] .topbar {
  background: linear-gradient(
    to bottom,
    rgba(250, 246, 240, 0.96),
    rgba(245, 239, 231, 0.9)
  );
  border-bottom: 1px solid rgba(90, 70, 52, 0.14);
}

html[data-theme="light"] .brand span.sub {
  color: #7f6f62;
}

html[data-theme="light"] .menu {
  background: rgba(255, 250, 245, 0.9);
  border-color: rgba(90, 70, 52, 0.16);
  box-shadow: 0 10px 24px rgba(98, 76, 56, 0.1);
}

html[data-theme="light"] .menu-group {
  background: #fffdf9;
}

html[data-theme="light"] .menu a {
  color: #6d5f53;
}

html[data-theme="light"] .menu a.menu-primary {
  color: #2b2119;
}

html[data-theme="light"] .menu a.menu-highlight {
  color: #c26e2f;
  border-color: rgba(194, 110, 47, 0.38);
}

html[data-theme="light"] .menu a:hover {
  background: rgba(194, 110, 47, 0.09);
  color: #2b2119;
}

html[data-theme="light"] .menu a.menu-highlight:hover {
  background: rgba(194, 110, 47, 0.13);
  color: #2b2119;
}

html[data-theme="light"] .menu-dropbtn {
  color: #7a6b5f;
}

html[data-theme="light"] .menu-dropcontent {
  background: #fffaf4;
  border-color: rgba(90, 70, 52, 0.16);
  box-shadow: 0 16px 34px rgba(98, 76, 56, 0.14);
}

html[data-theme="light"] .menu-dropcontent a {
  color: #2b2119;
}

html[data-theme="light"] .menu-dropcontent a:hover {
  background: rgba(194, 110, 47, 0.09);
  color: #2b2119;
}

/* ================= перемикач теми + мови ================= */

.theme-toggle {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(5, 6, 7, 0.9);
  color: #fff;
  padding: 4px 8px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lang-switcher {
  position: fixed;
  right: 16px;
  top: 12px;
  z-index: 50;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.lang-btn {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(5, 6, 7, 0.9);
  color: #fff;
  padding: 6px 8px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}

.lang-btn.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(240, 179, 118, 0.35) inset;
}

/* ---- LIGHT для перемикачів ---- */

html[data-theme="light"] .theme-toggle {
  background: #fffaf4;
  color: #2b2119;
  border-color: rgba(90, 70, 52, 0.18);
  box-shadow: 0 8px 18px rgba(98, 76, 56, 0.1);
}

html[data-theme="light"] .lang-btn {
  background: #fffaf4;
  color: #2b2119;
  border-color: rgba(90, 70, 52, 0.18);
  box-shadow: 0 8px 20px rgba(98, 76, 56, 0.12);
}

html[data-theme="light"] .lang-btn.active {
  border-color: #c26e2f;
  box-shadow: 0 0 0 1px rgba(194, 110, 47, 0.26) inset;
}

/* ================= кнопки ================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 0.84rem;
  background: rgba(5, 7, 10, 0.96);
  color: var(--text);
  cursor: pointer;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    transform 0.1s ease,
    box-shadow 0.16s ease;
}

.btn-primary {
  background: radial-gradient(circle at 0 0, #ffe1b5 0, #f0b376 38%, #e29c5d 100%);
  color: #1a120b;
  box-shadow: 0 16px 40px rgba(240, 179, 118, 0.45);
  border-color: transparent;
}

.btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.35);
  color: inherit;
}

.btn:hover:not(.btn-primary) {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.6);
  background: rgba(255, 255, 255, 0.06);
}

.btn-primary:hover {
  box-shadow: 0 20px 48px rgba(240, 179, 118, 0.6);
}

/* ---- LIGHT кнопки ---- */

html[data-theme="light"] .btn {
  background: #fffaf4;
  border-color: rgba(90, 70, 52, 0.18);
  color: #2b2119;
  box-shadow: 0 10px 24px rgba(98, 76, 56, 0.1);
}

html[data-theme="light"] .btn-primary {
  background: linear-gradient(135deg, #f5c696 0%, #e8a55c 52%, #d58034 100%);
  color: #21150d;
  box-shadow: 0 18px 34px rgba(216, 134, 61, 0.24);
}

html[data-theme="light"] .btn-ghost {
  background: #fffdf9;
  border-color: rgba(90, 70, 52, 0.18);
  color: #2b2119;
}

html[data-theme="light"] .btn:hover:not(.btn-primary) {
  background: rgba(194, 110, 47, 0.06);
  box-shadow: 0 12px 28px rgba(98, 76, 56, 0.14);
}

html[data-theme="light"] .btn-primary:hover {
  box-shadow: 0 22px 42px rgba(216, 134, 61, 0.3);
}

/* ================= FOOTER ================= */

.footer {
  margin-top: 28px;
  padding: 16px 0 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: radial-gradient(
    circle at top,
    rgba(240, 179, 118, 0.05) 0,
    rgba(4, 5, 7, 0.96) 46%
  );
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  font-size: 0.84rem;
  color: var(--muted);
}

.footer h4 {
  margin: 0 0 8px;
  font-size: 0.92rem;
  color: var(--text);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-links a {
  font-size: 0.8rem;
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--text);
}

.footer-bottom {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---- LIGHT footer ---- */

html[data-theme="light"] .footer {
  background: linear-gradient(to top, #efe7dc, #faf5ee);
  border-top: 1px solid rgba(90, 70, 52, 0.14);
}

html[data-theme="light"] .footer,
html[data-theme="light"] .footer p,
html[data-theme="light"] .footer-links a,
html[data-theme="light"] .footer-bottom {
  color: #5f5146;
}

html[data-theme="light"] .footer h4 {
  color: #2b2119;
}

html[data-theme="light"] .footer-links a:hover {
  color: #2b2119;
}

html[data-theme="light"] .footer-bottom {
  border-top: 1px solid rgba(90, 70, 52, 0.12);
}

/* ================= базовий респонс ================= */

@media (max-width: 720px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 0 8px;
    gap: 8px;
  }

  .menu {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px;
    padding: 4px 8px;
  }

  .footer-grid {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-bottom {
    flex-direction: column;
  }
}