/* style.css — СК Авангард. Металлоцех. */

/* ===== FONTS ===== */
/* Cabinet Grotesk (display, Fontshare) + Inter (body, Google) — precise industrial-technical feel */

/* ===== DESIGN TOKENS ===== */
:root,
[data-theme='light'] {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 4.75rem);
  --text-hero: clamp(2.75rem, 0.5rem + 6vw, 6.5rem);

  /* Spacing (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Surfaces — cool steel-white */
  --color-bg: #f5f6f8;
  --color-surface: #ffffff;
  --color-surface-2: #fbfcfd;
  --color-surface-offset: #eceef2;
  --color-surface-offset-2: #e2e5eb;
  --color-surface-dynamic: #d8dce3;
  --color-divider: #e1e4e9;
  --color-border: #d3d7de;

  /* Text — deep navy-charcoal */
  --color-text: #0e1b2e;
  --color-text-muted: #56616f;
  --color-text-faint: #98a1ab;
  --color-text-inverse: #f5f7fa;

  /* Primary Accent — industrial navy (from brochure cover) */
  --color-primary: #0a2540;
  --color-primary-hover: #133a63;
  --color-primary-active: #071627;
  --color-primary-highlight: #d7e0ea;

  /* Steel Blue secondary accent */
  --color-steel: #2f6fa8;
  --color-steel-hover: #245a8a;

  /* Warning */
  --color-warning: #a3591a;
  --color-warning-hover: #7c4213;
  --color-warning-highlight: #ecdcc9;

  /* Error */
  --color-error: #b4302f;
  --color-error-hover: #8f2423;
  --color-error-highlight: #ecd4d3;

  /* Success */
  --color-success: #2c7a4b;
  --color-success-hover: #1f5c38;
  --color-success-highlight: #d3e6da;

  /* Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.625rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

  /* Shadows (cool-toned) */
  --shadow-sm: 0 1px 2px oklch(0.15 0.03 250 / 0.08);
  --shadow-md: 0 4px 16px oklch(0.15 0.03 250 / 0.10);
  --shadow-lg: 0 16px 40px oklch(0.15 0.03 250 / 0.16);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 1080px;
  --content-wide: 1280px;
  --content-full: 100%;

  /* Fonts */
  --font-display: 'Cabinet Grotesk', 'Arial Narrow', sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', sans-serif;
}

[data-theme='dark'] {
  --color-bg: #0a1220;
  --color-surface: #101a2b;
  --color-surface-2: #142032;
  --color-surface-offset: #182537;
  --color-surface-offset-2: #1e2c40;
  --color-surface-dynamic: #263652;
  --color-divider: #223349;
  --color-border: #2c3e57;
  --color-text: #e6eaf0;
  --color-text-muted: #9aa7b8;
  --color-text-faint: #647084;
  --color-text-inverse: #0e1b2e;
  --color-primary: #6f9fca;
  --color-primary-hover: #8db5da;
  --color-primary-active: #557fa8;
  --color-primary-highlight: #1e3350;
  --color-steel: #6f9fca;
  --color-steel-hover: #8db5da;
  --color-warning: #d38a4c;
  --color-warning-hover: #e3a468;
  --color-warning-highlight: #3a2c1c;
  --color-error: #e07271;
  --color-error-hover: #ea9291;
  --color-error-highlight: #3a2222;
  --color-success: #5cba81;
  --color-success-hover: #7bcf9c;
  --color-success-highlight: #1c3626;
  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 4px 16px oklch(0 0 0 / 0.4);
  --shadow-lg: 0 16px 40px oklch(0 0 0 / 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0a1220;
    --color-surface: #101a2b;
    --color-surface-2: #142032;
    --color-surface-offset: #182537;
    --color-surface-offset-2: #1e2c40;
    --color-surface-dynamic: #263652;
    --color-divider: #223349;
    --color-border: #2c3e57;
    --color-text: #e6eaf0;
    --color-text-muted: #9aa7b8;
    --color-text-faint: #647084;
    --color-text-inverse: #0e1b2e;
    --color-primary: #6f9fca;
    --color-primary-hover: #8db5da;
    --color-primary-active: #557fa8;
    --color-primary-highlight: #1e3350;
    --color-steel: #6f9fca;
    --color-steel-hover: #8db5da;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
    --shadow-md: 0 4px 16px oklch(0 0 0 / 0.4);
    --shadow-lg: 0 16px 40px oklch(0 0 0 / 0.5);
  }
}

/* ===== LAYOUT PRIMITIVES ===== */
.container {
  max-width: var(--content-default);
  margin-inline: auto;
  padding-inline: var(--space-5);
}
.container-wide {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-5);
}
.container-narrow {
  max-width: var(--content-narrow);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

section {
  padding-block: clamp(var(--space-16), 8vw, var(--space-24));
}

.section-tight {
  padding-block: clamp(var(--space-10), 5vw, var(--space-16));
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-steel);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.eyebrow::before {
  content: '';
  width: 20px;
  height: 2px;
  background: var(--color-steel);
  display: inline-block;
}

h1 { font-size: var(--text-hero); font-weight: 650; }
h2 { font-size: var(--text-2xl); font-weight: 650; }
h3 { font-size: var(--text-lg); font-weight: 650; }
h4 { font-size: var(--text-base); font-weight: 700; }

p { color: var(--color-text-muted); }
.lede { font-size: var(--text-lg); color: var(--color-text-muted); max-width: 42ch; }

/* ===== HEADER ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: color-mix(in oklab, var(--color-surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid oklch(from var(--color-text) l c h / 0.08);
}
.site-header .container-wide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
  letter-spacing: 0.01em;
}
.logo svg { width: 38px; height: 38px; flex-shrink: 0; }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-text .sub { font-family: var(--font-body); font-size: var(--text-xs); font-weight: 500; color: var(--color-text-muted); letter-spacing: 0.04em; text-transform: uppercase; }
.header-logo-text { font-size: var(--text-base); letter-spacing: 0.02em; text-transform: uppercase; }

.header-phone { font-size: var(--text-sm); font-weight: 500; color: var(--color-text); text-decoration: none; white-space: nowrap; }
.header-phone:hover { color: var(--color-steel); }
@media (max-width: 860px) { .header-phone { display: none; } }

.nav-desktop {
  display: none;
  align-items: center;
  gap: var(--space-8);
}
.nav-desktop a {
  color: var(--color-text);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
}
.nav-desktop a:hover { color: var(--color-steel); }

.header-actions { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }

.header-actions .btn-primary { display: none; }

.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--color-text);
  flex-shrink: 0;
}
.nav-toggle svg { width: 22px; height: 22px; }

@media (min-width: 640px) {
  .header-actions { gap: var(--space-3); }
  .header-actions .btn-primary { display: inline-flex; }
}

@media (min-width: 900px) {
  .nav-desktop { display: flex; }
  .nav-toggle[data-nav-toggle] { display: none; }
}

.mobile-menu {
  position: fixed;
  inset: 72px 0 0 0;
  background: var(--color-surface);
  z-index: 99;
  padding: var(--space-8) var(--space-5);
  display: none;
  overflow-y: auto;
}
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: block;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-divider);
  color: var(--color-text);
  text-decoration: none;
  font-size: var(--text-lg);
  font-weight: 600;
}
.mobile-menu a[href="./application.html"] {
  color: var(--color-primary);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  min-height: 44px;
  white-space: nowrap;
  transition:
    background var(--transition-interactive),
    color var(--transition-interactive),
    box-shadow var(--transition-interactive),
    transform var(--transition-interactive),
    border-color var(--transition-interactive);
}
.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--color-primary-hover); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); box-shadow: var(--shadow-sm); }

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover { border-color: var(--color-steel); color: var(--color-steel); }

.btn-ghost {
  background: transparent;
  color: var(--color-text-inverse);
  border: 1px solid oklch(from var(--color-text-inverse) l c h / 0.3);
}
.btn-ghost:hover { background: oklch(from var(--color-text-inverse) l c h / 0.1); }

.btn-block { width: 100%; }

/* ===== CARDS ===== */
.card {
  background: var(--color-surface);
  border: 1px solid oklch(from var(--color-text) l c h / 0.08);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding-block: var(--space-16) var(--space-8);
}
.site-footer a { color: var(--color-text-inverse); }
.site-footer .footer-muted { color: oklch(from var(--color-text-inverse) l c h / 0.65); }
.site-footer hr { border: none; border-top: 1px solid oklch(from var(--color-text-inverse) l c h / 0.15); margin-block: var(--space-8); }

/* ===== SCROLL REVEAL ===== */
.reveal { opacity: 1; }
@supports (animation-timeline: view()) {
  .reveal {
    opacity: 0;
    animation: reveal-fade linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 40%;
  }
}
@keyframes reveal-fade { to { opacity: 1; } }

/* ===== UTILITY ===== */
.text-center { text-align: center; }
.mx-auto { margin-inline: auto; }
.grid { display: grid; gap: var(--space-6); }
.flex { display: flex; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-steel);
  background: var(--color-primary-highlight);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
}
