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

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    color: #ffffff;
    overflow-x: hidden;
    padding-bottom: 90px; /* компенсация sticky footer */
}

header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(138, 43, 226, 0.3);
}

/* Header auth button integrated into header flex flow */
#authTopBtn {
    position: static;
    margin-left: 1rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(45deg, #8a2be2, #00ffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

nav a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s;
}

nav a:hover {
    color: #00ffff;
}

.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 2rem;
    position: relative;
}

.hero h1 {
    font-size: clamp(2rem, 4vw + 1rem, 3.2rem);
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #8a2be2, #00ffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.hero p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(45deg, #8a2be2, #00ffff);
    color: #ffffff;
}

.btn-primary:hover {
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.5);
    transform: scale(1.05);
}

.btn-secondary {
    background: linear-gradient(45deg, #0088cc, #00ffff);
    color: #ffffff;
}

.btn-secondary:hover {
    box-shadow: 0 0 20px rgba(0, 136, 204, 0.5);
    transform: scale(1.05);
}

.btn-large {
    padding: 1.5rem 3rem;
    font-size: 1.2rem;
    font-weight: bold;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1001;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #1a1a2e;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    border: 1px solid rgba(138, 43, 226, 0.3);
}

.modal-content h2 {
    margin-bottom: 1rem;
    color: #00ffff;
}

.modal-content input,
.modal-content textarea {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 1rem;
    background: #0a0a0a;
    border: 1px solid rgba(138, 43, 226, 0.3);
    color: #ffffff;
    border-radius: 5px;
}

.modal-content button {
    width: 100%;
    padding: 0.5rem;
    background: linear-gradient(45deg, #8a2be2, #00ffff);
    border: none;
    color: #ffffff;
    border-radius: 5px;
    cursor: pointer;
}

.section {
    padding: 5rem 2rem;
    max-width: 1200px;
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s;
    scroll-margin-top: 100px; /* якоря не перекрываются фиксированным хедером */
    justify-self: center; /* если вдруг секцию поместили внутрь grid — центрируем ячейку */
}

/* Принудительное центрирование ключевых блоков даже если родитель — grid */
footer, #faq, #free-lessons, #demo, #resources, #blog, #materials, #auth, #contacts {
    max-width: 1200px;
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
    justify-self: center;
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

.advantages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.advantage {
    text-align: center;
    padding: 2rem;
    background: rgba(138, 43, 226, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(138, 43, 226, 0.3);
}

.advantage i {
    font-size: 3rem;
    color: #00ffff;
    margin-bottom: 1rem;
}

.program ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.program li {
    background: rgba(138, 43, 226, 0.1);
    padding: 1rem;
    border-radius: 5px;
    border: 1px solid rgba(138, 43, 226, 0.3);
}

.pricing {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    align-items: start;
    justify-items: center;
    max-width: 820px;
    margin: 0 auto;
}

.price-card {
    background: rgba(138, 43, 226, 0.1);
    padding: 1rem 1.25rem;
    border-radius: 12px;
    border: 1px solid rgba(138, 43, 226, 0.3);
    text-align: center;
    display: grid;
    gap: .35rem;
}

.price-card h3 {
    color: #00ffff;
    margin-bottom: .35rem;
    font-size: 1rem;
    line-height: 1.2;
}

.price-card .price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #e8f6ff;
    margin-bottom: .25rem;
    line-height: 1.2;
}
.price-card p {
    font-size: .95rem;
    opacity: .9;
    margin: 0;
}

/* Compact section padding specifically for pricing */
#pricing.section {
    padding: 3rem 1rem;
}

.testimonials {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.testimonial {
    background: rgba(138, 43, 226, 0.1);
    padding: 2rem;
    border-radius: 10px;
    border: 1px solid rgba(138, 43, 226, 0.3);
}

/* Ресурсы: карточки с аккуратными hover-эффектами */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}
.resource-card {
    display: block;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(138, 43, 226, 0.25);
    border-radius: 10px;
    color: #ffffff;
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.resource-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    border-color: rgba(0, 255, 255, 0.5);
}

footer {
    background: rgba(0, 0, 0, 0.8);
    padding: 2rem;
    text-align: center;
    border-top: 1px solid rgba(138, 43, 226, 0.3);
}

footer .social {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

footer a {
    color: #00ffff;
    text-decoration: none;
}

@keyframes glow {
    from { text-shadow: 0 0 10px #8a2be2; }
    to { text-shadow: 0 0 20px #00ffff; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.sticky-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    padding: 1rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    z-index: 1000;
    border-top: 1px solid rgba(138, 43, 226, 0.3);
}

.sticky-footer a {
    color: #00ffff;
    text-decoration: none;
    font-size: 1.2rem;
}

.sticky-footer a:hover {
    color: #ffffff;
}


@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    .hero p {
        font-size: 1.2rem;
    }
    nav ul {
        flex-direction: column;
        gap: 1rem;
    }
    /* Move auth button into the normal flow on mobile to avoid overlap */
    #authTopBtn {
        position: static;
        margin-left: .75rem;
        align-self: flex-start;
    }
    .buttons {
        flex-direction: column;
        align-items: center;
    }
    .sticky-footer {
        gap: 1rem;
        padding: 0.5rem;
    }
    .chat-widget {
        width: 90%;
        height: 400px;
        right: 5%;
    }
}

/* Доступность: заметные фокусы */
a:focus-visible, button:focus-visible, .btn:focus-visible,
input:focus-visible, textarea:focus-visible {
    outline: 2px solid #00ffff;
    outline-offset: 2px;
}

/* Эффектные, но деликатные анимации для модного вида */
.btn { will-change: transform; }
.btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 10px 30px rgba(0, 255, 255, 0.15);
}

/* Анимированные «блоб‑фонари» на герое без дополнительной разметки */
.hero::before,
.hero::after {
    content: "";
    position: absolute;
    width: 40vmax;
    height: 40vmax;
    top: 10%;
    left: -10%;
    background: radial-gradient(closest-side, rgba(138, 43, 226, 0.35), transparent 60%);
    filter: blur(30px);
    z-index: -2;
    animation: blob 12s ease-in-out infinite;
}
.hero::after {
    top: 50%;
    left: 60%;
    background: radial-gradient(closest-side, rgba(0, 255, 255, 0.25), transparent 60%);
    animation-duration: 16s;
}

@keyframes blob {
    0% { transform: translate(0,0) scale(1); }
    50% { transform: translate(10px,-10px) scale(1.05); }
    100% { transform: translate(0,0) scale(1); }
}

/* Subtle cosmic starfield and comet */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .25;
  background:
    radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,.25), transparent 40%),
    radial-gradient(1.5px 1.5px at 70% 20%, rgba(255,255,255,.18), transparent 40%),
    radial-gradient(1.2px 1.2px at 40% 80%, rgba(255,255,255,.15), transparent 40%),
    radial-gradient(1.8px 1.8px at 85% 75%, rgba(255,255,255,.2), transparent 40%);
}
.hero .comet {
  position: absolute;
  top: 12%;
  left: -25%;
  width: 320px;
  height: 2px;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.9) 50%, rgba(255,255,255,0) 100%);
  filter: drop-shadow(0 0 6px rgba(255,255,255,.6));
  transform: rotate(18deg);
  opacity: 0;
  animation: comet 14s ease-in-out 6s infinite;
}
@keyframes comet {
  0%   { opacity: 0; transform: translateX(0) translateY(0) rotate(18deg); }
  5%   { opacity: .9; }
  50%  { opacity: .6; transform: translateX(1200px) translateY(320px) rotate(18deg); }
  100% { opacity: 0; transform: translateX(1400px) translateY(360px) rotate(18deg); }
}

/* Уважение предпочтений пользователя по анимации */
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
/* ===== Enhancements: stylish sections and interactions (вайб-кодинг.рус) ===== */

/* Quick menu (sticky under header) */
.quick-menu {
  position: sticky;
  top: 64px;
  display: flex;
  justify-content: center;
  gap: .75rem;
  padding: .5rem 1rem;
  margin-top: 72px; /* initial offset under fixed header */
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(8px);
  z-index: 900;
  border-bottom: 1px solid rgba(138,43,226,.25);
}
.quick-menu a {
  color: #fff;
  text-decoration: none;
  padding: .5rem .75rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}
.quick-menu a:hover,
.quick-menu a:focus-visible {
  background: rgba(255,255,255,.08);
  border-color: rgba(0,255,255,.35);
  transform: translateY(-1px);
  outline: none;
}
@media (max-width: 768px) {
  .quick-menu {
    top: 58px;
    gap: .5rem;
    padding: .5rem .75rem;
  }
  .quick-menu a {
    padding: .4rem .6rem;
    font-size: .95rem;
  }
}

/* Free lessons form sizing (bigger controls, mobile-friendly) */
#free-lessons #email-form {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  align-items: center;
}
#free-lessons #email-form input[type="email"] {
  font-size: 1rem;
  padding: .9rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(138, 43, 226, .35);
  background: #0a0a0a;
  color: #ffffff;
  min-width: 260px;
  width: 100%;
  max-width: 420px;
}
#free-lessons #email-form button {
  padding: .9rem 1.25rem;
  font-size: 1rem;
  border-radius: 8px;
}

/* Smoother font rendering */
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* Skip link: visible on focus for accessibility */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  padding: .5rem .75rem;
  background: #000;
  color: #00ffff;
  border: 1px solid rgba(0,255,255,.45);
  border-radius: 8px;
  text-decoration: none;
  transform: translateY(-120%);
  transition: transform .2s ease;
  z-index: 1100;
}
.skip-link:focus {
  transform: translateY(0);
  outline: none;
}

/* Elevation and motion for existing cards */
.advantage, .price-card {
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.advantage:hover, .price-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0,0,0,.35);
  border-color: rgba(0,255,255,.4);
}

/* Features grid (Что вы получите за 1 день) */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}
.feature-card {
  padding: 1.25rem 1.5rem;
  border: 1px solid rgba(138, 43, 226, 0.3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(4px);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.feature-card h3 {
  margin-bottom: .5rem;
  color: #00ffff;
  font-size: 1.1rem;
}
.feature-card p { opacity: .9; }
.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(0,0,0,.35);
  border-color: rgba(0,255,255,.45);
}

/* Steps timeline (Как проходит обучение) */
#steps { counter-reset: step; }
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}
#steps .step {
  position: relative;
  padding: 1.5rem 1.25rem 1.25rem 1.5rem;
  border: 1px solid rgba(138, 43, 226, 0.3);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
#steps .step:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(0,0,0,.35);
  border-color: rgba(0,255,255,.45);
}
#steps .step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: -12px;
  left: -12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #8a2be2, #00ffff);
  color: #000;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0,255,255,.25);
}

/* Utility: gradient text */
.gradient-text {
  background: linear-gradient(45deg, #8a2be2, #00ffff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .features-grid, .steps { gap: 1rem; }
  .feature-card, .step { padding: 1rem; }

  /* Pricing mobile compaction */
  #pricing.section { padding: 2rem 1rem; }
  .pricing { gap: .75rem; max-width: 100%; }
  .price-card { padding: .9rem 1rem; }
}

/* Auth section (Личный кабинет): clean 2025 styling */
#auth .auth-form .inputs {
  display: grid;
  gap: .75rem;
}
#auth .auth-form input[type="email"],
#auth .auth-form input[type="password"],
#auth .auth-form textarea {
  width: 100%;
  font-size: 1rem;
  padding: .9rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.04);
  color: #ffffff;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
#auth .auth-form input:focus,
#auth .auth-form textarea:focus {
  border-color: rgba(0,255,255,.45);
  box-shadow: 0 0 0 3px rgba(0,255,255,.15);
  outline: none;
}
#auth .auth-form .buttons {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  justify-content: center;
}
#auth #dashboard {
  border: 1px solid rgba(138,43,226,.25);
  background: rgba(255,255,255,.03);
  border-radius: 12px;
  padding: 1.25rem;
}
#auth #authMsg {
  font-size: .95rem;
}
@media (max-width: 768px) {
  #auth .auth-form .buttons .btn {
    width: 100%;
  }
}
/* Fix counters: ensure steps counter increments across all items even if container structure changes */
#steps, .steps { counter-reset: step; }
/* Demo section cards: preserve aspect ratio and avoid stretched images */
.demo-card {
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(138, 43, 226, 0.25);
}
.demo-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover; /* fill without distortion, minimal crop if needed */
}

/* Ensure hero mini-CTA is clearly visible */
.hero-cta-mini .mini-link {
  color: #ffffff !important;
}

/* Mobile refinements for readability */
@media (max-width: 768px) {
  /* Make blog toggle buttons full-width for easier tapping */
  #blog summary.btn {
    width: 100%;
    box-sizing: border-box;
  }
  /* Stack testimonials for better readability */
  .testimonials {
    grid-template-columns: 1fr;
  }
}
/* Mobile optimization overrides (2025) */
.btn { min-height: 44px; } /* Better touch targets */

@media (max-width: 768px) {
  header { padding: .65rem 1rem; }
  nav ul {
    flex-wrap: nowrap;
    gap: .75rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  nav ul::-webkit-scrollbar { display: none; }
  nav a { padding: .4rem .5rem; }

  .section { padding: 3rem 1rem; }
  .hero { min-height: 88svh; padding: 0 1rem; }
  /* Hide decorative floating thumbs on small screens */
  .hero > img:not(:first-of-type) { display: none !important; }
  .hero p { font-size: 1rem; }

  .buttons { gap: .75rem; }
  .btn-large { width: 100%; padding: 1.1rem; }

  /* Force single-column content where readability matters */
  .resource-grid { grid-template-columns: 1fr; }
  /* Override inline grid in Demo container to single column */
  #demo > div { grid-template-columns: 1fr !important; }

  footer { padding: 1.25rem; }
  .sticky-footer { gap: 1rem; padding: .5rem .75rem; }
  .sticky-footer a { font-size: 1rem; }
}

/* Extra small screens */
@media (max-width: 480px) {
  .logo { font-size: 1.25rem; }
  .hero h1 { font-size: 1.75rem; }
  .btn { font-size: .95rem; }
}