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

:root {
  --bg: #050510;
  --bg-soft: #090b1f;
  --card: rgba(16, 18, 42, 0.76);
  --card-border: rgba(138, 105, 255, 0.24);
  --primary: #6c45e8;
  --primary-light: #c3a6ff;
  --text: #f7f4ff;
  --muted: #d2cbe3;
  --shadow: rgba(108, 69, 232, 0.35);
  --page-gutter: clamp(20px, 5vw, 40px);
}

body.light-theme {
  --bg: #eef2ff;
  --bg-soft: #ffffff;
  --card: rgba(255, 255, 255, 0.94);
  --card-border: rgba(84, 73, 136, 0.16);
  --primary: #633ee0;
  --primary-light: #6844df;
  --text: #171528;
  --muted: #565169;
  --shadow: rgba(86, 54, 201, 0.18);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  font-family: Inter, Arial, Helvetica, sans-serif;
  background:
    linear-gradient(180deg, rgba(5, 5, 16, 0.98) 0%, rgba(8, 10, 27, 0.98) 46%, rgba(6, 12, 32, 0.98) 100%),
    radial-gradient(circle at 92% 8%, rgba(73, 47, 190, 0.28), transparent 28%),
    radial-gradient(circle at 10% 55%, rgba(0, 184, 255, 0.08), transparent 30%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

body.light-theme .header {
  background: rgba(255, 255, 255, 0.86);
  border-bottom-color: rgba(84, 73, 136, 0.14);
}

body.light-theme {
  background:
    linear-gradient(180deg, #eef2ff 0%, #f7f5ff 42%, #eef4ff 100%),
    radial-gradient(circle at 88% 8%, rgba(104, 68, 223, 0.1), transparent 28%),
    radial-gradient(circle at 8% 50%, rgba(0, 166, 255, 0.06), transparent 30%),
    var(--bg);
}

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

button,
input,
textarea {
  font: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.skip-link {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 20;
  background: var(--primary);
  color: #ffffff;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 800;
  transform: translateY(-140%);
  transition: transform 0.2s ease;
}

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

:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 4px;
}

.btn:focus-visible,
.menu-toggle:focus-visible,
.details-button:focus-visible {
  box-shadow: 0 0 0 5px rgba(195, 166, 255, 0.16);
}

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(5, 5, 16, 0.82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.navbar {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding-inline: var(--page-gutter);
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo img {
  width: 150px;
}

.nav-menu {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 28px;
  font-weight: 600;
  font-size: 0.95rem;
}

.nav-menu a {
  color: var(--muted);
  transition: 0.3s;
}

.nav-menu a:hover {
  color: var(--primary-light);
}

.nav-menu a {
  border-radius: 8px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-toggle {
  display: none;
  width: 46px;
  height: 46px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.menu-toggle span {
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
  transition: 0.2s ease;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.theme-toggle {
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  border-radius: 12px;
  padding: 14px 24px;
  font-weight: 800;
  border: 1px solid transparent;
  cursor: pointer;
  transition: 0.3s;
}

.btn.small {
  padding: 11px 18px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #8d69ff);
  color: white;
  box-shadow: 0 12px 28px var(--shadow);
}

.btn-secondary {
  border-color: var(--card-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.btn:hover {
  transform: translateY(-3px);
}

.full {
  width: 100%;
}

.footer {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 38px var(--page-gutter);
  border-top: 1px solid var(--card-border);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer img {
  width: 145px;
  margin-bottom: 10px;
}

@media (max-width: 980px) {
  .header {
    position: sticky;
  }

  .navbar {
    flex-wrap: wrap;
    gap: 12px;
    position: relative;
  }

  .menu-toggle {
    display: inline-flex;
    order: 3;
  }

  .nav-menu {
    order: 4;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    transition: max-height 0.25s ease, opacity 0.2s ease, padding 0.2s ease;
  }

  .nav-menu.open {
    max-height: 420px;
    visibility: visible;
    opacity: 1;
    padding-bottom: 18px;
  }

  .nav-menu a {
    display: block;
    padding: 12px 0;
  }

  .nav-actions {
    margin-left: auto;
    order: 2;
  }
}

@media (max-width: 640px) {
  :root {
    --page-gutter: 18px;
  }

  .navbar {
    min-height: 72px;
    gap: 10px;
  }

  .logo img {
    width: 112px;
  }

  .nav-actions a.small {
    display: none;
  }

  .btn {
    padding: 13px 18px;
    border-radius: 10px;
  }

  .btn.small,
  .menu-toggle {
    width: 44px;
    height: 44px;
    padding: 0;
  }

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

@media (max-width: 380px) {
  .logo img {
    width: 96px;
  }
}

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

  .btn:hover {
    transform: none;
  }
}
