/* ================================================================
   MAF Industry — Base Styles
   ================================================================
   Reset, типографика, утилиты.
   Здесь нет ни одного компонента — только глобальные правила.
   ================================================================ */

/* ----------------------------------------------------------------
   1. RESET & BOX MODEL
---------------------------------------------------------------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
  letter-spacing: -0.01em;
}

/* Зернистый шум-оверлей: даёт ощущение люкс-материала */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--noise);
  opacity: 0.02;
  pointer-events: none;
  z-index: 9999;
}

/* ----------------------------------------------------------------
   2. ТИПОГРАФИКА
   Заголовки — Playfair Display (serif).
   Текст — Inter (sans-serif).
---------------------------------------------------------------- */
h1, h2, h3, h4, .font-heading {
  font-family: 'Playfair Display', serif;
  font-weight: 400;
  line-height: 1.05;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}

h1 { font-size: clamp(3rem, 6vw, 5.5rem);   margin-bottom: 32px; }
h2 { font-size: clamp(2.2rem, 4.5vw, 4rem); margin-bottom: 40px; }
h3 { font-size: clamp(1.5rem, 2.5vw, 2.2rem); margin-bottom: 20px; }

p {
  font-size: clamp(1rem, 1.1vw, 1.15rem);
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* Фирменный курсив — золотой акцент в заголовках */
.gold-italic {
  font-style: italic;
  color: var(--accent);
  position: relative;
  display: inline-block;
}

/* Метка раздела: UPPERCASE + разрядка, золото */
.section-label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 32px;
  opacity: 0.8;
}

/* ----------------------------------------------------------------
   3. БАЗОВЫЕ ТЕГИ
---------------------------------------------------------------- */
a   { text-decoration: none; color: inherit; }
ul  { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

/* ----------------------------------------------------------------
   4. LAYOUT — CONTAINER & SECTIONS
---------------------------------------------------------------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--pad-x);
  width: 100%;
}

section {
  padding: var(--pad-y) 0;
  position: relative;
}

/* Фоновые варианты секций */
.bg-warm { background-color: var(--bg-warm); }

/* ----------------------------------------------------------------
   5. REVEAL ANIMATIONS
   Элементы появляются при скролле через IntersectionObserver (main.js).
   Базовое состояние — скрыт и сдвинут вниз.
   При пересечении viewport — добавляется класс .visible.
---------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity   1s var(--transition-smooth),
    transform 1s var(--transition-smooth);
  will-change: transform, opacity; /* hardware acceleration */
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Каскадные задержки для групп элементов */
.delay-1 { transition-delay: 0.15s; }
.delay-2 { transition-delay: 0.30s; }
.delay-3 { transition-delay: 0.45s; }

/* ----------------------------------------------------------------
   6. SCROLL PROGRESS BAR
   Фиксированный индикатор прогресса чтения (золотая полоска вверху).
---------------------------------------------------------------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--accent);
  z-index: 2000;
  transition: width 0.1s ease-out;
  pointer-events: none;
}

/* ----------------------------------------------------------------
   7. BACK TO TOP BUTTON
---------------------------------------------------------------- */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  min-height: 60px;
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
  color: var(--accent);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s var(--transition-smooth);
  box-shadow: var(--shadow-sm);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-5px);
}
