/* Mobile-first fixes — воздух, светлее, не сжато */

@media (max-width: 768px) {
  :root {
    --container: calc(100% - 2.5rem);
    --mobile-px: 1.25rem;
  }

  /* ── Светлее: убираем «слои мрака» ── */
  .ambient--global { opacity: 0.25; }
  .ambient__blob--c { display: none; }

  .hero__orb,
  .hero__grid-lines,
  .hero__viz-glow,
  .section-ambient,
  .cursor-glow {
    display: none !important;
  }

  .hero__particles { opacity: 0.25; }

  #grid-canvas { opacity: 0.25; }
  .noise { opacity: 0.02; }

  .section--dark,
  .section--dense,
  .section--tabs,
  .section--ai {
    background: var(--bg) !important;
  }

  .section--dark {
    border-block-color: rgba(255, 255, 255, 0.05);
  }

  /* blur-reveal на мобиле = грязно и темно */
  .reveal {
    filter: none !important;
    transform: translateY(16px);
  }

  /* ── Воздух по бокам и между блоками ── */
  .section {
    padding: 3.75rem 0;
  }

  .section--compact {
    padding: 2.75rem 0;
  }

  .section--cta {
    padding-bottom: 4.5rem;
  }

  .section-head {
    margin-bottom: 2rem;
  }

  .section-title {
    font-size: 1.85rem;
    line-height: 1.15;
    margin-bottom: 0.65rem;
  }

  .section-desc {
    font-size: 0.92rem;
    line-height: 1.6;
  }

  .split {
    gap: 1.75rem;
    margin-bottom: 2rem;
  }

  .split__body p {
    font-size: 0.95rem;
    line-height: 1.65;
  }

  .container {
    width: var(--container);
  }

  /* Hero */
  .hero--dense {
    min-height: auto;
    padding-top: calc(var(--header-h) + 1.25rem);
  }

  .hero__grid {
    gap: 1.75rem;
  }

  .hero__content {
    padding-inline: 0;
  }

  .hero__title {
    font-size: 2.35rem;
    margin-bottom: 1rem;
  }

  .hero__lead {
    font-size: 0.95rem;
    line-height: 1.65;
    max-width: none;
    margin-bottom: 1.5rem;
  }

  .hero__actions {
    gap: 0.75rem;
  }

  .hero__actions .btn {
    flex: 1 1 auto;
    min-width: 140px;
  }

  .metrics {
    margin-top: 2rem;
  }

  .metrics__grid {
    grid-template-columns: 1fr 1fr;
    gap: 0;
  }

  .metric {
    padding: 1.15rem 0.75rem;
  }

  .metric__val {
    font-size: 1.65rem;
  }

  .metric__label {
    font-size: 0.68rem;
    line-height: 1.4;
    padding-inline: 0.25rem;
  }

  .marquee-row {
    margin-top: 0.5rem;
  }

  .hero-strip__grid > div {
    padding: 1rem var(--mobile-px);
  }

  /* Capabilities — 2 колонки, компактно с viz */
  .cap-wall {
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
  }

  .cap {
    padding: 0.85rem 0.75rem;
    display: block;
  }

  .cap__icon {
    display: inline-block;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
  }

  .cap h4 {
    font-size: 0.78rem;
    margin-bottom: 0.15rem;
  }

  .cap p {
    font-size: 0.65rem;
    padding-left: 0;
    line-height: 1.35;
    margin-bottom: 0;
  }

  .cap__micro {
    padding-top: 0.35rem;
    margin-top: 0.35rem;
  }

  /* Stack — 2 колонки, не пустые */
  .stack-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
  }

  .stack-item {
    padding: 0.85rem 0.75rem;
  }

  .stack-item__viz {
    min-height: 46px;
    padding-top: 0.5rem;
  }

  .stack-item strong {
    font-size: 0.72rem;
    line-height: 1.35;
  }

  /* Process — компактнее с viz */
  .process-step__viz {
    min-height: 40px;
    padding-top: 0.5rem;
  }

  /* Principles & bento */
  .principle-grid,
  .bento,
  .stack-grid,
  .process-track,
  .format-grid {
    gap: 0.85rem;
  }

  .principle-card,
  .bento__card,
  .stack-item,
  .process-step,
  .format-card {
    padding: 1.35rem 1.25rem;
  }

  .bento__card {
    min-height: auto;
  }

  .bento__card p {
    max-width: none;
    font-size: 0.82rem;
    line-height: 1.5;
  }

  /* Tabs */
  .tabs__nav {
    flex-direction: column;
    gap: 0.5rem;
    padding-bottom: 1.25rem;
  }

  .tabs__btn {
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: center;
  }

  .tab-grid {
    gap: 1.25rem;
    min-height: auto;
  }

  .tab-list li {
    font-size: 0.9rem;
    line-height: 1.55;
    padding-left: 1.1rem;
  }

  .tab-viz {
    min-height: 140px;
    padding: 1rem;
  }

  /* Horizontal showcase */
  .h-scroll {
    padding-block: 0.75rem 1.25rem;
  }

  .h-scroll__track {
    padding-inline: var(--mobile-px);
    gap: 1rem;
  }

  .bento__card--viz {
    min-height: auto;
  }

  .bento-preview {
    min-height: 108px;
  }

  .principle-card__viz {
    min-height: 40px;
  }

  .format-card__preview {
    padding-top: 0.85rem;
  }

  .mock--wide {
    flex: 0 0 calc(100vw - 2.5rem);
  }

  .mock--wide .mock__body {
    min-height: 280px;
  }

  .h-scroll-hint {
    margin-top: 0.75rem;
    padding-inline: var(--mobile-px);
  }

  /* Compare — карточки вместо таблицы */
  .compare {
    border: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
  }

  .compare__head {
    display: none;
  }

  .compare__row {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 1.15rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
  }

  .compare__row span {
    border: none !important;
    padding: 0 !important;
    text-align: left !important;
  }

  .compare__row span:first-child {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    padding-bottom: 0.5rem !important;
    border-bottom: 1px solid var(--border) !important;
    margin-bottom: 0.25rem;
  }

  .compare__row span:not(:first-child)::before {
    display: inline-block;
    width: 5.5rem;
    font-family: var(--mono);
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
  }

  .compare__row span:nth-child(2)::before { content: "Фриланс"; }
  .compare__row span:nth-child(3)::before { content: "Агентство"; }
  .compare__row span:nth-child(4)::before { content: "Sonya"; }

  /* Flow */
  .flow-diagram {
    padding: 1.5rem 1rem;
    gap: 0.5rem;
  }

  .flow-node {
    font-size: 0.62rem;
    padding: 0.55rem 0.9rem;
  }

  .flow-caption {
    font-size: 0.88rem;
    line-height: 1.55;
    padding-inline: 0.25rem;
  }

  /* AI / terminals */
  .ai-grid {
    gap: 1.75rem;
  }

  .ai-tags {
    gap: 0.55rem;
    margin-top: 1rem;
  }

  .ai-tags li {
    font-size: 0.82rem;
    padding: 0.5rem 0.85rem;
  }

  .terminal-stack {
    min-height: auto;
  }

  .terminal--float-2 {
    opacity: 1;
    margin-top: 0.85rem;
  }

  .terminal__body {
    font-size: 0.68rem;
    padding: 0.85rem;
  }

  /* Industries */
  .industries {
    gap: 0.55rem;
  }

  .industries span {
    font-size: 0.82rem;
    padding: 0.5rem 0.85rem;
  }

  /* FAQ */
  .faq {
    gap: 0.65rem;
  }

  .faq__item summary {
    padding: 1.15rem 1.25rem;
    font-size: 0.9rem;
    line-height: 1.45;
  }

  .faq__item p {
    padding: 0 1.25rem 1.15rem;
    font-size: 0.88rem;
    line-height: 1.6;
  }

  /* CTA */
  .cta {
    padding: 2.25rem 1.35rem;
    margin-inline: 0;
    text-align: left;
  }

  .cta__title {
    font-size: 1.75rem;
    text-align: left;
  }

  .cta__text {
    font-size: 0.92rem;
    line-height: 1.6;
    text-align: left;
  }

  .cta__actions {
    justify-content: flex-start;
  }

  .cta__actions .btn {
    width: 100%;
  }

  .cta__meta {
    text-align: left;
  }

  /* Footer */
  .footer--mega {
    padding: 2.5rem 0 1.5rem;
  }

  .footer__grid {
    gap: 1.75rem;
  }

  /* Statement band */
  .statement-band {
    padding: 0.9rem 0;
  }

  .statement-band__track span {
    font-size: 0.75rem;
  }

  /* Чуть контрастнее текст */
  .cap p,
  .metric__label,
  .principle-card p,
  .stack-item strong,
  .process-step p {
    color: #9494a4;
  }
}

/* Очень узкие экраны */
@media (max-width: 380px) {
  :root {
    --container: calc(100% - 2rem);
  }

  .hero__title {
    font-size: 2rem;
  }

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

  .metric {
    border-right: none !important;
    border-bottom: 1px solid var(--border);
  }

  .metric:last-child {
    border-bottom: none;
  }
}

/* safe area для iPhone */
@supports (padding: env(safe-area-inset-left)) {
  @media (max-width: 768px) {
    :root {
      --mobile-px: max(1.25rem, env(safe-area-inset-left));
      --container: calc(100% - 2 * var(--mobile-px));
    }

    .footer--mega {
      padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
    }
  }
}
