/* ─────────────────────────────────────────────────────────
   «Математическое чтение» — общие стили
   Бумажная палитра, спокойная типографика, голубой + рыжий.
   ───────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Source+Serif+4:opsz,wght@8..60,300;8..60,400;8..60,500;8..60,600;8..60,700&display=swap');

:root {
  --paper:        #f4ecda;
  --paper-soft:   #f9f3e3;
  --paper-warm:   #efe3c8;
  --paper-cream:  #faf5e9;
  --paper-edge:   #e6dbc1;

  --ink:          #1f1a12;
  --ink-soft:     #3a3328;
  --ink-mute:     #6b5e4d;
  --ink-line:     #cbb78f;

  --blue:         #5c8aa3;
  --blue-deep:    #3d6e88;
  --blue-soft:    #d9e6ed;

  --rust:         #c4673a;
  --rust-deep:    #a8512a;
  --rust-soft:    #f1d9c7;

  --sage:         #8aa088;
  --gold:         #b89055;

  --serif-display: 'Cormorant Garamond', 'Source Serif 4', Georgia, serif;
  --serif-body:    'Lora', Georgia, serif;
  --serif-text:    'Source Serif 4', 'Lora', Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--serif-body);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { background: var(--paper); }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

ul { list-style: none; margin: 0; padding: 0; }

.serif-display { font-family: var(--serif-display); }
.serif-body    { font-family: var(--serif-body); }
.serif-text    { font-family: var(--serif-text); }

/* Бумажная текстура — лёгкая, через SVG-шум */
.paper-texture { position: relative; }
.paper-texture::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: .35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.13  0 0 0 0 0.08  0 0 0 0.05 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ─── Кнопки ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 10px;
  font-family: var(--serif-body);
  font-size: 15px;
  letter-spacing: 0.3px;
  padding: 14px 28px;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, color .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-ink {
  background: var(--ink);
  color: var(--paper-cream);
  border-color: var(--ink);
}
.btn-ink:hover { background: var(--ink-soft); }
.btn-outline {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 24px;
  font-size: 14px;
}
.btn-outline:hover { background: var(--ink); color: var(--paper-cream); }
.btn-text {
  background: transparent; border: none; padding: 14px 4px;
  color: var(--ink); border-bottom: 1px solid var(--ink); border-radius: 0;
}
.btn-text:hover { color: var(--rust); border-color: var(--rust); }

/* ─── Универсальные элементы ─── */
.eyebrow {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--rust);
  font-family: var(--serif-body);
}
.eyebrow.mute { color: var(--ink-mute); }

.tag {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px;
  border: 1px solid var(--ink-line);
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.tag .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--rust);
}

.rule {
  display: inline-block;
  width: 48px; height: 1px;
  background: var(--rust);
  vertical-align: middle;
  margin: 0 12px;
}

/* ─── Шапка / навигация ─── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  padding: 22px 56px;
  background: var(--paper-soft);
  border-bottom: 1px solid rgba(31,26,18,0.08);
  position: relative;
  z-index: 50;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--ink); color: var(--paper);
  display: grid; place-items: center;
  font-family: var(--serif-display);
  font-style: italic; font-weight: 500; font-size: 22px;
  overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
a.brand-mark { text-decoration: none; cursor: pointer; transition: transform .15s ease, box-shadow .2s ease; }
a.brand-mark:hover { transform: rotate(-6deg) scale(1.05); box-shadow: 0 8px 18px -8px rgba(31,26,18,0.5); }
.brand-title {
  font-family: var(--serif-display);
  font-size: 20px; font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1.1;
}
.brand-sub {
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 4px;
}
.menu {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--serif-body);
  font-size: 14px;
  color: var(--ink-soft);
}
.menu li { display: flex; }
.menu a { position: relative; }
.nav-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 999px;
  color: var(--ink-soft);
  transition: background .2s, color .2s;
}
.nav-link:hover { background: var(--paper-warm); color: var(--rust-deep); }
.nav-link.is-active { background: var(--paper-warm); color: var(--ink); }
.nav-link.is-active::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--rust); }
.nav-divider { width: 1px; height: 22px; background: var(--ink-line); opacity: 0.4; margin: 0 6px; }
.nav-login {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px;
  background: var(--ink); color: var(--paper-cream);
  transition: background .2s, transform .15s;
}
.nav-login:hover { background: var(--rust-deep); color: var(--paper-cream); transform: translateY(-1px); }
.nav-login svg { display: block; }

/* ─── Сетка макета ─── */
.section { padding: 96px 72px; position: relative; }
.section--soft  { background: var(--paper-soft); border-top: 1px solid var(--paper-edge); border-bottom: 1px solid var(--paper-edge); }
.section--warm  { background: var(--paper-warm); border-top: 1px solid var(--paper-edge); }
.section--cream { background: var(--paper-cream); }

/* ─── Карточки шагов ─── */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}
.step {
  padding: 28px 24px 32px;
  background: var(--paper-cream);
  border: 1px solid var(--paper-edge);
  border-radius: 4px;
  position: relative;
}
.step-num {
  font-family: var(--serif-display);
  font-size: 14px;
  color: var(--rust);
  letter-spacing: 1px;
  margin-bottom: 18px;
  display: flex; align-items: center; gap: 10px;
}
.step-num::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--ink-line);
}
.step h3 {
  font-family: var(--serif-display);
  font-size: 24px;
  margin: 0 0 12px;
  font-weight: 500;
  color: var(--ink);
}
.step p { font-size: 14px; line-height: 1.6; color: var(--ink-mute); margin: 0; }

/* ─── Карточки команды ─── */
.team {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.person {
  display: flex; flex-direction: column; gap: 14px;
}
.person-avatar {
  width: 100%; aspect-ratio: 4/5;
  background: var(--paper-cream);
  border: 1px solid var(--paper-edge);
  display: grid; place-items: center;
  font-family: var(--serif-display);
  font-style: italic; font-size: 58px;
  color: var(--ink-line);
}
.person-name {
  font-family: var(--serif-display);
  font-size: 20px;
  color: var(--ink);
  font-weight: 500;
}
.person-role {
  font-size: 13px;
  color: var(--ink-mute);
  margin-top: 4px;
  line-height: 1.5;
}

/* ─── Цитата ─── */
.quote {
  margin: 32px 0 0;
  padding: 0 0 0 24px;
  border-left: 2px solid var(--rust);
  font-style: italic;
  font-size: 22px;
  color: var(--ink);
  line-height: 1.5;
  font-family: var(--serif-display);
}
.quote-attr {
  margin-top: 12px;
  font-size: 13px;
  color: var(--ink-mute);
  font-style: normal;
  font-family: var(--serif-body);
  letter-spacing: 1px;
}

/* ─── Футер ─── */
.footer {
  padding: 60px 72px 40px;
  background: var(--ink);
  color: var(--paper);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr;
  gap: 40px;
  align-items: flex-start;
}
.footer h4 {
  font-size: 11px;
  color: #a89876;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0 0 14px;
  font-weight: 500;
}
.footer ul { font-size: 14px; line-height: 2; color: var(--paper); }
.footer ul a:hover { color: var(--rust-soft); }
.footer-brand {
  font-family: var(--serif-display);
  font-size: 24px;
  font-style: italic;
  font-weight: 500;
  line-height: 1.1;
}
.footer-sub {
  font-size: 11px;
  color: var(--ink-line);
  letter-spacing: 2px;
  margin-top: 10px;
  text-transform: uppercase;
}
.footer-quote {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 17px;
  color: var(--ink-line);
  line-height: 1.5;
}
.footer-bottom {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(244,236,218,0.1);
  display: flex; justify-content: space-between;
  font-size: 12px; color: #a89876;
}

/* ─── Адаптив (на всякий) ─── */
@media (max-width: 1100px) {
  .topbar { padding: 24px 40px; }
  .section { padding: 72px 40px; }
  .menu { gap: 24px; }
  .footer { padding: 48px 40px 32px; }
}
