/* ============================================================
   LuxMed — Assuta brand system
   Palette: Assuta Blue #0D2D6E + Assuta Green #74C043
            White / light cool neutrals as dominant surface
   Type:    Fraunces (display serif) + Inter (body sans) + JetBrains Mono
   ============================================================ */

:root {
  /* Core Assuta brand */
  --ink:        #0D2D6E;   /* Blue/700 — primary brand */
  --ink-80:     #0A2458;   /* Blue/900 — deeper */
  --ink-60:     rgba(13, 45, 110, 0.70);
  --ink-40:     rgba(13, 45, 110, 0.48);
  --ink-20:     rgba(13, 45, 110, 0.22);
  --ink-10:     rgba(13, 45, 110, 0.12);
  --ink-05:     rgba(13, 45, 110, 0.06);

  --blue-500:   #3D578B;   /* Blue/500 — mid */
  --blue-100:   #E2E6EE;   /* Blue/100 — very light */

  --paper:      #FFFFFF;
  --paper-2:    #F4F6F8;   /* Surface/Soft */
  --paper-3:    #E2E6EE;   /* Blue/100 */
  --snow:       #FFFFFF;
  --white:      #FFFFFF;
  --border-soft: #D4DCE7;

  /* Accent green — used ONLY for micro-highlights, underline, active states */
  --clay:       #74C043;   /* Green/700 — Assuta Green (для фонов/иконок/кнопок) */
  --clay-dark:  #3D6E1E;   /* Green/900 — WCAG AA pass on white (для текста и цен) */
  --clay-soft:  #E6F4DD;   /* Green/100 */

  --sage:       #74C043;
  --sage-dark:  #5FA336;

  --gold:       #74C043;
  --coral:      #74C043;

  --success:    #74C043;

  /* Spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;

  /* Density multiplier (tweak) */
  --density: 1;

  /* Radii */
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 32px;
  --r-pill: 999px;

  /* Type */
  --font-display: 'Fraunces', 'Times New Roman', serif;
  --font-body: 'Inter', 'Helvetica Neue', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(13, 45, 110, 0.06), 0 0 0 1px rgba(13, 45, 110, 0.04);
  --shadow-md: 0 6px 24px -8px rgba(13, 45, 110, 0.18), 0 2px 6px rgba(13, 45, 110, 0.04);
  --shadow-lg: 0 20px 48px -20px rgba(13, 45, 110, 0.26), 0 4px 12px rgba(13, 45, 110, 0.06);

  --maxw: 1280px;
}

/* Dark-luxury theme */
:root[data-theme="dark"] {
  --ink:        #F4F6F8;
  --ink-80:     #E2E6EE;
  --ink-60:     rgba(244, 246, 248, 0.7);
  --ink-40:     rgba(244, 246, 248, 0.45);
  --ink-20:     rgba(244, 246, 248, 0.2);
  --ink-10:     rgba(244, 246, 248, 0.12);
  --ink-05:     rgba(244, 246, 248, 0.06);
  --paper:      #0A1A3B;
  --paper-2:    #0D2152;
  --paper-3:    #13306E;
  --snow:       #0D2D6E;
  --white:      #13306E;
  --clay:       #90CD69;
  --clay-soft:  rgba(116, 192, 67, 0.18);
  --sage:       #90CD69;
  --gold:       #90CD69;
}

/* Accent variants (tweak) */
:root[data-accent="clay"]   { --clay: #74C043; --clay-dark: #3D6E1E; --clay-soft: #E6F4DD; }
:root[data-accent="sage"]   { --clay: #74C043; --clay-dark: #3D6E1E; --clay-soft: #E6F4DD; }
:root[data-accent="cobalt"] { --clay: #0D2D6E; --clay-dark: #0A2458; --clay-soft: #E2E6EE; }
:root[data-accent="plum"]   { --clay: #3D578B; --clay-dark: #0D2D6E; --clay-soft: #E2E6EE; }

/* Direction presets */
:root[data-direction="clinical"] {
  --ink: #0D2D6E; --ink-80: #0A2458;
  --paper: #FFFFFF; --paper-2: #F4F6F8; --paper-3: #E2E6EE; --snow: #FFFFFF;
  --clay: #74C043; --clay-dark: #3D6E1E; --clay-soft: #E6F4DD;
  --sage: #74C043;
  --font-display: 'Fraunces','Times New Roman',serif;
  --font-body: 'Inter',system-ui,sans-serif;
}
:root[data-direction="tech"] {
  --ink: #0D2D6E; --ink-80: #0A2458;
  --paper: #FFFFFF; --paper-2: #F4F6F8; --paper-3: #E2E6EE; --snow: #FFFFFF;
  --clay: #74C043; --clay-dark: #3D6E1E; --clay-soft: #E6F4DD;
  --sage: #74C043;
  --font-display: 'Inter',system-ui,sans-serif;
  --font-body: 'Inter',system-ui,sans-serif;
}
:root[data-direction="tech"] .display-xl,
:root[data-direction="tech"] .display-lg,
:root[data-direction="tech"] .display-md,
:root[data-direction="tech"] .display-sm {
  font-weight: 500; letter-spacing: -0.03em;
}
:root[data-direction="tech"] .italic-accent { font-style: normal; font-weight: 500; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv01";
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }
img { max-width: 100%; display: block; }

/* Tabular numerals — ровные столбики цифр в статистике, ценах, таблицах */
.stat-big, .stat-deck, .mini-card .mv, .pp, .unit,
.pc-price, .cmp-price, .price, .price-row, .rating, .review-rating,
.trust-big, .data-big, .doc-stats, .hero-trust-big,
table, .tabular { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* Stat-tail — хвост процентов/единиц к крупному числу (пример: 95.6% → ".6%" в clay на baseline) */
.stat-tail {
  font-size: 0.5em;
  vertical-align: baseline;
  color: var(--clay-dark);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-left: 0.03em;
  font-variant-numeric: tabular-nums;
}
/* На тёмных фонах хвост остаётся светло-зелёным (контраст инвертирован) */
.contact .stat-tail, .data .stat-tail { color: var(--clay); }

/* Моно по-умолчанию tabular — но прописываем явно */
[style*="var(--font-mono)"], .mono,
*[class*="mono"] { font-variant-numeric: tabular-nums; }

/* ------ Typography system ------ */
.eyebrow {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-60);
  font-weight: 500;
}
.display-xl {
  font-family: var(--font-display);
  font-weight: 350;
  font-size: clamp(44px, 6vw, 80px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  font-variation-settings: "SOFT" 30, "opsz" 144;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}
.display-lg {
  font-family: var(--font-display);
  font-weight: 350;
  font-size: clamp(40px, 5.2vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  font-variation-settings: "SOFT" 30, "opsz" 144;
  margin: 0;
  text-wrap: balance;
}
.display-md {
  font-family: var(--font-display);
  font-weight: 380;
  font-size: clamp(32px, 3.6vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  font-variation-settings: "SOFT" 30, "opsz" 100;
  margin: 0;
  text-wrap: balance;
}
.display-sm {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0;
}
.italic-accent { font-style: italic; font-weight: 300; color: var(--clay-dark); }
/* На тёмных фонах italic-accent остаётся светло-зелёным */
.contact .italic-accent, .data .italic-accent, .process .italic-accent { color: var(--clay); }

.body-lg { font-size: 19px; line-height: 1.55; color: var(--ink-80); }
@media (max-width: 640px) { .body-lg { font-size: 18px; } }
.body-md { font-size: 16px; line-height: 1.55; color: var(--ink-80); }
.body-sm { font-size: 14px; line-height: 1.5; color: var(--ink-60); }
.caption { font-size: 12px; line-height: 1.4; color: var(--ink-60); letter-spacing: 0.02em; }

/* ------ Buttons ------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: var(--r-pill);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
  line-height: 1;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover { background: var(--clay); color: var(--snow); }

.btn-clay {
  background: var(--clay);
  color: #FFF8EE;
}
.btn-clay:hover { background: var(--clay-dark); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink-20);
}
.btn-ghost:hover { border-color: var(--ink); background: var(--ink-05); }

.btn-outline-paper {
  background: transparent;
  color: var(--paper);
  border: 1px solid rgba(255, 248, 238, 0.3);
}
.btn-outline-paper:hover { background: rgba(255, 248, 238, 0.08); border-color: var(--paper); }

.btn-sm { padding: 10px 16px; font-size: 13px; }
.btn-lg { padding: 18px 28px; font-size: 16px; }

/* Arrow glyph inside buttons */
.btn-arrow {
  width: 8px; height: 8px;
  border-right: 1.5px solid currentColor;
  border-top: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-right: 2px;
  transition: transform 0.2s ease;
}
.btn:hover .btn-arrow { transform: rotate(45deg) translate(2px, -2px); }

/* ------ Layout ------ */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
}
.section { padding: calc(var(--s-9) * var(--density)) 0; }
.section-sm { padding: calc(var(--s-8) * var(--density)) 0; }
.section-tight { padding: calc(var(--s-7) * var(--density)) 0; }

.grain {
  position: relative;
}
.grain::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: none;
  z-index: 0;
}

/* Divider glyph used between sections */
.divider-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: var(--ink-40);
  padding: var(--s-6) 0;
}
.divider-mark::before, .divider-mark::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ink-20), transparent);
  max-width: 120px;
}

/* Chip / tag */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-size: 12px;
  letter-spacing: 0.02em;
  border: 1px solid var(--ink-20);
  color: var(--ink-80);
  background: var(--snow);
}
.chip.chip-dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(63, 122, 91, 0.18);
}
.chip.chip-clay { background: var(--clay-soft); color: var(--clay-dark); border-color: transparent; }
.chip.chip-ink { background: var(--ink); color: var(--paper); border-color: transparent; }

/* Card */
.card {
  background: var(--snow);
  border: 1px solid var(--ink-10);
  border-radius: var(--r-lg);
  padding: calc(var(--s-6) * var(--density));
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.card:hover { border-color: var(--ink-20); box-shadow: var(--shadow-md); }

/* Focus states */
:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Reveal on scroll */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.reveal { opacity: 0; }
.reveal.in-view { animation: fade-up 0.8s cubic-bezier(.2,.7,.2,1) forwards; }
.reveal.in-view.d1 { animation-delay: 0.08s; }
.reveal.in-view.d2 { animation-delay: 0.16s; }
.reveal.in-view.d3 { animation-delay: 0.24s; }
.reveal.in-view.d4 { animation-delay: 0.32s; }

/* Scroll bar touch-up */
::selection { background: var(--clay); color: var(--paper); }

/* Utility */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 24px; }
.gap-6 { gap: 32px; }
.text-center { text-align: center; }
.hidden { display: none; }
