/* ============================================================
   Hovhannisyan Dental
   Токены: ui-ux-pro-max (циан + Lexend / Source Sans 3)
   Композиция: taste-skill, VARIANCE 6 / MOTION 4 / DENSITY 3
   Формы: кнопки pill, карточки 16px, поля ввода 10px
   ============================================================ */

:root {
  --bg: #FBFDFE;
  --surface: #FFFFFF;
  --tint: #EFF7FA;          /* приглушённый вариант muted из палитры */
  --text: #12333F;          /* тёмный петроль вместо чистого чёрного */
  --text-soft: #47626E;
  --accent: #0E7490;        /* затемнённый primary ради контраста AA на белом */
  --accent-strong: #155E75;
  --accent-soft: #D5EDF4;
  --border: #DCEAF0;
  --success: #059669;
  --error: #DC2626;
  --radius-card: 16px;
  --radius-input: 10px;
  --glow-a: rgba(23, 122, 104, 0.14);   /* тёплый теал, светлая тема: едва заметен */
  --glow-b: rgba(214, 220, 160, 0.18);
  --grain-opacity: 0.03;
  --shadow-card: 0 12px 32px -16px rgba(18, 51, 63, 0.18);
  --font-head: "Lexend", sans-serif;
  --font-body: "Source Sans 3", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B1B21;
    --surface: #10242C;
    --tint: #0E2029;
    --text: #E8F2F5;
    --text-soft: #9DB6BF;
    --accent: #38BDD8;
    --accent-strong: #67D3E8;
    --accent-soft: #123845;
    --border: #1E3842;
    --shadow-card: 0 12px 32px -16px rgba(0, 0, 0, 0.5);
    --glow-a: rgba(34, 150, 126, 0.46);  /* как в референсе: теал + тёплое пятно */
    --glow-b: rgba(213, 219, 158, 0.30);
    --grain-opacity: 0.05;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Фоновое свечение: фиксированный слой позади контента */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(52vw 46vh at 64% 34%, var(--glow-a), transparent 62%),
    radial-gradient(38vw 40vh at 82% 58%, var(--glow-b), transparent 60%),
    var(--bg);
}

/* Зерно поверх всей страницы: фиксированный слой, не участвует в скролле */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 160px 160px;
}

img { display: block; max-width: 100%; height: auto; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

a { color: var(--accent); }

.container {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 1rem;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 200ms ease, border-color 200ms ease, transform 150ms ease;
}
.btn:active { transform: translateY(1px) scale(0.98); }

.btn-primary {
  background: var(--accent);
  color: #FFFFFF;
}
.btn-primary:hover { background: var(--accent-strong); }
@media (prefers-color-scheme: dark) {
  .btn-primary { color: #06181E; }
}

.btn-ghost {
  border-color: var(--border);
  color: var(--text);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-sm { padding: 0.6rem 1.25rem; font-size: 0.9375rem; }
.btn-wide { width: 100%; }

/* ---------- Шапка ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 72px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
}
.logo-mark { width: 30px; height: 30px; color: var(--accent); flex-shrink: 0; }
.logo-text {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.logo-accent { color: var(--accent); }

.main-nav {
  display: flex;
  gap: 1.75rem;
  margin-left: auto;
}
.main-nav a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-soft);
  text-decoration: none;
  transition: color 180ms ease;
}
.main-nav a:hover { color: var(--accent); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.header-phone {
  font-family: var(--font-head);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.header-phone:hover { color: var(--accent); }

.nav-toggle { display: none; }
.menu-phone { display: none; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(3rem, 7vw, 5.5rem); }

.hero-grid {
  display: grid;
  grid-template-columns: 6fr 5fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.eyebrow {
  font-family: var(--font-head);
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(2rem, 3.2vw, 2.625rem);
  margin-bottom: 1.25rem;
}

.hero-sub {
  font-size: 1.1875rem;
  color: var(--text-soft);
  max-width: 46ch;
  margin-bottom: 2rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.875rem; }

.hero-media img {
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* ---------- Секции ---------- */
.section { padding-block: clamp(4.5rem, 9vw, 7.5rem); }
.section-tinted { background: color-mix(in srgb, var(--tint) 84%, transparent); }

.section-head {
  max-width: 62ch;
  margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
}
.section-head h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); margin-bottom: 0.875rem; }
.section-head p { color: var(--text-soft); font-size: 1.125rem; }

/* ---------- Услуги: bento ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.25rem;
}

.bento-cell {
  grid-column: span 2;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 250ms ease, box-shadow 250ms ease;
}
.bento-cell:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}
.bento-cell img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.bento-body { padding: 1.5rem 1.75rem 1.75rem; }
.bento-cell h3 { font-size: 1.25rem; margin-bottom: 0.625rem; }
.bento-cell p { color: var(--text-soft); font-size: 0.9875rem; }

.bento-featured {
  grid-column: span 3;
  background: linear-gradient(135deg, var(--accent-soft), var(--surface) 70%);
}
.bento-featured img { aspect-ratio: 21 / 10; }
.bento-featured h3 { font-size: 1.5rem; }
.bento-featured .price {
  margin-top: 1.25rem;
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* второй элемент верхнего ряда занимает те же 3 колонки */
.bento-featured + .bento-cell { grid-column: span 3; }
.bento-featured + .bento-cell img { aspect-ratio: 21 / 10; }

/* ---------- Клиника ---------- */
.clinic-intro {
  max-width: 62ch;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.clinic-intro h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); margin-bottom: 0.875rem; }
.clinic-intro p { color: var(--text-soft); font-size: 1.125rem; }

.clinic-media img {
  border-radius: var(--radius-card);
  aspect-ratio: 21 / 9;
  object-fit: cover;
  box-shadow: var(--shadow-card);
}

.clinic-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: clamp(2rem, 4vw, 3rem);
}
.clinic-stats dt {
  font-family: var(--font-head);
  font-size: clamp(1.875rem, 3.5vw, 2.5rem);
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.clinic-stats dd { color: var(--text-soft); margin-top: 0.25rem; }

/* ---------- Врачи ---------- */
.doctors-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.doctor-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: transform 250ms ease, box-shadow 250ms ease;
}
.doctor-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}
.doctor-card-offset { margin-top: 2.5rem; }

.doctor-card img {
  aspect-ratio: 4 / 5;
  width: 100%;
  object-fit: cover;
  object-position: 20% center; /* уводим фоновые надписи кабинета из кадра */
}
.doctor-info { padding: 1.5rem 1.625rem 1.75rem; }
.doctor-info h3 { font-size: 1.25rem; }
.doctor-role {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9375rem;
  margin: 0.375rem 0 0.75rem;
}
.doctor-info p:last-child { color: var(--text-soft); font-size: 0.9875rem; }

/* ---------- Отзывы ---------- */
.reviews-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 1.5rem;
  align-items: stretch;
}

.reviews-side {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.review {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
}
.review p { font-size: 1.0625rem; }
.review-large { padding: clamp(2rem, 4vw, 3rem); }
.review-large p {
  font-family: var(--font-head);
  font-size: clamp(1.25rem, 2.2vw, 1.625rem);
  font-weight: 500;
  line-height: 1.4;
}
.review footer { display: flex; flex-direction: column; gap: 0.125rem; }
.review cite { font-style: normal; font-weight: 600; }
.review footer span { color: var(--text-soft); font-size: 0.9375rem; }

/* ---------- Контакты ---------- */
.contacts-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}

.contacts-form-wrap h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); margin-bottom: 0.875rem; }
.form-lede { color: var(--text-soft); font-size: 1.125rem; margin-bottom: 2rem; max-width: 48ch; }

.booking-form { display: flex; flex-direction: column; gap: 1.25rem; max-width: 480px; }

.field { display: flex; flex-direction: column; gap: 0.5rem; }
.field label { font-weight: 600; font-size: 0.9875rem; }
.optional { font-weight: 400; color: var(--text-soft); font-size: 0.875rem; }

.field input,
.field textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 0.8rem 1rem;
  min-height: 48px;
  transition: border-color 180ms ease;
}
.field textarea { resize: vertical; min-height: 90px; }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field input::placeholder { color: var(--text-soft); }

.field-hint { color: var(--text-soft); font-size: 0.875rem; }
.field-error { color: var(--error); font-size: 0.875rem; }
.field.invalid input { border-color: var(--error); }

.form-success {
  background: color-mix(in srgb, var(--success) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--success) 40%, var(--border));
  color: var(--text);
  border-radius: var(--radius-input);
  padding: 0.875rem 1.125rem;
  font-weight: 500;
}

.contacts-info {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  padding: clamp(1.75rem, 3vw, 2.25rem);
  background: var(--tint);
  border-radius: var(--radius-card);
}
.info-block h4 {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-soft);
  margin-bottom: 0.5rem;
}
.info-block p { font-size: 1.0625rem; }
.info-block a { color: var(--text); text-decoration-color: var(--accent); }
.info-block a:hover { color: var(--accent); }

/* ---------- Футер ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 2rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  color: var(--text-soft);
  font-size: 0.9375rem;
}
.footer-inner a { color: var(--text-soft); }
.footer-inner a:hover { color: var(--accent); }

/* ---------- Адаптив ---------- */
@media (max-width: 1023px) {
  .main-nav { display: none; }
  .header-phone { display: none; }
  .header-actions { margin-left: auto; }

  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
  }
  .nav-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--text);
    border-radius: 2px;
    transition: transform 200ms ease;
  }
  .menu-open .nav-toggle span:first-child { transform: translateY(4px) rotate(45deg); }
  .menu-open .nav-toggle span:last-child { transform: translateY(-4px) rotate(-45deg); }

  .menu-open .main-nav {
    display: flex;
    flex-direction: column;
    gap: 1.375rem;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1.75rem clamp(1rem, 4vw, 2rem) 2rem;
    box-shadow: var(--shadow-card);
  }
  .menu-open .main-nav a { font-size: 1.125rem; }
  .menu-open .menu-phone {
    display: block;
    font-family: var(--font-head);
    color: var(--text);
    font-weight: 600;
    border-top: 1px solid var(--border);
    padding-top: 1.375rem;
  }
}

@media (max-width: 767px) {
  .header-inner { height: 64px; gap: 0.75rem; }
  .header-actions { display: none; }
  .logo-text { font-size: 1rem; }
  .nav-toggle { margin-left: auto; }

  .hero-grid { grid-template-columns: 1fr; }
  .hero-media { order: -1; }
  .hero-media img { aspect-ratio: 16 / 11; }

  .bento { grid-template-columns: 1fr; }
  .bento-cell, .bento-featured, .bento-featured + .bento-cell { grid-column: auto; }

  .clinic-media img { aspect-ratio: 4 / 3; }
  .clinic-stats { grid-template-columns: 1fr; gap: 1.75rem; }

  .doctors-grid { grid-template-columns: 1fr; }
  .doctor-card-offset { margin-top: 0; }

  .reviews-grid { grid-template-columns: 1fr; }

  .contacts-grid { grid-template-columns: 1fr; }
  .booking-form { max-width: none; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .bento-cell, .bento-featured, .bento-featured + .bento-cell { grid-column: auto; }
  .doctors-grid { grid-template-columns: repeat(3, 1fr); gap: 1rem; }
}
