/* ==========================================================================
   ВАЛЛАБ.БЕЗНАЛИЧНЫЙ-ЧЕК — Адаптивные стили
   ========================================================================== */

/* --------------------------------------------------------------------------
   TABLET (iPad) — 768px - 1023px
   -------------------------------------------------------------------------- */

@media (max-width: 1023px) {
  :root {
    --container-padding: 1.5rem;
  }

  /* Header */
  .header-inner {
    height: 64px;
  }

  .logo-text {
    font-size: 1rem;
  }

  /* Navigation — показываем мобильное меню */
  .nav-toggle {
    display: flex;
  }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border-weak);
    display: none;
    padding: var(--space-4) var(--container-padding);
    box-shadow: var(--shadow-md);
  }

  .nav-checkbox:checked ~ .nav {
    display: block;
  }

  .nav-checkbox:checked ~ .nav-toggle span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav-checkbox:checked ~ .nav-toggle span:nth-child(2) {
    opacity: 0;
  }

  .nav-checkbox:checked ~ .nav-toggle span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .nav-list {
    flex-direction: column;
    gap: 0;
  }

  .nav-list a {
    padding: var(--space-3) var(--space-4);
    font-size: 1rem;
  }

  /* Hero */
  .hero {
    padding: var(--space-10) 0;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .hero-subtitle {
    font-size: var(--font-size-lg);
  }

  /* Intro infographic */
  .schemes-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .intro-header h2 {
    font-size: 1.5rem;
  }

  /* Demo */
  .demo-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .demo-grid .demo-card:last-child {
    grid-column: span 2;
  }

  /* Sections */
  .section {
    padding: var(--space-10) 0;
  }

  .section-title {
    font-size: 1.75rem;
    margin-bottom: var(--space-6);
  }

  /* Highlight banner */
  .highlight-banner {
    padding: var(--space-5) var(--space-6);
    font-size: 1rem;
  }

  .highlight-banner strong {
    font-size: 1.25rem;
  }

  /* Grids — 2 колонки */
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .benefits-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tech-grid {
    grid-template-columns: 1fr;
  }

  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pricing-card:last-child {
    grid-column: span 2;
  }

  .clients-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .contacts-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contacts-grid .contact-card:last-child {
    grid-column: span 2;
  }

  /* Feature blocks */
  .feature-block {
    padding: var(--space-5);
  }

  .three-columns {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }

  /* Download */
  .download-card {
    flex-direction: column;
    text-align: center;
  }

  .download-meta {
    justify-items: center;
  }

  /* Compat grid */
  .compat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
  }

  .footer-grid > div:last-child {
    grid-column: span 2;
  }

  .footer-bottom {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-legal {
    text-align: center;
  }

  /* Docs list */
  .docs-list {
    columns: 1;
  }
}

/* --------------------------------------------------------------------------
   MOBILE (iPhone) — до 767px
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {
  :root {
    --container-padding: 1rem;
    --font-size-base: 15px;
  }

  html {
    scroll-padding-top: 64px;
  }

  /* Header */
  .header-inner {
    height: 56px;
  }

  .logo {
    gap: var(--space-2);
  }

  .logo-icon {
    width: 28px;
    height: 28px;
  }

  .logo-text {
    font-size: 0.875rem;
  }

  .a11y-toggle-btn {
    width: 32px;
    height: 32px;
  }

  /* Hero */
  .hero {
    padding: var(--space-8) 0;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .hero-subtitle {
    font-size: 1rem;
    margin-bottom: var(--space-6);
  }

  .hero-features {
    font-size: var(--font-size-sm);
  }

  /* Intro infographic */
  .intro-header h2 {
    font-size: 1.25rem;
  }

  .intro-lead {
    font-size: 1rem;
  }

  .schemes-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }

  .scheme-item {
    padding: var(--space-4);
  }

  .scheme-icon {
    width: 44px;
    height: 44px;
    margin-bottom: var(--space-3);
  }

  .scheme-item h4 {
    font-size: 0.875rem;
  }

  .scheme-item p {
    font-size: 0.75rem;
  }

  .intro-footer {
    font-size: 1rem;
  }

  /* Demo */
  .demo-lead {
    font-size: 1rem;
  }

  .demo-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .demo-grid .demo-card:last-child {
    grid-column: auto;
  }

  .demo-card {
    padding: var(--space-5);
  }

  .demo-icon {
    width: 48px;
    height: 48px;
  }

  .demo-card h4 {
    font-size: 1rem;
  }

  .demo-channel {
    padding: var(--space-5);
  }

  .demo-channel p {
    font-size: 1rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Sections */
  .section {
    padding: var(--space-8) 0;
  }

  .section-title {
    font-size: 1.5rem;
    margin-bottom: var(--space-5);
  }

  .section-intro {
    font-size: 1rem;
  }

  .highlight-banner {
    padding: var(--space-4) var(--space-5);
    font-size: 0.9375rem;
    margin-bottom: var(--space-6);
  }

  .highlight-banner strong {
    font-size: 1.125rem;
  }

  .content-block {
    margin-bottom: var(--space-8);
  }

  /* All grids — 1 колонка */
  .two-columns,
  .three-columns,
  .cards-grid,
  .benefits-grid,
  .tech-grid,
  .pricing-grid,
  .clients-list,
  .contacts-grid,
  .compat-grid {
    grid-template-columns: 1fr;
  }

  .pricing-card:last-child,
  .contacts-grid .contact-card:last-child {
    grid-column: auto;
  }

  /* Cards */
  .card,
  .benefit-card,
  .tech-card,
  .pricing-card,
  .client-card,
  .contact-card {
    padding: var(--space-5);
  }

  /* Feature blocks */
  .feature-block {
    flex-direction: column;
    padding: var(--space-4);
  }

  .feature-number {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }

  /* Tags */
  .tags {
    gap: var(--space-1);
  }

  .tag {
    font-size: 0.75rem;
    padding: var(--space-1) var(--space-2);
  }

  /* Download */
  .download-card {
    padding: var(--space-4);
  }

  .download-meta {
    font-size: var(--font-size-sm);
  }

  .btn-large {
    padding: var(--space-3) var(--space-5);
    font-size: 1rem;
  }

  /* Steps */
  .step {
    gap: var(--space-4);
  }

  .step-number {
    width: 28px;
    height: 28px;
    font-size: 0.875rem;
  }

  /* Pricing */
  .price {
    font-size: 1.75rem;
  }

  .pricing-features li {
    font-size: 0.875rem;
  }

  /* Tables */
  .specs-table th,
  .specs-table td {
    padding: var(--space-2);
    font-size: var(--font-size-sm);
  }

  .specs-table th {
    width: 35%;
  }

  /* Footer */
  .footer {
    padding: var(--space-8) 0 var(--space-5);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }

  .footer-grid > div:last-child {
    grid-column: auto;
  }

  .footer-bottom {
    gap: var(--space-5);
  }

  .footer-info p,
  .footer-legal p {
    font-size: 0.75rem;
  }

  /* Intro */
  .intro-text {
    font-size: 1rem;
  }

  /* Pre/code */
  pre {
    font-size: 0.8125rem;
    padding: var(--space-3);
  }
}

/* --------------------------------------------------------------------------
   ОЧЕНЬ МАЛЕНЬКИЕ ЭКРАНЫ — до 374px (iPhone SE и подобные)
   -------------------------------------------------------------------------- */

@media (max-width: 374px) {
  :root {
    --font-size-base: 14px;
  }

  .logo-text {
    font-size: 0.75rem;
  }

  .hero-title {
    font-size: 1.25rem;
  }

  .section-title {
    font-size: 1.25rem;
  }

  h3 {
    font-size: 1.125rem;
  }

  h4 {
    font-size: 1rem;
  }

  .btn {
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-sm);
  }

  .price {
    font-size: 1.5rem;
  }
}

/* --------------------------------------------------------------------------
   LANDSCAPE ORIENTATION на мобильных
   -------------------------------------------------------------------------- */

@media (max-width: 767px) and (orientation: landscape) {
  .hero {
    padding: var(--space-6) 0;
  }

  .section {
    padding: var(--space-6) 0;
  }

  .hero-title {
    font-size: 1.25rem;
  }

  .hero-features {
    column-count: 2;
    column-gap: var(--space-4);
  }

  .hero-features li {
    break-inside: avoid;
  }

  .hero-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .hero-actions .btn {
    width: auto;
    flex: 1;
    min-width: 200px;
  }
}

/* --------------------------------------------------------------------------
   HOVER STATES — только для устройств с точным указателем (мышь)
   -------------------------------------------------------------------------- */

@media (hover: hover) and (pointer: fine) {
  .nav-list a:hover {
    background: var(--color-bg-alt);
  }

  .btn:hover {
    transform: translateY(-1px);
  }

  .card:hover,
  .benefit-card:hover,
  .tech-card:hover,
  .client-card:hover {
    box-shadow: var(--shadow-md);
  }

  .feature-block:hover {
    box-shadow: var(--shadow-sm);
  }
}

/* Убираем hover-эффекты на touch-устройствах */
@media (hover: none) {
  .btn:active {
    transform: scale(0.98);
  }
}

/* --------------------------------------------------------------------------
   HIGH DPI / RETINA DISPLAYS
   -------------------------------------------------------------------------- */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Увеличиваем толщину тонких линий для чёткости */
  .nav-toggle span {
    height: 2px;
  }

  .feature-list li::before {
    width: 6px;
    height: 6px;
  }
}

/* --------------------------------------------------------------------------
   REDUCED MOTION — для пользователей, предпочитающих меньше анимаций
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* --------------------------------------------------------------------------
   LARGE DESKTOP — от 1400px
   -------------------------------------------------------------------------- */

@media (min-width: 1400px) {
  :root {
    --container-max: 1320px;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .section-title {
    font-size: 2.25rem;
  }
}
