:root {
  --blue: #004d2c;
  --blue-bright: #0b7a43;
  --blue-deep: #003822;
  --white: #ffffff;
  --black: #0a0a0a;
  --bg: #f6f8fc;
  --surface: rgba(255, 255, 255, 0.78);
  --text: #0a0a0a;
  --muted: #3f4654;
  --line: rgba(10, 10, 10, 0.1);
  --shadow: 0 10px 40px rgba(10, 10, 10, 0.08);
  --header-h: 76px;
}

html[data-theme="dark"] {
  --bg: #05070c;
  --surface: rgba(10, 10, 10, 0.72);
  --text: #ffffff;
  --muted: #c5cad3;
  --line: rgba(255, 255, 255, 0.12);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: Manrope, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.45s ease, color 0.45s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 420px at 12% -10%, color-mix(in srgb, var(--blue) 22%, transparent), transparent 60%),
    radial-gradient(700px 360px at 92% 0%, color-mix(in srgb, var(--black) 10%, transparent), transparent 55%);
  z-index: 0;
}

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  animation: headerDrop 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes headerDrop {
  from {
    opacity: 0;
    transform: translateY(-24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header__glow {
  position: absolute;
  inset: auto 18% -40px;
  height: 70px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--blue) 45%, transparent), transparent);
  filter: blur(18px);
  opacity: 0.55;
  animation: glowPulse 3.6s ease-in-out infinite;
}

@keyframes glowPulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scaleX(0.92);
  }
  50% {
    opacity: 0.7;
    transform: scaleX(1);
  }
}

.header__inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1180px;
  margin: 14px auto 0;
  padding: 12px 16px 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.logo__img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--line);
}

.logo__mark {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
}

.logo__diamond {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--blue-bright), var(--blue-deep));
  transform: rotate(12deg);
  animation: markSpin 8s linear infinite;
}

@keyframes markSpin {
  from {
    transform: rotate(12deg);
  }
  50% {
    transform: rotate(24deg);
  }
  to {
    transform: rotate(12deg);
  }
}

.logo__letter {
  position: relative;
  z-index: 1;
  color: var(--white);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.04em;
}

.logo__text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.logo__name {
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
}

.logo__prep {
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  color: var(--blue);
}

.nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav__link {
  position: relative;
  z-index: 1;
  padding: 10px 14px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
  white-space: nowrap;
  transition: color 0.25s ease, transform 0.25s ease;
}

.nav__link:hover {
  color: var(--text);
  transform: translateY(-1px);
}

.nav__link.is-active {
  color: var(--white);
}

.nav__indicator {
  position: absolute;
  top: 4px;
  height: calc(100% - 8px);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--blue-bright), var(--blue));
  box-shadow: 0 8px 20px color-mix(in srgb, var(--blue) 45%, transparent);
  transition: left 0.38s cubic-bezier(0.22, 1, 0.36, 1), width 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
}

.theme-toggle {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.theme-toggle__track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 68px;
  height: 36px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--black) 6%, var(--white));
  overflow: hidden;
}

html[data-theme="dark"] .theme-toggle__track {
  background: color-mix(in srgb, var(--white) 8%, var(--black));
}

/* ===== THEME ALMASHGANDA BO‘LIMLAR YO‘QOLMASLIGI UCHUN ===== */

html {
  color-scheme: light;
  background: var(--bg);
}

html[data-theme="dark"] {
  color-scheme: dark;
  background: var(--bg);
}

body,
.page,
main,
section {
  background-color: transparent;
}

/* Mocklar va kurslar bo‘limlari */
#mocklar,
#kurslar,
#daraja {
  position: relative;
  z-index: 1;
  display: block;
  visibility: visible;
  opacity: 1;
}

/* Kartalarning umumiy ko‘rinishi */
.card,
.mock,
.course-hero,
.split,
.cta-banner {
  position: relative;
  z-index: 1;
}

/* Kunduzgi rejim */
html:not([data-theme="dark"]) .card {
  background: #ffffff;
  color: #0a0a0a;
  border-color: rgba(10, 10, 10, 0.1);
}

html:not([data-theme="dark"]) .card h3,
html:not([data-theme="dark"]) .card p {
  color: inherit;
}

/* Tungi rejim */
html[data-theme="dark"] .card {
  background: #101720 !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .card h1,
html[data-theme="dark"] .card h2,
html[data-theme="dark"] .card h3 {
  color: #ffffff !important;
}

html[data-theme="dark"] .card p {
  color: #c5cad3 !important;
}

/* Kurslar va mock kartalaridagi ichki bloklar */
html[data-theme="dark"] .mock__meta,
html[data-theme="dark"] .tag,
html[data-theme="dark"] .card__icon {
  color: #ffffff;
}

html[data-theme="dark"] .tag {
  background: rgba(11, 122, 67, 0.28);
  border: 1px solid rgba(170, 239, 190, 0.2);
}

/* Kurslar rasmi va mock rasmlari aniq ko‘rinsin */
html[data-theme="dark"] .mock__photo,
html[data-theme="dark"] .course-hero,
html[data-theme="dark"] .split__photo {
  background: #101720;
  border-color: rgba(255, 255, 255, 0.12);
}

/* Bo‘lim sarlavhalari */
html[data-theme="dark"] .section__head h2 {
  color: #ffffff !important;
}

html[data-theme="dark"] .section__head p:not(.section__kicker),
html[data-theme="dark"] .lock-note {
  color: #c5cad3 !important;
}

.theme-toggle__icon {
  position: relative;
  z-index: 1;
  font-size: 0.85rem;
  line-height: 1;
  transition: transform 0.45s ease, opacity 0.3s ease;
}

.theme-toggle__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--blue) 50%, transparent);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="dark"] .theme-toggle__thumb {
  transform: translateX(32px);
}

html[data-theme="dark"] .theme-toggle__icon--sun {
  transform: scale(0.8) rotate(-20deg);
  opacity: 0.45;
}

html:not([data-theme="dark"]) .theme-toggle__icon--moon {
  transform: scale(0.8) rotate(20deg);
  opacity: 0.45;
}

.login-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  text-decoration: none;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--blue) 10%, transparent);
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.login-btn:hover {
  transform: translateY(-2px) scale(1.04);
  background: var(--blue);
  box-shadow: 0 10px 22px color-mix(in srgb, var(--blue) 40%, transparent);
}

.login-btn:hover .login-btn__emoji {
  filter: grayscale(0) brightness(2);
}

.login-btn__emoji {
  font-size: 1.15rem;
  line-height: 1;
}

.menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  padding: 10px 11px;
}

.menu-btn span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: var(--text);
  border-radius: 99px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-btn.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-btn.is-open span:nth-child(2) {
  opacity: 0;
}

.menu-btn.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.hero {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0 auto;
  padding: 88px 24px 64px;
  text-align: center;
  animation: fadeUp 0.8s 0.15s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero__kicker {
  margin: 0 0 10px;
  color: var(--blue);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  letter-spacing: 0.04em;
}

.hero__lead {
  margin: 16px auto 0;
  max-width: 520px;
  color: var(--muted);
  font-size: 1.05rem;
}

@media (max-width: 980px) {
  .nav {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    backdrop-filter: blur(18px);
  }

  .nav.is-open {
    display: flex;
    animation: fadeUp 0.28s ease both;
  }

  .nav__indicator {
    display: none;
  }

  .nav__link.is-active {
    background: var(--blue);
  }

  .menu-btn {
    display: block;
  }
}
