* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 75% -10%, var(--gradient1) 0%, transparent 60%),
    radial-gradient(900px 500px at 10% 0%, var(--gradient2) 0%, transparent 55%),
    var(--bg-dark);
}

header {
  position: sticky;
  top: 0;
  z-index: 1000;
  pointer-events: auto;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--header-border);
  padding: 14px clamp(10px, 2vw, 28px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  flex-shrink: 0;
}

.logo a:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.logo img {
  height: 36px;
  width: auto;
  filter: var(--logo-filter);
}

.logo-text {
  color: var(--header-text);
  font-size: clamp(12px, 1.1vw, 16px);
  font-weight: 700;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  white-space: nowrap;
}

nav ul li {
  position: relative;
}

nav ul li a,
.dropdown-toggle {
  color: var(--header-text);
  font-weight: 600;
  font-size: 13px;
  opacity: 0.95;
  padding: 8px 10px;
  border-radius: 10px;
  transition: 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
  text-decoration: none;
}

.dropdown-toggle {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}

nav ul li a:hover,
.dropdown-toggle:hover {
  color: #62b6f0;
  background: rgba(98, 182, 240, 0.1);
  transform: translateY(-1px);
}

nav ul li a:focus-visible,
.dropdown-toggle:focus-visible,
.nav-toggle:focus-visible {
  outline: 3px solid var(--theme-toggle-focus);
  outline-offset: 3px;
}

nav ul li a.active,
li.dropdown.open > .dropdown-toggle {
  color: #62b6f0;
  background: rgba(98, 182, 240, 0.12);
}

.dropdown-toggle::after {
  content: "▾";
  font-size: 11px;
  opacity: 0.9;
  margin-left: 2px;
}

li.dropdown::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 8px;
}

.dropdown-menu.left {
  left: 0;
  right: auto;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  min-width: 180px;
  background: var(--header-dropdown-bg);
  border: 1px solid var(--header-dropdown-border);
  border-radius: 12px;
  padding: 6px;
  display: none;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  z-index: 20;
}

.dropdown-menu a {
  display: block;
  padding: 10px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--header-dropdown-text);
  opacity: 0.95;
  text-decoration: none;
}

.dropdown-menu a:hover {
  background: rgba(98, 182, 240, 0.1);
  color: #62b6f0;
  transform: none;
}

li.dropdown.open .dropdown-menu {
  display: block;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 1px solid var(--header-dropdown-border);
  border-radius: 12px;
  background: var(--header-dropdown-bg);
  color: var(--header-text);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  margin: 4px auto;
  border-radius: 999px;
  background: currentColor;
  transition: transform 180ms ease, opacity 180ms ease;
}

header.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

header.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

header.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 2000;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  color: var(--header-dropdown-text);
  background: var(--header-dropdown-bg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 64px 0;
}

.section-title {
  font-size: 28px;
  margin: 0 0 14px;
  letter-spacing: 0.3px;
}

.section-subtitle {
  margin: 0 0 28px;
  color: #b6c0cc;
  max-width: 800px;
  line-height: 1.6;
}

@media (max-width: 1200px) {
  .logo-text {
    font-size: 12px;
  }

  nav ul li a,
  .dropdown-toggle {
    font-size: 12px;
    padding: 7px 8px;
  }
}

@media (hover: hover) and (min-width: 1101px) {
  li.dropdown:hover .dropdown-menu {
    display: block;
  }
}

@media (max-width: 1100px) {
  .nav-toggle {
    display: block;
    flex: 0 0 auto;
  }

  nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 10px;
    left: 10px;
    display: none;
    max-height: calc(100vh - 88px);
    margin: 0;
    padding: 10px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--header-dropdown-border);
    border-radius: 16px;
    background: var(--header-dropdown-bg);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
  }

  header.nav-open nav {
    display: block;
  }

  nav ul {
    display: grid;
    gap: 4px;
    white-space: normal;
  }

  nav ul li a,
  .dropdown-toggle {
    width: 100%;
    min-height: 44px;
    justify-content: space-between;
    padding: 10px 12px;
    font-size: 15px;
  }

  .dropdown-menu,
  .dropdown-menu.left {
    position: static;
    min-width: 0;
    margin: 2px 0 8px 12px;
    border-radius: 10px;
    box-shadow: none;
  }

  li.dropdown::after {
    display: none;
  }

  .theme-toggle-item {
    padding: 8px 12px;
  }
}

@media (max-width: 620px) {
  .logo-text {
    display: none;
  }
}
