/* =========================================================
   Dr. Hadjiev — design tokens.
   Change brand colors here; they flow through the whole site.
   ========================================================= */
:root {
  --primary: #231f58;
  --primary-fg: #ffffff;
  --accent: #d83f4f;
  --bg: rgba(248, 249, 252, 0.95);
  --bg-alt: rgba(255, 255, 255, 0.94);
  --fg: #121226;
  --fg-muted: #6f7280;
  --border: rgba(35, 32, 88, 0.12);
  --radius: 20px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --shadow-sm: 0 12px 30px rgba(18, 16, 44, 0.08);
  --shadow: 0 24px 50px rgba(18, 16, 44, 0.12);
  --container: 1180px;
  --nav-h: 76px;
  --font: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bg-image-path: url('../images/bg.jpg');
  --cardio-blue: rgba(35, 32, 88, 0.92);
  --cardio-blue-strong: rgba(20, 18, 50, 1);
  --cardio-fg: #ffffff;
  --surface: rgba(255,255,255,0.88);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--fg);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Fixed site background image layer (use provided image path). Placed behind content.
   Using ::before avoids `background-attachment: fixed` bugs on some mobile browsers. */
html::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: var(--bg-image-path);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  z-index: -1;
  transform: translateZ(0);
  will-change: transform;
}
h1, h2, h3, h4, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
img { max-width: 100%; display: block; }

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

/* Image placeholder — swap with <img> when assets are ready. */
.placeholder {
  display: grid;
  place-items: center;
  background: var(--bg-alt);
  color: var(--fg-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  min-height: 100px;
}
.placeholder::before { content: attr(data-label); }

/* ---------- Navbar ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  background: rgba(20, 18, 50, 0.96);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: box-shadow 0.25s ease, background 0.25s ease, transform 0.25s ease;
}
.nav.scrolled {
  background: rgba(20, 18, 50, 0.98);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
}
.nav-inner {
  min-height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.brand-logo {
  width: 44px;
  height: 44px;
  min-height: 44px;
  /* show only the image itself — remove placeholder background/border */
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0;
  display: inline-grid;
  place-items: center;
}
/* Ensure any <img> placed inside the brand slot fits and keeps its aspect */
.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* If the logo is the <img> itself (img.brand-logo), style it directly so glow is visible */
img.brand-logo {
  width: 44px;
  height: 44px;
  display: block;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 0 10px 3px rgba(255,255,255,0.95);
}
.brand-name {
  font-weight: 800;
  color: rgba(255,255,255,0.95);
  /* flexible sizing: shrink on small screens instead of wrapping/ellipsis */
  flex: 1 1 auto;
  min-width: 0;
  font-size: clamp(0.85rem, 3.2vw, 1.3rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}
@media (min-width: 640px) { .brand-name { font-size: 1.15rem; } }

/* Add red glow to brand and nav white text */
.nav .brand-name {
  text-shadow: 0 0 2.5px rgb(255, 0, 0), 0 0 5px rgb(255, 0, 0), 0 0 7.5px rgb(255, 0, 0);
}

/* Desktop boost */
@media (min-width: 1024px) {
  .brand-name { font-size: 1.35rem; }
}

.nav-links { display: none; align-items: center; gap: 0.75rem; }
@media (min-width: 1024px) { .nav-links { display: flex; } }
.nav-links a,
.nav-links-mobile a {
  padding: 0.65rem 1rem;
  border-radius: calc(var(--radius-pill) * 0.8);
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(255,255,255,0.92);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.nav-links a:hover,
.nav-links-mobile a:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.16);
  color: rgba(255,255,255,1);
  border-color: rgba(255,255,255,0.2);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
}
.nav-links a.active {
  background: rgba(255,255,255,0.18);
  color: var(--accent);
  border-color: rgba(216,63,79,0.9);
  box-shadow: 0 12px 34px rgba(216,63,79,0.28), 0 0 0 4px rgba(216,63,79,0.06);
  transform: translateY(-2px);
  text-shadow: 0 1px 0 rgba(255,255,255,0.04);
}

.nav-actions { display: flex; align-items: center; gap: 0.5rem; }
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.18rem;
  border-radius: var(--radius-pill);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.14);
  overflow: visible;
}
.lang-toggle button {
  padding: 0.45rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: rgba(255,255,255,0.88);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.lang-toggle button.active {
  background: rgba(216,63,79,0.04);
  color: var(--accent);
  border-color: rgba(216,63,79,0.9);
  box-shadow: 0 0 0 1px rgba(216,63,79,0.45), 0 0 12px rgba(216,63,79,0.7), 0 0 24px rgba(216,63,79,0.28);
  transform: translateY(-1px);
  text-shadow: 0 0 2.5px rgba(255, 0, 0, 0.5), 0 0 6px rgba(255, 0, 0, 0.35);
}

.menu-btn {
  display: inline-grid;
  place-items: center;
  padding: 0.5rem;
  color: rgba(255,255,255,0.92);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 8px 18px rgba(11, 12, 33, 0.1);
}
.menu-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(35,32,88,0.18);
}
@media (min-width: 1024px) { .menu-btn { display: none; } }

.nav-links-mobile {
  display: flex;
  flex-direction: column;
  border-top: 1px solid rgba(255,255,255,0.12);
  background: rgba(20,18,50,0.98);
  padding: 0.75rem 1rem;
}
.nav-links-mobile[hidden] { display: none; }
@media (min-width: 1024px) { .nav-links-mobile { display: none; } }
.nav-links-mobile a {
  padding: 0.85rem 1rem;
  margin-bottom: 0.15rem;
  border-radius: calc(var(--radius) * 0.75);
  color: rgba(255,255,255,0.95);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
}
.nav-links-mobile a.active {
  background: rgba(255,255,255,0.18);
  color: var(--accent);
  border-color: rgba(216,63,79,0.9);
  box-shadow: 0 12px 34px rgba(216,63,79,0.28), 0 0 0 4px rgba(216,63,79,0.06);
  transform: translateY(-2px);
}
.nav-links-mobile a:last-child { margin-bottom: 0; }
.nav-links-mobile a:hover { background: rgba(255,255,255,0.14); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: transparent;
  padding-top: calc(var(--nav-h) + 1.25rem);
}
.hero-bg {
  display: none;
}
.hero-bg.placeholder {
  display: none;
}
.hero-overlay {
  /* Fixed-size overlay window so it doesn't resize when slide content changes */
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: calc(min(100%, var(--container)) + 4rem);
  max-width: calc(100% + 4rem);
  height: 520px;
  pointer-events: none;
  /* Make overlay fully invisible */
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  opacity: 0 !important;
  transition: none !important;
  z-index: 0;
}
.hero-grid {
  position: relative;
  display: grid;
  gap: 2.25rem;
  padding-top: 3.5rem;
  padding-bottom: 5rem;
}

/* Keep hero content above the fixed overlay */
.hero-grid { z-index: 1; }
@media (min-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr 1fr; padding-top: 4rem; padding-bottom: 6rem; }
}
.hero-left { display: flex; flex-direction: column; gap: 1.25rem; }
.badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  align-self: flex-start;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  background: rgba(203, 254, 255, 0.25);
  border: rgba(0, 0, 0, 0.156) 1px solid;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}
.badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.hero-left h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  color: #102d5c;
  line-height: 1.08;
}
.hero-sub {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  max-width: 760px;
  width: fit-content;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-pill);
  background: rgba(203, 254, 255, 0.25);
  border: 1px solid rgba(0, 0, 0, 0.156);
  color: #102d5c;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.45;
  box-shadow: inset 0 0 0 1px rgba(16, 45, 92, 0.04);
  white-space: nowrap;
}

@media (max-width: 767px) {
  .hero-sub {
    white-space: normal;
    width: auto;
    max-width: 100%;
  }
}

.hero-card {
  background: rgba(232, 255, 253, 0.72);
  color: #102d5c;
  border: 1px solid rgba(16,45,92,0.12);
  border-radius: calc(var(--radius) + 4px);
  padding: 2rem;
  box-shadow: 0 28px 80px rgba(10, 10, 40, 0.12);
}
.hero-count {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(16, 45, 92, 0.68);
}
/* Remove numbers completely */
.hero-count { display: none !important; }
.hero-title {
  margin-top: 0.5rem;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  color: #102d5c;
}
.hero-text {
  margin-top: 1rem;
  color: rgba(16, 45, 92, 0.8);
  line-height: 1.8;
}
.hero-dots { margin-top: 1.5rem; display: flex; gap: 0.5rem; }
.hero-dots button {
  height: 6px; width: 16px;
  background: rgba(16, 45, 92, 0.22);
  border-radius: var(--radius-pill);
  transition: width 0.25s, background 0.25s;
}
.hero-dots button.active { width: 32px; background: var(--accent); }

/* ---------- Sections ---------- */
.section {
  padding: 5rem 0;
  scroll-margin-top: var(--nav-h);
  background-color: transparent;
}
.section-light { --section-bg: rgba(255,255,255,0.94); background-color: var(--section-bg); }
.section-alt   { --section-bg: rgba(249,250,253,0.92); background-color: var(--section-bg); }

.hero { background: transparent; }

/* ---------- Cardiology theme overrides ---------- */
/* Use a focused dark blue overlay for primary informational sections */
#about.section,
#services.section,
#contact.section {
  background-color: var(--cardio-blue);
  color: var(--cardio-fg);
}

#about.section,
#contact.section {
  background-color: var(--cardio-blue) !important;
}

#departments.section {
  background-color: rgba(249,250,253,0.3) !important;
  color: var(--fg);
}

#about.section .about-list li {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: calc(var(--radius) + 4px);
  padding: 1rem 1.1rem;
  color: rgba(255,255,255,0.95) !important;
}
#contact.section .contact-heading,
#contact.section .contact-sub,
#contact.section .contact-label,
#contact.section .contact-value,
#contact.section a {
  color: var(--cardio-fg) !important;
}
#contact.section .contact-row {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.16);
  box-shadow: 0 18px 36px rgba(10, 10, 40, 0.08);
}
#contact.section .contact-icon {
  background: linear-gradient(135deg, rgba(226, 9, 27, 0.96), rgba(214, 57, 73, 0.8));
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--cardio-fg);
}
#contact.section .contact-map {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
}

/* Headings and underline visibility on blue backgrounds */
#about.section .section-heading h2,
#services.section .section-heading h2,
#contact.section .section-heading h2 {
  color: var(--cardio-fg);
}
#about.section .section-underline,
#services.section .section-underline,
#contact.section .section-underline {
  background: rgba(255,255,255,0.85);
}
#departments.section .section-heading h2 {
  color: var(--primary);
}
#departments.section .section-underline {
  background: var(--accent);
}

/* Links and interactive elements on these sections */
#about.section a,
#services.section a,
#about.section .dept-label,
#services.section .dept-label {
  color: rgba(255,255,255,0.95);
}

#departments.section a,
#departments.section .dept-intro {
  color: var(--fg);
}

/* Ensure cards and list items contrast well when placed on dark blue */
#services.section .services-list li,
#about.section .about-list li {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.16);
  box-shadow: 0 18px 36px rgba(10, 10, 40, 0.08);
}

#departments.section .dept-card {
  background: transparent;
  border: none;
  box-shadow: none;
}
#departments.section .dept-icon {
  background: rgba(220, 47, 63, 0.95);
}
#departments.section .dept-card:hover {
  background: transparent;
}

.section-heading { display: flex; flex-direction: column; align-items: center; text-align: center; }
.section-heading h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.section-underline {
  margin-top: 0.75rem; height: 4px; width: 64px; border-radius: var(--radius-pill); background: var(--accent);
}

/* ---------- About ---------- */
.about-grid {
  margin: 2.5rem auto 0;
  display: grid;
  gap: 2rem;
  max-width: 1000px;
}
.about-list { display: flex; flex-direction: column; gap: 1rem; }
.about-list li {
  display: flex; gap: 0.75rem;
  color: rgba(28,26,46,0.85);
  line-height: 1.65;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(35,32,88,0.08);
  border-radius: calc(var(--radius) + 4px);
  padding: 1rem 1.1rem;
}
.about-list li::before {
  content: ""; margin-top: 0.6rem; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: 0 0 6px;
}

/* ---------- Departments ---------- */
.dept-intro {
  margin: 2rem auto 0; max-width: 900px; display: flex; flex-direction: column; gap: 1rem;
  list-style: none;
}
.dept-intro li {
  display: flex; gap: 0.75rem;
  color: rgba(28,26,46,0.85);
  line-height: 1.65;
  background: rgba(216, 252, 255, 0.46);
  border: 1px solid rgba(35,32,88,0.08);
  border-radius: calc(var(--radius) + 4px);
  padding: 1rem 1.1rem;
  box-shadow: 0 18px 36px rgba(10, 10, 40, 0.08);
  color: rgb(35, 31, 89);
  font-weight: 500;
}
.dept-intro li::before {
  content: ""; margin-top: 0.6rem; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: 0 0 6px;
}
.dept-grid {
  margin-top: 3rem;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .dept-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .dept-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.dept-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 0;
  text-align: center;
  background: transparent;
  border: none;
  box-shadow: none;
  transition: transform 260ms ease;
}
.dept-card:hover {
  transform: translateY(-6px);
}
.dept-icon {
  position: relative;
  width: 100%;
  max-width: 390px;
  aspect-ratio: 16 / 10;
  min-height: 220px;
  background: rgba(220, 47, 63, 0.95);
  border-radius: 28px;
  transition: transform 260ms ease, box-shadow 260ms ease, background 260ms ease;
  overflow: hidden;
  display: grid;
  place-items: center;
  box-shadow: 0 16px 32px rgba(220, 47, 63, 0.14);
}
.dept-card:hover .dept-icon {
  background: rgba(255,255,255,0.96);
  transform: scale(1.02);
  box-shadow: 0 0 28px rgba(220, 47, 63, 0.22);
}

/* Stronger specificity for departments section to ensure hover flips the box */
#departments.section .dept-card:hover .dept-icon {
  background: rgba(255,255,255,0.96);
  transform: scale(1.02);
  box-shadow: 0 0 20px rgba(220, 47, 63, 0.18);
}
.dept-icon-img {
  width: auto;
  max-width: 72%;
  max-height: 72%;
  object-fit: contain;
  transition: filter 180ms ease;
}
.dept-card:hover .dept-icon-img {
  filter: brightness(0.95);
}
.dept-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem 0.75rem;
  color: rgba(255,255,255,0.95);
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.dept-card:hover .dept-label {
  color: var(--accent);
  background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.96) 100%);
}

/* Ensure departments label flips to red when hovered even when other rules exist */
#departments.section .dept-card:hover .dept-label {
  color: var(--accent) !important;
  background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.96) 100%) !important;
}

/* ---------- Services ---------- */
.services-intro { margin: 2rem auto 0; max-width: 900px; text-align: center; color: rgba(28,26,46,0.82); line-height: 1.65; }
.services-list { margin: 2.5rem auto 0; max-width: 900px; display: grid; gap: 0.75rem; }
@media (min-width: 640px) { .services-list { grid-template-columns: 1fr 1fr; } }
.services-list li {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 1.25rem 1rem;
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(35,32,88,0.1);
  border-radius: calc(var(--radius) + 4px);
  transition: transform 260ms ease, border-color 260ms ease, box-shadow 260ms ease;
}
.services-list li:hover {
  transform: translateY(-4px);
  border-color: rgba(35,32,88,0.2);
  box-shadow: 0 14px 32px rgba(11, 12, 33, 0.06);
}
.check {
  display: grid; place-items: center;
  width: 24px; height: 24px; flex: 0 0 24px; margin-top: 2px;
  background: var(--accent); color: #fff; border-radius: 50%;
}
.check svg { width: 14px; height: 14px; }

/* ---------- People ---------- */
.people-grid { margin: 3rem auto 0; display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .people-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .people-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.people-grid-2 { max-width: 720px; margin-left: auto; margin-right: auto; }
.person-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  min-width: 0;
  padding: 1.5rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(231,244,255,0.96));
  border-radius: calc(var(--radius) + 8px);
  border: 1px solid rgba(35,32,88,0.12);
  box-shadow: 0 12px 28px rgba(11, 12, 33, 0.08), inset 0 0 0 1px rgba(255,255,255,0.4);
  transition: transform 260ms ease, box-shadow 260ms ease, border-color 260ms ease;
}
.person-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 44px rgba(11, 12, 33, 0.12), 0 0 0 1px rgba(216,63,79,0.18), 0 0 28px rgba(216,63,79,0.18);
  border-color: rgba(216,63,79,0.38);
}
.person-portrait {
  width: 100%;
  max-width: none;
  aspect-ratio: 1 / 1;
  border-radius: calc(var(--radius-sm)) calc(var(--radius-sm)) 0 0;
  border: none;
  object-fit: cover;
  object-position: center top;
  background: transparent;
  display: block;
  box-shadow: 0 18px 40px rgba(16,45,92,0.08), 0 6px 18px rgba(216,63,79,0.06);
  margin: 0 auto;
}
.person-name {
  margin: 0;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--cardio-blue-strong);
}
/* Bordered box that contains the name + roles */
.person-info {
  width: 100%;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(245,247,250,0.96));
  border-radius: 0 0 calc(var(--radius-sm)) calc(var(--radius-sm));
  display: block;
  text-align: center;
  position: relative;
  z-index: 1;
  border: 1px solid rgba(216,63,79,0.95);
  box-shadow: 0 8px 28px rgba(216,63,79,0.12), 0 0 18px rgba(216,63,79,0.18);
}
.person-info .person-roles { margin-top: 0.35rem; text-align: center; }
.person-name { text-align: center; }
/* soft neon glow behind the bordered box */
.person-info::after {
  content: "";
  position: absolute;
  left: -6px; right: -6px; top: -6px; bottom: -6px;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(ellipse at center, rgba(216,63,79,0.16), rgba(216,63,79,0.05) 45%, transparent 70%);
  filter: blur(8px);
  pointer-events: none;
}
.person-roles {
  margin-top: 0.45rem;
  font-size: 0.9rem;
  color: rgba(35,32,88,0.8);
  line-height: 1.45;
}
.person-roles p {
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: normal;
  text-shadow: 0 0 2px rgba(35,32,88,0.08);
}

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: 2.5rem; }
@media (min-width: 1024px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
.contact-heading {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  color: var(--primary);
  text-shadow: 0 0 2.5px rgb(255, 0, 0), 0 0 5px rgb(255, 0, 0), 0 0 7.5px rgb(255, 0, 0);
}
.contact-sub {
  margin-top: 0.5rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent);
}
.contact-rows { margin-top: 2rem; display: flex; flex-direction: column; gap: 1.25rem; }
.contact-row {
  display: flex;
  gap: 1rem;
  background: rgba(255,255,255,0.94);
  border: 1px solid rgba(35,32,88,0.08);
  border-radius: calc(var(--radius) + 4px);
  padding: 1rem 1rem;
  align-items: flex-start;
}
.contact-icon {
  display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 40px;
  background: var(--primary); color: var(--primary-fg); border-radius: 50%;
}
.contact-icon svg { width: 20px; height: 20px; }
.contact-label {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.28em;
  text-decoration-thickness: 1px;
}
.contact-value {
  letter-spacing: 0.1em;
  margin-top: 0.25rem;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.5;
}
.contact-value a:hover { color: var(--accent); }
.contact-map { aspect-ratio: 16 / 9; width: 100%; }
@media (min-width: 1024px) { .contact-map { aspect-ratio: auto; min-height: 100%; } }

/* ---------- Footer ---------- */
.footer { background: var(--cardio-blue-strong); color: rgba(255,255,255,0.95); padding: 1.75rem 0; }
.footer-inner { display: flex; flex-direction: column; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 0.9rem; }
@media (min-width: 640px) { .footer-inner { flex-direction: row; } }
.footer-inner p { width: 100%; margin: 0; }
.footer-muted { color: rgba(255,255,255,0.8); }

/* Ensure readable text for cardiology-themed blue sections */
#about.section,
#services.section,
#contact.section {
  color: var(--cardio-fg);
}

#about.section h1, #about.section h2, #about.section h3, #about.section h4,
#about.section p, #about.section li, #about.section a,
#about.section span,
#services.section h1, #services.section h2, #services.section h3, #services.section h4,
#services.section p, #services.section li, #services.section a,
#services.section span,
#contact.section h1, #contact.section h2, #contact.section h3, #contact.section h4,
#contact.section p, #contact.section li, #contact.section a,
#contact.section span {
  color: var(--cardio-fg) !important;
}

/* Specific overrides for elements that were set to dark colors */
#about.section .about-list li { color: var(--cardio-fg) !important; }
#departments.section .dept-intro { color: var(--fg) !important; }
#services.section .services-intro { color: var(--cardio-fg) !important; }
#departments.section .dept-label { color: rgba(255,255,255,0.95) !important; }
#departments.section .dept-icon { background: rgba(174, 21, 41); color: var(--cardio-fg); }
#departments.section .dept-card { background: transparent; border: none; box-shadow: none; }

/* Placeholders inside dark sections */
#about.section .placeholder, #departments.section .placeholder, #services.section .placeholder {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.9);
  border-color: rgba(255,255,255,0.08);
}

/* Adjust people cards when placed on dark backgrounds (if any appear there) */
#about.section .person-card, #departments.section .person-card, #services.section .person-card {
  background: rgba(255,255,255,0.04);
  color: var(--cardio-fg);
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal-backdrop::before {
  content: ""; position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
}
.modal {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  width: 100%; max-width: 780px; max-height: 90vh;
  background: var(--bg); border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow); overflow: hidden;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--primary); color: var(--primary-fg);
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 1.15rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.modal-close {
  display: grid; place-items: center; padding: 0.4rem; border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.modal-close:hover { background: rgba(255,255,255,0.15); }
.modal-body {
  overflow-y: auto; padding: 1.5rem; display: flex; flex-direction: column; gap: 0.75rem;
  line-height: 1.65; color: var(--fg);
}
.modal-body p.underlined {
  margin-top: 0.5rem; font-weight: 700; color: var(--primary);
  text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px;
}
.modal-body p.item { padding-left: 1rem; }
.modal-body .red { color: var(--accent); font-weight: 700; }

body.modal-open { overflow: hidden; }

/* ---------- Scroll reveal animations (performant, variant-driven) ---------- */
:root {
  --reveal-duration: 420ms;
  --reveal-ease: cubic-bezier(0.2, 0.9, 0.3, 1);
  --reveal-distance: 16px;
}

.reveal {
  opacity: 0;
  transform: translate3d(0, var(--reveal-distance), 0);
  will-change: transform, opacity;
  transition: opacity var(--reveal-duration) var(--reveal-ease), transform var(--reveal-duration) var(--reveal-ease);
}
.reveal.in-view { opacity: 1; transform: translate3d(0, 0, 0); }

/* Directional variants for nicer UX */
.reveal-left  { transform: translate3d(calc(-1 * var(--reveal-distance)), 0, 0); }
.reveal-right { transform: translate3d(var(--reveal-distance), 0, 0); }
.reveal-up    { transform: translate3d(0, var(--reveal-distance), 0); }
.reveal-scale { transform: scale(0.985) translate3d(0, var(--reveal-distance), 0); }
.reveal.in-view.reveal-scale { transform: scale(1) translate3d(0, 0, 0); }

/* Keep things instantaneous and accessible for reduced motion users */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.in-view, .reveal-left, .reveal-right, .reveal-up, .reveal-scale {
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}
