/* =====================================================
   alexlisovoy.ru · Brand & Design System · Tokens v2.1
   Colors + Typography master file
   Import from any HTML in the project.
   ===================================================== */

/* ─── Google Fonts (Cormorant + Montserrat) ───────── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant:ital,wght@0,400;0,500;0,600;1,400;1,500;1,600&family=Montserrat:wght@700;800;900&display=swap');

/* ─── Local fonts: Fira Sans Compressed + Bebas Neue ─ */
@font-face {
  font-family: 'Fira Sans Compressed';
  src: url('fonts/FiraSansCompressed-Book.otf') format('opentype');
  font-weight: 350; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Fira Sans Compressed';
  src: url('fonts/FiraSansCompressed-BookItalic.otf') format('opentype');
  font-weight: 350; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Fira Sans Compressed';
  src: url('fonts/FiraSansCompressed-Regular.otf') format('opentype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Fira Sans Compressed';
  src: url('fonts/FiraSansCompressed-Medium.otf') format('opentype');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Fira Sans Compressed';
  src: url('fonts/FiraSansCompressed-MediumItalic.otf') format('opentype');
  font-weight: 500; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Fira Sans Compressed';
  src: url('fonts/FiraSansCompressed-BoldItalic.otf') format('opentype');
  font-weight: 700; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Fira Sans Compressed';
  src: url('fonts/FiraSansCompressed-HeavyItalic.otf') format('opentype');
  font-weight: 900; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Bebas Neue';
  src: url('fonts/BebasNeue-Regular.otf') format('opentype');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'Bebas Neue';
  src: url('fonts/BebasNeue-Bold.otf') format('opentype');
  font-weight: 700; font-display: swap;
}

:root {
  /* ─── Surfaces ─── */
  --bg-warm:        #F5F1EC;  /* primary page bg */
  --bg-cream:       #FAF6F0;  /* alternating bg */
  --surface:        #FFFFFF;  /* cards "sheet of paper" */
  --bg-dark:        #2A2520;  /* dark "islands" */
  --bg-dark-deep:   #1F1B17;  /* footer */

  /* ─── Accent (ochre — the only "speaking" colour) ─── */
  --accent:         #C8792A;
  --accent-dark:    #A66220;
  --accent-cta:     #A8651F;  /* затемнённая охра ТОЛЬКО для заливки кнопок/лейблов — white 4.62:1 WCAG AA. --accent (#C8792A) НЕ трогаем (em/ссылки/overline сохраняют охру) */
  --accent-cta-hover: #874E14; /* hover для CTA-кнопок — заметно темнее --accent-cta, white ~6.6:1 */
  --accent-soft:    rgba(200, 121, 42, 0.08);
  --accent-glow:    rgba(245, 179, 106, 0.18);
  --accent-line:    rgba(200, 121, 42, 0.20);
  --border-accent:  rgba(200, 121, 42, 0.20);

  /* ─── Text ─── */
  --text-dark:       #2C2C2A;
  --text-muted:      #6B5245;  /* fg2 — secondary, meta. WCAG AA 6.4:1 на --bg-warm (прод-значение) */
  --text-light:      #F5F1EC;
  --text-muted-dark: #B4B2A9;

  /* ─── Lines ─── */
  --border:          #E8E4DF;

  /* ─── Semantic ─── */
  --danger:          #8B2E1F;
  --dont-red:        #B85446;
  --do-green:        #5A9A6E;
  --success:         #5A9A6E;
  --warning:         #C8792A;

  /* ─── Aliases (fg/bg short names) ─── */
  --fg1: var(--text-dark);
  --fg2: var(--text-muted);
  --bg1: var(--bg-warm);
  --bg2: var(--bg-cream);
  --line: var(--border);
  --brand: var(--accent);

  /* ─── Font families ─── */
  --font-serif:    'Cormorant', Georgia, 'Times New Roman', serif;
  --font-body:     'Fira Sans Compressed', -apple-system, BlinkMacSystemFont, 'Segoe UI Condensed', sans-serif;
  --font-heading:  'Bebas Neue', 'Impact', sans-serif;
  --font-number:   'Montserrat', 'Arial Black', sans-serif;
  --font-mono:     'Courier New', ui-monospace, monospace;

  /* ─── Type scale ─── */
  --text-display:    700 104px/0.92 var(--font-body);
  --text-hero-serif: 500  88px/1.0  var(--font-serif);
  --text-hero-caps:  700  88px/0.95 var(--font-body);
  --text-section:    500  52px/1.1  var(--font-serif);
  --text-h1:         500  36px/1.15 var(--font-serif);
  --text-h2-italic:  500 italic 32px/1.3 var(--font-serif);
  --text-h3:         500  26px/1.3  var(--font-serif);
  --text-h4:         500  20px/1.3  var(--font-body);

  --text-lead:       400  21px/1.55 var(--font-body);
  --text-body-lg:    400  19px/1.65 var(--font-body);
  --text-body:       400  17px/1.65 var(--font-body);
  --text-body-sm:    400  15px/1.55 var(--font-body);
  --text-caption:    400  13px/1.5  var(--font-body);

  --text-overline:   500  13px/1.3  var(--font-body);
  --text-label-caps: 700  14px/1.3  var(--font-heading);

  --text-num-hero:   900  96px/0.9  var(--font-number);
  --text-num-meta:   900  44px/1    var(--font-number);
  --text-num-small:  900  14px/1    var(--font-number);

  --text-quote-lg:   500 italic 32px/1.4  var(--font-serif);
  --text-quote-md:   500 italic 26px/1.45 var(--font-serif);

  /* ─── Letter-spacing ─── */
  --ls-display:    -2.5px;
  --ls-tight:      -1.5px;
  --ls-h2:         -0.5px;
  --ls-default:     0;
  --ls-overline:    2.5px;
  --ls-uppercase:   2px;
  --ls-label-caps:  3px;

  /* ─── Spacing scale (×4) ─── */
  --space-1:   4px;  --space-2:   8px;  --space-3:  12px;  --space-4:  16px;
  --space-5:  20px;  --space-6:  24px;  --space-8:  32px;  --space-10: 40px;
  --space-12: 48px;  --space-16: 64px;  --space-20: 80px;  --space-24: 96px;
  --space-30: 120px;

  /* ─── Radii ─── */
  --radius-xs:   3px;
  --radius-sm:   4px;
  --radius-md:   6px;
  --radius-lg:   8px;
  --radius-pill: 999px; /* avatars, code-badges only */

  /* ─── Border widths ─── */
  --bw:        1px;
  --bw-accent: 3px;
  --bw-cta:    4px;

  /* ─── Shadows (used sparingly) ─── */
  --shadow-photo: 0 20px 60px rgba(42, 37, 32, 0.15), 0 8px 24px rgba(42, 37, 32, 0.08);
  --shadow-hover: 0 4px 16px rgba(42, 37, 32, 0.06);
  --shadow-card:  0 2px 12px rgba(42, 37, 32, 0.06);
  --shadow-faint: 0 1px 2px rgba(42, 37, 32, 0.04);
  --shadow-book:  0 40px 80px rgba(0, 0, 0, 0.55), 0 0 80px rgba(200, 121, 42, 0.15);

  /* ─── Motion ─── */
  --ease-out:  cubic-bezier(0.22, 1, 0.36, 1);
  --ease:      ease;
  --dur-fast:  0.15s;
  --dur:       0.2s;
  --dur-med:   0.32s;
  --dur-slow:  0.6s;

  /* ─── Layout ─── */
  --container:        1240px;
  --container-narrow:  820px;
  --container-text:    720px;
  --gutter:             32px;
  --gutter-mobile:      20px;
}

/* ═══════════════════════════════════════════════════
   SEMANTIC ELEMENT DEFAULTS
   ═══════════════════════════════════════════════════ */

* { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body {
  background: var(--bg-warm);
  color: var(--text-dark);
  font: var(--text-body);
  font-family: var(--font-body);
}

img, video { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }

h1 { font: var(--text-h1);      color: var(--text-dark); text-wrap: pretty; }
h2 { font: var(--text-section); color: var(--text-dark); letter-spacing: var(--ls-h2); text-wrap: pretty; }
h3 { font: var(--text-h3);      color: var(--text-dark); text-wrap: pretty; }
h4 {
  font: var(--text-overline);
  color: var(--text-muted);
  letter-spacing: var(--ls-overline);
  text-transform: uppercase;
}

em { font-style: italic; color: var(--accent); font-weight: 500; }
p  { margin: 0 0 1em; text-wrap: pretty; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--accent-line);
  text-decoration-thickness: 1px;
  transition: color var(--dur) var(--ease),
              text-decoration-color var(--dur) var(--ease);
}
a:hover { color: var(--accent-dark); text-decoration-color: var(--accent); }

code, kbd, samp { font-family: var(--font-mono); font-size: 0.9em; }

blockquote {
  font: var(--text-quote-md);
  color: var(--text-dark);
  border-left: var(--bw-accent) solid var(--accent);
  padding: var(--space-6) 0 var(--space-6) 28px;
  max-width: 720px;
}
blockquote::before { content: '«'; color: var(--accent); margin-right: 4px; }
blockquote::after  { content: '»'; color: var(--accent); margin-left: 4px; }

hr { border: 0; border-top: 1px solid var(--border); margin: var(--space-12) 0; }

*:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ═══════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════ */

.eyebrow,
.overline {
  font: var(--text-overline);
  letter-spacing: var(--ls-overline);
  text-transform: uppercase;
  color: var(--accent);
  display: block;
}
.overline-muted { color: var(--text-muted); }

.label-caps {
  font: var(--text-label-caps);
  letter-spacing: var(--ls-label-caps);
  text-transform: uppercase;
  color: var(--accent);
}

.section-title {
  font: var(--text-section);
  letter-spacing: var(--ls-h2);
  color: var(--text-dark);
  text-wrap: pretty;
}

.muted { color: var(--text-muted); }

.lead {
  font: var(--text-lead);
  color: var(--text-muted);
  max-width: 640px;
  text-wrap: pretty;
}

.display-caps {
  font: var(--text-display);
  letter-spacing: var(--ls-display);
  text-transform: uppercase;
}

.container        { max-width: var(--container);        margin: 0 auto; padding: 0 var(--gutter); position: relative; }
.container-narrow { max-width: var(--container-narrow); margin: 0 auto; padding: 0 var(--gutter); }
.container-text   { max-width: var(--container-text);   margin: 0 auto; padding: 0 var(--gutter); }

@media (max-width: 767px) {
  .container, .container-narrow, .container-text { padding: 0 var(--gutter-mobile); }
}

.bg-warm      { background: var(--bg-warm); }
.bg-cream     { background: var(--bg-cream); }
.bg-surface   { background: var(--surface); }
.bg-dark      { background: var(--bg-dark);      color: var(--text-light); }
.bg-dark-deep { background: var(--bg-dark-deep); color: var(--text-muted-dark); }

.section    { padding: 96px 0; }
.section-sm { padding: 64px 0; }
.section-lg { padding: 120px 0; }

@media (max-width: 860px) {
  .section    { padding: 64px 0; }
  .section-sm { padding: 48px 0; }
  .section-lg { padding: 80px 0; }
}
@media (max-width: 767px) {
  .section, .section-lg { padding: 48px 0; }
  .section-sm           { padding: 36px 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  html { scroll-behavior: auto; }
}
