/**
 * ============================================================================
 * [MODULE]: HigherSchoolOfMathematicsStyles (Version 2)
 * [PURPOSE]: Полная адаптация дизайна из client_demo_realise для платформы
 *            Высшей школы стохастического анализа и теоретической математики.
 * [PALETTE]: Manrope font, #111827 text, #6B7280 muted, #FFFFFF bg, #000000 accent,
 *            #E5E7EB border, #F9FAFB alternate bg, strictly 0px border-radius.
 * ============================================================================
 */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;600;700&display=swap');

:root { 
  --text: #111827; 
  --text-muted: #6B7280; 
  --bg: #FFFFFF; 
  --bg-alt: #F9FAFB;
  --bg-card: #FFFFFF;
  --accent: #000000; 
  --border: #E5E7EB; 
  --font-sans: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;
}

* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

html { 
  scroll-behavior: smooth; 
}

body { 
  font-family: var(--font-sans); 
  background: var(--bg); 
  color: var(--text); 
  -webkit-font-smoothing: antialiased; 
  line-height: 1.6; 
}

a { 
  text-decoration: none; 
  color: inherit;
  transition: 0.2s; 
}

/* ============================================================================
   CONTAINER
   ============================================================================ */
.container { 
  max-width: 1440px; 
  margin: 0 auto; 
  padding: 0 4rem; 
  box-sizing: border-box;
}

/* ============================================================================
   HEADER & NAVIGATION (EXACT PATTERN FROM client_demo_realise)
   ============================================================================ */
.header { 
  padding: 1.75rem 0; 
  border-bottom: 2px solid var(--border); 
  background: var(--bg); 
  box-shadow: 0 4px 20px rgba(0,0,0,0.06); 
  position: sticky; 
  top: 0; 
  z-index: 100; 
}

.header-inner { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  width: 100%; 
}

.logo { 
  display: flex; 
  align-items: center; 
  gap: 12px;
  text-decoration: none;
}

.logo-symbol {
  width: 44px;
  height: 44px;
  background: #000000;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.05em;
  border-radius: 0;
}

.logo-text-group {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.1;
  text-transform: uppercase;
}

.logo-sub {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.header-top { 
  display: contents; 
}

.header-phone { 
  font-weight: 800; 
  font-size: 1.1rem; 
  color: var(--text); 
  text-decoration: none; 
  white-space: nowrap; 
  letter-spacing: -0.01em;
}

.nav { 
  display: flex; 
  gap: 2.5rem; 
  align-items: center; 
}

.nav a { 
  color: var(--text); 
  font-weight: 600; 
  font-size: 1.05rem; 
  position: relative; 
  white-space: nowrap;
}

.nav a::after { 
  content: ''; 
  position: absolute; 
  bottom: -6px; 
  left: 0; 
  width: 0; 
  height: 2px; 
  background: var(--accent); 
  transition: width 0.2s; 
}

.nav a:hover::after,
.nav a.active::after { 
  width: 100%; 
}

/* ============================================================================
   BUTTONS (NO ROUNDED CORNERS - EXACT client_demo_realise SPEC)
   ============================================================================ */
.btn { 
  display: inline-flex; 
  align-items: center; 
  justify-content: center; 
  background: var(--accent); 
  color: #fff; 
  padding: 1.25rem 2.5rem; 
  font-weight: 800; 
  font-size: 1.1rem; 
  border: none; 
  cursor: pointer; 
  transition: transform 0.2s, background 0.2s; 
  border-radius: 0; 
  text-align: center;
}

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

.btn-outline { 
  display: inline-flex; 
  align-items: center; 
  justify-content: center; 
  background: transparent; 
  color: var(--accent); 
  border: 2px solid var(--accent); 
  padding: 1.25rem 2.5rem; 
  font-weight: 800; 
  font-size: 1.1rem; 
  cursor: pointer; 
  transition: 0.2s; 
  border-radius: 0; 
  text-align: center;
}

.btn-outline:hover { 
  background: var(--accent); 
  color: #fff; 
  transform: translateY(-4px); 
}

/* Брендовые кнопки быстрого действия из client_demo_realise */
.btn-wa { 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  gap: 12px; 
  background: transparent; 
  color: var(--accent); 
  border: 2px solid var(--accent); 
  padding: 1.25rem 2.5rem; 
  font-size: 1.1rem; 
  font-weight: 800; 
  min-width: 280px; 
  transition: 0.2s; 
  border-radius: 0; 
}
.btn-wa:hover { 
  background: #000000; 
  color: #fff; 
  border-color: #000000; 
  transform: translateY(-4px); 
}

.btn-tg { 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  gap: 12px; 
  background: transparent; 
  color: var(--accent); 
  border: 2px solid var(--accent); 
  padding: 1.25rem 2.5rem; 
  font-size: 1.1rem; 
  font-weight: 800; 
  min-width: 280px; 
  transition: 0.2s; 
  border-radius: 0; 
}
.btn-tg:hover { 
  background: #0088cc; 
  color: #fff; 
  border-color: #0088cc; 
  transform: translateY(-4px); 
}

.btn-max { 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  gap: 12px; 
  background: transparent; 
  color: var(--accent); 
  border: 2px solid var(--accent); 
  padding: 1.25rem 2.5rem; 
  font-size: 1.1rem; 
  font-weight: 800; 
  min-width: 280px; 
  transition: 0.2s; 
  border-radius: 0; 
}
.btn-max:hover { 
  background: #111827; 
  color: #fff; 
  border-color: #111827; 
  transform: translateY(-4px); 
}

/* ============================================================================
   HERO SECTION
   ============================================================================ */
.hero { 
  padding-top: 4.5rem; 
  padding-bottom: 4.5rem; 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  gap: 4rem; 
  border-bottom: 1px solid var(--border); 
  box-sizing: border-box; 
}

.hero-content { 
  max-width: 680px; 
  margin-left: 0; 
}

.hero-badge {
  display: inline-block;
  background: #F3F4F6;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 14px;
  margin-bottom: 1.5rem;
}

.hero h1 { 
  font-size: 4.2rem; 
  font-weight: 800; 
  line-height: 1.05; 
  margin-bottom: 2rem; 
  letter-spacing: -0.04em; 
  color: var(--text);
}

.hero-content > p {
  font-size: 1.2rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 2.5rem;
}

.hero-content strong {
  color: var(--text);
  font-weight: 800;
}

.feature-list { 
  list-style: none; 
  margin-bottom: 3rem; 
}

.feature-list li { 
  display: flex; 
  align-items: flex-start; 
  gap: 1.5rem; 
  margin-bottom: 2rem; 
}

.feature-icon-box {
  width: 48px;
  height: 48px;
  background: #000000;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
  flex-shrink: 0;
  border-radius: 0;
  font-family: var(--font-mono);
}

.feature-list p { 
  font-size: 1.15rem; 
  color: var(--text-muted); 
  margin: 0; 
  line-height: 1.6; 
}

.feature-list strong { 
  color: var(--text); 
  font-weight: 800; 
}

.hero-actions { 
  display: flex; 
  align-items: center; 
  gap: 1.5rem; 
  flex-wrap: wrap; 
}

/* Правая часть Hero: визуальный интерактивный холст / карточка терминала */
.hero-image-wrapper { 
  width: 560px; 
  max-width: 100%; 
  border: 2px solid #000000;
  background: #FFFFFF;
  box-shadow: 12px 12px 0px rgba(0,0,0,1);
  padding: 0;
  display: flex;
  flex-direction: column;
}

.terminal-header {
  background: #000000;
  color: #FFFFFF;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.terminal-header .dots {
  display: flex;
  gap: 6px;
}
.terminal-header .dot {
  width: 10px;
  height: 10px;
  border: 1px solid #ffffff;
}

.terminal-canvas-box {
  height: 320px;
  background: #FAFAFA;
  position: relative;
  border-bottom: 2px solid #000000;
}

#heroCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.terminal-footer-meta {
  padding: 16px 20px;
  background: #FFFFFF;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.meta-box span {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
}
.meta-box b {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
}

/* ============================================================================
   STATS BANNER (NUMBERS & METRICS)
   ============================================================================ */
.stats-strip {
  background: #000000;
  color: #FFFFFF;
  padding: 3.5rem 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  text-align: center;
}

.stat-item h3 {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
}

.stat-item p {
  font-size: 1.05rem;
  color: #9CA3AF;
  font-weight: 500;
  line-height: 1.4;
}

/* ============================================================================
   GRID SECTION & CARDS (EXACT client_demo_realise SPEC)
   ============================================================================ */
.grid-container { 
  max-width: 1440px; 
  margin: 0 auto; 
  padding: 0 4rem; 
}

.grid-section { 
  padding: 5rem 0; 
  text-align: center; 
}

.section-title { 
  display: block; 
  width: 100%; 
  color: #111827; 
  background: transparent; 
  margin-bottom: 1rem; 
  font-size: 3rem !important; 
  font-weight: 800 !important; 
  letter-spacing: -0.03em !important; 
  border: none !important; 
  padding: 0 !important; 
  box-shadow: none !important; 
  text-align: center; 
}

.section-subtitle { 
  display: block; 
  font-size: 1.25rem; 
  font-weight: 500; 
  color: var(--text-muted); 
  text-align: center; 
  margin-bottom: 3.5rem; 
  max-width: 900px; 
  margin-left: auto; 
  margin-right: auto; 
  line-height: 1.6; 
}

/* Фильтры категорий */
.category-filter-bar {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3.5rem;
}

.filter-btn {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text);
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: 0;
  transition: 0.2s;
  font-family: var(--font-sans);
}

.filter-btn:hover,
.filter-btn.active {
  background: #000000;
  color: #ffffff;
  border-color: #000000;
}

/* Карточки курсов */
.grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); 
  gap: 3rem; 
  text-align: left; 
}

.card { 
  display: flex; 
  flex-direction: column; 
  background: #FFFFFF; 
  padding: 2.25rem; 
  border: 2px solid var(--border); 
  height: 100%; 
  transition: border-color 0.2s, transform 0.2s;
  border-radius: 0;
}

.card:hover {
  border-color: #000000;
  transform: translateY(-4px);
}

.card-top-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.card-code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  background: #F3F4F6;
  padding: 4px 10px;
  border: 1px solid var(--border);
}

.card-level {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.card h3 { 
  font-size: 1.5rem; 
  font-weight: 800; 
  margin-bottom: 0.75rem; 
  color: var(--text); 
  letter-spacing: -0.02em; 
  line-height: 1.25;
}

.card-chair {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.card-desc {
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.55;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.card-formula {
  background: #F9FAFB;
  border-left: 3px solid #000000;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: #111827;
  margin-bottom: 1.5rem;
  word-break: break-all;
}

.card .price { 
  font-size: 1.15rem; 
  font-weight: 700; 
  color: var(--text); 
  margin-bottom: 1.5rem; 
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.card .price span {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
}

.card .btn-outline { 
  width: 100%; 
  min-width: 0; 
  padding: 1rem; 
  font-size: 1.05rem; 
  margin-top: auto; 
}

/* ============================================================================
   ORDER BLOCK / FAST APPLICATION & LEAN 4 VERIFICATION (EXACT client_demo_realise)
   ============================================================================ */
.order-block-wrapper { 
  padding: 7rem 0; 
  border-bottom: 1px solid var(--border); 
  background: #F9FAFB; 
  scroll-margin-top: 120px; 
}

.order-block { 
  text-align: center; 
  max-width: 960px; 
  margin: 0 auto; 
}

.order-block h2 { 
  font-size: 3.2rem; 
  font-weight: 800; 
  letter-spacing: -0.03em; 
  margin-bottom: 1rem; 
  color: var(--text); 
}

.order-block > p { 
  font-size: 1.3rem; 
  color: var(--text-muted); 
  margin-bottom: 3.5rem; 
  line-height: 1.6;
}

.messenger-btns { 
  display: flex; 
  gap: 2rem; 
  justify-content: center; 
  flex-wrap: wrap; 
  margin-bottom: 4rem; 
}

.contact-mini { 
  display: flex; 
  justify-content: center; 
  gap: 4rem; 
  flex-wrap: wrap; 
}

.contact-mini a { 
  display: flex; 
  align-items: center; 
  gap: 12px; 
  color: var(--text); 
  font-size: 1.4rem; 
  font-weight: 800; 
  letter-spacing: -0.02em; 
}

.contact-mini a:hover { 
  color: var(--text-muted); 
}

/* ============================================================================
   INTERACTIVE LECTURE THEATRE & TASKS (DEEP CONTENT)
   ============================================================================ */
.lecture-theatre-box {
  background: #FFFFFF;
  border: 2px solid #000000;
  margin-top: 3rem;
  text-align: left;
}

.theatre-topbar {
  background: #000000;
  color: #FFFFFF;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  font-size: 1.1rem;
}

.theatre-main {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
}

@media (max-width: 1050px) {
  .theatre-main {
    grid-template-columns: 1fr;
  }
}

.theatre-screen {
  border-right: 2px solid #000000;
  background: #000000;
  position: relative;
  min-height: 420px;
  display: flex;
  flex-direction: column;
}

#lectureCanvas {
  width: 100%;
  height: 380px;
  display: block;
  background: #0b0f19;
}

.screen-controls {
  background: #111827;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  border-top: 1px solid #374151;
}

.theatre-syllabus {
  padding: 24px;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 480px;
  overflow-y: auto;
}

.syllabus-row {
  padding: 14px 18px;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.syllabus-row:hover,
.syllabus-row.active {
  border-color: #000000;
  background: #F9FAFB;
}

.syllabus-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 700;
}

.syllabus-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
}

/* ============================================================================
   TASKS & LEAN 4 VERIFIER SANDBOX
   ============================================================================ */
.tasks-container {
  border: 2px solid #000000;
  background: #FFFFFF;
  text-align: left;
  margin-top: 3rem;
}

.tasks-header {
  background: #000000;
  color: #ffffff;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  font-size: 1.15rem;
}

.tasks-split {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
}

@media (max-width: 1050px) {
  .tasks-split {
    grid-template-columns: 1fr;
  }
}

.tasks-list-pane {
  border-right: 2px solid #000000;
  max-height: 600px;
  overflow-y: auto;
  background: #FAFAFA;
}

.task-item-card {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.task-item-card:hover,
.task-item-card.active {
  background: #FFFFFF;
  border-left: 6px solid #000000;
}

.task-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.task-code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 800;
  color: #000000;
}

.task-tag {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 2px 8px;
  background: #E5E7EB;
  text-transform: uppercase;
}

.task-tag.verified {
  background: #000000;
  color: #ffffff;
}

.task-item-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.35;
}

.task-solver-pane {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #FFFFFF;
}

.lemma-statement-box {
  background: #F9FAFB;
  border: 1px solid var(--border);
  padding: 18px;
  font-size: 1.05rem;
  line-height: 1.6;
}

.lean-terminal-box {
  border: 2px solid #000000;
  display: flex;
  flex-direction: column;
}

.lean-header {
  background: #111827;
  color: #FFFFFF;
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
}

.lean-code-editor {
  width: 100%;
  min-height: 180px;
  padding: 14px;
  background: #FFFFFF;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.5;
  color: #111827;
  resize: vertical;
}

.lean-console-output {
  background: #000000;
  color: #FFFFFF;
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
  min-height: 80px;
  white-space: pre-wrap;
}

/* ============================================================================
   MODAL SYLLABUS
   ============================================================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(17, 24, 39, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: #FFFFFF;
  border: 3px solid #000000;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 16px 16px 0px rgba(0,0,0,1);
}

.modal-box-header {
  background: #000000;
  color: #FFFFFF;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-box-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: #FFFFFF;
  font-size: 1.5rem;
  font-weight: 800;
  cursor: pointer;
  line-height: 1;
}

.modal-box-content {
  padding: 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ============================================================================
   FOOTER (EXACT client_demo_realise SPEC)
   ============================================================================ */
.footer { 
  padding: 4.5rem 0 3.5rem 0; 
  background: var(--bg); 
  border-top: 2px solid var(--border); 
  box-shadow: 0 -4px 20px rgba(0,0,0,0.06); 
  position: relative; 
  z-index: 10; 
}

.footer-inner { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); 
  gap: 4rem; 
}

.footer-col h4 { 
  margin-bottom: 2rem; 
  color: var(--text); 
  font-size: 1.25rem; 
  font-weight: 800; 
  letter-spacing: -0.02em; 
}

.footer-col p, .footer-col a { 
  color: var(--text-muted); 
  margin-bottom: 1rem; 
  display: block; 
  font-size: 1.05rem; 
  font-weight: 500; 
  line-height: 1.6; 
}

.footer-col a:hover { 
  color: var(--text); 
}

.social-icons { 
  display: flex; 
  gap: 1rem; 
  margin-top: 1.5rem; 
}

.social-icons a { 
  width: 48px; 
  height: 48px; 
  border: 2px solid var(--border); 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  border-radius: 0; 
  color: var(--text); 
  transition: 0.2s; 
}

.social-icons a:hover { 
  border-color: var(--accent); 
  background: var(--accent); 
  color: #fff; 
}

/* ============================================================================
   RESPONSIVE BREAKPOINTS (EXACT client_demo_realise BEHAVIOR)
   ============================================================================ */
.nav a {
  white-space: nowrap !important;
}

/* 1. Десктоп >= 1241px: в одну строчку */
@media (min-width: 1241px) {
  .header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }
  .header-top {
    display: contents;
  }
  .logo {
    order: 1;
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }
  .nav {
    order: 2;
    display: flex;
    gap: 2.25rem;
    align-items: center;
    margin-left: auto;
    margin-right: 2.5rem;
  }
  .header-phone {
    order: 3;
    flex-shrink: 0 !important;
  }
}

/* 2. Планшеты и компактные экраны <= 1240px: верхнее меню в две строчки */
@media (max-width: 1240px) {
  .header {
    padding: 1.25rem 0 !important;
  }
  .header-inner {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    width: 100% !important;
  }
  .header-top {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
  }
  .nav {
    display: flex !important;
    width: 100% !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 2rem !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding-bottom: 2px !important;
    margin: 0 !important;
  }
  .nav::-webkit-scrollbar {
    display: none !important;
  }
  .nav a {
    font-size: 1.05rem !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }
}

/* 3. Средние экраны и планшеты <= 992px: стек Hero */
@media (max-width: 992px) {
  .container, .grid-container {
    padding-left: 2.5rem !important;
    padding-right: 2.5rem !important;
  }
  .hero {
    flex-direction: column !important;
    text-align: left !important;
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
    gap: 3rem !important;
  }
  .hero-content {
    max-width: 100% !important;
    width: 100% !important;
  }
  .hero h1 {
    font-size: 3.5rem !important;
  }
  .hero-image-wrapper {
    width: 100% !important;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2.5rem !important;
  }
}

/* 4. Мобильные устройства <= 768px: крупный текст и кнопки во всю ширину */
@media (max-width: 768px) {
  .container, .grid-container {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }
  .header {
    padding: 0.85rem 0 !important;
  }
  .logo-title {
    font-size: 1rem !important;
  }
  .hero {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
    gap: 2rem !important;
  }
  .hero h1 {
    font-size: 2.6rem !important;
    line-height: 1.1 !important;
  }
  .hero-content > p {
    font-size: 1.15rem !important;
  }
  .hero .btn, .hero .btn-outline {
    width: 100% !important;
  }
  .order-block h2, .section-title {
    font-size: 2.2rem !important;
  }
  .stats-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }
  .messenger-btns {
    flex-direction: column !important;
    width: 100% !important;
  }
  .btn-wa, .btn-tg, .btn-max {
    width: 100% !important;
    min-width: 0 !important;
  }
  .contact-mini {
    flex-direction: column !important;
    gap: 1.5rem !important;
    align-items: center !important;
  }
}
