:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Executive Dark Palette (Default) */
  --bg-main: #070a11;
  --bg-surface: #0f1626;
  --bg-surface-elevated: #162035;
  --bg-glass: rgba(15, 22, 38, 0.75);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #38bdf8;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-blue: #0284c7;
  --accent-cyan: #06b6d4;
  --accent-gold: #f59e0b;
  --accent-emerald: #10b981;
  --accent-glow: rgba(2, 132, 199, 0.25);
  --gold-glow: rgba(245, 158, 11, 0.2);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
  --transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --border-subtle: rgba(15, 23, 42, 0.08);
  --border-focus: #0284c7;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;

  --accent-glow: rgba(2, 132, 199, 0.15);
  --gold-glow: rgba(245, 158, 11, 0.15);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 60px rgba(15, 23, 42, 0.12);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Background Atmospheric Glow */
.ambient-canvas {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 0;
  background: 
    radial-gradient(circle at 15% 15%, rgba(2, 132, 199, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 85% 25%, rgba(245, 158, 11, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(16, 185, 129, 0.07) 0%, transparent 50%);
}

.container {
  width: 100%;
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

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

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

/* Badges */
.badge-gold {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--accent-gold);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: var(--radius-full);
}

.badge-emerald {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

/* Navigation Header */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  transition: var(--transition);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  height: 80px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-symbol {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0b1322, #16243b);
  border: 1px solid rgba(245, 158, 11, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 12px rgba(245, 158, 11, 0.15);
  position: relative;
  overflow: hidden;
}

.brand-symbol::after {
  content: '';
  position: absolute;
  top: -50%; left: -50%; width: 200%; height: 200%;
  background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.3) 50%, transparent 60%);
  animation: shimmer 4s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  30%, 100% { transform: translateX(100%); }
}

.brand-info h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-info h1 span.gold {
  color: var(--accent-gold);
}

.brand-tagline {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
  position: relative;
  padding: 6px 0;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-main);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; width: 0; height: 2px;
  background: var(--accent-blue);
  transition: var(--transition);
  border-radius: 2px;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
  box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(2, 132, 199, 0.4);
  background: linear-gradient(135deg, #0369a1, #0284c7);
}

.btn-gold {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0b0f17;
  font-weight: 800;
  box-shadow: 0 8px 24px var(--gold-glow);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(245, 158, 11, 0.4);
}

.btn-ghost {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.btn-ghost:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-focus);
}

.theme-toggle-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
}

.theme-toggle-btn:hover {
  color: var(--text-main);
  background: var(--bg-surface-elevated);
}

/* Language switch: AZ / RU / EN (js/i18n.js) */
.lang-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 42px;
  padding: 0 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.lang-switch:hover,
.lang-switch:focus-within {
  color: var(--text-main);
  background: var(--bg-surface-elevated);
}
.lang-switch select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  outline: none;
  color: inherit;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0 14px 0 0;
  cursor: pointer;
}
.lang-switch::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -5px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  pointer-events: none;
}
.lang-switch select option { color: #0f172a; }

/* HERO SECTION */
.hero-section {
  padding: 90px 0 60px;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 50px;
  align-items: center;
}

.hero-text h2.main-title {
  font-size: clamp(34px, 3.8vw, 52px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.14;
  max-width: 620px;
  margin: 20px 0 24px;
}

/* one calm accent in the headline: brand gold, darker on the light theme for contrast */
.hero-text h2.main-title .title-accent { color: var(--accent-gold); }
[data-theme="light"] .hero-text h2.main-title .title-accent { color: #b45309; }

.hero-text h2.main-title span.highlight-blue {
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-text h2.main-title span.highlight-gold {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 36px;
  max-width: 640px;
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 48px;
}

/* Trust Indicators */
.trust-metrics {
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: space-between;
  gap: 20px;
  padding-top: 32px;
  border-top: 1px solid var(--border-subtle);
}

.metric-item .val {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-main);
  font-family: var(--font-heading);
}

.metric-item .val span.gold { color: var(--accent-gold); }
.metric-item .lbl {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

/* Hero Interactive Terminal / Shield Card */
.hero-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #0284c7, #f59e0b, #10b981);
}

.card-top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.audit-status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-emerald);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.card-system-tabs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.sys-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.sys-row:hover {
  border-color: var(--accent-blue);
  transform: translateX(4px);
}

.sys-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sys-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(2, 132, 199, 0.15);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
}

.sys-title {
  font-size: 14px;
  font-weight: 700;
}

.sys-tag {
  font-size: 11px;
  color: var(--text-dim);
}

.sys-score {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-emerald);
  font-family: var(--font-mono);
}

.card-footer-box {
  background: rgba(245, 158, 11, 0.06);
  border: 1px dashed rgba(245, 158, 11, 0.3);
  padding: 16px;
  border-radius: var(--radius-md);
  text-align: center;
}

.card-footer-box p {
  font-size: 13px;
  color: var(--accent-gold);
  font-weight: 600;
}

/* SECTION COMMONS */
section.page-section {
  padding: 100px 0;
  position: relative;
}

.section-head {
  text-align: center;
  max-width: 740px;
  margin: 0 auto 60px;
}

.section-head h3.sec-title {
  font-size: clamp(30px, 3.4vw, 46px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 16px 0 14px;
}

.section-head p.sec-subtitle {
  font-size: 17px;
  color: var(--text-muted);
}

/* SERVICES SUITE */
.services-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 40px;
}

.pill-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

.pill-btn:hover {
  color: var(--text-main);
  background: var(--bg-surface-elevated);
}

.pill-btn.active {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 28px;
}

.service-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.service-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-focus);
  box-shadow: var(--shadow-lg);
}

.service-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0; width: 80px; height: 80px;
  background: radial-gradient(circle at 100% 0%, var(--accent-glow), transparent 70%);
  pointer-events: none;
}

.srv-icon-box {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 24px;
  color: #38bdf8;
  transition: var(--transition);
}

.service-card:hover .srv-icon-box {
  background: var(--accent-blue);
  color: #fff;
  transform: scale(1.08);
}

.service-card h4.srv-name {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 12px;
}

.service-card p.srv-desc {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.srv-feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
}

.srv-feature-list li {
  font-size: 14px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.srv-feature-list li svg {
  color: var(--accent-emerald);
  flex-shrink: 0;
}

.srv-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.srv-tag {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-gold);
  letter-spacing: 0.05em;
}

.srv-link {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.srv-link:hover {
  transform: translateX(4px);
  color: #38bdf8;
}

/* STANDARDS DIRECTORY MATRIX */
.standards-matrix {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.matrix-header {
  padding: 24px 32px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--bg-surface-elevated);
}

.matrix-search {
  position: relative;
  min-width: 280px;
}

.matrix-search input {
  width: 100%;
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 10px 16px 10px 38px;
  border-radius: var(--radius-full);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}

.matrix-search input:focus {
  border-color: var(--border-focus);
}

.matrix-search svg {
  position: absolute;
  top: 50%; left: 14px; transform: translateY(-50%);
  color: var(--text-dim);
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
}

.matrix-table th {
  text-align: left;
  padding: 16px 24px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-subtle);
  letter-spacing: 0.05em;
}

.matrix-table td {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 14px;
  vertical-align: middle;
}

.matrix-table tr:hover td {
  background: var(--bg-surface-elevated);
}

.std-code-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.std-tag-pill {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: #0284c7;
  padding: 4px 10px;
  border-radius: 6px;
}

.std-badge-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.badge-qms { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.badge-hse { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.badge-food { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.badge-risk { background: rgba(168, 85, 247, 0.15); color: #c084fc; }

/* METHODOLOGY (JEWELER ROADMAP) */
.roadmap-container {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  margin-top: 40px;
  position: relative;
}

@media (max-width: 1024px) {
  .roadmap-container {
    grid-template-columns: 1fr;
  }
}

.roadmap-step {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  position: relative;
  transition: var(--transition);
}

.roadmap-step:hover {
  transform: translateY(-6px);
  border-color: var(--accent-gold);
  box-shadow: 0 10px 30px var(--gold-glow);
}

.step-num-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 20px;
}

.roadmap-step h4 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 10px;
}

.roadmap-step p {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* INTERACTIVE AUDIT CALCULATOR */
.calc-wrapper {
  background: linear-gradient(135deg, var(--bg-surface), #131d33);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 48px;
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: center;
}

@media (max-width: 900px) {
  .calc-wrapper {
    grid-template-columns: 1fr;
    padding: 28px;
  }
}

.calc-inputs {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}

.form-select, .form-input {
  width: 100%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

.form-select:focus, .form-input:focus {
  border-color: var(--border-focus);
}

.checkbox-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.checkbox-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  transition: var(--transition);
}

.checkbox-card:hover {
  border-color: var(--accent-blue);
}

.checkbox-card input[type="checkbox"] {
  accent-color: var(--accent-blue);
  width: 18px;
  height: 18px;
}

.calc-result-box {
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
}

.result-time {
  font-size: 44px;
  font-weight: 900;
  color: var(--accent-gold);
  font-family: var(--font-heading);
  line-height: 1;
  margin: 14px 0 6px;
}

.result-stages {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* EXPERT PROFILE SECTION */
.expert-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 48px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
  align-items: center;
  box-shadow: var(--shadow-md);
}

@media (max-width: 800px) {
  .expert-card {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

.expert-avatar-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.avatar-frame {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #f59e0b);
  padding: 4px;
  box-shadow: var(--shadow-md);
  margin-bottom: 18px;
}

.avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg-surface-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  color: #38bdf8;
  font-weight: 800;
}

.expert-details h3 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 6px;
}

.expert-details .role-text {
  font-size: 16px;
  color: var(--accent-gold);
  font-weight: 700;
  margin-bottom: 18px;
}

.expert-details p.bio {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 24px;
}

.expert-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-pill {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-full);
}

/* CONTACT & CONSULTATION FORM */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 40px;
}

@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; }
}

.contact-info-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.info-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
}

.info-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(2, 132, 199, 0.15);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.info-text h4 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.info-text p, .info-text a {
  font-size: 14px;
  color: var(--text-muted);
}

.contact-form-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-md);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .form-row-2 { grid-template-columns: 1fr; }
}

textarea.form-input {
  min-height: 120px;
  resize: vertical;
}

/* FOOTER */
footer.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 60px 0 30px;
  margin-top: 80px;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}

@media (max-width: 900px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .footer-top { grid-template-columns: 1fr; }
}

.footer-col h5 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 18px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-main);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a,
.footer-links span {
  font-size: 14px;
  color: var(--text-muted);
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--text-main);
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--text-dim);
}

/* Modal / Toast */
.toast-msg {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--accent-emerald);
  color: var(--text-main);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 999;
  transform: translateY(calc(100% + 40px));
  visibility: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0.3s;
}

.toast-msg.show {
  transform: translateY(0);
  visibility: visible;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Narrow screens: the menu links don't fit next to the name and buttons */
@media (max-width: 900px) {
  .nav-links { display: none; }
}

/* ===== Phones and small tablets =====
   The layout above was built for wide screens; these rules make it fit
   a phone without sideways scrolling. */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-card { max-width: 560px; }
}

@media (max-width: 600px) {
  .container { padding: 0 16px; }
  section.page-section { padding-top: 64px; padding-bottom: 64px; }

  /* header: name, theme switch and the order button side by side */
  .nav-row { height: 64px; gap: 10px; }
  .brand-wrapper { gap: 10px; min-width: 0; }
  .brand-symbol { width: 36px; height: 36px; flex-shrink: 0; }
  .brand-info h1 { font-size: 16px; white-space: nowrap; }
  .nav-actions { gap: 8px; flex-shrink: 0; }
  .theme-toggle-btn { width: 36px; height: 36px; }
  .nav-actions .btn { display: none; } /* the same action is the first hero button */
  .lang-switch { height: 36px; padding: 0 8px; }

  /* hero */
  .hero-section { padding: 40px 0 40px; }
  .hero-text h2.main-title { font-size: 30px; margin: 16px 0 18px; }
  .hero-description { font-size: 15.5px; margin-bottom: 26px; }
  .hero-cta-group { margin-bottom: 32px; gap: 10px; }
  .hero-cta-group .btn { width: 100%; }
  .badge-gold, .badge-emerald { white-space: normal; text-align: left; }
  .trust-metrics { grid-template-columns: 1fr 1fr; gap: 18px 14px; padding-top: 24px; }
  .metric-item .val { font-size: 24px; }
  .hero-card { padding: 20px; }
  .card-top-header { flex-wrap: wrap; gap: 10px; }
  .sys-row { gap: 10px; }
  .sys-meta { min-width: 0; }
  .sys-tag { white-space: normal; }

  /* services */
  .services-grid { grid-template-columns: 1fr; gap: 16px; }
  .services-pills { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start;
    margin: 0 -16px 28px; padding: 0 16px 6px; scrollbar-width: none; }
  .services-pills::-webkit-scrollbar { display: none; }
  .pill-btn { flex-shrink: 0; padding: 9px 16px; font-size: 13px; }

  /* standards table becomes a list of cards */
  .matrix-header { padding: 18px; }
  .matrix-search { min-width: 0; width: 100%; }
  .matrix-table thead { display: none; }
  .matrix-table, .matrix-table tbody { display: block; }
  .matrix-table tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-subtle);
  }
  .matrix-table td { display: block; padding: 0; border: 0; }
  .matrix-table td:nth-child(1),
  .matrix-table td:nth-child(2) { flex-basis: 100%; }
  .matrix-table td:nth-child(4),
  .matrix-table td:nth-child(5) { font-size: 12.5px; color: var(--text-muted); }
  .matrix-table td:nth-child(5)::before { content: '·'; margin-right: 10px; }

  /* calculator, expert, contact */
  .calc-wrapper { padding: 20px; gap: 24px; }
  .calc-result-box { padding: 22px; }
  .result-time { font-size: 36px; }
  .expert-card { padding: 24px; gap: 24px; }
  .avatar-frame { width: 140px; height: 140px; }
  .contact-form-card { padding: 20px; }
  .toast-msg { left: 16px; right: 16px; bottom: 16px; }
  /* 16px stops iPhone from zooming in when a field is tapped */
  .form-input, .form-select { font-size: 16px; }
}

@media (max-width: 600px) {
  .contact-grid > * { min-width: 0; }
  .info-item a, .info-item p { overflow-wrap: anywhere; }
}

/* Very small phones (320–359px) */
@media (max-width: 359px) {
  .brand-info h1 { font-size: 15px; }
  .lang-switch svg { display: none; }
}

/* Longer RU/EN texts: let grid columns shrink instead of growing past the screen */
.calc-wrapper > *,
.calc-inputs > *,
.checkbox-group > * { min-width: 0; }
.form-select { max-width: 100%; text-overflow: ellipsis; }

/* Header: menu + language + theme + order button need ~1240px (Russian is longest).
   Below that the order button goes (it is the first hero button), below 1024 the menu goes. */
@media (max-width: 1280px) {
  .nav-links { gap: 20px; }
}
@media (max-width: 1240px) {
  .nav-actions .btn { display: none; }
}
@media (max-width: 1024px) {
  .nav-links { display: none; }
}
