/* ── LIGHT THEME (default) ── */
:root,
[data-theme="light"] {
  --red: #d62b2b;
  --red-dark: #a81f1f;
  --red-glow: rgba(214, 43, 43, 0.15);
  --gold: #f0c040;
  --bg: #f5f5f5;
  --bg2: #eeecea;
  --bg3: #e8e5e1;
  --border: #d4d0cc;
  --text: #1a1a1a;
  --text-secondary: #444;
  --muted: #6d6969;
  --card: #ffffff;
  --card-hover: #f0eded;
  --nav-bg: rgba(255, 255, 255, 0.85);
  --nav-text: #1a1a1a;
  --form-bg: rgba(20, 20, 20, 0.92);
  --form-text: #f5f5f5;
  --form-input-bg: rgba(255, 255, 255, 0.06);
  --form-input-border: rgba(255, 255, 255, 0.12);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.1);
  --logo-fill: #1a1a1a;
}

/* ── DARK THEME ── */
[data-theme="dark"] {
  --bg: #0e0e0e;
  --bg2: #141414;
  --bg3: #1a1a1a;
  --border: #2a2a2a;
  --text: #f0ede8;
  --text-secondary: #b0aca6;
  --muted: #7a7672;
  --card: #181818;
  --card-hover: #222;
  --nav-bg: rgba(14, 14, 14, 0.9);
  --nav-text: #f0ede8;
  --form-bg: rgba(20, 20, 20, 0.95);
  --form-text: #f0ede8;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
  --logo-fill: #f0ede8;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: "Manrope", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

/* ── INTERACTIVE CANVAS ── */
#bgCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 16px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.nav-logo svg { width: 52px; height: 40px; }
.nav-logo svg text { fill: var(--logo-fill); transition: fill 0.3s; }

.whatsapp-svg {
  height: 28px;
  opacity: 0.7;
  transition: opacity 0.3s, transform 0.3s;
}
[data-theme="dark"] .whatsapp-svg { filter: invert(1) brightness(0.8); }
[data-theme="light"] .whatsapp-svg { filter: none; }
.whatsapp-svg:hover { opacity: 1; transform: scale(1.1); }

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  align-items: center;
}
.nav-links a {
  color: var(--nav-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--red); }

.nav-cta {
  background: var(--red) !important;
  color: #fff !important;
  padding: 10px 24px;
  border-radius: 6px;
  font-weight: 700 !important;
  letter-spacing: 0.06em;
  transition: background 0.2s, transform 0.2s !important;
}
.nav-cta:hover { background: var(--red-dark) !important; transform: translateY(-1px); }

/* ── NAV CONTROLS ── */
.nav-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  position: relative;
  width: 48px;
  height: 26px;
  border-radius: 13px;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.theme-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s;
}
[data-theme="dark"] .theme-toggle::after {
  transform: translateX(22px);
  background: var(--red);
}
.theme-toggle:hover { border-color: var(--red); }

.lang-switch {
  display: flex;
  gap: 4px;
  align-items: center;
}
.lang-btn {
  background: transparent;
  border: none;
  padding: 4px 0;
  font-family: "Manrope", sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.3s;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  position: relative;
}
.lang-btn::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--red);
  transition: width 0.3s;
}
.lang-btn.active {
  color: var(--text);
  background: none;
}
.lang-btn.active::after {
  width: 100%;
}
.lang-btn:hover:not(.active) { color: var(--text); }
.lang-divider {
  width: 1px;
  height: 14px;
  background: var(--border);
  margin: 0 6px;
}

/* ── HAMBURGER ── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 110;
}
.hamburger span {
  display: block;
  width: 24px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ── HERO ── */
#hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  overflow: hidden;
}

.hero-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 140px 64px 80px 64px;
  position: relative;
  z-index: 2;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 28px;
}
.hero-tag::before {
  content: "";
  display: block;
  width: 24px; height: 2px;
  background: var(--red);
}

h1 {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(52px, 6vw, 88px);
  line-height: 0.95;
  letter-spacing: 0.02em;
  color: var(--text);
  margin-bottom: 28px;
}
h1 span { color: var(--red); }

.hero-desc {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 420px;
  margin-bottom: 48px;
}

.hero-stats { display: flex; gap: 40px; }
.stat-num {
  font-family: "Bebas Neue", sans-serif;
  font-size: 42px;
  color: var(--text);
  line-height: 1;
}
.stat-num span { color: var(--red); }
.stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  letter-spacing: 0.05em;
}

/* Hero right */
.hero-right {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-bg-img {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1a0a0a 0%, #0c0c0c 100%);
  overflow: hidden;
}
.hero-bg-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("https://images.unsplash.com/photo-1449965408869-eaa3f722e40d?w=900&q=80&auto=format&fit=crop") center/cover no-repeat;
  opacity: 0.68;
  mix-blend-mode: luminosity;
  filter: invert(1);
}
.hero-bg-img::before {
  content: "";
  position: absolute;
  left: -80px; top: 0; bottom: 0;
  width: 160px;
  background: linear-gradient(to right, var(--red), transparent);
  z-index: 1;
}

/* ── FORM CARD ── */
.form-card {
  position: relative;
  z-index: 2;
  background: var(--form-bg);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 40px 36px;
  width: 360px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
}
.form-card h2 {
  font-family: "Bebas Neue", sans-serif;
  font-size: 28px;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  color: var(--form-text);
}
.form-card p {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 28px;
  line-height: 1.5;
}

.form-group { margin-bottom: 14px; position: relative; }
.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.8);
  margin-bottom: 7px;
}

.form-group input, .form-group select {
  width: 100%;
  background: var(--form-input-bg);
  border: 1px solid var(--form-input-border);
  border-radius: 8px;
  padding: 12px 16px;
  color: white;
  font-family: "Manrope", sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
}
.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}
.form-group select option { background: #1c1c1c; color: white; }
.form-group input:focus, .form-group select:focus {
  border-color: var(--red);
  background: rgba(214, 43, 43, 0.05);
  box-shadow: 0 0 0 3px var(--red-glow);
}
.form-group input.error, .form-group select.error { border-color: #ff4444; }

.error-msg { font-size: 11px; color: #ff6b6b; margin-top: 5px; display: none; }
.error-msg.show { display: block; }

.btn-submit {
  width: 100%;
  margin-top: 8px;
  padding: 15px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: "Manrope", sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}
.btn-submit:hover { background: var(--red-dark); box-shadow: 0 4px 16px var(--red-glow); }
.btn-submit:active { transform: scale(0.98); }
.btn-submit.loading { pointer-events: none; opacity: 0.7; }

.form-success { display: none; text-align: center; padding: 20px 0; }
.form-success.show { display: block; }
.success-icon { font-size: 48px; margin-bottom: 12px; }
.form-success h3 {
  font-family: "Bebas Neue", sans-serif;
  font-size: 24px;
  color: #4caf50;
  margin-bottom: 8px;
}
.form-success p { font-size: 14px; color: var(--muted); }

/* ── SECTIONS ── */
.section-line {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.section-line::before {
  content: "";
  display: block;
  width: 32px; height: 2px;
  background: var(--red);
}
.section-line span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--red);
}

/* ── WHY US ── */
#why {
  padding: 100px 64px;
  background: var(--bg2);
  position: relative;
  transition: background 0.3s;
}
#why::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--red), transparent);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 64px;
}
.section-header h2 {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(36px, 4vw, 56px);
  letter-spacing: 0.03em;
  line-height: 1;
}
.section-header p {
  max-width: 340px;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  text-align: right;
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.why-card {
  background: var(--card);
  padding: 40px 36px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.why-card:hover {
  background: var(--card-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--red);
}

.why-icon {
  width: 52px; height: 52px;
  background: var(--red-glow);
  border: 1px solid rgba(214, 43, 43, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  font-size: 24px;
}
.why-card h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--red);
}
.why-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ── PRICING ── */
#pricing {
  padding: 100px 64px;
  background: var(--bg);
  transition: background 0.3s;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 64px;
}

.price-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 32px;
  position: relative;
  transition: all 0.3s;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.price-card:hover {
  border-color: rgba(214, 43, 43, 0.4);
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}
.price-card.featured {
  border-color: var(--red);
  background: var(--card);
  box-shadow: 0 0 0 1px var(--red), var(--shadow-md);
}

.price-badge {
  display: none;
  position: absolute;
  top: -12px; left: 50%;
  transform: translateX(-50%);
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 16px;
  border-radius: 20px;
  white-space: nowrap;
}
.price-card.featured .price-badge { display: block; }

.price-type {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 10px;
}
.price-card h3 {
  font-family: "Bebas Neue", sans-serif;
  font-size: 26px;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
}
.price-card .desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 28px;
  line-height: 1.5;
}
.price-amount {
  font-family: "Bebas Neue", sans-serif;
  font-size: 52px;
  letter-spacing: 0.02em;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}
.price-per {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 28px;
}
.price-divider {
  height: 1px;
  background: var(--border);
  margin-bottom: 24px;
}
.price-features { list-style: none; margin-bottom: 0; flex: 1; }
.price-features li {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 6px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.price-features li::before {
  content: "";
  display: block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
}

.btn-book {
  display: block;
  width: 100%;
  padding: 14px;
  text-align: center;
  border-radius: 8px;
  font-family: "Manrope", sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  margin-top: 24px;
}
.btn-book-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-book-outline:hover {
  border-color: var(--red);
  color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
}
.btn-book-filled { background: var(--red); color: #fff; }
.btn-book-filled:hover { background: var(--red-dark); box-shadow: 0 4px 16px var(--red-glow); }

/* ── TEAM ── */
#team {
  padding: 100px 64px;
  background: var(--bg2);
  position: relative;
  transition: background 0.3s;
}
#team::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 64px;
}

.team-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  transition: all 0.3s;
  box-shadow: var(--shadow-sm);
}
.team-card:hover {
  border-color: rgba(214, 43, 43, 0.3);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.team-img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  object-position: center 70%;
  display: block;
  transition: filter 0.4s, transform 0.5s;
}
.team-card:hover .team-img { transform: scale(1.05); }

/* Per-photo positioning to show instructor + car optimally */
.team-img.pos-center { object-position: center center; }
.team-img.pos-bottom { object-position: center 55%; }
.team-img.pos-mid { object-position: center 60%; }
.team-img.pos-lower { object-position: center 60%; }
.team-img.pos-sergey { object-position: 70% 30%; }

.team-img-placeholder {
  width: 100%;
  height: 420px;
  background: linear-gradient(135deg, var(--bg3), var(--card));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.team-info { padding: 20px; }
.team-info h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.team-info span {
  font-size: 12px;
  color: var(--red);
  font-weight: 600;
  letter-spacing: 0.05em;
}
.team-info p {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.05em;
}

.team-detail {
  margin-top: 8px;
}
.team-detail strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.team-detail p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* ── FOOTER ── */
footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 48px 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.3s;
}
.footer-copy { font-size: 13px; color: var(--muted); }
.footer-phone {
  font-family: "Bebas Neue", sans-serif;
  font-size: 22px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}
.footer-phone:hover { color: var(--red); }

/* ── ANIMATIONS ── */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ── SCROLL HINT ── */
.scroll-hint {
  position: absolute;
  bottom: 32px; left: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  animation: bounce 2s ease-in-out infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  nav { padding: 14px 20px; }
  .nav-links {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    z-index: 100;
  }
  .nav-links.open { display: flex; }
  .hamburger { display: flex; }

  #hero { grid-template-columns: 1fr; }
  .hero-left { padding: 80px 28px 40px; }
  .hero-left h1 { font-size: 11vw; }
  .hero-right { padding: 0 28px 60px; justify-content: stretch; }
  .form-card { margin-top: 2vh; width: 100%; }
  .hero-desc { width: 80%; }

  #why, #pricing, #team, footer { padding: 60px 24px; }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .section-header p { text-align: left; }

  .why-grid { grid-template-columns: 1fr; gap: 12px; }
  .pricing-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: repeat(2, 1fr); }

  /* ── Mobile: focus on instructors, not cars ── */
  .team-img,
  .team-img-placeholder {
    height: 240px;
  }
  .team-img {
    object-position: center 15% !important;
  }
  /* Саят — person is right-center, face is upper */
  .team-img.pos-sergey {
    object-position: 75% 10% !important;
  }
  /* Елдос — horizontal photo, person in center */
  .team-img.pos-center {
    object-position: 60% 25% !important;
  }
  /* Даулет — person is left side */
  .team-img.pos-mid {
    object-position: 30% 15% !important;
  }
  /* Андрей — person is far right edge, face very high */
  .team-img.pos-lower {
    object-position: 95% 0% !important;
  }

  footer { flex-direction: column; gap: 16px; text-align: center; }
  .hero-stats { gap: 24px; }
  .scroll-hint { left: 28px; }
}
