/**
  Нормализация блочной модели
 */
*,
::before,
::after {
    box-sizing: border-box;
}

/**
  Убираем внутренние отступы слева тегам списков,
  у которых есть атрибут class
 */
:where(ul, ol):where([class]) {
    padding-left: 0;
}

/**
  Убираем внешние отступы body и двум другим тегам,
  у которых есть атрибут class
 */
body,
:where(blockquote, figure, fieldset):where([class]) {
    margin: 0;
}

/**
  Убираем внешние отступы вертикали нужным тегам,
  у которых есть атрибут class
 */
:where(h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    p,
    ul,
    ol,
    dl):where([class]) {
    margin-block: 0;
}

:where(dd[class]) {
    margin-left: 0;
}

:where(fieldset[class]) {
    padding: 0;
    border: none;
}

/**
  Убираем стандартный маркер маркированному списку,
  у которого есть атрибут class
 */
:where(ul[class]) {
    list-style: none;
}

:where(address[class]) {
    font-style: normal;
}

/**
  Обнуляем вертикальные внешние отступы параграфа,
  объявляем локальную переменную для внешнего отступа вниз,
  чтобы избежать взаимодействие с более сложным селектором
 */
p {
    --paragraphMarginBottom: 24px;

    margin-block: 0;
}

/**
  Внешний отступ вниз для параграфа без атрибута class,
  который расположен не последним среди своих соседних элементов
 */
p:where(:not([class]):not(:last-child)) {
    margin-bottom: var(--paragraphMarginBottom);
}

/**
  Упрощаем работу с изображениями и видео
 */
img,
video {
    display: block;
    max-width: 100%;
    height: auto;
}

/**
  Наследуем свойства шрифт для полей ввода
 */
input,
textarea,
select,
button {
    font: inherit;
}

html {
    /**
    Пригодится в большинстве ситуаций
    (когда, например, нужно будет "прижать" футер к низу сайта)
   */
    height: 100%;
    /**
    Убираем скачок интерфейса по горизонтали
    при появлении / исчезновении скроллбара
   */
    scrollbar-gutter: stable;
    /**
    Плавный скролл
   */
    scroll-behavior: smooth;
}

body {
    /**
    Пригодится в большинстве ситуаций
    (когда, например, нужно будет "прижать" футер к низу сайта)
   */
    min-height: vh;
    /**
    Унифицированный интерлиньяж
   */
    line-height: 1.5;
}

/**
  Нормализация высоты элемента ссылки при его инспектировании в DevTools
 */
a:where([class]) {
    display: inline-flex;
}

/**
  Курсор-рука при наведении на элемент
 */
button,
label {
    cursor: pointer;
}

/**
  Убирает серую подсветку при тапе на мобильных устройствах (iOS/Android)
 */
button {
    -webkit-tap-highlight-color: transparent;
}

/**
  Приводим к единому цвету svg-элементы
  (за исключением тех, у которых уже указан
  атрибут fill со значением 'none' или начинается с 'url')
 */
:where([fill]:not([fill="none"],
        [fill^="url"])) {
    fill: currentColor;
}

/**
  Приводим к единому цвету svg-элементы
  (за исключением тех, у которых уже указан
  атрибут stroke со значением 'none')
 */
:where([stroke]:not([stroke="none"],
        [stroke^="url"])) {
    stroke: currentColor;
}

/**
  Чиним баг задержки смены цвета при взаимодействии с svg-элементами
 */
svg * {
    transition-property: fill, stroke;
}

/**
  Приведение рамок таблиц в классический 'collapse' вид
 */
:where(table) {
    border-collapse: collapse;
    border-color: currentColor;
}

/**
  Удаляем все анимации и переходы для людей,
  которые предпочитают их не использовать
 */
@media (prefers-reduced-motion: reduce) {

    *,
    ::before,
    ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Дополнительные стили для Magic Rays */
:root {
    /* Цветовая схема */
    --color-primary: #6366f1;
    --color-primary-dark: #4f46e5;
    --color-secondary: #ec4899;
    --color-dark: #0f172a;
    --color-light: #ffffff;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;

    /* Тени */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    
    /* Градиенты */
    --gradient-primary: linear-gradient(135deg, #6366f1, #ec4899);
    --gradient-light: linear-gradient(135deg, #f3f4f6, #ffffff);
    
    /* Скругления */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Отступы */
    --container-padding: 1rem;
    --section-spacing: 5rem;
    
    /* Анимации */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Базовые стили */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--color-gray-900);
    background-color: var(--color-light);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Контейнер */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* Шапка */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-gray-200);
    z-index: 1000;
    transition: var(--transition-base);
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem var(--container-padding);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    background: var(--color-gray-900);
    color: white;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Навигация */
.main-nav {
    display: none;
}

@media (min-width: 768px) {
    .main-nav {
        display: block;
    }
}

.nav-list {
    display: flex;
    gap: 2rem;
}

.nav-list a {
    color: var(--color-gray-700);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
    position: relative;
}

.nav-list a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: var(--transition-base);
}

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

.nav-list a:hover::after {
    width: 100%;
}

/* Селектор языка */
.language-selector {
    position: relative;
    margin-left: 1rem;
}

.lang-btn {
    background: none;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-full);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-gray-700);
    transition: var(--transition-fast);
}

.lang-btn:hover {
    background: var(--color-gray-100);
    border-color: var(--color-gray-400);
}

/* Мобильное меню */
.mobile-menu-btn {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    padding: 0.5rem;
}

@media (min-width: 768px) {
    .mobile-menu-btn {
        display: none;
    }
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-gray-900);
    transition: var(--transition-base);
}

/* Герой-секция */
.hero {
    padding: calc(80px + var(--section-spacing)) 0 var(--section-spacing);
    background: var(--gradient-light);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: radial-gradient(circle at 70% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    padding: 0 var(--container-padding);
    position: relative;
    z-index: 1;
}

@media (min-width: 1024px) {
    .hero {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: center;
        gap: 4rem;
        padding-top: 120px;
    }
    
    .hero-content {
        text-align: left;
        margin: 0;
        padding-left: var(--container-padding);
    }
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--color-gray-600);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.hero-image {
    padding: 2rem var(--container-padding);
    position: relative;
    z-index: 1;
}

.preview-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* Секции */
section {
    padding: var(--section-spacing) 0;
}

.section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--color-gray-900);
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: var(--gradient-primary);
    margin: 1rem auto 0;
    border-radius: var(--radius-full);
}

/* Сетка преимуществ */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.feature-card {
    padding: 2rem;
    background: white;
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-lg);
    transition: var(--transition-base);
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: transparent;
    background: linear-gradient(135deg, white, var(--color-gray-50));
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-gray-900);
}

.feature-card p {
    color: var(--color-gray-600);
    line-height: 1.6;
}

/* Как использовать */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.step {
    text-align: center;
    position: relative;
}

.step-number {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    position: relative;
    z-index: 1;
}

.step-number::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: inherit;
    border-radius: inherit;
    opacity: 0.3;
    z-index: -1;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.2); opacity: 0.1; }
    100% { transform: scale(1); opacity: 0.3; }
}

.step h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-gray-900);
}

.step p {
    color: var(--color-gray-600);
    line-height: 1.6;
}

/* Секция загрузки */
.download {
    background: var(--gradient-primary);
    color: white;
    text-align: center;
}

.download .section-title {
    color: white;
}

.download .section-title::after {
    background: white;
}

.download-text {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Кнопка App Store */
.app-store-badge {
    display: inline-block;
    transition: var(--transition-base);
}

.app-store-badge:hover {
    transform: scale(1.05);
}

.app-store-badge.large img {
    max-width: 200px;
}

/* QR код */
.qr-code {
    margin-top: 3rem;
}

.qr-code img {
    max-width: 150px;
    margin: 0 auto 1rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.qr-caption {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Подвал */
.footer {
    background: var(--color-gray-900);
    color: white;
    padding: 4rem 0 2rem;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.footer-info {
    text-align: center;
    margin-bottom: 3rem;
}

.footer-logo {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-links h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--color-gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-links ul {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--color-gray-400);
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: white;
}

/* Языки в подвале */
.footer-languages {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--color-gray-800);
    color: var(--color-gray-500);
}

.footer-languages a {
    color: var(--color-gray-400);
    text-decoration: none;
    margin: 0 0.5rem;
    transition: var(--transition-fast);
}

.footer-languages a:hover {
    color: white;
}

.lang-note {
    font-size: 0.875rem;
    margin-top: 1rem;
    color: var(--color-gray-600);
}

.future-lang {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Адаптивность */
@media (max-width: 768px) {
    :root {
        --section-spacing: 3rem;
    }
    
    .features-grid,
    .steps {
        gap: 1.5rem;
    }
    
    .footer-links {
        text-align: center;
    }
}

/* Анимации при скролле */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feature-card,
.step {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }
.feature-card:nth-child(4) { animation-delay: 0.4s; }
.feature-card:nth-child(5) { animation-delay: 0.5s; }
.feature-card:nth-child(6) { animation-delay: 0.6s; }

.step:nth-child(1) { animation-delay: 0.1s; }
.step:nth-child(2) { animation-delay: 0.2s; }
.step:nth-child(3) { animation-delay: 0.3s; }