/* ==========================================================================
   Dr Aliaksandr Mudrakouski, Pain Management — stylesheet
   Mobile-first. Breakpoints: 768px (tablet), 1280px (desktop).

   Design direction: deep teal + cream, serif display headings over a sans
   body, gold accents, flat editorial blocks. Calm and clinical rather than
   corporate-blue.
   ========================================================================== */

:root {
  /* Teal — primary brand colour */
  --color-teal-900: #062f29;   /* footer, deepest ground */
  --color-teal-800: #0a463c;
  --color-teal-700: #0e6153;   /* hero band, primary buttons */
  --color-teal-600: #127a68;   /* hover */
  --color-teal-100: #d7e8e3;
  --color-teal-50:  #eef6f4;

  /* Cream — secondary ground */
  --color-cream:      #f8f4ed;
  --color-cream-dark: #ebe3d6;  /* borders on cream */

  /* Gold — accent only (eyebrows, rules). Never a large text colour.
     Three tints so text always clears WCAG AA 4.5:1 on its own background:
       gold        decorative rules and the deep teal-900 footer  (6.70:1 there)
       gold-light  text on the mid-teal hero band                 (4.57:1)
       gold-dark   text on white or cream                         (6.28 / 5.73:1) */
  --color-gold:       #d9a93f;
  --color-gold-light: #eac878;
  --color-gold-dark:  #7d5a10;

  --color-text: #1b2422;
  --color-text-muted: #3f4b47;   /* 9.0:1 on white — body copy, not just captions */
  --color-border: #dfe5e2;
  --color-error: #a4231b;
  --color-surface: #ffffff;

  --color-placeholder: #a8480d;
  --color-placeholder-bg: #fdf0e6;

  --font-display: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --max-width: 1180px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --shadow-sm: 0 1px 2px rgba(6, 47, 41, 0.06);
  --shadow-md: 0 10px 30px rgba(6, 47, 41, 0.10);
  --header-height: 76px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-height); }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;           /* 17px base — patients here skew older */
  color: var(--color-text);
  background: var(--color-surface);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, p, ul, figure { margin: 0 0 1rem; }
ul { padding-left: 0; list-style: none; }
button { font: inherit; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 0.5rem; top: -3rem;
  background: var(--color-teal-900); color: #fff;
  padding: 0.6rem 1rem; border-radius: var(--radius-sm);
  z-index: 1000; transition: top 0.15s ease;
}
.skip-link:focus { top: 0.5rem; }

:focus-visible { outline: 3px solid var(--color-teal-600); outline-offset: 2px; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.25rem; }

/* ---------- Typography ---------- */
h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--color-teal-900);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.1rem, 5.2vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); margin-bottom: 0.75rem; }
h3 { font-size: 1.28rem; margin-bottom: 0.5rem; letter-spacing: 0; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-gold-dark);
  margin-bottom: 0.75rem;
}

.fine-print { font-size: 0.925rem; color: var(--color-text-muted); }

.placeholder-inline {
  color: var(--color-placeholder);
  background: var(--color-placeholder-bg);
  padding: 0.05em 0.35em;
  border-radius: 3px;
  font-size: 0.92em;
}

/* ---------- Buttons — uppercase, letterspaced, pill ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.btn-primary { background: var(--color-teal-700); color: #fff; }
.btn-primary:hover { background: var(--color-teal-600); }
.btn-outline { background: transparent; color: var(--color-teal-800); border-color: var(--color-teal-800); }
.btn-outline:hover { background: var(--color-teal-800); color: #fff; }
/* Ghost: for use on the dark teal hero band */
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.45); }
.btn-ghost:hover { background: rgba(255,255,255,0.12); border-color: #fff; }
.btn-lg { padding: 1rem 2rem; font-size: 0.975rem; }
.btn .icon { width: 1.05em; height: 1.05em; }

/* ---------- Icons ---------- */
.icon { width: 22px; height: 22px; color: currentColor; }
.icon-lg { width: 34px; height: 34px; color: var(--color-teal-700); margin-bottom: 1rem; }
.icon-md { width: 26px; height: 26px; color: var(--color-teal-700); margin-bottom: 0.6rem; }

/* ---------- Utility bar ---------- */
.utility-bar {
  /* Hidden on mobile: the details wrap to two rows and cost ~80px of a 375px
     viewport before the hero even starts. The sticky header's click-to-call
     covers the phone there, and full details remain in Contact and the footer. */
  display: none;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  font-size: 0.875rem;
  letter-spacing: 0.04em;
}
.utility-inner {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 0.55rem 1.25rem;
  flex-wrap: wrap;
}
.utility-bar a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--color-text-muted);
  text-transform: uppercase;
  font-weight: 600;
}
.utility-bar a:hover { color: var(--color-teal-700); }
.utility-bar .icon { width: 14px; height: 14px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  /* Solid, not translucent + backdrop-filter: a backdrop-filter creates a new
     containing block for fixed-position descendants, which would trap the
     .primary-nav mobile overlay inside the header instead of the viewport. */
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
  display: flex;
  align-items: center;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--color-teal-800);
}
.logo-mark { width: 34px; height: 34px; flex-shrink: 0; }
.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.15;
  color: var(--color-teal-900);
  white-space: nowrap;
}
.logo-text span {
  display: block;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
}

.nav-toggle {
  background: none; border: none; padding: 0.4rem;
  cursor: pointer; color: var(--color-teal-800); display: inline-flex;
}

.primary-nav {
  /* Anchored to the header's own bottom edge (top:100% against the sticky
     .site-header) rather than offset from the viewport top. A viewport-based
     offset breaks whenever anything sits above the header — the utility bar
     pushed the header down and the overlay covered it. */
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: calc(100vh - var(--header-height));
  background: var(--color-surface);
  padding: 2rem 1.25rem;
  transform: translateX(100%);
  transition: transform 0.22s ease;
  overflow-y: auto;
}
.primary-nav.is-open { transform: translateX(0); }
.primary-nav ul { display: flex; flex-direction: column; gap: 1.4rem; }
/* Scoped to the list only. An unscoped `.primary-nav a` colour rule outranks
   `.btn-primary` and repainted the CTA button's label dark-on-dark. */
.primary-nav ul a {
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--color-teal-900);
}
.primary-nav ul a:hover { color: var(--color-teal-600); }
.nav-cta { margin-top: 2rem; width: 100%; justify-content: center; }

.call-button {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--color-teal-700); color: #fff;
  padding: 0.6rem 1rem; border-radius: 999px;
  text-decoration: none; font-weight: 700;
  font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em;
  white-space: nowrap;
}
.call-button:hover { background: var(--color-teal-600); }
.call-button .icon { width: 15px; height: 15px; }
.call-button-text { display: none; }

/* ---------- Hero ---------- */
.hero {
  background: var(--color-teal-700);
  color: #fff;
  padding: 3.5rem 0;
  overflow: hidden;
}
.hero-inner { display: grid; gap: 2.5rem; align-items: center; }
.hero h1 { color: #fff; margin-bottom: 1.25rem; }

.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-gold-light);
  margin-bottom: 0.35rem;
}
.hero-credentials {
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.92);   /* credentials are a trust signal — keep them legible */
  margin-bottom: 1.25rem;
}
.hero-registration {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.82);
  letter-spacing: 0.02em;
  margin-bottom: 1.25rem;
}
.hero-subhead {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.93);
  max-width: 34rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 2rem; }
/* The default teal primary button would be invisible on the teal hero band.
   A darker teal fill still only reaches ~2:1 against it, short of the 3:1 that
   WCAG 1.4.11 requires for a UI component boundary — so the hero CTA inverts
   to white (7.36:1) instead. */
.hero .btn-primary { background: #fff; color: var(--color-teal-900); }
.hero .btn-primary:hover { background: var(--color-cream); color: var(--color-teal-900); }

.hero-portrait { position: relative; display: flex; justify-content: center; }
.hero-rings {
  position: absolute;
  width: 150%;
  max-width: none;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, 0.16);
  pointer-events: none;
}
.portrait-frame {
  position: relative;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 3 / 4;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.28);
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
}

/* Portrait. The file is pre-cropped to an exact 3:4, so object-fit only guards
   against a future replacement with different proportions. */
.portrait-photo {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 3 / 4;
  height: auto;
  object-fit: cover;
  object-position: 50% 20%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: #fff;
}

/* ---------- Sections ---------- */
.section { padding: 4.5rem 0; }
.section-alt { background: var(--color-cream); }

/* Gold rule under every section heading. One rule for all of them — this was
   three near-duplicate selectors, which is how headings ended up inconsistent.
   :not(.sr-only) keeps it off the visually hidden form heading. */
.section h2:not(.sr-only)::after {
  content: "";
  display: block;
  width: 54px;
  height: 2px;
  background: var(--color-gold);
  margin: 1.1rem 0 1.5rem;
}

/* ---------- About ---------- */
.about-grid { display: grid; gap: 2.5rem; align-items: center; }
.about-media-frame {
  aspect-ratio: 4 / 3;
  background: var(--color-teal-50);
  border: 1px solid var(--color-teal-100);
  display: flex; align-items: center; justify-content: center;
}
.about-media-frame span {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--color-teal-700);
}
.about-copy p { color: var(--color-text-muted); }

/* ---------- Card grid ---------- */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; margin-top: 2rem; }
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.75rem 1.5rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.section-alt .card { border-color: var(--color-cream-dark); }
.card:hover { border-color: var(--color-teal-700); box-shadow: var(--shadow-md); }
.card p { color: var(--color-text); margin-bottom: 0; font-size: 1rem; }

/* ---------- Insurance ---------- */
.insurer-list { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.insurer-list li {
  background: var(--color-surface);
  border: 1px solid var(--color-cream-dark);
  padding: 0.85rem 1.5rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--color-teal-800);
}

/* ---------- Why Choose Us ---------- */
.trust-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; margin-top: 2rem; }
.trust-item { border-top: 2px solid var(--color-gold); padding-top: 1.25rem; }
.trust-item p { color: var(--color-text); font-size: 1rem; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: 2.5rem; }
.contact-details p { color: var(--color-text-muted); }
.contact-list { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.75rem; }
.contact-list li { display: flex; align-items: flex-start; gap: 0.85rem; }
.contact-list .icon { color: var(--color-teal-700); flex-shrink: 0; margin-top: 0.2rem; }
.contact-list a { text-decoration: none; font-weight: 600; }
.contact-note { font-size: 0.9rem; color: var(--color-text-muted); font-weight: 400; }
.cred-list { margin-bottom: 1.5rem; }
.cred-list li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}
.cred-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.7em;
  width: 7px; height: 7px;
  background: var(--color-gold);
  border-radius: 50%;
}
.about-copy h3 { margin-top: 1.75rem; }
.contact-list a:hover { color: var(--color-teal-700); }

.contact-form {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 2rem;
}
.section-alt .contact-form { border-color: var(--color-cream-dark); }
.form-row { margin-bottom: 1.15rem; }
.form-row label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-teal-900);
}
.form-row input,
.form-row textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font: inherit;
  color: var(--color-text);
  background: #fff;
}
.form-row input:focus, .form-row textarea:focus { border-color: var(--color-teal-700); }
.form-row-checkbox { display: flex; align-items: flex-start; gap: 0.6rem; }
.form-row-checkbox input { width: auto; margin-top: 0.3rem; }
.form-row-checkbox label {
  font-weight: 400; font-size: 0.95rem; text-transform: none;
  letter-spacing: 0; color: var(--color-text-muted);
}
.form-row-checkbox a { color: var(--color-teal-700); }
.contact-form .btn { width: 100%; justify-content: center; margin-top: 0.5rem; }
.form-status { min-height: 1.2rem; margin: 0.85rem 0 0; font-weight: 600; font-size: 0.9rem; }
.form-status.success { color: var(--color-teal-600); }
.form-status.error { color: var(--color-error); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-teal-900);
  color: rgba(255, 255, 255, 0.78);
  padding: 3.5rem 0 1.5rem;
}
.footer-inner {
  display: grid; grid-template-columns: 1fr; gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
.site-footer .logo { color: #fff; }
.site-footer .logo-text { color: #fff; }
.site-footer .logo-text span { color: var(--color-gold); }
.site-footer .fine-print { color: rgba(255, 255, 255, 0.62); }
.footer-nav ul, .footer-legal ul { display: flex; flex-direction: column; gap: 0.7rem; }
.footer-nav a, .footer-legal a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.975rem;
}
.footer-nav a:hover, .footer-legal a:hover { color: #fff; }
.footer-legal { display: flex; flex-direction: column; gap: 1rem; }
.copyright {
  text-align: center; margin: 1.5rem 0 0;
  color: rgba(255, 255, 255, 0.66); font-size: 0.875rem;
}

/* ==========================================================================
   Tablet — 768px+
   ========================================================================== */
@media (min-width: 768px) {
  .call-button-text { display: inline; }
  .utility-bar { display: block; }
  .utility-inner { justify-content: flex-end; gap: 2.25rem; }

  .hero { padding: 4.5rem 0; }
  .hero-inner { grid-template-columns: 1.15fr 0.85fr; }

  .about-grid { grid-template-columns: 1fr; max-width: 46rem; }

  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .trust-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr 1.05fr; align-items: start; }
  .footer-inner { grid-template-columns: 1.5fr 1fr 1fr; }
}

/* ==========================================================================
   Desktop — 1280px+
   ========================================================================== */
@media (min-width: 1280px) {
  .nav-toggle { display: none; }
  /* At desktop the phone number is already in the utility bar and the nav CTA,
     so the header call button is redundant. It stays on mobile/tablet, where
     the brief requires click-to-call in the sticky header. */
  .call-button { display: none; }

  .primary-nav {
    position: static; transform: none; background: none;
    padding: 0; display: flex; align-items: center; gap: 2.5rem;
    overflow: visible;
  }
  .primary-nav ul { flex-direction: row; gap: 2.25rem; }
  .primary-nav ul a { font-family: var(--font-body); font-size: 1rem; font-weight: 600; }
  .nav-cta { margin-top: 0; width: auto; }

  .card-grid { grid-template-columns: repeat(4, 1fr); }
  .trust-grid { grid-template-columns: repeat(4, 1fr); }

  .hero { padding: 6rem 0; }
  .section { padding: 6rem 0; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}
