/* ============================================================================
   ЭПИКО — site styles. Палитра: Trial Blue.
   Структура: reset / tokens / base / layout / header / footer / components / pages / responsive.
   ============================================================================ */

/* ───── tokens ───── */
:root {
  --primary:        #1E5BFF;
  --primary-hover:  #1644CC;
  --accent:         #00B8D9;
  --bg:             #FFFFFF;
  --bg-soft:        #F0F6FF;
  --text:           #0A1F44;
  --muted:          #4A5878;
  --border:         #D6E1F0;
  --shadow-sm:      0 1px 3px rgba(10,31,68,.06);
  --shadow-md:      0 6px 24px rgba(10,31,68,.08);
  --radius-sm:      8px;
  --radius:         10px;
  --radius-lg:      14px;
  --max-w:          1180px;
  --header-h:       72px;
}

/* ───── reset ───── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  font-size: 16px; line-height: 1.55;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { letter-spacing: -0.01em; }

/* ───── layout ───── */
.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
main { display: block; }
section { padding: 80px 0; }
section.alt { background: var(--bg-soft); }
.section-eyebrow {
  display: inline-block; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--primary); font-weight: 600; margin-bottom: 12px;
}
.section-title { font-size: clamp(26px, 3vw, 36px); margin: 0 0 14px; font-weight: 700; }
.section-subtitle { font-size: 17px; color: var(--muted); max-width: 720px; margin: 0 0 48px; line-height: 1.55; }

/* ───── header ───── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(6px);
  -webkit-backdrop-filter: saturate(180%) blur(6px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; color: var(--text); font-size: 18px; letter-spacing: 0.2px;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-mark { height: 36px; width: auto; display: block; }
.nav { display: flex; gap: 28px; }
.nav a { color: var(--muted); font-weight: 500; font-size: 15px; }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a.nav-active {
  color: var(--text); position: relative;
}
.nav a.nav-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -26px;
  height: 2px; background: var(--primary);
}
.menu-toggle {
  display: none; background: transparent; border: 0; cursor: pointer;
  width: 40px; height: 40px; padding: 0;
  align-items: center; justify-content: center;
  color: var(--text);
}
.menu-toggle svg { width: 22px; height: 22px; }


/* ───── header — mobile menu ───── */
.mobile-nav {
  display: none;
  position: fixed; inset: var(--header-h) 0 0 0; z-index: 40;
  background: var(--bg);
  padding: 24px;
  flex-direction: column; gap: 4px;
  border-top: 1px solid var(--border);
  overflow-y: auto;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  display: block; padding: 16px 4px;
  color: var(--text); font-size: 18px; font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.mobile-nav .btn { margin-top: 16px; align-self: stretch; }

/* ───── buttons ───── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 22px; border-radius: var(--radius);
  font: inherit; font-weight: 600; font-size: 15px;
  cursor: pointer; border: 1px solid transparent; line-height: 1.2;
  transition: transform .06s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-soft); text-decoration: none; }
.btn:active { transform: translateY(1px); }

/* ───── hero ───── */
.hero {
  position: relative;
  padding: 120px 0 100px;
  color: #fff;
  background:
    /* Очень лёгкое затемнение слева под белый текст */
    linear-gradient(90deg,
      rgba(10, 31, 68, 0.28) 0%,
      rgba(10, 31, 68, 0.18) 40%,
      rgba(10, 31, 68, 0.05) 70%,
      rgba(10, 31, 68, 0.00) 100%
    ),
    /* Само фото */
    url('../img/photos/hero-bg.png?v=4') center center / cover no-repeat,
    /* Фоллбек на случай ошибки загрузки */
    var(--text);
}
.hero h1 {
  font-size: clamp(32px, 4.5vw, 52px);
  line-height: 1.1; margin: 0 0 20px;
  font-weight: 700; max-width: 820px; letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.7), 0 1px 3px rgba(0, 0, 0, 0.6);
}
.hero p.lead {
  font-size: clamp(16px, 1.5vw, 19px);
  color: #fff;
  max-width: 660px; margin: 0 0 32px; line-height: 1.55;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.6), 0 1px 2px rgba(0, 0, 0, 0.5);
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .btn-primary { background: var(--primary); color: #fff; }
.hero .btn-primary:hover { background: #2D6BFF; }
.hero .btn-ghost {
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.40);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.hero .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.5);
}
.hero .meta-row {
  margin-top: 56px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.18); padding-top: 32px;
}
.hero .meta-row .stat-num { font-size: 28px; font-weight: 700; color: var(--accent); text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5); }
.hero .meta-row .stat-label { font-size: 13px; color: rgba(255, 255, 255, 0.88); margin-top: 4px; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5); }

/* ───── inner-page hero (less tall) ───── */
.page-hero {
  padding: 72px 0 56px;
  background:
    radial-gradient(40% 60% at 100% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    var(--bg);
  border-bottom: 1px solid var(--border);
}
.page-hero h1 { font-size: clamp(28px, 3.6vw, 42px); margin: 0 0 14px; font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; }
.page-hero p.lead { font-size: clamp(15px, 1.4vw, 18px); color: var(--muted); max-width: 720px; margin: 0; }

/* page-hero вариант с фото-фоном.
   Используем background-image (задаётся inline на странице — путь
   относителен HTML, как и положено), а градиентный overlay рисуем
   через ::before. Так избегаем подвоха с URL-резолвом в var(). */
.page-hero.with-photo {
  position: relative;
  padding: 96px 0 80px;
  color: #fff;
  background-color: var(--text);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-bottom: 0;
  overflow: hidden;
}
.page-hero.with-photo::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg,
    rgba(10, 31, 68, 0.28) 0%,
    rgba(10, 31, 68, 0.18) 40%,
    rgba(10, 31, 68, 0.05) 75%,
    rgba(10, 31, 68, 0.00) 100%
  );
  pointer-events: none;
  z-index: 0;
}

.page-hero.with-photo > .container {
  position: relative;
  z-index: 1;
}
.page-hero.with-photo h1 {
  color: #fff;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.7), 0 1px 3px rgba(0, 0, 0, 0.6);
}
.page-hero.with-photo p.lead {
  color: #fff;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.6), 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* ───── service cards ───── */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.service-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 28px; transition: border-color .2s, transform .2s, box-shadow .2s;
}
.service-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.service-icon {
  width: 44px; height: 44px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary);
  display: grid; place-items: center; margin-bottom: 16px; font-size: 22px;
}
.service-card h3 { font-size: 18px; margin: 0 0 8px; }
.service-card p { font-size: 15px; color: var(--muted); margin: 0; }

/* ───── 4-col grids (phases, principles, stats) ───── */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.flat-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 24px;
}
.flat-card h3 { font-size: 17px; margin: 0 0 10px; }
.flat-card p { font-size: 14.5px; color: var(--muted); margin: 0; line-height: 1.55; }

/* ───── number card (used in stats) ───── */
.num-card { padding: 0; border: 0; background: transparent; }
.num-card .num { font-size: 40px; font-weight: 700; color: var(--primary); line-height: 1; }
.num-card .lab { font-size: 14px; color: var(--muted); margin-top: 10px; }

/* ───── function list (services by function) ───── */
.func-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px;
}
.func-list li {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px 24px;
}
.func-list h4 { font-size: 16px; margin: 0 0 6px; }
.func-list p { font-size: 14.5px; color: var(--muted); margin: 0; line-height: 1.55; }

/* ───── tag cloud (therapeutic areas) ───── */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
  display: inline-block;
  padding: 8px 14px; border-radius: 99px;
  background: var(--bg-soft); color: var(--text);
  font-size: 14px; font-weight: 500;
  border: 1px solid var(--border);
}

/* ───── portfolio matrix ───── */
.matrix-wrap { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.matrix { width: 100%; border-collapse: collapse; font-size: 15px; }
.matrix th, .matrix td {
  padding: 14px 18px; text-align: center;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.matrix th:last-child, .matrix td:last-child { border-right: 0; }
.matrix tr:last-child td { border-bottom: 0; }
.matrix thead th { background: var(--bg-soft); color: var(--text); font-weight: 600; letter-spacing: 0.02em; }
.matrix tbody th { background: var(--bg-soft); text-align: left; font-weight: 600; color: var(--text); }
.matrix td { color: var(--muted); }
.matrix td.has-projects { color: var(--text); font-weight: 600; }
.matrix td.heat-1 { background: color-mix(in srgb, var(--primary)  6%, var(--bg)); }
.matrix td.heat-2 { background: color-mix(in srgb, var(--primary) 14%, var(--bg)); }
.matrix td.heat-3 { background: color-mix(in srgb, var(--primary) 24%, var(--bg)); color: var(--text); }
.matrix td.heat-4 { background: color-mix(in srgb, var(--primary) 34%, var(--bg)); color: #fff; }
.matrix-note { font-size: 13px; color: var(--muted); margin-top: 12px; }

/* ───── contacts layout + form ───── */
.contact-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.contact-info p { color: var(--muted); margin: 0 0 12px; line-height: 1.6; }
.contact-info strong { color: var(--text); }
.contact-info dl { margin: 0; }
.contact-info dt { color: var(--muted); font-size: 13px; margin-top: 14px; text-transform: uppercase; letter-spacing: 0.06em; }
.contact-info dd { margin: 4px 0 0; color: var(--text); font-weight: 500; font-size: 15px; }
.contact-form {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 28px;
}
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.field input, .field textarea {
  width: 100%; font: inherit;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
.field textarea { min-height: 120px; resize: vertical; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #D93025; }
.field-error { color: #D93025; font-size: 13px; margin-top: 6px; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); margin-bottom: 18px; line-height: 1.5; }
.checkbox input { margin-top: 3px; accent-color: var(--primary); flex-shrink: 0; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-status { font-size: 14px; padding: 10px 14px; border-radius: var(--radius-sm); margin-top: 12px; }
.form-status.ok { background: #E7F6EA; color: #1E7A33; }
.form-status.err { background: #FBEAEA; color: #C73030; }

/* ───── final CTA strip ───── */
.cta {
  background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--accent) 70%, var(--primary)));
  color: #fff; padding: 56px 0;
}
.cta .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta h2 { font-size: clamp(22px, 2.8vw, 30px); margin: 0; max-width: 720px; line-height: 1.25; }
.cta .btn-primary { background: #fff; color: var(--primary); }
.cta .btn-primary:hover { background: #F0F6FF; }

/* ───── feature row (illustration + text) ───── */
.feature-row { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.feature-row.reverse { grid-template-columns: 1fr 1.1fr; }
.feature-row.reverse .feature-text { order: -1; }
.feature-text h3 { font-size: 22px; margin: 0 0 12px; letter-spacing: -0.01em; }
.feature-text p { font-size: 15.5px; color: var(--muted); margin: 0 0 14px; line-height: 1.6; }
.feature-text ul { padding-left: 22px; color: var(--muted); font-size: 15.5px; line-height: 1.6; }
.feature-text ul li { margin-bottom: 4px; }
.feature-text .eyebrow {
  display: inline-block; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--primary); font-weight: 600; margin-bottom: 8px;
}
.illustration {
  background: var(--bg-soft); border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  display: block;
  aspect-ratio: 16 / 9;
}
.illustration img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

/* ───── regulatory list (used on about page) ───── */
.reg-list { list-style: none; padding: 0; margin: 0; }
.reg-list li {
  padding: 14px 0; border-bottom: 1px solid var(--border);
  display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: baseline;
}
.reg-list li:last-child { border-bottom: 0; }
.reg-list dt { font-weight: 600; color: var(--text); font-size: 14.5px; }
.reg-list dd { color: var(--muted); font-size: 15px; line-height: 1.55; margin: 0; }

/* ───── prose (privacy / consent) ───── */
.prose { max-width: 760px; }
.prose h2 { font-size: 22px; margin: 36px 0 12px; }
.prose h3 { font-size: 17px; margin: 24px 0 8px; }
.prose p, .prose li { color: var(--text); font-size: 15.5px; line-height: 1.65; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--text); }

/* ───── footer ───── */
footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 32px; color: var(--muted); font-size: 14px;
}
.footer-grid {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 36px;
  margin-bottom: 32px;
}
.footer-grid h4 { color: var(--text); font-size: 14px; margin: 0 0 14px; text-transform: uppercase; letter-spacing: 0.06em; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { color: var(--muted); }
.footer-grid a:hover { color: var(--text); text-decoration: none; }
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.footer-brand .brand-mark { height: 32px; width: auto; }
.footer-meta { color: var(--muted); font-size: 13px; line-height: 1.6; }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 24px; border-top: 1px solid var(--border);
  font-size: 13px; gap: 16px; flex-wrap: wrap;
}

/* ───── 404 ───── */
.center-page { min-height: calc(100vh - var(--header-h) - 220px); display: grid; place-items: center; padding: 48px 24px; text-align: center; }
.center-page .code { font-size: 80px; font-weight: 700; color: var(--primary); line-height: 1; letter-spacing: -0.04em; }
.center-page h1 { font-size: 28px; margin: 16px 0 12px; }
.center-page p { color: var(--muted); max-width: 480px; margin: 0 auto 24px; }

/* ───── responsive ───── */
@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .func-list { grid-template-columns: 1fr; }
}
@media (max-width: 880px) {
  .nav { display: none; }
  .menu-toggle { display: inline-flex; }
  .site-header .btn { display: none; }
  .hero { padding: 64px 0 56px; }
  .hero .meta-row { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .services-grid { grid-template-columns: 1fr; }
  .contact-layout { grid-template-columns: 1fr; gap: 32px; }
  .grid-2 { grid-template-columns: 1fr; }
  .feature-row, .feature-row.reverse { grid-template-columns: 1fr; gap: 24px; }
  .feature-row.reverse .feature-text { order: 0; }
  .reg-list li { grid-template-columns: 1fr; gap: 6px; }
  section { padding: 56px 0; }
  .matrix th, .matrix td { padding: 10px 8px; font-size: 13px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .cta .container { flex-direction: column; align-items: flex-start; }
}
