/* ============================================
   BASE.CSS — Custom Properties, Reset, Typography
   ============================================ */

:root {
  /* Colors */
  --color-primary: #1A1A1A;
  --color-accent: #C8922A;
  --color-accent-dark: #a87420;
  --color-bg: #F5F2EE;
  --color-surface: #FFFFFF;
  --color-muted: #6B6B6B;
  --color-border: #E0DBD4;
  --color-dark: #111111;
  --color-error: #C0392B;
  /* Semantic aliases + tokens referenced by people/leaders components */
  --color-text: var(--color-primary);
  --color-bg-alt: #EDE8E1;

  /* Typography — single family covers Cyrillic + Latin identically */
  --font-base: 'Geologica', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Geologica', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  /* Aliases kept for backwards compatibility */
  --font-display: var(--font-heading);
  --font-body: var(--font-base);

  /* Type scale */
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.25rem;
  --text-2xl: clamp(1.5rem, 2.5vw, 2rem);

  /* Spacing */
  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  --space-5xl: 8rem;

  /* Layout */
  --container-max: 1440px;
  --container-pad: clamp(1rem, 5vw, 4rem);
  --section-pad: clamp(3rem, 6vw, 5.5rem);
  --header-h: 80px; /* fixed header clearance used by heroes/breadcrumbs */

  /* Shadows */
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.1);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
}

/* ============================================
   RESET
   ============================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-base);
  background-color: var(--color-bg);
  color: var(--color-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1, "liga" 1;
}

img, video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  font: inherit;
  border: none;
  background: none;
}

input, textarea, select {
  font: inherit;
}

address {
  font-style: normal;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 800;
  overflow-wrap: break-word;
}

h1 { font-size: clamp(2.8rem, 6vw, 5.5rem); font-weight: 900; }
h2 { font-size: clamp(1.75rem, 3.5vw, 3rem); font-weight: 800; }
h3 { font-size: clamp(1.15rem, 2vw, 1.75rem); font-weight: 700; }
h4 { font-size: clamp(1rem, 1.5vw, 1.35rem); font-weight: 600; }

p {
  font-size: clamp(0.95rem, 1.2vw, 1.05rem);
  line-height: 1.7;
}

.mono {
  font-family: var(--font-mono);
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */

.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section {
  padding-block: var(--section-pad);
}

/* Vertical rhythm: a section's own padding is always symmetric (colored
   bands need it on both edges). Only when two sections sit on the same
   page background would their pads stack into a double gap — collapse
   the second one's top pad so consecutive sections share a single gap. */
.section:not(.section--bg):not(.section--dark) + .section:not(.section--bg):not(.section--dark) {
  padding-top: 0;
}

.section--dark {
  background-color: var(--color-primary);
  color: var(--color-surface);
}

.section--bg {
  background-color: var(--color-surface);
}

.section__title {
  margin-bottom: var(--space-3xl);
}

.section__title--light {
  color: var(--color-surface);
}

.section__footer {
  margin-top: var(--space-3xl);
  text-align: center;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(2rem); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeUp 0.6s ease forwards;
}

/* Hero entrance — staggered on page load */
@keyframes heroSlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero__title   { animation: heroSlideUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both; }
.hero__sub     { animation: heroSlideUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.2s  both; }
.hero__actions { animation: heroSlideUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.35s both; }
.hero__scroll-hint { animation: heroSlideUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both; }

/* ============================================
   ACCENT WORD — hero headline highlight
   ============================================ */

.accent-word {
  color: var(--color-accent);
  position: relative;
  display: inline-block;
}

.accent-word::after {
  content: '';
  position: absolute;
  /* em-based offset scales with the headline size so the line clears
     Cyrillic descenders on every breakpoint (line-height on the hero
     title is 0.95, so px offsets end up inside the glyphs on mobile) */
  bottom: -0.14em;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  animation: underline-in 0.6s ease 0.9s forwards;
}

@keyframes underline-in {
  to { transform: scaleX(1); }
}

/* ============================================
   SCROLL REVEAL — animate-on-scroll
   Requires .js class on <html> (added by main.js)
   ============================================ */

.js .animate-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.js .animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger siblings */
.js .animate-on-scroll:nth-child(2) { transition-delay: 0.09s; }
.js .animate-on-scroll:nth-child(3) { transition-delay: 0.18s; }
.js .animate-on-scroll:nth-child(4) { transition-delay: 0.27s; }
.js .animate-on-scroll:nth-child(5) { transition-delay: 0.36s; }

/* ============================================
   CURSOR DOT — desktop only
   ============================================ */

.cursor-dot {
  width: 8px;
  height: 8px;
  background: var(--color-accent);
  border-radius: 50%;
  position: fixed;
  top: -4px;
  left: -4px;
  pointer-events: none;
  z-index: 9999;
  will-change: transform;
  transition: width 0.2s ease, height 0.2s ease,
              top 0.2s ease, left 0.2s ease,
              background 0.2s ease, border 0.2s ease;
}

.cursor-dot.is-hovering {
  width: 40px;
  height: 40px;
  top: -20px;
  left: -20px;
  background: transparent;
  border: 2px solid var(--color-accent);
}

/* Hide on touch devices */
@media (hover: none), (pointer: coarse) {
  .cursor-dot { display: none; }
}

/* ============================================
   HERO SCROLL HINT
   ============================================ */

.hero__scroll-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: var(--space-xl);
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color var(--transition-base);
  text-decoration: none;
}

.hero__scroll-hint:hover {
  color: var(--color-accent);
}

/* ============================================
   STAT NUMBERS
   ============================================ */

.stat-number {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(3rem, 7vw, 6.5rem);
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1;
  letter-spacing: -0.04em;
}

.stat-label {
  display: block;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
  margin-top: var(--space-xs);
}

/* Rich text content */
.rich-text p { margin-bottom: var(--space-lg); }
.rich-text h2 { margin-top: var(--space-3xl); margin-bottom: var(--space-lg); }
.rich-text h3 { margin-top: var(--space-xl); margin-bottom: var(--space-md); }
.rich-text ul, .rich-text ol { margin-bottom: var(--space-lg); padding-left: var(--space-xl); list-style: disc; }
.rich-text ol { list-style: decimal; }
.rich-text li { margin-bottom: var(--space-xs); }
.rich-text dl { margin-bottom: var(--space-lg); }
.rich-text dt { font-weight: 600; margin-top: var(--space-lg); }
.rich-text dd { margin-left: 0; margin-bottom: var(--space-sm); }
