:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #eef4ff;
  --text: #122033;
  --text-soft: #5c6b80;
  --text-muted: #8190a3;
  --line: rgba(33, 52, 80, .12);
  --accent: #7c3cff;
  --accent-strong: #087f76;
  --accent-soft: rgba(124, 60, 255, .12);
  --shadow: 0 18px 48px rgba(20, 42, 73, .13);
  --radius: 8px;
  --container: 1180px;
}

[data-theme="dark"] {
  --bg: #08111f;
  --surface: #111d2d;
  --surface-soft: #0d1828;
  --text: #e9f1fb;
  --text-soft: #a8b6c7;
  --text-muted: #728097;
  --line: rgba(232, 241, 251, .12);
  --accent-soft: rgba(124, 60, 255, .18);
  --shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input { font: inherit; }
.container { width: min(var(--container), calc(100% - 32px)); margin: 0 auto; }

.glass-nav {
  position: sticky;
  top: 0;
  z-index: 25;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(20, 42, 73, .05);
}
[data-theme="dark"] .glass-nav { background: rgba(17, 29, 45, .94); }
.nav-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 26px;
}
.brand {
  display: inline-flex;
  align-items: center;
  min-height: 64px;
  flex: 0 0 auto;
}
.brand-logo { display: block; width: 142px; height: auto; object-fit: contain; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 0 auto;
  padding: 0;
  list-style: none;
}
.nav-links > li > a,
.nav-links > li > button,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 13px;
  border: 0;
  border-radius: var(--radius);
  color: var(--text-soft);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
}
.nav-links > li > a:hover,
.nav-links > li > button:hover,
.theme-toggle:hover,
.nav-fixed-button {
  color: var(--text) !important;
  background: var(--accent-soft) !important;
}
.has-menu { position: relative; isolation: isolate; }
.dropdown {
  position: absolute;
  top: calc(100% - 1px);
  left: 0;
  z-index: 999;
  display: grid;
  min-width: 230px;
  padding: 10px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  list-style: none;
  background: var(--surface);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: .18s ease;
}
.has-menu:hover .dropdown,
.has-menu:focus-within .dropdown,
.has-menu.open .dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.dropdown a { display: block; padding: 10px 12px; border-radius: 6px; color: var(--text-soft); }
.dropdown a:hover { color: var(--text); background: var(--accent-soft); }
.menu-toggle, .mobile-theme { display: none; }
.icon-theme { width: 42px; padding: 0; justify-content: center; color: var(--accent) !important; background: var(--accent-soft) !important; }

.social-dock {
  position: fixed;
  right: 18px;
  top: 45%;
  z-index: 20;
  display: grid;
  gap: 9px;
}
.social-dock a, .social-toggle, .back-to-top {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent-strong);
  background: var(--surface);
  box-shadow: 0 12px 26px rgba(20, 42, 73, .12);
  cursor: pointer;
}
.social-toggle { display: none; }
.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; }

.site-footer {
  padding: 58px 0 26px;
  color: #d9e6f5;
  background: #160b2a;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 28px;
}
.footer-brand { margin-bottom: 10px; font-size: 1.35rem; font-weight: 900; }
.footer-brand span { color: #65d8cc; }
.site-footer p, .footer-bottom { color: #a69ab9; }
.site-footer h4 { margin: 0 0 12px; }
.site-footer a { display: block; margin: 8px 0; color: #d2c6e5; }
.site-footer a:hover { color: #65d8cc; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 24px;
  margin-top: 34px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: .88rem;
}
.muted { font-size: .9rem; }

@media (max-width: 900px) {
  .menu-toggle {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-left: auto;
    border: 0;
    border-radius: var(--radius);
    color: var(--text);
    background: var(--accent-soft);
  }
  .icon-theme { display: none; }
  .mobile-theme { display: block; }
  .nav-links {
    position: fixed;
    top: 76px;
    left: 0;
    right: 0;
    display: none;
    padding: 12px 16px 18px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
  }
  .nav-links.open { display: grid; }
  .dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    box-shadow: none;
    border: 0;
    background: var(--surface-soft);
    margin: 6px 0 0;
  }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
  .social-dock { display: none !important; }
}

@media (max-width: 640px) {
  .container { width: min(100% - 24px, var(--container)); }
  .brand-logo { width: 110px; }
}
