:root {
  --bg-deep: #0b0f14;
  --bg-elevated: #121820;
  --bg-card: rgba(18, 24, 32, 0.72);
  --text: #f4f6f8;
  --text-muted: #9aa8b8;
  --accent: #3aa9ff;
  --accent-soft: rgba(58, 169, 255, 0.15);
  --accent-glow: rgba(58, 169, 255, 0.35);
  --border: rgba(255, 255, 255, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --header-h: 64px;
  --font: "Manrope", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] {
  --bg-deep: #f5f7fa;
  --bg-elevated: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.92);
  --text: #0b0f14;
  --text-muted: #5a6570;
  --accent: #0d8ce8;
  --accent-soft: rgba(13, 140, 232, 0.12);
  --accent-glow: rgba(13, 140, 232, 0.2);
  --border: rgba(11, 15, 20, 0.08);
  --shadow: 0 20px 40px rgba(11, 15, 20, 0.08);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-deep);
  transition: background 0.35s ease, color 0.35s ease;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: var(--bg-deep);
  z-index: 10000;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg-deep) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background 0.35s ease, border-color 0.35s ease;
}

.header-inner {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.12em;
  color: var(--text);
  text-decoration: none;
}

.logo-link:hover {
  color: var(--accent);
  text-decoration: none;
}

.logo-link__img {
  background: #ffffff;
  padding: 3px;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: contain;
}

[data-theme="light"] .logo-link__img {
   padding: 3px;
  box-sizing: border-box;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 1.75rem;
}

.nav-desktop a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
}

.nav-desktop a:hover {
  color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.15rem;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 0 var(--accent-glow);
}

.btn-primary:hover {
  box-shadow: 0 0 24px var(--accent-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: border-color 0.2s, background 0.2s;
}

.theme-toggle:hover {
  border-color: var(--accent);
}

.burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  cursor: pointer;
}

.burger span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

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

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

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

.mobile-nav {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: color-mix(in srgb, var(--bg-deep) 96%, transparent);
  backdrop-filter: blur(16px);
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 999;
  border-top: 1px solid var(--border);
}

.mobile-nav.is-open {
  transform: translateX(0);
}

.mobile-nav a {
  padding: 0.85rem 0;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.mobile-nav .btn-primary {
  margin-top: 1rem;
  width: 100%;
}

@media (min-width: 900px) {
  .nav-desktop {
    display: flex;
  }

  .burger {
    display: none;
  }

  .mobile-nav {
    display: none;
  }
}

/* Layout */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

main > section {
  padding: 4rem 0;
}

main > section:nth-child(even) {
  background: linear-gradient(180deg, transparent 0%, var(--accent-soft) 50%, transparent 100%);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

h2 {
  margin: 0 0 1.25rem;
  font-size: clamp(1.65rem, 4vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.lead {
  color: var(--text-muted);
  max-width: 42rem;
  margin: 0 0 1.5rem;
  font-size: 1.05rem;
}

/* Hero */
.hero {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100dvh - var(--header-h));
  display: flex;
  align-items: center;
  padding: 3rem 0 4rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: -12% -8%;
  z-index: 0;
  pointer-events: none;
}

.hero-bg__layer {
  width: 100%;
  height: 100%;
}

.hero-depth {
  will-change: transform;
}

.hero-bg svg {
  width: 100%;
  height: 100%;
  transform-origin: center center;
}

@media (min-width: 768px) {
  .hero-bg svg {
    transform: scale(1.12);
    preserve-aspect-ratio: xMidYMid slice;
  }
}

.hero__parallax {
  position: relative;
  z-index: 1;
  width: 100%;
  will-change: transform;
}

.hero .container {
  position: relative;
}

/* Hero decorative animations */
@keyframes hero-orb-drift-a {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-18px, 14px) scale(1.04);
  }
}

@keyframes hero-orb-drift-b {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(22px, -20px) scale(1.06);
  }
}

@keyframes hero-line-pulse {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 0.85;
  }
}

@keyframes hero-dot-pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(1);
  }
  50% {
    opacity: 0.95;
    transform: scale(1.15);
  }
}

@keyframes hero-logo-glow {
  0%,
  100% {
    filter: drop-shadow(0 0 14px rgba(58, 169, 255, 0.2));
  }
  50% {
    filter: drop-shadow(0 0 28px rgba(58, 169, 255, 0.45));
  }
}

@keyframes hero-logo-glow-light {
  0%,
  100% {
    filter: drop-shadow(0 0 8px rgba(13, 140, 232, 0.15));
  }
  50% {
    filter: drop-shadow(0 0 18px rgba(13, 140, 232, 0.35));
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-orb-a,
  .hero-orb-b,
  .hero-line-anim,
  .hero-dot,
  .hero-mark__img {
    animation: none !important;
  }
}

.hero-orb-a {
  transform-origin: 920px 180px;
  animation: hero-orb-drift-a 16s ease-in-out infinite;
}

.hero-orb-b {
  transform-origin: 200px 620px;
  animation: hero-orb-drift-b 20s ease-in-out infinite;
}

.hero-line-anim {
  animation: hero-line-pulse 7s ease-in-out infinite;
}

.hero-line-anim--2 {
  animation-delay: -2s;
}

.hero-line-anim--3 {
  animation-delay: -4s;
}

.hero-dot {
  transform-origin: center;
  animation: hero-dot-pulse 5s ease-in-out infinite;
}

.hero-dot--2 {
  animation-delay: -1.2s;
}

.hero-dot--3 {
  animation-delay: -2.4s;
}

.hero-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 0.25rem;
}

@media (min-width: 600px) {
  .hero-head {
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
  }
}

.hero-mark {
  background: #fafafa;
  border-radius: 50%;
  /*padding: 10px;*/
  flex-shrink: 0;
  line-height: 0;
  box-shadow: 0 6px 40px rgba(255, 255, 255, 0.842);
}

.hero-mark__img {
  width: clamp(88px, 22vw, 132px);
  height: auto;
  border-radius: 50%;
  animation: hero-logo-glow 4s ease-in-out infinite;
}

[data-theme="light"] .hero-mark__img {
  animation: hero-logo-glow-light 4s ease-in-out infinite;
}

[data-theme="light"] .hero-mark {
  /*background: #1a1f26;*/
  border-radius: 50%;
  /*padding: 10px;*/
  box-shadow: 0 12px 40px rgba(11, 15, 20, 0.05);
}

.hero-title-wrap {
  min-width: 0;
}

.hero-title {
  font-size: clamp(2rem, 6.5vw, 3.35rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 0 0.35rem;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-tagline {
  font-size: clamp(1.1rem, 2.8vw, 1.35rem);
  color: var(--text-muted);
  max-width: 28rem;
  margin: 0 0 2rem;
  line-height: 1.55;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@media (max-width: 767px) {
  .hero {
    padding: 2rem 0 2.75rem;
  }

  .hero-bg {
    inset: 0;
  }

  .hero-bg svg {
    object-fit: contain;
    object-position: center center;
  }

  .hero-tagline {
    margin-bottom: 1.5rem;
  }
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 {
  transition-delay: 0.08s;
}

.reveal-delay-2 {
  transition-delay: 0.16s;
}

.reveal-delay-3 {
  transition-delay: 0.24s;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Cards grid */
.cards-grid {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

@media (min-width: 640px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
  box-shadow: var(--shadow);
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.card:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.card h3 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.card ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.card li {
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.85;
}

/* Modular / game block */
.modular-wrap {
  display: grid;
  gap: 2rem;
  margin-top: 2rem;
  align-items: start;
}

@media (min-width: 880px) {
  .modular-wrap {
    grid-template-columns: 1fr 1fr;
    align-items: center;
  }
}

.modular-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.modular-list li {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.modular-list li:last-child {
  border-bottom: none;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  width: 2rem;
  flex-shrink: 0;
}

.game-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.game-panel::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -20%;
  width: 60%;
  height: 80%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
  pointer-events: none;
}

.levels {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  z-index: 1;
}

.level-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.level-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent);
  flex-shrink: 0;
}

.level-row.done .level-badge {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.level-info strong {
  display: block;
  font-size: 0.95rem;
}

.level-info span {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.xp-bar {
  margin-top: 1.25rem;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
}

.xp-fill {
  height: 100%;
  width: 68%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #fff));
}

/* Achievements */
.badges-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 2rem;
}

@media (min-width: 560px) {
  .badges-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .badges-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.badge-card {
  text-align: center;
  padding: 1.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.25s ease;
}

.badge-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.badge-emoji {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.85rem;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.badge-card h4 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
}

.badge-card p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Contact */
.contact-block {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.contact-block h3 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
}

.contact-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact-list li {
  margin-bottom: 0.85rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.contact-list strong {
  display: block;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.contact-list a.contact-maps {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.9rem;
}

.contact-block--solo {
  max-width: 36rem;
  margin-top: 0.5rem;
}

/* Footer */
.site-footer {
  padding: 2rem 0 5rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.fab-enroll {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 900;
  box-shadow: var(--shadow);
}

.scroll-top {
  position: fixed;
  bottom: 1.25rem;
  left: 1.25rem;
  z-index: 900;
  width: 48px;
  height: 48px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s ease, border-color 0.2s ease, color 0.2s ease;
}

.scroll-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.scroll-top:hover {
  border-color: var(--accent);
  color: var(--accent);
}

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

.scroll-top__icon {
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .scroll-top {
    transition: opacity 0.15s ease, visibility 0.15s ease;
    transform: none;
  }

  .scroll-top.is-visible {
    transform: none;
  }
}

.header-enroll {
  display: none;
}

@media (min-width: 900px) {
  .header-enroll {
    display: inline-flex;
  }

  .fab-enroll {
    display: none;
  }

  .scroll-top {
    left: auto;
    right: 1.25rem;
    bottom: 1.25rem;
  }
}
