/* SBR Pulse Hospitals: tokens first, then base, layout, components */
:root {
  --ink: #0f2e2c;
  --ink-2: #1b4642;
  --paper: #f3f7f6;
  --surface: #ffffff;
  --mint: #d3e9e3;
  --line: #d3e1dd;
  --muted: #4a625f;
  --pulse: #d93f24;        /* buttons and alerts */
  --pulse-bright: #ff7a5c; /* the ECG line on dark/light accents */
  --on-dark: #e6f1ee;
  --on-dark-muted: #a9c4be;

  --f-display: "Newsreader", Georgia, "Times New Roman", serif;
  --f-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --wrap: 72rem;
  --r: 10px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  font: 400 1.0625rem/1.65 var(--f-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--ink-2); text-underline-offset: 3px; }
a:hover { color: var(--pulse); }
:focus-visible { outline: 3px solid var(--pulse); outline-offset: 3px; border-radius: 3px; }

h1, h2, h3 { font-family: var(--f-display); font-weight: 500; line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 .6em; }
h1 { font-size: clamp(2.4rem, 5.5vw, 4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3, .h3 { font-family: var(--f-display); font-weight: 600; font-size: 1.35rem; line-height: 1.25; margin: 0 0 .35em; }
p { margin: 0 0 1em; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: .5rem; top: .5rem; }

/* ---------- top bar & header ---------- */
.topbar { background: var(--ink); color: var(--on-dark-muted); font-size: .875rem; }
.topbar a { color: var(--on-dark); }
.topbar-inner { display: flex; justify-content: space-between; gap: 1rem; padding-block: .45rem; }

.site-header { position: sticky; top: 0; z-index: 50; background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-block: .8rem; }

.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--ink); }
.brand-mark { width: 2.1rem; height: 2.1rem; }
.brand-mark rect { fill: var(--ink); }
.brand-mark path { fill: none; stroke: var(--pulse-bright); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.brand-name { font-family: var(--f-display); font-weight: 600; font-size: 1.3rem; letter-spacing: -0.01em; }

.site-nav { display: flex; align-items: center; gap: 1.75rem; }
.site-nav ul { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.site-nav ul a { text-decoration: none; color: var(--ink); font-weight: 500; padding: .4rem 0; border-bottom: 2px solid transparent; }
.site-nav ul a:hover { border-bottom-color: var(--mint); color: var(--ink); }
.site-nav ul a[aria-current="page"] { border-bottom-color: var(--pulse); }

.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; width: 2.8rem; height: 2.8rem; cursor: pointer; align-items: center; justify-content: center; }
.nav-toggle .bars, .nav-toggle .bars::before, .nav-toggle .bars::after { display: block; width: 1.25rem; height: 2px; background: var(--ink); content: ""; position: relative; transition: transform .2s, opacity .2s; }
.nav-toggle .bars::before { position: absolute; top: -6px; }
.nav-toggle .bars::after { position: absolute; top: 6px; }
.nav-toggle[aria-expanded="true"] .bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- buttons & links ---------- */
.btn { display: inline-block; font: 600 1rem/1 var(--f-body); padding: .95rem 1.4rem; border-radius: var(--r); border: 2px solid transparent; text-decoration: none; cursor: pointer; text-align: center; transition: background-color .15s, color .15s, border-color .15s; }
.btn-pulse { background: var(--pulse); color: #fff; }
.btn-pulse:hover { background: #b9321a; color: #fff; }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.text-link { font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.75rem; }

/* ---------- hero ---------- */
.hero { position: relative; padding-block: clamp(3rem, 8vw, 6rem) 0; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; position: relative; z-index: 1; }
.hero-copy h1 { max-width: 14ch; }
.lead { font-size: 1.2rem; max-width: 38rem; color: var(--muted); }
.hero .lead { max-width: 34rem; }

.hours { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1.5rem 1.5rem 1.1rem; }
.hours h2 { font-size: 1.35rem; margin-bottom: .8rem; }
.hours dl { margin: 0; }
.hours dl > div { padding: .75rem 0; border-top: 1px solid var(--line); }
.hours dt { font-weight: 600; }
.hours dd { margin: 0; color: var(--muted); }

.ecg { display: block; width: 100%; height: clamp(70px, 10vw, 120px); margin-top: clamp(1.5rem, 4vw, 3rem); }
.ecg path { fill: none; stroke: var(--pulse); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ecg { animation: trace 2.4s cubic-bezier(.5, 0, .2, 1) .2s both; }
@keyframes trace { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* ---------- sections ---------- */
.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section-tint { background: var(--mint); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.section-head h2 { margin: 0; }

.page-head { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(1.5rem, 3vw, 2.5rem); border-bottom: 1px solid var(--line); background: var(--surface); }
.page-head h1 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); margin-bottom: .4em; }
.page-head .lead { margin-bottom: 0; }

/* departments: ruled list, not cards */
.dept-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 2.5rem; }
.dept-list li { padding: 1.4rem 0 1.6rem; border-top: 2px solid var(--ink); }
.dept-list p { color: var(--muted); margin-bottom: .6em; }
.dept-list-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* steps: a genuine sequence */
.steps-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.lead-sm { color: var(--ink-2); max-width: 28rem; }
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 1.4rem 3.4rem; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -.1rem; width: 2.3rem; height: 2.3rem; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font: 600 1rem/1 var(--f-display); }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 1.1rem; top: 2.4rem; bottom: .2rem; width: 2px; background: var(--ink-2); opacity: .35; }

.cta { background: var(--ink); color: var(--on-dark); padding-block: clamp(2.5rem, 6vw, 4rem); }
.cta h2 { color: #fff; margin-bottom: .4em; }
.cta p { color: var(--on-dark-muted); max-width: 36rem; }
.cta .btn-pulse { margin-top: .5rem; }

/* about */
.prose-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.prose { max-width: 40rem; }
.prose h2:not(:first-child) { margin-top: 1.8em; }
.values { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1.6rem; }
.values ul { list-style: none; margin: 0; padding: 0; }
.values li { padding: .9rem 0; border-top: 1px solid var(--line); }
.values li:first-child { border-top: 0; padding-top: 0; }

/* doctors */
.doc-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.doc { display: flex; gap: 1.1rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1.25rem; }
.doc img, .avatar { width: 5rem; height: 5rem; border-radius: 50%; flex: none; object-fit: cover; }
.avatar { display: grid; place-items: center; background: var(--mint); color: var(--ink); font: 600 1.5rem/1 var(--f-display); }
.doc p { margin: 0; }
.doc-role { color: var(--ink-2); font-weight: 500; }
.doc-meta { color: var(--muted); font-size: .95rem; }

/* contact */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(1.25rem, 3vw, 2rem); }
.field { margin-bottom: 1.1rem; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
label { display: block; font-weight: 600; margin-bottom: .35rem; }
.opt { font-weight: 400; color: var(--muted); }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1.5px solid #9db5b0; border-radius: 8px; padding: .75rem .85rem; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--pulse-bright); outline-offset: 1px; border-color: var(--ink); }
textarea { resize: vertical; min-height: 7rem; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--pulse); }
.err { color: #a82d17; margin: .35rem 0 0; font-size: .95rem; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.fine { color: var(--muted); font-size: .9rem; margin: 1rem 0 0; }

.notice { border-radius: 8px; padding: 1rem 1.1rem; margin-bottom: 1.25rem; border: 1px solid; }
.notice-ok { background: #e4f4ec; border-color: #8cc9a7; color: #123d27; }
.notice-err { background: #fdeceb; border-color: #e7a79c; color: #6b1d10; }

.contact-side h2 { font-size: 1.35rem; }
.contact-side h2:not(:first-child) { margin-top: 1.8rem; }
.details { margin: 0; }
.details > div { padding: .8rem 0; border-top: 1px solid var(--line); }
.details dt { font-weight: 600; }
.details dd { margin: 0; color: var(--muted); }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: var(--on-dark); padding-top: 3rem; border-top: 4px solid var(--pulse); }
.site-footer a { color: var(--on-dark); }
.site-footer a:hover { color: var(--pulse-bright); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr .8fr; gap: 2rem; padding-bottom: 2.5rem; }
.footer-brand { font: 600 1.4rem/1.2 var(--f-display); margin-bottom: .3rem; }
.footer-h { font: 600 .95rem/1.2 var(--f-body); letter-spacing: 0; color: var(--on-dark-muted); margin-bottom: .7rem; }
.muted-on-dark { color: var(--on-dark-muted); }
.site-footer address { font-style: normal; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: .3rem; }
.footer-base { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem 2rem; padding-block: 1.1rem; border-top: 1px solid rgba(255,255,255,.15); color: var(--on-dark-muted); font-size: .9rem; }

/* ---------- responsive ---------- */
@media (max-width: 62rem) {
  .dept-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 52rem) {
  .nav-toggle { display: inline-flex; }
  .site-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; gap: 1rem; padding: 1rem 1.25rem 1.4rem; display: none; }
  .site-nav.is-open { display: flex; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav ul a { display: block; padding: .8rem 0; border-bottom: 1px solid var(--line); }
  .hero-grid, .steps-wrap, .prose-grid, .contact-grid { grid-template-columns: 1fr; }
  .hero-copy h1 { max-width: none; }
  .doc-grid { grid-template-columns: 1fr; }
}
@media (max-width: 40rem) {
  .topbar-mail { display: none; }
  .dept-list, .dept-list-wide, .row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .actions .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ecg { animation: none; }
  .nav-toggle .bars, .nav-toggle .bars::before, .nav-toggle .bars::after { transition: none; }
}
