/* ==========================================================================
   Ноев Ковчег — demo landing (Rev9 whole-design build)
   Breakpoints: mobile 390 (base) / tablet 768 / desktop 1440
   Safe content field: 28px mobile, 56px tablet, 88px desktop
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --navy: #17324D;
  --navy-deep: #244B67;
  --coral: #FF8D72;
  --coral-pale: #FFB09C;
  --mint: #DCEFEA;
  --mint-deep: #B5DED5;
  --paper: #F7F4EE;
  --white: #FFFFFF;
  --slate: #527084;
  --error: #C0392B;
  --mint-eyebrow: #C7D9DD;
  --card-border: #E4EDE9;

  --container-pad: 28px;
  --font: "Segoe UI", "Helvetica Neue", Roboto, "Noto Sans", system-ui, -apple-system, sans-serif;

  --focus-ring: 0 0 0 2px var(--paper), 0 0 0 4px var(--coral);
  --card-radius: 18px;
  --pill-radius: 999px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--navy);
  background: var(--paper);
  overflow-x: hidden;
  min-width: 320px;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 700; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

/* ---------- Utilities ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px; left: 16px;
  z-index: 200;
  background: var(--navy);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

.container {
  width: 100%;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
  margin-inline: auto;
  position: relative;
}

.eyebrow {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: 0;
}
.eyebrow--coral { color: var(--coral); }
/* hero eyebrow matches the masters (red token) and now reads on mint at
   WCAG AA: #A5322A on #DCEFEA = 5.69:1 (was #E56355 = 2.81:1, tester FAIL) */
.hero .eyebrow--coral { color: #A5322A; }
.eyebrow--pale { color: var(--coral-pale); }

.section-title {
  font-size: 27px;
  line-height: 1.18;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}
.section-sub {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--slate);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 10px 26px;
  border: 0;
  border-radius: var(--pill-radius);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
  will-change: transform;
}
/* navy fill, white label */
.btn-primary { background: var(--navy); color: #fff; }
/* coral fill, navy label */
.btn-coral { background: var(--coral); color: var(--navy); }
/* navy pill placed on the coral contact band */
.btn-on-coral { background: var(--navy); color: #fff; }

.btn:hover { transform: translateY(-4px); box-shadow: 0 10px 22px rgba(23, 50, 77, .20); }
.btn:active { transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

.btn:focus-visible,
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 3px;
  transform: translateY(-4px);
  box-shadow: 0 8px 18px rgba(23, 50, 77, .16);
}

/* ---------- Header ---------- */
.site-header {
  background: var(--paper);
  position: relative;
  z-index: 30;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 92px;
  padding-top: 24px;
  padding-bottom: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
}
.brand-mark { width: 44px; height: 44px; flex: 0 0 44px; }
.brand-mark svg { width: 100%; height: 100%; }
.brand-text { display: flex; flex-direction: column; gap: 2px; }
.brand-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--navy);
}
.brand-sub {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--slate);
}

.site-nav { margin-left: auto; }
.nav-list { display: flex; gap: 30px; align-items: center; }
.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 15px;
  font-weight: 500;
  color: var(--navy);
  padding: 0 4px;
}
.nav-link:hover { text-decoration: underline; text-underline-offset: 6px; }

.header-cta { min-width: 152px; }

/* mobile nav toggle */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  margin-left: auto;
  background: transparent;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
}
.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 11px; right: 11px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle-icon { top: 50%; margin-top: -1px; }
.nav-toggle-icon::before { top: -7px; }
.nav-toggle-icon::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon::after { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: var(--mint);
  overflow: hidden;
}
.hero-inner {
  padding-top: 76px;
  padding-bottom: 60px;
  position: relative;
  z-index: 2;
}
.hero-title {
  margin-top: 18px;
  font-size: 30px;
  line-height: 1.18;
  font-weight: 700;
  color: var(--navy);
  max-width: 20ch;
}
.hero-sub {
  margin-top: 30px;
  font-size: 20px;
  line-height: 1.4;
  color: #4A667A; /* #4A667A on #DCEFEA = 5.06:1 (was --slate #527084 = 4.38) */
  max-width: 30ch;
}
.hero .btn { margin-top: 34px; min-width: 170px; }

.hero-shape { position: absolute; border-radius: 50%; z-index: 1; }
.hero-shape--mint {
  width: 300px; height: 300px;
  background: var(--mint-deep);
  top: 88px; right: 0;
}
.hero-shape--coral {
  width: 144px; height: 144px;
  background: var(--coral);
  top: 18px; right: 60px;
}

/* ---------- Services ---------- */
.services { padding-top: 32px; padding-bottom: 32px; background: var(--paper); }
.services .container { overflow: hidden; }
.services-grid {
  margin-top: 34px;
  display: grid;
  /* minmax(0, 1fr): allow tracks to shrink below content min-width so the
     2-col grid never blows out past the container at 320 (was repeat(2, 1fr),
     which floor-tracked to min-content and clipped the right column to R387). */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.service-card {
  position: relative;
  background: var(--white);
  border: 2px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: 28px 20px 24px;
  min-height: 126px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.service-card::before {
  content: "";
  position: absolute;
  top: 0; left: 20px;
  width: 96px; height: 5px;
  border-radius: 0 0 6px 6px;
  background: var(--coral);
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 26px rgba(23, 50, 77, .12);
  border-color: var(--coral);
}
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.card-dot { width: 30px; height: 30px; border-radius: 50%; background: var(--coral); flex: 0 0 30px; }
.card-num { font-size: 14px; font-weight: 600; color: #A5322A; letter-spacing: .04em; } /* #A5322A on #fff = 6.80:1 (was #E56355 = 3.36) */
.card-title { font-size: 20px; font-weight: 700; color: var(--navy); margin: 0; min-width: 0; overflow-wrap: break-word; } /* min-width:0 + break-word: 'Диагностика' (148px ink, unbreakable) spills 16px past the 320 viewport in the 2-col mobile grid; wraps to two lines at <=360 and stays single-line at 390+ (fits there) */
.card-text { margin-top: 6px; font-size: 13px; line-height: 1.5; color: var(--slate); }

/* ---------- Offer (navy) ---------- */
.offer {
  position: relative;
  background: var(--navy);
  color: #fff;
  overflow: hidden;
}
.offer-inner { padding-top: 55px; padding-bottom: 105px; position: relative; z-index: 2; }
.offer-title {
  margin-top: 20px;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 700;
  color: #fff;
  max-width: 22ch;
}
.offer-text { margin-top: 45px; font-size: 16px; line-height: 1.5; color: var(--mint-eyebrow); }
.offer .btn { margin-top: 45px; min-width: 192px; }
.offer .btn-coral:focus-visible { outline-color: #fff; }

.offer-shape { position: absolute; border-radius: 50%; z-index: 1; }
.offer-shape--deep { width: 260px; height: 260px; background: var(--navy-deep); top: -40px; right: -40px; }
.offer-shape--coral { width: 70px; height: 70px; background: var(--coral); bottom: 20px; right: 60px; }

/* ---------- Trust ---------- */
.trust { background: var(--paper); padding-top: 32px; padding-bottom: 32px; }
.trust-list { margin-top: 24px; display: flex; flex-direction: column; gap: 40px; }
.trust-item { display: flex; align-items: flex-start; gap: 20px; }
.trust-num { font-size: 14px; font-weight: 600; color: #A5322A; min-width: 24px; padding-top: 3px; } /* #A5322A on #F7F4EE = 6.19:1 (was #E56355 = 3.06) */
.trust-title { font-size: 18px; font-weight: 700; color: var(--navy); margin: 0; }
.trust-text { margin-top: 5px; font-size: 13px; line-height: 1.5; color: var(--slate); }

/* ---------- Contact CTA (coral) ---------- */
.contact {
  position: relative;
  background: var(--coral);
  color: var(--navy);
  overflow: hidden;
}
.contact-inner { padding-top: 55px; padding-bottom: 90px; min-height: 270px; position: relative; z-index: 2; }
.contact-title { font-size: 28px; line-height: 1.18; font-weight: 700; color: var(--navy); margin: 0; }
.contact-lead {
  margin-top: 18px;
  font-size: 20px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--navy);
  max-width: 22ch;
}
.contact-phone { margin-top: 34px; font-size: 20px; font-weight: 700; color: var(--navy); }
.contact-phone a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: underline;
  text-underline-offset: 5px;
}
.contact-mail { margin-top: 4px; font-size: 14px; color: var(--navy); }
.contact-mail a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: underline;
  text-underline-offset: 5px;
}
.contact-meta { margin-top: 8px; font-size: 13px; color: var(--navy); opacity: .9; }
.contact .btn { margin-top: 44px; min-width: 180px; }
.contact .btn:focus-visible { outline-color: #fff; }

.contact-shape { position: absolute; border-radius: 50%; z-index: 1; }
.contact-shape--light { width: 220px; height: 220px; background: var(--coral-pale); top: -50px; right: -40px; }
.contact-shape--navy { width: 64px; height: 64px; background: var(--navy); top: 110px; right: 100px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--paper); }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-top: 30px;
  padding-bottom: 30px;
}
.footer-left, .footer-right { display: flex; flex-direction: column; gap: 6px; }
.footer-right { text-align: right; align-items: flex-end; }
.footer-brand { font-size: 18px; font-weight: 700; letter-spacing: .05em; color: var(--navy); }
.footer-note { font-size: 14px; color: var(--slate); }
.footer-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 13px;
  color: var(--slate);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.footer-link:hover { color: var(--navy); }
.footer-copy { font-size: 13px; color: var(--slate); }

/* ==========================================================================
   Tablet  >= 768
   ========================================================================== */
@media (min-width: 768px) {
  :root { --container-pad: 56px; }
  /* border-box: 768 - 2*56 = 656px inner field, matching the master tablet
     geometry (content 56..712). The prior 656px border-box gave only a 544px
     field, so the header row overflowed to 783 at 768 (tester FAIL). */
  .container { max-width: 768px; }

  .site-nav { margin-left: auto; }
  /* 10px gap (was 28): the brand+nav+CTA row is ~680px intrinsic at 768,
     wider than the 656px safe field, which pushed the CTA to R765 (only
     3px from the viewport edge). The master places the CTA at 560..712.
     Tightening the gap pulls the CTA right edge to ~711, matching the
     master geometry with real headroom from the viewport edge. */
  .nav-list { gap: 10px; }
  .header-cta { margin-left: 4px; }

  .hero-inner { padding-top: 78px; padding-bottom: 62px; }
  .hero-title { font-size: 28px; max-width: 22ch; }
  .hero-sub { font-size: 18px; max-width: 40ch; }
  .hero .btn { margin-top: 32px; }

  .services-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 34px; }
  .service-card { padding: 30px 24px 30px; }
  .services .container { max-width: 768px; }

  .offer-inner { padding-top: 55px; padding-bottom: 105px; }
  .offer-title { font-size: 25px; max-width: 26ch; }
  .offer .btn { margin-top: 45px; }

  .trust-item { gap: 20px; }
  .trust-list { gap: 40px; }
  .trust-title { font-size: 20px; }

  .section-title { font-size: 34px; }
  .contact-title { font-size: 34px; }
  .contact-lead { font-size: 28px; line-height: 1.32; max-width: 24ch; }
  .contact-inner { padding-top: 55px; padding-bottom: 100px; min-height: 390px; }
  .contact .btn { margin-top: 44px; }

  .footer-inner { padding-top: 32px; padding-bottom: 32px; }
}

/* ==========================================================================
   Desktop  >= 1440
   ========================================================================== */
@media (min-width: 1440px) {
  :root { --container-pad: 88px; }
  .container { max-width: 1264px; }

  .hero-title { font-size: 28px; }
  .hero-inner { padding-top: 78px; padding-bottom: 62px; }

  .services-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 44px; }
  .service-card { padding: 30px 30px 30px; min-height: 126px; }
  .service-card::before { left: 24px; width: 96px; }

  .offer-inner { padding-top: 55px; padding-bottom: 105px; }
  .offer-title { font-size: 25px; }

  .trust-list { gap: 100px; margin-top: 24px; }
  .trust-num { min-width: 32px; }

  .section-title { font-size: 34px; }
  .contact-inner { padding-top: 55px; padding-bottom: 90px; min-height: 1190px; }
  .contact .btn { margin-top: 44px; }
}

/* ==========================================================================
   Mobile nav  (< 768)
   ========================================================================== */
@media (max-width: 767.5px) {
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--card-border);
    box-shadow: 0 18px 30px rgba(23, 50, 77, .14);
    padding: 8px var(--container-pad) 16px;
    display: none;
  }
  .site-nav.is-open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 4px; }
  .nav-link { min-height: 48px; font-size: 16px; }
  .nav-toggle { display: inline-flex; }
  .header-cta { display: none; }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .btn, .service-card { transform: none !important; }
  .btn:focus-visible, a:focus-visible, button:focus-visible { transform: none; }
}
