/* ============================================================
   QUANTIUM — Premium Design System
   Vibe: Ethereal Glass (SaaS/AI) + Warm Gold from brand
   Fonts: Geist (body) + Clash Display (heading) + JetBrains Mono
   ============================================================ */
/* Fonts loaded via <link rel="stylesheet"> in HTML <head> (non-blocking, preconnected).
   Previously: @import — synchronous and render-blocking — now removed. */

:root {
  /* Surface */
  --bg: #050505;
  --bg-elevated: #0a0a0a;
  --bg-card: #0d0d0f;
  --bg-card-hover: #111114;
  --bg-glass: rgba(13,13,15,.65);

  /* Borders */
  --border: rgba(255,255,255,.06);
  --border-strong: rgba(255,255,255,.12);
  --border-gold: rgba(245,201,123,.18);

  /* Text — tuned for WCAG AA contrast on OLED black */
  --text: #ece8e0;          /* body base — 13.8:1 on --bg */
  --text-bright: #fcf8f0;   /* headings/bright — 16.2:1 */
  --text-muted: #a39a8a;    /* secondary/body paragraph — 7.1:1 (AA) */
  --text-subtle: #80776a;   /* meta/mono/labels — 4.8:1 (AA large) */

  /* Brand Gold (from logo) */
  --gold: #f5c97b;
  --gold-deep: #d4a054;
  --gold-hot: #ffe5a8;
  --gold-glow: rgba(245,201,123,.15);
  --gold-glow-strong: rgba(245,201,123,.25);

  /* Radii — exaggerated squircle */
  --r-2xl: 2rem;
  --r-xl: 1.25rem;
  --r-lg: 1rem;
  --r-md: .75rem;
  --r-pill: 100px;

  /* Type */
  --font: 'Geist', system-ui, -apple-system, sans-serif;
  --font-display: 'Clash Display', 'Geist', sans-serif;
  --mono: 'JetBrains Mono', monospace;

  /* Motion — custom spring-like bezier */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
  --duration: 700ms;
  --duration-fast: 400ms;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0 }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none }
img { display: block; max-width: 100% }
ul, ol { list-style: none }
button, input, textarea, select { font-family: inherit; border: 0; outline: 0 }

/* === Layout === */
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px }
.section { padding: 72px 0; position: relative }
@media (max-width: 768px) { .section { padding: 48px 0 } .container { padding: 0 18px } }

/* === Typography (Clash Display for headings) === */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.02em; color: var(--text-bright) }
h1 { font-size: clamp(48px, 7vw, 84px); line-height: 1.02 }
h2 { font-size: clamp(36px, 4.5vw, 56px); line-height: 1.06 }
h3 { font-size: clamp(22px, 2.5vw, 30px); line-height: 1.15 }
h4 { font-size: 18px; line-height: 1.3 }
p { color: var(--text-muted); line-height: 1.7 }
.text-gold { color: var(--gold) }
.text-bright { color: var(--text-bright) }

/* === Eyebrow badge (pill) === */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--gold); padding: 6px 16px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(245,201,123,.2);
  background: rgba(245,201,123,.04);
}

/* === Section head === */
.section-head { margin-bottom: 56px }
.section-head p { max-width: 560px; font-size: 17px; margin-top: 16px }
.section-head-row { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap }

/* ============================================================
   DOUBLE-BEZEL CARD SYSTEM (Doppelrand)
   Outer shell + inner core = haptic depth
   ============================================================ */
.bezel {
  background: rgba(255,255,255,.02);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  padding: 6px;
  transition: border-color var(--duration-fast) var(--ease-spring);
}
.bezel:hover { border-color: var(--border-strong) }
.bezel-inner {
  background: var(--bg-card);
  border-radius: calc(2rem - 6px);
  padding: 32px;
  box-shadow: inset 0 1px 1px rgba(255,255,255,.06);
  position: relative; overflow: hidden;
}

/* Simple card (non-bezel) */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  transition: all var(--duration-fast) var(--ease-spring);
  overflow: hidden;
}
.card:hover { border-color: var(--border-strong); background: var(--bg-card-hover) }

/* ============================================================
   BUTTONS — Island Architecture
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font); font-weight: 600; font-size: 15px;
  padding: 14px 24px; border-radius: var(--r-pill);
  cursor: pointer; position: relative;
  transition: all var(--duration-fast) var(--ease-spring);
  transform: translateZ(0);
}
.btn:active { transform: scale(.98) }
.btn-gold {
  background: var(--gold); color: #050505;
}
.btn-gold:hover { background: var(--gold-hot); box-shadow: 0 0 40px var(--gold-glow) }
.btn-outline {
  background: transparent; color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold) }
.btn-sm { padding: 10px 18px; font-size: 13px }
.btn-lg { padding: 18px 32px; font-size: 16px }

/* Button trailing icon circle */
.btn .icon-circle {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0,0,0,.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: transform var(--duration-fast) var(--ease-spring);
}
.btn:hover .icon-circle { transform: translate(2px, -1px) scale(1.05) }

/* ============================================================
   NAVIGATION — Floating Glass Pill
   ============================================================ */
.nav-wrap { position: fixed; top: 0; left: 0; right: 0; z-index: 50; padding: 14px 24px }
.nav {
  max-width: 1240px; margin: 0 auto;
  background: var(--bg-glass); backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 8px 8px 8px 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
.nav > .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; width: 100%;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-size: 18px; font-weight: 600;
  color: var(--text-bright); white-space: nowrap; flex-shrink: 0;
}
.nav-logo svg { width: 26px; height: 26px; flex-shrink: 0 }
.nav-links {
  display: flex; gap: 2px;
  flex: 1; justify-content: center;
  min-width: 0;
}
.nav-links a {
  font-size: 13px; font-weight: 500; color: rgba(245,245,244,.92);
  padding: 8px 12px; border-radius: var(--r-pill);
  white-space: nowrap;
  transition: all var(--duration-fast) var(--ease-spring);
}
.nav-links a:hover, .nav-links a.active { color: var(--gold); background: rgba(255,255,255,.08) }
.nav-cta { display: flex; align-items: center; gap: 8px; flex-shrink: 0 }
.nav-cta .btn { white-space: nowrap }
.nav .btn-sm { padding: 10px 18px; font-size: 13px }

/* Language switcher in nav — minimal, matches nav-link weight */
.lang-switch{position:relative;display:inline-flex;margin-right:4px}
.lang-switch-trigger{display:inline-flex;align-items:center;gap:6px;padding:8px 10px;border:0;background:transparent;color:rgba(245,245,244,.78);font-family:var(--font);font-size:13px;font-weight:500;line-height:1;cursor:pointer;border-radius:var(--r-pill);transition:color .15s,background .15s;white-space:nowrap;letter-spacing:.02em}
.lang-switch-trigger:hover{color:var(--gold);background:rgba(255,255,255,.06)}
.lang-switch.open .lang-switch-trigger{color:var(--gold);background:rgba(255,255,255,.08)}
.lang-switch .lang-globe-svg{display:inline-block;opacity:.7;flex-shrink:0}
.lang-switch-trigger:hover .lang-globe-svg,.lang-switch.open .lang-globe-svg{opacity:1}
.lang-switch .lang-chevron{transition:transform .2s var(--ease-spring);opacity:.55;margin-left:1px;flex-shrink:0}
.lang-switch-trigger:hover .lang-chevron{opacity:.85}
.lang-switch.open .lang-chevron{transform:rotate(180deg);opacity:1}

.lang-switch-menu{position:absolute;top:calc(100% + 6px);right:0;min-width:170px;background:rgba(13,13,15,.96);border:1px solid rgba(255,255,255,.08);border-radius:12px;padding:5px;box-shadow:0 12px 32px rgba(0,0,0,.5),0 2px 8px rgba(0,0,0,.35);opacity:0;visibility:hidden;transform:translateY(-4px) scale(.97);transform-origin:top right;transition:opacity .18s var(--ease-spring),transform .2s var(--ease-spring),visibility .2s;z-index:50;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
.lang-switch.open .lang-switch-menu{opacity:1;visibility:visible;transform:translateY(0) scale(1)}
.lang-switch-menu a,.lang-switch-current{display:flex;align-items:center;gap:10px;padding:9px 12px;border-radius:8px;color:rgba(245,245,244,.88);font-family:var(--font);font-size:13px;font-weight:500;text-decoration:none;transition:background .15s,color .15s;cursor:pointer}
.lang-switch-menu a:hover{background:rgba(255,255,255,.06);color:var(--gold)}
.lang-switch-current{color:rgba(245,245,244,.5);cursor:default;background:transparent}
.lang-switch-current:hover{background:transparent;color:rgba(245,245,244,.5)}
.lang-switch-menu .lang-code{font-family:var(--mono);font-size:10px;font-weight:600;letter-spacing:.12em;color:var(--gold);min-width:22px;opacity:.85}
.lang-switch-menu .lang-name{flex:1}
.lang-switch-menu .lang-tick{color:var(--gold);margin-left:auto;opacity:.65}
.lang-switch-current .lang-code{color:rgba(245,201,123,.5)}

@media (max-width: 760px){
  .lang-switch{margin-right:0}
  .lang-switch-trigger{padding:7px 8px;gap:4px}
  .lang-switch-trigger .lang-label{display:none}
  .lang-switch-trigger .lang-chevron{display:none}
  .lang-switch-menu{min-width:160px}
}

/* Language switcher in footer (compact text links) */
.lang-switch-foot{display:inline-flex;align-items:center;gap:6px;font-family:var(--mono);font-size:12px;letter-spacing:.06em}
.lang-switch-foot a{color:var(--text-subtle);text-decoration:none;padding:2px 4px;border-radius:4px;transition:color .15s}
.lang-switch-foot a:hover{color:var(--gold)}
.lang-switch-foot a.active{color:var(--text);font-weight:600}
.lang-switch-foot .sep{color:var(--text-subtle);opacity:.5}

@media (max-width: 1100px) {
  .nav-links a { font-size: 12px; padding: 7px 10px }
}
@media (max-width: 960px) {
  .nav-links { display: none }
  .nav-wrap { padding: 10px 14px }
  .nav { padding: 8px 8px 8px 20px }
}

/* Atom logo SVG */
.atom-logo .orbit { stroke: var(--gold); stroke-width: .7; fill: none; opacity: .6 }
.atom-logo .dot { fill: var(--gold-hot) }
.atom-logo .letter { fill: var(--gold-hot); font-family: var(--font); font-weight: 800; font-size: 28px }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100dvh; display: flex; align-items: center;
  padding: 140px 0 100px; position: relative; overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 900px 600px at 55% 20%, rgba(245,201,123,.10), transparent 60%),
    radial-gradient(ellipse 700px 500px at 25% 70%, rgba(212,160,84,.05), transparent 50%),
    radial-gradient(ellipse 400px 400px at 80% 80%, rgba(100,80,50,.04), transparent 50%);
}
.hero .container { position: relative; z-index: 2; text-align: center }
.hero-sub { font-size: 18px; max-width: 620px; margin: 24px auto 40px; color: var(--text-muted) }

/* ============================================================
   CHIPS / FILTERS
   ============================================================ */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: var(--r-pill);
  font-size: 12.5px; font-weight: 500; color: var(--text-muted);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-spring);
  white-space: nowrap;
}
.chip:hover { border-color: var(--border-strong); color: var(--text) }
.chip.active { background: var(--text-bright); color: var(--bg); border-color: var(--text-bright) }
.chips { display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px 0 }
.chips::-webkit-scrollbar { display: none }

/* Sticky filter bar — used on gallery, blog and other listing pages
   so the filter chips remain accessible while scrolling through the feed */
.sticky-filter-bar {
  position: sticky;
  top: 88px;
  z-index: 30;
  padding: 8px 0 9px;
  /* Centered pill: fit-content + auto margins so the bar wraps tight around chips */
  width: fit-content;
  max-width: calc(100% - 32px);
  margin: 0 auto 12px;
  background: rgba(8, 7, 5, 0.78);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--r-pill);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}
.sticky-filter-bar > .container { padding: 0 16px }
.sticky-filter-bar .chips { justify-content: center }
@media (max-width: 768px) {
  .sticky-filter-bar { top: 76px; padding: 10px 0 12px }
  .sticky-filter-bar .chips { flex-wrap: nowrap; overflow-x: auto; padding: 0 16px; scrollbar-width: none }
  .sticky-filter-bar .chips::-webkit-scrollbar { display: none }
  .sticky-filter-bar .chip { flex-shrink: 0 }
}

/* Inline single-row filter layout for gallery: Категория [chips] | Модель [chips] */
.filters-inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  justify-content: center;
}
.filter-cat-group, .filter-model-group {
  display: inline-flex; align-items: center;
  gap: 6px; flex-wrap: wrap;
}
.filter-model-group::before {
  content: ""; display: inline-block; width: 1px; height: 18px;
  background: rgba(255,255,255,.12); margin: 0 6px;
}
.filter-label {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--text-subtle); margin-right: 4px;
}
.filter-model-group .chip.hidden { display: none }
@media (max-width: 820px) {
  .filters-inline { gap: 4px 6px }
  .filter-model-group::before { display: none }
  .filter-cat-group, .filter-model-group { width: 100%; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding: 4px 4px }
}

/* ============================================================
   FEATURE-ALT — split layout: header row (text+image) then full-width examples
   used on homepage CAPABILITIES section
   ============================================================ */
.feat-block { padding: 64px 0; border-top: 1px solid var(--border) }
.feat-block:first-of-type { border-top: none; padding-top: 32px }

.feat-alt-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.feat-alt-row.reverse .feat-alt-media { order: 2 }
.feat-alt-row.reverse .feat-alt-body { order: 1 }

.feat-alt-media {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(245,201,123,.08), rgba(245,201,123,.02));
  border: 1px solid rgba(245,201,123,.14);
  aspect-ratio: 4 / 3;
}
.feat-alt-media > img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block;
}

.feat-alt-num {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 64px; font-weight: 700;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px var(--gold);
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}
.feat-alt-body h3 {
  font-family: var(--font-display);
  font-size: 36px; font-weight: 600;
  line-height: 1.1;
  color: var(--text-bright);
  margin-bottom: 14px;
}
.feat-alt-providers {
  font-size: 13px;
  color: var(--gold);
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 18px;
}
.feat-alt-body p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* Examples row — full width below the header row */
.feat-alt-examples-row { margin-top: 32px }
.feat-alt-examples-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 14px;
}
.feat-alt-examples-title {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--text-subtle);
}
.feat-alt-examples-link {
  font-size: 13px; color: var(--gold);
  display: inline-flex; align-items: center; gap: 4px;
}
.feat-alt-examples {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.feat-alt-example {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: transform .25s var(--ease-spring), border-color .2s;
}
.feat-alt-example:hover {
  transform: translateY(-3px);
  border-color: rgba(245,201,123,.4);
}
.feat-alt-example img,
.feat-alt-example video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.feat-alt-example video { pointer-events: none; background: #050505; }
.feat-alt-example-label {
  position: absolute;
  left: 8px; bottom: 8px;
  font-family: var(--mono);
  font-size: 10px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 6px;
  background: rgba(8,7,5,.78);
  color: #fff;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.1);
}

/* AI-chat examples — speech bubbles, not images */
.chat-examples {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.chat-mock {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color .2s, transform .25s var(--ease-spring);
}
.chat-mock:hover { border-color: rgba(245,201,123,.3); transform: translateY(-2px) }
.chat-mock-head {
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.chat-mock-head .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #4ade80; flex-shrink: 0;
  box-shadow: 0 0 8px rgba(74,222,128,.6);
}
.chat-mock-head .label {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold); font-weight: 600;
}
.chat-bubble {
  font-size: 13px; line-height: 1.55;
  padding: 10px 14px; border-radius: 12px;
  max-width: 92%;
}
.chat-bubble.user {
  align-self: flex-end;
  background: rgba(245,201,123,.14);
  color: var(--text-bright);
  border-bottom-right-radius: 4px;
}
.chat-bubble.bot {
  align-self: flex-start;
  background: rgba(255,255,255,.04);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.06);
  border-bottom-left-radius: 4px;
}
.chat-bubble.bot strong { color: var(--text-bright); font-weight: 600 }

@media (max-width: 900px) {
  .feat-block { padding: 48px 0 }
  .feat-alt-row {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .feat-alt-row.reverse .feat-alt-media { order: 0 }
  .feat-alt-row.reverse .feat-alt-body { order: 1 }
  .feat-alt-num { font-size: 48px; margin-bottom: 12px }
  .feat-alt-body h3 { font-size: 28px }
  .feat-alt-examples { grid-template-columns: repeat(2, 1fr) }
  .chat-examples { grid-template-columns: 1fr }
}

/* ============================================================
   Q-POPUP — universal popup/lightbox for example tiles
   chat / image / video / audio / text
   ============================================================ */
.q-popup{position:fixed;inset:0;background:rgba(2,1,0,.92);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);display:none;align-items:center;justify-content:center;z-index:100;padding:24px;overflow-y:auto;-webkit-overflow-scrolling:touch}
.q-popup.open{display:flex}
.q-popup-shell{position:relative;width:min(820px,100%);max-height:88vh;background:#0d0c0a;border:1px solid var(--border);border-radius:24px;box-shadow:0 32px 80px rgba(0,0,0,.6);overflow:hidden;display:flex;flex-direction:column}
.q-popup-body{overflow-y:auto;-webkit-overflow-scrolling:touch;padding:32px 32px 28px;overscroll-behavior:contain}
.q-popup-close{position:absolute;top:16px;right:16px;width:36px;height:36px;border-radius:50%;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.15);color:#fff;font-size:20px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .15s;z-index:2}
.q-popup-close:hover{background:rgba(255,255,255,.18)}
.q-popup-head{margin-bottom:18px}
.q-popup-tag{display:inline-flex;align-items:center;font-family:var(--mono);font-size:11px;letter-spacing:.14em;text-transform:uppercase;padding:6px 14px;border-radius:var(--r-pill);background:rgba(245,201,123,.12);color:var(--gold);border:1px solid rgba(245,201,123,.3);font-weight:600}
.q-popup-chat{display:flex;flex-direction:column;gap:14px}
.q-popup-chat .chat-bubble{font-size:15px;line-height:1.7;padding:14px 18px;border-radius:14px;max-width:88%}
.q-popup-chat .chat-bubble.user{align-self:flex-end;background:rgba(245,201,123,.16);color:var(--text-bright);border-bottom-right-radius:6px}
.q-popup-chat .chat-bubble.bot{align-self:flex-start;background:rgba(255,255,255,.04);color:var(--text);border:1px solid rgba(255,255,255,.07);border-bottom-left-radius:6px}
.q-popup-figure{display:flex;flex-direction:column;gap:14px}
.q-popup-figure img{display:block;width:100%;max-height:60vh;object-fit:contain;border-radius:12px}
.q-popup-figure video{display:block;width:100%;max-height:60vh;border-radius:12px;background:#000}
.q-popup-figure figcaption{font-family:var(--mono);font-size:12px;color:var(--text-subtle);letter-spacing:.06em;text-align:center}
.q-popup-prompt{margin-top:4px;padding:14px 18px;background:rgba(255,255,255,.03);border:1px solid var(--border);border-radius:12px}
.q-popup-prompt-label{display:block;font-family:var(--mono);font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:var(--text-subtle);margin-bottom:6px}
.q-popup-prompt p{font-family:var(--mono);font-size:13px;line-height:1.65;color:var(--text-bright);margin:0;white-space:pre-wrap}
.q-popup-audio{display:flex;flex-direction:column;align-items:center;gap:16px;padding:8px 0}
.q-popup-audio-wave{width:100%;max-width:480px;aspect-ratio:5/1;border-radius:12px;overflow:hidden;background:rgba(255,255,255,.04);display:flex;align-items:center;justify-content:center}
.q-popup-audio-wave img{max-width:100%;max-height:100%;object-fit:contain;opacity:.85}
.q-popup-audio audio{width:100%;max-width:480px}
.q-popup-audio-stub{font-family:var(--mono);font-size:12px;color:var(--text-subtle);text-align:center;padding:14px 16px;background:rgba(255,255,255,.03);border:1px dashed rgba(255,255,255,.12);border-radius:10px;max-width:480px;width:100%;line-height:1.5}
.q-popup-caption{font-size:14px;color:var(--text-muted);line-height:1.6;text-align:center;max-width:480px;margin:0}
.q-popup-text{font-size:15px;line-height:1.75;color:var(--text)}
.q-popup-video-placeholder{position:relative;width:100%;display:flex;align-items:center;justify-content:center;background:#000;border-radius:12px;overflow:hidden}
.q-popup-video-placeholder img{position:relative;z-index:1;opacity:.85;width:100%;max-height:60vh;object-fit:cover}
.q-popup-play{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;z-index:2;font-size:48px;color:#fff;text-shadow:0 4px 24px rgba(0,0,0,.7);pointer-events:none}
@media(max-width:640px){
  /* QA-FIX (Issue 1): popup must be scrollable on mobile when content
     exceeds viewport. Allow popup container to scroll, give shell a max-height
     based on dvh (dynamic viewport — accounts for mobile browser chrome). */
  .q-popup{padding:0;align-items:flex-start}
  .q-popup-shell{max-height:100dvh;min-height:100dvh;width:100%;border-radius:0;border-left:0;border-right:0}
  .q-popup-body{padding:64px 20px 32px;max-height:100dvh;-webkit-overflow-scrolling:touch}
  .q-popup-close{position:fixed;top:12px;right:12px;width:44px;height:44px;font-size:24px;background:rgba(0,0,0,.7);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);z-index:10}
  .q-popup-chat .chat-bubble{font-size:14px}
  .q-popup-figure img,.q-popup-figure video,.q-popup-video-placeholder img{max-height:70vh}
}
@supports not (height: 100dvh){
  @media(max-width:640px){
    .q-popup-shell{max-height:100vh;min-height:100vh}
    .q-popup-body{max-height:100vh}
  }
}

/* Chat-mock button styling — these are now <button> elements with cursor pointer */
.chat-mock{cursor:pointer;text-align:left;font-family:inherit;width:100%}
.chat-mock-more{margin-top:6px;font-family:var(--mono);font-size:10.5px;letter-spacing:.1em;text-transform:uppercase;color:var(--gold);align-self:flex-start}

/* Compact savings stats — used in "Дешевле подписок" section instead of huge 3D image */
.savings-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; max-width: 880px; margin: 24px auto 0;
}
.savings-stat {
  text-align: center;
  padding: 28px 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--bg-card);
}
.savings-stat-accent {
  border-color: rgba(245,201,123,.4);
  background: linear-gradient(180deg, rgba(245,201,123,.08), transparent 65%);
}
.savings-stat-num {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-bright);
}
.savings-stat-accent .savings-stat-num { color: var(--gold) }
.savings-stat-label {
  margin-top: 8px;
  font-family: var(--mono); font-size: 11px;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-subtle);
}
@media (max-width: 640px) {
  .savings-stats { grid-template-columns: 1fr; gap: 12px }
}

/* ============================================================
   FOOTER — massive, premium, multi-column (Apple/Linear-tier)
   ============================================================ */
footer {
  position: relative;
  background: linear-gradient(180deg, var(--bg) 0%, #030303 100%);
  border-top: 1px solid var(--border);
  padding: 96px 0 36px;
  overflow: hidden;
}
footer::before {
  content: "";
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 80%; max-width: 1100px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: .4;
}
footer::after {
  content: "";
  position: absolute; top: -200px; left: 50%; transform: translateX(-50%);
  width: 600px; height: 400px; pointer-events: none;
  background: radial-gradient(ellipse, rgba(245,201,123,.08), transparent 65%);
  filter: blur(40px);
}
footer .container { position: relative; z-index: 1 }

.foot-top {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 64px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border);
}
/* Legacy .foot-grid → behave as .foot-top */
.foot-grid {
  display: grid !important;
  grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 64px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border);
  align-items: start !important;
}

.foot-brand { display: flex; flex-direction: column; gap: 20px; max-width: 320px }
.foot-brand .nav-logo { font-size: 24px; color: var(--text-bright); gap: 12px }
.foot-brand .nav-logo svg { width: 32px; height: 32px }
.foot-tagline {
  font-size: 14px; color: var(--text-muted); line-height: 1.6;
}
.foot-social {
  display: flex; gap: 10px; margin-top: 8px;
}
.foot-social a {
  width: 40px; height: 40px; border-radius: var(--r-pill);
  background: var(--bg-card); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 16px;
  transition: all var(--duration-fast) var(--ease-spring);
}
.foot-social a:hover {
  color: var(--gold); border-color: var(--gold);
  transform: translateY(-2px);
  background: rgba(245,201,123,.06);
}

.foot-col { display: flex; flex-direction: column; align-items: flex-start }
.foot-col h4 {
  display: block !important;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
}
.foot-col ul {
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  font-size: 14px;
  align-items: flex-start !important;
}
.foot-col a {
  color: var(--text-muted); font-weight: 500;
  transition: all var(--duration-fast) var(--ease-spring);
  position: relative;
}
.foot-col a:hover { color: var(--gold); transform: translateX(3px) }
.foot-desc {
  display: block;
  font-size: 14px; color: var(--text-muted);
  line-height: 1.6; margin-top: 8px;
  max-width: 320px;
}

/* Bottom bar — legal + language */
.foot-bottom {
  display: flex; justify-content: space-between; align-items: center;
  gap: 24px; flex-wrap: wrap;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  font-family: var(--mono);
  color: var(--text-subtle);
  letter-spacing: .02em;
}
.foot-bottom-left { display: flex; align-items: center; gap: 16px; flex-wrap: wrap }
.foot-bottom-right { display: flex; align-items: center; gap: 24px; flex-wrap: wrap }
.foot-bottom a {
  color: var(--text-muted);
  transition: color .2s;
  text-decoration: none;
}
.foot-bottom a:hover { color: var(--gold) }

/* Responsive */
@media (max-width: 1080px) {
  .foot-top, .foot-grid { grid-template-columns: 1fr 1fr 1fr; gap: 40px }
  .foot-brand { grid-column: 1 / -1; max-width: none; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; padding-bottom: 32px; margin-bottom: 8px; border-bottom: 1px solid var(--border) }
  .foot-tagline { max-width: 400px }
}
@media (max-width: 720px) {
  footer { padding: 72px 0 28px }
  .foot-top, .foot-grid { grid-template-columns: 1fr 1fr; gap: 32px; padding-bottom: 40px; margin-bottom: 24px }
  .foot-brand { grid-column: 1 / -1; flex-direction: column; align-items: flex-start; gap: 16px }
  .foot-bottom { flex-direction: column; align-items: flex-start; gap: 12px }
}

/* ============================================================
   PAGE HERO (sub-pages)
   ============================================================ */
.page-hero {
  padding: 140px 0 64px; text-align: center;
  position: relative; overflow: hidden;
}
.page-hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 800px 400px at 50% 30%, rgba(245,201,123,.08), transparent 60%);
}
.page-hero .container { position: relative; z-index: 2 }
.page-hero h1 { font-size: clamp(40px, 5.5vw, 68px); margin-bottom: 16px }
.page-hero p { font-size: 17px; max-width: 600px; margin: 0 auto }

/* === Breadcrumb === */
.breadcrumb {
  font-family: var(--mono); font-size: 12px; color: var(--text-subtle);
  display: flex; gap: 8px; align-items: center; margin-bottom: 20px;
  justify-content: center;
}
.breadcrumb a { color: var(--text-muted); transition: color .2s }
.breadcrumb a:hover { color: var(--gold) }
.breadcrumb .sep { opacity: .3 }

/* ============================================================
   SCROLL REVEAL (JS-driven)
   ============================================================ */
.reveal {
  opacity: 0; transform: translateY(40px);
  transition: opacity 800ms var(--ease-out-expo), transform 800ms var(--ease-out-expo);
}
.reveal.visible { opacity: 1; transform: translateY(0) }
.reveal-delay-1 { transition-delay: 100ms }
.reveal-delay-2 { transition-delay: 200ms }
.reveal-delay-3 { transition-delay: 300ms }
.reveal-delay-4 { transition-delay: 400ms }

/* ============================================================
   UTILITIES
   ============================================================ */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr) } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr } }
.text-center { text-align: center }
.mx-auto { margin-left: auto; margin-right: auto }
.mt-16 { margin-top: 16px }
.mt-24 { margin-top: 24px }
.mt-40 { margin-top: 40px }
.mt-56 { margin-top: 56px }
.gap-12 { gap: 12px }
.gap-24 { gap: 24px }
.gap-32 { gap: 32px }
.flex-center { display: flex; align-items: center; justify-content: center }
.inline-flex { display: inline-flex; align-items: center }

/* Noise overlay (fixed, GPU-safe) */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 9999;
  pointer-events: none; opacity: .025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============================================================
   GLOBAL POLISH — alignment, images, cards coherence
   ============================================================ */

/* Bulletproof image defaults — no drift, no overflow */
img { max-width: 100%; height: auto; display: block }

/* Hero backgrounds — consistent behavior across pages */
.hero-bg-img,
.hero-bg-image,
.contests-hero-bg,
.pricing-hero .hero-bg-img,
.models-hero-bg,
.tutorials-hero-bg,
.gallery-hero-bg,
.blog-hero .hero-bg-img,
.referral-hero .hero-bg-img,
.faq-hero .hero-bg-img {
  position: absolute !important; inset: 0 !important;
  width: 100% !important; height: 100% !important;
  object-fit: cover !important; object-position: center !important;
  opacity: .35 !important;
  pointer-events: none; z-index: 0 !important;
}
/* Ensure content above bg */
.hero .container,
.hero-wrap .container,
section .container { position: relative; z-index: 2 }

/* Cover images inside cards — uniform */
.post-cover img,
.blog-cover img,
.featured-cover img,
.related-cover img,
.tutorial-cover img,
.contest-card-cover img,
.masonry-placeholder img,
.winner-thumb img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block;
}

/* Avatars — consistent circular framing */
.test-avatar,
.testimonial-avatar,
.author-avatar,
.author-ava,
.winner-thumb img,
img.avatar {
  object-fit: cover; object-position: center;
}
.test-avatar, .testimonial-avatar, img.avatar {
  border-radius: 50%;
}

/* Use-case icons — 1.5× of 144 = 216px so visual читается с расстояния */
.usecase-icon-img {
  width: 216px !important;
  height: 216px !important;
  border-radius: 24px;
  margin-bottom: 24px !important;
}

/* Icons/tiles — centered, contained */
.cap-icon-img,
.tier-img,
.usecase-icon-img,
.payment-icon-img,
.faq-topic-icon,
.pay-icon-img,
.stat-icon-img,
.feature-extra-icon,
.referral-cond-icon,
.contest-rule-icon {
  display: block;
  margin-left: auto; margin-right: auto;
  object-fit: contain; object-position: center;
}

/* Tier hero wrap — consistent height + center */
.tier-img-wrap,
.price-card-img-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 140px; margin-bottom: 20px;
}
.tier-img-wrap img,
.price-card-img-wrap img {
  max-height: 140px; width: auto;
  filter: drop-shadow(0 12px 40px rgba(245,201,123,.18));
}

/* Card inner consistency — text alignment */
.card { text-align: left }
.card.text-center { text-align: center }
.price-card { text-align: left }
.price-card.text-center,
.usecase-card,
.test-card,
.testimonial-card,
.faq-item,
.contest-card,
.payment-card,
.topup-card,
.discount-card,
.path-card,
.cat-tile,
.stat-card { text-align: center }
.blog-card, .post-card, .tutorial-card, .related-card { text-align: left }

/* Body paragraphs — improved readability */
p { color: var(--text-muted) }
.hero-sub, .section-head p, .section-sub { color: var(--text-muted) }
.card p, .bezel-inner p { color: var(--text-muted) }
section p strong, .article-body p strong { color: var(--text-bright); font-weight: 600 }

/* Headings — consistent brightness */
h1, h2, h3, h4, h5, h6 { color: var(--text-bright) }

/* List items readability */
.price-card li,
.feature-list li,
.path-card li,
.rules-list li { color: var(--text) }

/* Meta / mono — subtle but readable */
.post-meta, .blog-meta, .contest-meta, .article-meta,
.foot-bottom, .breadcrumb { color: var(--text-subtle) }

/* Links in paragraphs — gold underline on hover */
p a, article a:not(.btn) {
  color: var(--gold); text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
p a:hover, article a:hover:not(.btn) { border-color: var(--gold) }

/* Fix any accidental unstyled img float */
section img { vertical-align: middle }

/* Consistent eyebrow alignment above H1/H2 */
.eyebrow + h1, .eyebrow + h2 { margin-top: 16px }

/* Cards should have consistent min-height to avoid stair-step grids */
.grid-3 > .card,
.grid-4 > .card { height: 100% }
.grid-3 > .card > *,
.grid-4 > .card > * { max-width: 100% }

/* Testimonial card inner balance */
.test-card .test-quote,
.testimonial-card .testimonial-quote { color: var(--text); font-size: 15px; line-height: 1.6 }
.test-author, .testimonial-author { color: var(--text-bright) }
.test-role, .testimonial-role { color: var(--text-subtle); font-size: 13px }

/* Stars ratings — gold */
.stars, .rating-stars { color: var(--gold); letter-spacing: 2px }

/* Section head — centered when .text-center or when inside a centered section */
.section-head.text-center { text-align: center }
.section-head.text-center p { margin-left: auto; margin-right: auto }

/* Remove any leftover gradient avatars when <img> is present */
.test-avatar[style*="background:linear-gradient"] img,
.testimonial-avatar[style*="background:linear-gradient"] img,
.author-avatar[style*="background:linear-gradient"] img {
  position: relative; z-index: 1;
  border-radius: inherit;
}

/* Comparison table readability */
.compare-table td, .comp-table td { color: var(--text) }
.compare-table td:first-child, .comp-table td:first-child { color: var(--text-bright); font-weight: 500 }
.compare-check { color: var(--gold); font-weight: 600 }
.compare-total td { color: var(--text-bright) !important; font-weight: 700; background: rgba(245,201,123,.05) }

/* Prevent overlapping hero text on low-opacity bg */
.hero h1, .hero .hero-sub,
.page-hero h1, .page-hero p,
section h1, section h2 { text-shadow: 0 2px 20px rgba(0,0,0,.4) }

/* ============================================================
   POLISH PASS — final alignment + consistency patches
   ============================================================ */

/* .section-header — alias for .section-head (used on pricing/referral) */
.section-header { margin-bottom: 56px; text-align: center }
.section-header .eyebrow { margin-bottom: 16px }
.section-header h1, .section-header h2 { margin-top: 16px }
.section-header .section-sub,
.section-header p { max-width: 620px; margin: 16px auto 0; font-size: 17px; color: var(--text-muted) }
.section-sub { color: var(--text-muted) }

/* Gallery placeholders — ensure image fills and the leftover gradient is masked */
.gallery-placeholder,
.masonry-placeholder,
.featured-cover,
.blog-cover,
.post-cover,
.related-cover,
.tut-cover,
.img-placeholder { position: relative; overflow: hidden }
.gallery-placeholder > img,
.masonry-placeholder > img,
.featured-cover > img,
.blog-cover > img,
.post-cover > img,
.related-cover > img,
.tut-cover > img,
.img-placeholder > img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  z-index: 1;
}

/* Uniform cap-thumb inside bezel (capability cards) — enforce consistent size */
.cap-thumb {
  width: 120px; height: 120px;
  object-fit: cover;
  border-radius: var(--r-lg);
  margin-bottom: 16px;
  display: block;
}

/* Use case icon images — uniform size across the grid (1.5× of 144 = 216) */
.usecase-icon-img {
  width: 216px !important; height: 216px !important;
  border-radius: 24px;
  object-fit: cover;
}

/* Testimonial avatars — drop legacy gradient backgrounds when <img> is the child */
.test-avatar { background: transparent !important }
.test-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block }
.test-avatar.av1, .test-avatar.av2, .test-avatar.av3,
.test-avatar.av4, .test-avatar.av5, .test-avatar.av6 { background: transparent !important }

/* Author avatars on post/tutorial pages — allow image child to cover gradient */
.author-avatar img, .author-avatar-lg img {
  width: 100%; height: 100%; border-radius: 50%;
  object-fit: cover; display: block;
}

/* Hero stats — icon + number alignment */
.hero-stat { display: flex; flex-direction: column; align-items: center; gap: 2px }
.stat-mini-icon { width: 40px; height: 40px; object-fit: contain; margin: 0 auto 6px }

/* Tier image — enforce identical 120px height everywhere */
.tier-img { height: 120px !important; width: auto; max-width: 200px; object-fit: contain }

/* Card grid row equal heights */
.grid-2 > .card, .grid-2 > .bezel,
.grid-3 > .card, .grid-3 > .bezel,
.grid-4 > .card, .grid-4 > .bezel,
.pricing-grid > .card,
.topup-grid > .card,
.discount-grid > .card,
.payment-grid > .card { height: 100% }

/* Bezel-inner fills parent evenly inside grid */
.grid-2 > .bezel, .grid-3 > .bezel, .grid-4 > .bezel { display: flex }
.grid-2 > .bezel > .bezel-inner,
.grid-3 > .bezel > .bezel-inner,
.grid-4 > .bezel > .bezel-inner { flex: 1; width: 100% }

/* Price cards stretch buttons to bottom */
.price-card { display: flex; flex-direction: column }
.price-card > ul { flex: 1 }
.price-card .btn { margin-top: auto; justify-content: center }

/* Payment icons — consistent 72px centered */
.payment-icon-img { width: 72px !important; height: 72px !important; object-fit: contain; margin: 0 auto 16px }

/* Tutorial cover badges readability */
.tut-cover .diff-badge { background: rgba(5,5,5,.7); backdrop-filter: blur(8px) }

/* Related cover inner image force cover */
.related-card .related-cover { aspect-ratio: 16/10; border-radius: var(--r-lg); overflow: hidden }

/* Referral step images — uniform */
.referral-step-img,
.referral-cond-icon,
.contest-rule-icon,
.faq-topic-icon,
.feature-extra-icon { display: block; margin: 0 auto }

/* Ensure p strong uses bright */
p strong, li strong { color: var(--text-bright) }

/* Meta readability bump (was text-subtle ~4.8:1) */
.post-meta, .blog-meta, .contest-meta, .article-meta { color: var(--text-muted) }

/* Prevent text shadow smothering on regular section copy */
section p { text-shadow: none }

/* ============================================================
   HERO STATS — clean icon-based row (replaces photo thumbnails)
   ============================================================ */
.hero-stats { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; align-items: center; justify-items: center; gap: 0; margin: 64px auto 0; max-width: 1080px }
.hero-stat { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0 16px; width: 100%; box-sizing: border-box }
.hero-stat .stat-icon {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-pill);
  background: rgba(245,201,123,.06); border: 1px solid var(--border-gold);
  color: var(--gold);
  margin-bottom: 2px;
}
.hero-stat .stat-icon img { width: 24px; height: 24px; filter: none; opacity: .95 }
.hero-stat strong { display: block; font-family: var(--font-display); font-size: 30px; font-weight: 700; color: var(--text-bright); line-height: 1 }
.hero-stat .stat-label { font-size: 12px; color: var(--text-muted); font-family: var(--mono); letter-spacing: .04em; text-transform: none; text-align: center }
.hero-stat-sep { width: 1px; height: 52px; background: linear-gradient(transparent, var(--border-strong), transparent) }
@media (max-width: 768px) {
  .hero-stats { grid-template-columns: 1fr 1fr; row-gap: 28px; column-gap: 0 }
  .hero-stat { padding: 12px 8px }
  .hero-stat-sep { display: none }
}

/* ============================================================
   MODELS TABLE — readability fix
   ============================================================ */
.models-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15px }
.models-table th,
.models-table td {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}
.models-table th {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: .15em; text-transform: uppercase;
  color: var(--text-subtle);
}
.models-table .provider-cell {
  color: var(--text-bright); font-weight: 600;
  font-size: 15px;
  font-family: var(--font);
  letter-spacing: -.005em;
  display: flex; align-items: center; gap: 10px;
}
.models-table .model-name {
  color: var(--text); font-weight: 500;
  font-size: 15px;
  font-family: var(--font);
  letter-spacing: -.005em;
}
.models-table tr:hover td { background: rgba(255,255,255,.02) }
.models-table tr:last-child td { border-bottom: 0 }
.tier-badge {
  display: inline-block; padding: 3px 10px; border-radius: var(--r-pill);
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  letter-spacing: .15em; text-transform: uppercase;
}
.tier-badge.standard { background: rgba(255,255,255,.05); color: var(--text-muted); border: 1px solid var(--border) }
.tier-badge.pro { background: rgba(245,201,123,.12); color: var(--gold); border: 1px solid var(--border-gold) }

/* ============================================================
   PRICING GRID — 5 tiers equal width at wide, balanced collapse
   ============================================================ */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr) !important;
  gap: 18px;
  align-items: stretch;
}
.pricing-grid .price-card {
  padding: 28px 24px;
  min-height: 100%;
}
.pricing-grid .tier-img-wrap {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 180px;
  margin: -12px 0 16px;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(245,201,123,.04), transparent 70%);
}
.pricing-grid .tier-img {
  height: 100% !important; width: 100% !important;
  max-height: none !important; max-width: none !important;
  object-fit: cover !important; object-position: center;
  filter: none;
}
.pricing-grid .price-card .plan-name { font-size: 20px; margin-top: 4px }
.pricing-grid .price-card .price { font-size: 30px }
.pricing-grid .price-card ul { margin: 16px 0; gap: 8px; font-size: 13px }
.pricing-grid .price-card li { font-size: 13px; color: var(--text) }
.pricing-grid .price-card .btn { padding: 12px 18px; font-size: 13px; justify-content: center; width: 100% }
@media (max-width: 1280px) { .pricing-grid { grid-template-columns: repeat(3, 1fr) !important } }
@media (max-width: 840px)  { .pricing-grid { grid-template-columns: repeat(2, 1fr) !important } }
@media (max-width: 560px)  { .pricing-grid { grid-template-columns: 1fr !important } }

/* ============================================================
   FOOTER FIX — restore columns, real SVG socials, proper rhythm
   ============================================================ */
.foot-top, .foot-grid {
  display: grid !important;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr !important;
  gap: 56px !important;
  align-items: start !important;
  padding-bottom: 56px !important;
  margin-bottom: 32px !important;
  border-bottom: 1px solid var(--border) !important;
}
.foot-brand { display: flex; flex-direction: column; gap: 18px; align-items: flex-start !important; max-width: 340px }
.foot-brand .nav-logo { font-size: 22px; color: var(--text-bright) }
.foot-brand .nav-logo svg { width: 28px; height: 28px }
.foot-tagline { font-size: 14px; color: var(--text-muted); line-height: 1.7; margin-top: 4px }
.foot-social { display: flex; gap: 10px; margin-top: 8px }
.foot-social a {
  width: 42px; height: 42px; border-radius: var(--r-pill);
  background: rgba(255,255,255,.03); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: all var(--duration-fast) var(--ease-spring);
}
.foot-social a:hover {
  color: var(--gold); border-color: var(--gold);
  background: rgba(245,201,123,.06);
  transform: translateY(-2px);
}
.foot-social a svg { width: 18px; height: 18px }

.foot-col {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 0 !important;
}
.foot-col h4 {
  display: block !important;
  font-family: var(--mono) !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  letter-spacing: .2em !important;
  text-transform: uppercase !important;
  color: var(--gold) !important;
  margin-bottom: 22px !important;
}
.foot-col ul {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 14px !important;
  font-size: 14px;
  width: 100%;
}
.foot-col a {
  color: var(--text-muted) !important;
  font-weight: 500;
  transition: color var(--duration-fast) var(--ease-spring), transform var(--duration-fast) var(--ease-spring);
  display: inline-block;
  line-height: 1.3;
}
.foot-col a:hover { color: var(--gold) !important; transform: translateX(3px) }

.foot-bottom {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  font-family: var(--mono);
  color: var(--text-subtle);
  letter-spacing: .02em;
}
.foot-bottom-left, .foot-bottom-right { display: flex; align-items: center; gap: 20px; flex-wrap: wrap }
.foot-bottom a { color: var(--text-muted); transition: color .2s }
.foot-bottom a:hover { color: var(--gold) }

@media (max-width: 1080px) {
  .foot-top, .foot-grid { grid-template-columns: 1fr 1fr 1fr !important; gap: 40px !important }
  .foot-brand { grid-column: 1 / -1; max-width: none; margin-bottom: 16px; padding-bottom: 32px; border-bottom: 1px solid var(--border) }
  .foot-brand { flex-direction: row; align-items: flex-start !important; justify-content: space-between; flex-wrap: wrap; gap: 24px }
  .foot-tagline { max-width: 460px }
}
@media (max-width: 720px) {
  footer { padding: 64px 0 28px }
  .foot-top, .foot-grid { grid-template-columns: 1fr 1fr !important; gap: 32px !important }
  .foot-brand { flex-direction: column; gap: 14px }
  .foot-bottom { flex-direction: column; align-items: flex-start; gap: 14px }
}

/* ============================================================
   BRAND LOGOS — provider logos in trust bar and model cards
   ============================================================ */
.trust-logos {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  align-items: center; justify-items: center;
  gap: 0;
  padding: 40px 0;
  opacity: .9;
  max-width: 1280px; margin-left: auto; margin-right: auto;
  transition: opacity .3s var(--ease-spring);
}
.trust-logos:hover { opacity: 1 }
.trust-logo {
  color: var(--text-bright);
  transition: opacity .2s, transform .2s;
  display: inline-flex; align-items: center; justify-content: center;
  height: 48px; width: 100%; max-width: none;
}
.trust-logo:hover { transform: translateY(-2px) }
.trust-logo:hover { color: var(--gold) }
.trust-logo svg,
.trust-logo img {
  height: 100%; width: auto; max-width: 100%;
  object-fit: contain; display: block;
}
.trust-label {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--text-subtle); text-align: center;
  margin-bottom: 24px;
}

/* Inline logo inside provider cards on models.html / index providers section */
.provider-logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; padding: 12px;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(245,201,123,.16), rgba(245,201,123,.06));
  border: 1px solid rgba(245,201,123,.45);
  box-shadow: 0 6px 20px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.1);
  color: #fff;
  margin-bottom: 18px;
  flex-shrink: 0;
}
.provider-logo svg,
.provider-logo img {
  width: 100%; height: 100%; object-fit: contain;
}

/* Smaller inline logo for table rows */
.provider-logo-sm {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  color: #fff; flex-shrink: 0;
  vertical-align: middle; margin-right: 10px;
}
.provider-logo-sm svg,
.provider-logo-sm img { width: 100%; height: 100%; object-fit: contain }

/* feat-models block — table inserted inside each capability section */
.feat-models-block { margin-top: 28px; }
.feat-models-title { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--text-bright); margin: 0 0 14px; opacity: .85 }
.feat-models-block .bezel { margin: 0 }

/* feat-examples — мини-галерея под каждой возможностью */
.feat-examples { margin-top: 28px; }
.feat-examples-title { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--text-bright); margin: 0 0 14px; opacity: .85 }
.feat-examples-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px }
@media (max-width: 760px) { .feat-examples-grid { grid-template-columns: 1fr } }
.feat-example { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: var(--bg-card); cursor: pointer; transition: transform .2s, border-color .2s }
.feat-example:hover { transform: translateY(-2px); border-color: var(--border-strong) }
.feat-example img { display: block; width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4/3 }
.feat-example .fe-tag { position: absolute; left: 10px; top: 10px; font-family: var(--mono); font-size: 10px; letter-spacing: .05em; padding: 4px 9px; border-radius: 999px; background: rgba(8,7,5,.78); color: var(--text-bright); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.15) }
.feat-example .fe-caption { padding: 12px 14px; font-size: 13px; color: var(--text-muted); line-height: 1.45 }
.feat-example.fe-text { padding: 16px 18px 14px; display: flex; flex-direction: column; gap: 8px; aspect-ratio: auto }
.feat-example.fe-text .fe-q { font-family: var(--font-display); font-size: 14px; font-weight: 600; color: var(--text-bright); line-height: 1.35 }
.feat-example.fe-text .fe-a { font-size: 13px; color: var(--text-muted); line-height: 1.5 }
.feat-example.fe-audio { display: flex; flex-direction: column; aspect-ratio: auto }
.feat-example.fe-audio .fe-art { position: relative; aspect-ratio: 16/9; background: linear-gradient(135deg, rgba(245,201,123,.16), rgba(180,123,245,.12)); display: flex; align-items: center; justify-content: center; font-size: 28px; color: var(--gold) }
.feat-example.fe-audio audio { width: 100%; margin-top: 10px }
.feat-examples-link { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin-top: 16px; display: inline-block; transition: transform .2s }
.feat-examples-link:hover { transform: translateX(4px) }

@media (max-width: 768px) {
  .trust-logos { gap: 36px }
  .trust-logo { height: 36px }
}

/* =====================================================================
   MOBILE OVERHAUL — comprehensive pass for ≤960px / ≤480px
   ===================================================================== */

/* Prevent iOS auto-zoom on input focus (font-size must be ≥16px) */
@media (max-width: 760px){
  input[type="text"], input[type="email"], input[type="tel"], input[type="number"],
  input[type="search"], input[type="url"], input[type="password"], input[type="datetime-local"],
  select, textarea {
    font-size: 16px !important;
  }
}

/* ---------- Hamburger menu (replaces hidden nav-links at ≤960px) ---------- */
.nav-burger{display:none;background:transparent;border:0;width:44px;height:44px;align-items:center;justify-content:center;cursor:pointer;border-radius:var(--r-pill);transition:background .15s;padding:0;margin-right:4px;-webkit-tap-highlight-color:transparent}
.nav-burger:hover,.nav-burger:focus-visible{background:rgba(255,255,255,.08);outline:0}
.nav-burger svg{width:22px;height:22px;color:var(--text)}
.nav-burger:hover svg,.nav-burger[aria-expanded="true"] svg{color:var(--gold)}

.mobile-drawer{position:fixed;top:0;right:0;bottom:0;width:min(86vw,360px);background:rgba(8,7,5,.98);backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);border-left:1px solid rgba(255,255,255,.08);transform:translateX(100%);transition:transform .32s var(--ease-spring);z-index:2000;display:flex;flex-direction:column;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:env(safe-area-inset-top,20px) 0 env(safe-area-inset-bottom,20px) 0}
.mobile-drawer.open{transform:translateX(0)}
.mobile-drawer-head{display:flex;align-items:center;justify-content:space-between;padding:18px 22px;border-bottom:1px solid rgba(255,255,255,.06)}
.mobile-drawer-head .drawer-brand{font-family:var(--font-display);font-size:18px;color:var(--text-bright);font-weight:600}
.mobile-drawer-close{width:44px;height:44px;background:transparent;border:0;color:var(--text);font-size:20px;cursor:pointer;border-radius:50%;display:flex;align-items:center;justify-content:center;transition:background .15s;-webkit-tap-highlight-color:transparent}
.mobile-drawer-close:hover{background:rgba(255,255,255,.08);color:var(--gold)}
.mobile-drawer-nav{display:flex;flex-direction:column;padding:14px 18px;flex:1}
.mobile-drawer-nav a{display:flex;align-items:center;padding:14px 16px;color:var(--text);font-size:17px;font-weight:500;border-radius:12px;text-decoration:none;transition:background .15s,color .15s;min-height:48px}
.mobile-drawer-nav a:hover,.mobile-drawer-nav a:active,.mobile-drawer-nav a.active{background:rgba(245,201,123,.08);color:var(--gold)}
.mobile-drawer-foot{padding:18px 22px;border-top:1px solid rgba(255,255,255,.06);display:flex;flex-direction:column;gap:12px}
.mobile-drawer-foot .btn{width:100%;justify-content:center;min-height:48px;font-size:15px}
.mobile-drawer-foot .lang-row{display:flex;gap:8px;justify-content:center;align-items:center;font-family:var(--mono);font-size:12px;color:var(--text-subtle);letter-spacing:.06em;padding-top:6px}
.mobile-drawer-foot .lang-row a{color:var(--text-muted);padding:6px 12px;border-radius:var(--r-pill);text-decoration:none;transition:all .15s}
.mobile-drawer-foot .lang-row a:hover{color:var(--gold);background:rgba(245,201,123,.08)}
.mobile-drawer-foot .lang-row a.active{color:var(--text);font-weight:600}

.mobile-drawer-scrim{position:fixed;inset:0;background:rgba(0,0,0,.6);opacity:0;visibility:hidden;transition:opacity .25s,visibility .25s;z-index:1999;backdrop-filter:blur(2px)}
.mobile-drawer-scrim.open{opacity:1;visibility:visible}

@media (max-width: 960px){
  .nav-burger{display:inline-flex}
  /* Hide nav lang-switch on mobile — it's in the drawer instead */
  .lang-switch{display:none}
}
body.drawer-open{overflow:hidden}

/* ---------- Hero (index.html) ---------- */
@media (max-width: 760px){
  .hero{padding-top:90px;padding-bottom:48px}
  .hero h1{font-size:clamp(34px,9vw,46px);line-height:1.05}
  .hero-sub{font-size:15px;line-height:1.55;padding:0 4px}
  .hero-buttons{flex-direction:column;width:100%;gap:10px}
  .hero-buttons .btn{width:100%;justify-content:center;min-height:48px;font-size:15px}
  /* Hero stats: stack 2×2 grid instead of 4 columns */
  .hero-stats{display:grid;grid-template-columns:1fr 1fr;gap:14px;padding:24px 0 0;margin-top:24px;border-top:1px solid var(--border)}
  .hero-stats::before,.hero-stats::after{display:none}
  .hero-stat-divider{display:none}
  .hero-stat{padding:8px 4px;text-align:left;border-left:2px solid rgba(245,201,123,.25);padding-left:14px}
  .hero-stat .stat-icon{width:24px;height:24px}
  .hero-stat .stat-num{font-size:22px}
  .hero-stat .stat-label{font-size:11px}
}
@media (max-width: 480px){
  .hero h1{font-size:34px}
  .hero-stats{grid-template-columns:1fr 1fr;gap:10px}
}

/* ---------- Sections padding ---------- */
@media (max-width: 760px){
  .section{padding:48px 0}
  section .container,main .container{padding-left:18px;padding-right:18px}
  .section-head h2,h2{font-size:clamp(26px,6vw,34px);line-height:1.1}
  .section-head p{font-size:15px}
}

/* ---------- Cards / grids ---------- */
@media (max-width: 600px){
  .card{padding:24px 20px}
  .card h3{font-size:18px}
  .card p{font-size:14px}
  .grid-2,.grid-3,.grid-4{gap:16px}
  .gap-24{gap:16px}
}

/* ---------- Sticky filter bar — tighter on mobile ---------- */
@media (max-width: 760px){
  .sticky-filter-bar{margin-left:-18px !important;margin-right:-18px !important;border-radius:0 !important;padding:10px 14px !important;max-width:none !important;width:auto !important;box-shadow:0 1px 0 var(--border) !important}
  .sticky-filter-bar .chips{flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none;padding-bottom:2px}
  .sticky-filter-bar .chips::-webkit-scrollbar{display:none}
  .chip{flex-shrink:0;min-height:36px;padding:8px 14px;font-size:13px}
}

/* ---------- Gallery masonry ---------- */
@media (max-width: 600px){
  .masonry{columns:1 !important;column-gap:12px}
  .masonry-item{margin-bottom:12px}
  .masonry-tag{font-size:11px;padding:6px 12px;min-height:28px}
}
@media (min-width: 601px) and (max-width: 960px){
  .masonry{columns:2 !important}
}

/* ---------- Blog & tutorial cards ---------- */
@media (max-width: 600px){
  .blog-grid,.tut-grid{grid-template-columns:1fr !important}
  .blog-card h3,.tut-card h3,.tut-title{font-size:18px;line-height:1.25}
  .blog-body,.tut-body{padding:18px 20px 22px}
  .featured-inner{grid-template-columns:1fr !important}
  .featured-body{padding:24px 22px}
}

/* ---------- Pricing & comparison tables — horizontal scroll wrapper ---------- */
@media (max-width: 768px){
  .compare-table,.pricing-table{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch;white-space:nowrap;border-radius:12px;border:1px solid var(--border)}
  .compare-table table,.pricing-table table{min-width:600px;white-space:normal}
  /* Direct table style fallback */
  table.compare-table,table.pricing-table{display:block}
  table.compare-table tbody,table.pricing-table tbody,
  table.compare-table thead,table.pricing-table thead{display:table;width:100%;table-layout:auto;white-space:normal;min-width:600px}
}

/* Tap-friendly chips, pills, badges */
@media (max-width: 760px){
  .chip,.tag-pill,.filter-chip{min-height:38px;padding:9px 14px;font-size:13px}
  .btn-sm{min-height:44px;padding:10px 18px;font-size:13px}
}

/* ---------- Footer — stack columns ---------- */
@media (max-width: 760px){
  footer{padding:48px 0 24px}
  .foot-grid{grid-template-columns:1fr 1fr !important;gap:28px 20px}
  .foot-col h4{font-size:13px;margin-bottom:12px}
  .foot-col ul{gap:10px}
  .foot-col li{font-size:14px}
  .foot-brand{grid-column:1/-1;margin-bottom:8px}
  .foot-tagline{max-width:none}
  .foot-bottom{flex-direction:column;gap:14px;align-items:flex-start;padding-top:20px}
  .foot-bottom-right{flex-wrap:wrap;gap:14px}
}
@media (max-width: 420px){
  .foot-grid{grid-template-columns:1fr !important;gap:24px}
}

/* ---------- Forms — touch-friendly ---------- */
@media (max-width: 760px){
  .form-row input,.form-row textarea,.form-row select,
  input[type="text"],input[type="email"],input[type="tel"],input[type="datetime-local"],textarea,select{
    min-height:48px;padding:14px 16px;font-size:16px;border-radius:12px
  }
  textarea{min-height:120px;line-height:1.5}
  .form-row label{font-size:13px;margin-bottom:8px}
  .form-row button[type="submit"],.form-row .btn{width:100%;min-height:48px}
}

/* ---------- FAQ — bigger tap area ---------- */
@media (max-width: 760px){
  .faq-q,.faq-item summary,.faq-item .faq-q{min-height:54px;padding:16px 18px;font-size:15px;line-height:1.35}
  .faq-item .faq-a,.faq-item p{font-size:15px;line-height:1.6;padding:0 18px 16px}
}

/* ---------- Featured / feature alt rows on mobile ---------- */
@media (max-width: 768px){
  .feat-alt-row,.feat-alt-row.reverse{grid-template-columns:1fr !important;gap:24px}
  .feat-alt-media img{max-width:80%;margin:0 auto;display:block}
  .feat-alt-body{text-align:left}
  .feat-alt-examples{grid-template-columns:1fr 1fr !important;gap:10px}
}

/* ---------- CTA buttons — full width on mobile ---------- */
@media (max-width: 480px){
  .btn-lg{width:100%;justify-content:center;min-height:50px;font-size:15px}
  .cta-block .btn{width:auto;min-width:240px}
}

/* ---------- Article body (blog/tutorial pages) ---------- */
/* QA-FIX: article hero H1 max 2 lines with ellipsis everywhere */
.article-hero h1{
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;
  overflow:hidden;text-overflow:ellipsis;
  max-width:22ch;margin-left:auto;margin-right:auto;
  hyphens:auto;line-height:1.1
}
@media (max-width: 768px){
  .article-hero{padding-top:100px}
  .article-hero h1{font-size:clamp(28px,6.5vw,34px);max-width:18ch}
  .article-cover{margin-top:24px;aspect-ratio:16/10}
  .article-layout{grid-template-columns:1fr !important;gap:32px;padding:32px 0 56px}
  .sidebar{position:static !important;order:2}
  .toc-card,.sidebar-cta{padding:20px}
  .article-body{font-size:16px}
  .article-body h2{font-size:22px;margin:32px 0 14px}
  .article-body h3{font-size:18px}
  .compare-table{font-size:13px}
}

/* ---------- Tap-state polish ---------- */
@media (hover: none){
  .card:active,.blog-card:active,.tut-card:active,.gallery-item:active{transform:scale(.98);transition:transform .12s}
  .btn:active{transform:scale(.97)}
}

/* ---------- Respect reduced-motion preference ---------- */
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}
  .reveal{opacity:1 !important;transform:none !important}
}

/* ---------- Safe-area awareness for fixed nav and CTAs ---------- */
.nav-wrap{padding-left:max(14px,env(safe-area-inset-left));padding-right:max(14px,env(safe-area-inset-right))}

/* =====================================================================
   QA-FIX PASS — visual issues found during mobile audit (375px)
   ===================================================================== */

/* QA-FIX: html-level overflow clip — body alone wasn't enough on iOS Safari
   when fixed/translated elements (drawer, scrim) create new containing
   blocks that escape body's overflow-x:hidden */
html{overflow-x:clip}
@supports not (overflow-x: clip){
  html{overflow-x:hidden}
}

/* QA-FIX: article-body paragraphs/lists were 602px wide on a 375 viewport
   because grid 1fr respects min-content (a <table class=compare-table>
   with min-width:600px blew out the track). minmax(0,1fr) constrains it. */
@media (max-width: 960px){
  .article-layout{grid-template-columns:minmax(0, 1fr) !important}
  .article-body{min-width:0;max-width:100%;overflow-wrap:break-word;word-wrap:break-word}
  .article-body p,.article-body li,.article-body h2,.article-body h3,.article-body h4,
  .article-body img,.article-body figure,.article-body blockquote,
  .article-body pre,.article-body code{max-width:100%;overflow-wrap:break-word;word-wrap:break-word}
  .article-body pre{overflow-x:auto;-webkit-overflow-scrolling:touch}
  /* Tables inside articles must scroll horizontally, not blow out layout */
  .article-body table,.article-body .compare-table,
  .article-body .pricing-table{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%}
}

/* QA-FIX: All CSS grids/containers on mobile should also respect min-content
   to prevent grid blowouts from long children like tables, code blocks, URLs */
@media (max-width: 760px){
  .grid-2,.grid-3,.grid-4,.feat-alt-row,.foot-grid,.article-layout,
  .feat-models-block,.feat-examples-grid{min-width:0}
  .grid-2 > *,.grid-3 > *,.grid-4 > *,.foot-grid > *{min-width:0}
}

/* QA-FIX: contests.html submission form had inline grid-template-columns:1fr 1fr
   that didn't collapse on mobile → form fields overflowed (input at 224px each).
   Force all 2-col grids inside contest-submit-form to single column ≤600px. */
@media (max-width: 600px){
  #contest-submit-form > div[style*="grid-template-columns"]{
    grid-template-columns:1fr !important;
  }
  /* Generic safety: any inline 1fr 1fr or 1fr 1fr 1fr grids inside forms */
  form div[style*="1fr 1fr"]{grid-template-columns:1fr !important}
}

/* QA-FIX: Long URLs / unbroken tokens in article copy could still overflow.
   Add overflow-wrap for everything inside .container on mobile. */
@media (max-width: 600px){
  .container{min-width:0}
  .container,.container *{overflow-wrap:anywhere;word-break:normal}
  /* Restore normal wrapping on items where break-anywhere looks ugly */
  .container .btn,.container .chip,.container .nav-logo,.container .badge,
  .container .nav-links a,.container .nav-cta .btn,
  .container .lang-switch *,.container .stat-num,.container code{
    overflow-wrap:normal;word-break:keep-all
  }
}

/* QA-FIX: img/svg/video without max-width inside article content can overflow */
.article-body img,.article-body video,.article-body iframe,
.article-body svg:not(.atom-logo *),.article-body picture img,
.blog-card img,.tut-card img{max-width:100%;height:auto}

/* QA-FIX: sticky-filter-bar negative margin (-18px each side) extended past
   container, which is correct edge-to-edge — but on viewports where the
   parent .container is already at viewport edge, this caused 18px overflow.
   Use box-shadow expansion instead of negative margin on smallest screens. */
@media (max-width: 480px){
  .sticky-filter-bar{margin-left:0 !important;margin-right:0 !important}
  .sticky-filter-bar > .container{padding-left:14px !important;padding-right:14px !important}
}

/* QA-FIX: Touch target — footer social icons were 42×42, below the 44×44
   recommended minimum. Also the small "Quantium" footer brand link. */
@media (max-width: 760px){
  .foot-social a,.foot-col a[aria-label],.foot-icons a{min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center}
  .foot-brand a,.foot-bottom a{min-height:24px;padding:4px 2px;display:inline-flex;align-items:center}
}

/* QA-FIX: contests.html file/datetime/select inputs had inline font-size:14px
   that triggered iOS auto-zoom. Inline styles win over our generic !important
   rule for font-size:16px because of inline-style specificity. */
@media (max-width: 760px){
  input[type="file"],input[type="datetime-local"],input[type="date"],
  input[type="time"],input[type="number"]{font-size:16px !important}
  /* Bump inline-styled fields explicitly */
  form input[style*="font-size:14px"],form select[style*="font-size:14px"],
  form textarea[style*="font-size:14px"]{font-size:16px !important}
}

/* QA-FIX: nav-cta button "Открыть бот" can squeeze the nav on small viewports.
   Make it use shorter label / icon-only when truly tight (<360px) */
@media (max-width: 360px){
  .nav-cta .btn-sm{padding:8px 12px;font-size:12px}
  .nav-logo{font-size:16px}
  .nav-logo svg{width:22px;height:22px}
}

/* QA-FIX: Hero image LCP — prevent layout shift by reserving aspect-ratio */
@media (max-width: 760px){
  .hero img,.hero picture img,.hero-cover img{aspect-ratio:auto;contain:layout}
}

/* QA-FIX: 414px breakpoint check — make sure hero stats still 2x2, not 4x1 */
@media (min-width: 481px) and (max-width: 600px){
  .hero-stats{grid-template-columns:1fr 1fr !important}
}

.mobile-drawer{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}

/* =====================================================================
   QA-FIX PASS 2 (May 2026) — mobile UX fixes for 7 reported issues
   Issues: video popup scroll, use-case cards 6→3, providers row scroll,
   testimonials 6→3, contests 3→1, pricing horizontal-scroll, FAQ layout
   ===================================================================== */

/* Issue 3 — Providers row: horizontal scroll on mobile with snap.
   `.providers-row` is the homepage trust-bar grid. Same treatment for the
   features.html provider tile rows (added .providers-row class there). */
@media (max-width: 760px){
  .providers-row{
    display:flex !important;
    grid-template-columns:none !important;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    scroll-snap-type:x mandatory;
    gap:14px;
    padding:8px 18px 18px;
    margin:0 -18px;
    scrollbar-width:none;
  }
  .providers-row::-webkit-scrollbar{display:none}
  .providers-row > .card,
  .providers-row > *{
    flex:0 0 78%;
    max-width:280px;
    min-width:0;
    scroll-snap-align:center;
  }
}

/* Issue 5 — Featured single contest card on landing — centered, capped width */
.contests-featured{display:flex;justify-content:center}
.contests-featured > .contest-card-featured{max-width:520px;width:100%}
@media (max-width: 600px){
  .contests-featured > .contest-card-featured{max-width:none}
}

/* Issue 6 — Pricing: horizontal-scroll on landing (.price-grid-land) and
   on the standalone pricing.html (.pricing-grid). Both classes get the
   swipeable carousel treatment ≤ 760px. */
@media (max-width: 760px){
  .price-grid-land,
  .pricing-grid{
    display:flex !important;
    grid-template-columns:none !important;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    scroll-snap-type:x mandatory;
    gap:16px;
    padding:8px 18px 24px;
    margin:0 -18px;
    scrollbar-width:none;
  }
  .price-grid-land::-webkit-scrollbar,
  .pricing-grid::-webkit-scrollbar{display:none}
  .price-grid-land > .price-card,
  .pricing-grid > .price-card,
  .pricing-grid > .pricing-tier{
    flex:0 0 82%;
    max-width:320px;
    min-width:0;
    scroll-snap-align:center;
  }
  .price-card{padding:26px 22px}
}

/* Issue 7 — FAQ "поплыло" fix: plus icon was being pushed by long
   question text wrapping; also padding inconsistent. Force the plus to
   be a fixed-size span, give the text a `min-width: 0` so it can shrink. */
.faq-q{gap:12px;align-items:flex-start}
.faq-q::after{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;line-height:1;margin-top:-2px}
@media (max-width: 760px){
  .faq-list{padding:0 2px}
  .faq-item{border-radius:14px}
  .faq-q{padding:14px 16px;font-size:15px;line-height:1.4;gap:10px}
  .faq-q::after{font-size:20px;width:22px;height:22px}
  .faq-a{padding:0 16px}
  .faq-item.open .faq-a{padding:0 16px 14px !important}
  .faq-a p{font-size:14.5px;line-height:1.6;text-align:left;hyphens:auto}
}

/* Pricing comparison table on mobile — wrap in horizontal scroll */
@media (max-width: 760px){
  .compare-wrap,.pricing-compare-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
  .compare-table,.pricing-compare-table{min-width:520px}
}

/* Tutorial covers — keep readable aspect-ratio on tiny screens */
@media (max-width: 480px){
  .tut-card .tut-cover,.tutorial-cover{aspect-ratio:16/10;object-fit:cover}
}

/* Blog cards safety on ≤ 600px (most already 1-col; force min-width:0) */
@media (max-width: 600px){
  .blog-grid,.tut-grid{grid-template-columns:1fr !important;gap:18px}
  .blog-grid > *,.tut-grid > *{min-width:0}
}

/* Gallery lightbox — same scroll fix as q-popup */
@media (max-width: 640px){
  .lightbox,.gallery-lightbox{overflow-y:auto;-webkit-overflow-scrolling:touch}
  .lightbox-inner,.gallery-lightbox-inner{max-height:100dvh;overflow-y:auto}
}

/* Contacts form: ensure topic select shows full options (16px font already
   set by global rule; just confirm padding for tap area) */
@media (max-width: 760px){
  select{min-height:48px;padding-right:36px}
}
