/* ============================================================
   АвтоЛегенда — статическая версия (HTML/CSS/JS без зависимостей)
   Токены и компоненты повторяют дизайн Next.js-версии 1:1.
   ============================================================ */

/* ── Локальные шрифты (без CDN) ── */
@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ── Токены темы ── */
:root {
  --font-sans: "Geist", ui-sans-serif, system-ui, sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
    "Liberation Mono", monospace;

  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  --card: 0 0% 100%;
  --card-foreground: 222.2 84% 4.9%;
  --primary: 222.2 47.4% 11.2%;
  --primary-foreground: 210 40% 98%;
  --secondary: 210 40% 96.1%;
  --muted: 210 40% 96.1%;
  --muted-foreground: 215.4 16.3% 46.9%;
  --accent: 210 40% 96.1%;
  --accent-foreground: 222.2 47.4% 11.2%;
  --destructive: 0 84.2% 60.2%;
  --border: 214.3 31.8% 91.4%;
  --input: 214.3 31.8% 91.4%;
  --ring: 222.2 84% 4.9%;
  --radius: 0.75rem;
}

.dark {
  --background: 222.2 84% 4.9%;
  --foreground: 210 40% 98%;
  --card: 222.2 84% 4.9%;
  --card-foreground: 210 40% 98%;
  --primary: 210 40% 98%;
  --primary-foreground: 222.2 47.4% 11.2%;
  --secondary: 217.2 32.6% 17.5%;
  --muted: 217.2 32.6% 17.5%;
  --muted-foreground: 215 20.2% 65.1%;
  --accent: 217.2 32.6% 17.5%;
  --accent-foreground: 210 40% 98%;
  --destructive: 0 62.8% 30.6%;
  --border: 217.2 32.6% 17.5%;
  --input: 217.2 32.6% 17.5%;
  --ring: 212.7 26.8% 83.9%;
}

/* ── Сброс (аналог Tailwind preflight в нужном объёме) ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  border-width: 0;
  border-style: solid;
  border-color: hsl(var(--border));
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  line-height: 1.5;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
  color: inherit;
  background: transparent;
}

button {
  cursor: pointer;
}

b,
strong {
  font-weight: bolder;
}

/* ── Утилиты ── */
.container {
  width: 100%;
  margin-inline: auto;
  padding-inline: 2rem;
}

@media (min-width: 640px) {
  .container { max-width: 640px; }
}
@media (min-width: 768px) {
  .container { max-width: 768px; }
}
@media (min-width: 1024px) {
  .container { max-width: 1024px; }
}
@media (min-width: 1280px) {
  .container { max-width: 1280px; }
}
@media (min-width: 1400px) {
  .container { max-width: 1400px; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.icon-lg {
  width: 1.25rem;
  height: 1.25rem;
}

.page {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.page main {
  flex: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .animate-fade-up {
    animation: fade-up 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
}

.animate-delay-1 { animation-delay: 100ms; }
.animate-delay-2 { animation-delay: 200ms; }
.animate-delay-3 { animation-delay: 300ms; }
.animate-delay-4 { animation-delay: 400ms; }

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Кнопки ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  height: 2.5rem;
  padding: 0.5rem 1rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease,
    border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
}

.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.btn-primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.btn-primary:hover {
  background-color: hsl(var(--primary) / 0.9);
}

.btn-outline {
  border: 1px solid hsl(var(--input));
  background-color: hsl(var(--background));
}

.btn-outline:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.btn-lg {
  height: 2.75rem;
  padding-inline: 2rem;
}

/* ── Поля ввода ── */
.input {
  display: flex;
  width: 100%;
  height: 2.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid hsl(var(--input));
  border-radius: calc(var(--radius) - 2px);
  background-color: hsl(var(--background));
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.input::placeholder {
  color: hsl(var(--muted-foreground));
}

.input:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
}

.input-subscribe {
  height: 2.75rem;
  flex: 1;
  min-width: 0;
  border-radius: 9999px;
  background-color: hsl(var(--background) / 0.8);
}

/* ── Значки ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border: 1px solid transparent;
  border-radius: 9999px;
  font-size: 0.75rem;
  line-height: 1;
  font-weight: 600;
}

/* ── Шапка ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid hsl(var(--border) / 0.6);
  background-color: hsl(var(--background) / 0.8);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  height: 4rem;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: inherit;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.logo:hover {
  opacity: 0.8;
}

.logo-badge {
  display: flex;
  height: 2.25rem;
  width: 2.25rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.logo-name {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.main-nav {
  display: none;
  align-items: center;
  gap: 2rem;
}

.main-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  transition: color 0.15s ease;
}

.main-nav a:hover {
  color: hsl(var(--foreground));
}

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

.theme-toggle {
  position: relative;
  display: flex;
  height: 2rem;
  width: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  color: hsl(var(--muted-foreground));
  transition: color 0.15s ease;
}

.theme-toggle:hover {
  color: hsl(var(--foreground));
}

.theme-toggle:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
}

.theme-toggle .icon-moon {
  position: absolute;
  inset: 0;
  margin: auto;
}

.theme-toggle svg {
  transition: transform 0.3s ease;
}

html:not(.dark) .icon-moon {
  transform: scale(0) rotate(90deg);
}

html.dark .icon-sun {
  transform: scale(0) rotate(-90deg);
}

/* ── Hero ── */
.hero {
  position: relative;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    60% 50% at 50% 0%,
    hsl(var(--primary) / 0.08),
    transparent
  );
}

.hero-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-block: 5rem;
  text-align: center;
}

@media (min-width: 640px) {
  .hero-inner {
    padding-block: 7rem;
  }
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 1rem;
  border: 1px solid hsl(var(--border));
  border-radius: 9999px;
  background-color: hsl(var(--muted) / 0.6);
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: hsl(var(--muted-foreground));
}

.pill-icon {
  color: #f59e0b;
}

.hero-title {
  margin-top: 1.5rem;
  max-width: 48rem;
  font-size: 2.25rem;
  line-height: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

@media (min-width: 640px) {
  .hero-title {
    font-size: 3.75rem;
    line-height: 1;
  }
}

.hero-lead {
  margin-top: 1.25rem;
  max-width: 36rem;
  font-size: 1.125rem;
  line-height: 1.75rem;
  color: hsl(var(--muted-foreground));
  text-wrap: balance;
}

.hero-actions {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.hero-actions .btn-lg {
  padding-inline: 1.75rem;
}

.hero-figure {
  position: relative;
  margin-top: 3.5rem;
  width: 100%;
  max-width: 56rem;
}

.hero-figure-frame {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border: 1px solid hsl(var(--border));
  border-radius: 1.5rem;
  box-shadow: 0 25px 50px -12px hsl(0 0% 0% / 0.2);
}

.dark .hero-figure-frame {
  box-shadow: 0 25px 50px -12px hsl(0 0% 0% / 0.6);
}

.hero-figure-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-stats {
  margin-top: 3.5rem;
  display: grid;
  width: 100%;
  max-width: 48rem;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 1.5rem;
  row-gap: 2rem;
}

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

.stat {
  text-align: center;
}

.stat dd {
  font-family: var(--font-mono);
  font-size: 1.875rem;
  line-height: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.stat dt {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: hsl(var(--muted-foreground));
}

/* ── Секции ── */
.section {
  padding-block: 5rem;
}

@media (min-width: 640px) {
  .section {
    padding-block: 6rem;
  }
}

#collection,
#about,
#subscribe {
  scroll-margin-top: 5rem;
}

.section-head {
  margin-bottom: 3rem;
  max-width: 42rem;
}

.eyebrow {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: hsl(var(--muted-foreground));
}

.section-title {
  margin-top: 0.5rem;
  font-size: 1.875rem;
  line-height: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

@media (min-width: 640px) {
  .section-title {
    font-size: 2.25rem;
    line-height: 2.5rem;
  }
}

.section-text {
  margin-top: 1rem;
  color: hsl(var(--muted-foreground));
}

/* ── Коллекция ── */
.cards-grid {
  display: grid;
  gap: 1.5rem;
}

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

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

.car-card {
  overflow: hidden;
  border: 1px solid hsl(var(--border));
  border-radius: 1rem;
  background-color: hsl(var(--card));
  transition: transform 0.3s ease, box-shadow 0.3s ease,
    border-color 0.3s ease;
}

.car-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px hsl(0 0% 0% / 0.1),
    0 8px 10px -6px hsl(0 0% 0% / 0.1);
}

.dark .car-card:hover {
  box-shadow: 0 20px 25px -5px hsl(0 0% 0% / 0.4),
    0 8px 10px -6px hsl(0 0% 0% / 0.4);
}

.card-media {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.car-card:hover .card-media img {
  transform: scale(1.05);
}

.card-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background-color: hsl(var(--background) / 0.85);
  color: hsl(var(--foreground));
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.card-badge-highlight {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background-color: rgb(245 158 11 / 0.95);
  color: #451a03;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
}

.card-title h3 {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.25;
}

.card-title p {
  margin-top: 0.375rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: hsl(var(--muted-foreground));
}

.card-specs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  background-color: hsl(var(--muted) / 0.6);
  text-align: center;
}

.spec {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.spec .icon {
  margin-inline: auto;
  color: hsl(var(--muted-foreground));
}

.spec dd {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.card-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid hsl(var(--border));
  padding-top: 1rem;
}

.card-price > span:first-child {
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: hsl(var(--muted-foreground));
}

.card-price-value {
  font-weight: 600;
}

/* ── О проекте ── */
.about {
  border-top: 1px solid hsl(var(--border));
  border-bottom: 1px solid hsl(var(--border));
  background-color: hsl(var(--muted) / 0.4);
}

.features-grid {
  display: grid;
  gap: 2rem;
}

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

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

.feature-icon {
  display: flex;
  height: 2.75rem;
  width: 2.75rem;
  align-items: center;
  justify-content: center;
  border: 1px solid hsl(var(--border));
  border-radius: 0.75rem;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
}

.feature h3 {
  margin-top: 0.75rem;
  font-weight: 600;
}

.feature p {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.625;
  color: hsl(var(--muted-foreground));
}

/* ── Подписка ── */
.subscribe-card {
  position: relative;
  overflow: hidden;
  padding: 3.5rem 1.5rem;
  border: 1px solid hsl(var(--border));
  border-radius: 1.5rem;
  background-color: hsl(var(--card));
  text-align: center;
}

@media (min-width: 640px) {
  .subscribe-card {
    padding: 3.5rem 3rem;
  }
}

.subscribe-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    50% 60% at 50% 100%,
    hsl(var(--primary) / 0.1),
    transparent
  );
}

.subscribe-card .section-title {
  position: relative;
  margin-top: 0;
}

.subscribe-text {
  position: relative;
  margin-top: 1rem;
  max-width: 32rem;
  margin-inline: auto;
  color: hsl(var(--muted-foreground));
}

.subscribe-form-wrap {
  position: relative;
  margin-top: 2rem;
}

.subscribe-form {
  display: flex;
  width: 100%;
  max-width: 28rem;
  margin-inline: auto;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .subscribe-form {
    flex-direction: row;
  }
}

.btn-submit {
  padding-inline: 1.5rem;
}

.btn-submit .icon-loader {
  display: none;
  animation: spin 1s linear infinite;
}

.btn-submit.is-loading .icon-loader {
  display: block;
}

.btn-submit.is-loading .icon-send {
  display: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Подвал ── */
.site-footer {
  border-top: 1px solid hsl(var(--border));
  background-color: hsl(var(--muted) / 0.4);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 2.5rem;
}

@media (min-width: 768px) {
  .footer-inner {
    flex-direction: row;
  }
}

.logo-badge-sm {
  height: 2rem;
  width: 2rem;
}

.logo-name-sm {
  font-size: 0.875rem;
}

.footer-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: hsl(var(--muted-foreground));
}

.footer-nav a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-nav a:hover {
  color: hsl(var(--foreground));
}

.footer-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .footer-actions {
    flex-direction: row;
    gap: 1.5rem;
  }
}

.btn-download {
  border: 1px solid hsl(var(--border));
  border-radius: 9999px;
  background-color: hsl(var(--background));
}

.btn-download:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.copyright {
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: hsl(var(--muted-foreground));
}

/* ── Toast-уведомления (аналог sonner, внизу справа) ── */
.toast-stack {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 22rem;
  max-width: calc(100vw - 2rem);
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border: 1px solid hsl(var(--border));
  border-radius: 0.75rem;
  background-color: hsl(var(--card));
  color: hsl(var(--card-foreground));
  font-size: 0.875rem;
  line-height: 1.25rem;
  box-shadow: 0 10px 15px -3px hsl(0 0% 0% / 0.1),
    0 4px 6px -4px hsl(0 0% 0% / 0.1);
}

.toast-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  margin-top: 1px;
  color: hsl(142 71% 45%);
}

@media (prefers-reduced-motion: no-preference) {
  .toast {
    animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .toast.toast-hide {
    animation: toast-out 0.2s ease both;
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}
