@import url("tokens.css");

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--t-base);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.18;
  letter-spacing: -0.005em;
  margin: 0;
  font-weight: 600;
}
h1 { font-size: var(--t-3xl); letter-spacing: -0.018em; }
h2 { font-size: var(--t-2xl); letter-spacing: -0.012em; }
h3 { font-size: var(--t-lg); }
p  { margin: 0; }
img { max-width: 100%; height: auto; display: block; }
[id] { scroll-margin-top: calc(var(--header-h) + 24px); }

a { color: var(--slate); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--slate-deep); }

::selection { background: var(--clay); color: var(--white); }
* { scrollbar-color: var(--rule) var(--field); }
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-track { background: var(--field); }
*::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 99px; }
*::-webkit-scrollbar-thumb:hover { background: var(--ink-soft); }

/* generous, obvious focus: this is the accessibility-forward site */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}
.skip {
  position: absolute; left: var(--s-2); top: -100px; z-index: 200;
  background: var(--slate); color: var(--white);
  padding: 12px 20px; border-radius: var(--radius);
  font-family: var(--font-display); font-weight: 600; text-decoration: none;
  transition: top var(--dur) var(--ease);
}
.skip:focus { top: var(--s-2); color: var(--white); }

.wrap { width: min(100% - 40px, var(--wrap)); margin-inline: auto; }
.ico { width: 20px; height: 20px; flex: none; }

/* ---------- header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: var(--hairline);
}
.hdr-in {
  width: min(100% - 40px, var(--wrap)); margin-inline: auto;
  min-height: var(--header-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--s-2);
}
.mark {
  justify-self: start;
  font-family: var(--font-display); text-decoration: none; line-height: 1.15;
  color: var(--ink); font-size: var(--t-sm); letter-spacing: 0.005em;
  display: flex; flex-direction: column; justify-content: center;
  min-height: 44px; padding: 4px 0;
}
.mark-a { display: block; color: var(--clay); font-weight: 600; }
.mark-b { display: block; color: var(--ink-soft); font-weight: 500; }
.mark:hover .mark-b { color: var(--ink); }

.nav { justify-self: center; }
.navlist {
  display: flex; gap: 4px; list-style: none; margin: 0; padding: 0;
}
.navlist a {
  padding: 10px 14px; min-height: 44px; display: flex; align-items: center;
  font-family: var(--font-display); font-size: var(--t-sm); font-weight: 500;
  color: var(--ink-soft); text-decoration: none; border-radius: var(--radius);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.navlist a:hover { color: var(--ink); background: var(--field); }
.navlist a[aria-current="page"] { color: var(--slate); font-weight: 600; background: var(--field); }

.switch {
  justify-self: end; margin: 0;
  font-family: var(--font-display); font-size: var(--t-xs); color: var(--ink-soft);
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.switch a {
  color: var(--ink-soft); text-decoration: none; padding: 4px 2px;
  border-bottom: 1px solid transparent;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.switch a:hover { color: var(--clay); border-bottom-color: var(--clay); }
.switch span { color: var(--rule); }

.nav-tog {
  display: none; align-items: center; gap: 8px;
  min-height: 44px; padding: 8px 12px;
  font-family: var(--font-display); font-size: var(--t-sm); font-weight: 500;
  color: var(--ink); background: transparent;
  border: var(--hairline); border-radius: var(--radius); cursor: pointer;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.nav-tog:hover { background: var(--field); }
.nav-tog:active { transform: translateY(1px); }
.nav-tog .ico-shut { display: none; }
.nav-tog[aria-expanded="true"] .ico-open { display: none; }
.nav-tog[aria-expanded="true"] .ico-shut { display: block; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 24px;
  font-family: var(--font-display); font-size: var(--t-base); font-weight: 600;
  border-radius: var(--radius); border: 1px solid transparent; cursor: pointer;
  text-decoration: none; text-align: center;
  background: var(--slate); color: var(--paper);
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.btn:hover { background: var(--slate-deep); color: var(--paper); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn[disabled] { background: var(--rule); color: var(--ink-soft); cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- hero (split) ---------- */
.hero { border-bottom: var(--hairline); }
.hero-in {
  width: min(100% - 40px, var(--wrap)); margin-inline: auto;
  display: grid; grid-template-columns: 46fr 54fr; align-items: stretch;
  gap: 0;
}
.hero-shot { position: relative; overflow: hidden; }
.hero-shot img { width: 100%; height: 100%; object-fit: cover; }
.hero-copy {
  position: relative; isolation: isolate; overflow: hidden;
  padding: var(--s-9) var(--s-7);
  display: flex; flex-direction: column; justify-content: center;
  background: var(--field);
}
/* ambient: extremely slow vertical light gradient, no pattern */
.hero-copy::before {
  content: ""; position: absolute; inset: -25% 0; z-index: -1;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--white) 78%, transparent) 0%,
    color-mix(in srgb, var(--white) 10%, transparent) 42%,
    color-mix(in srgb, var(--field-warm) 60%, transparent) 100%);
  animation: drift 44s var(--ease) infinite alternate;
  will-change: transform;
}
@keyframes drift {
  from { transform: translate3d(0, -3%, 0) scale(1.02); }
  to   { transform: translate3d(0,  3%, 0) scale(1.06); }
}
.hero h1 { max-width: 15ch; }
.hero-lede {
  margin-top: var(--s-3); max-width: 46ch;
  font-size: var(--t-md); color: var(--ink-soft);
}
.hero-lines { margin-top: var(--s-5); border-top: var(--hairline); }
.phone-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-2);
  padding: 14px 0; border-bottom: var(--hairline);
  flex-wrap: wrap;
}
.phone-label {
  font-family: var(--font-display); font-size: var(--t-sm); font-weight: 600; color: var(--ink);
}
.phone-label small { display: block; font-weight: 400; font-size: var(--t-xs); color: var(--ink-soft); }
.phone-num {
  font-size: var(--t-lg); font-weight: 600; color: var(--slate);
  text-decoration: none; letter-spacing: 0.01em;
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  transition: color var(--dur) var(--ease);
}
.phone-num:hover { color: var(--clay); text-decoration: underline; }
.hero-cta { margin-top: var(--s-5); display: flex; flex-direction: column; gap: var(--s-2); align-items: flex-start; }
.hero-note { font-size: var(--t-sm); color: var(--ink-soft); max-width: 42ch; }

/* ---------- sections ---------- */
.sec { padding: var(--s-9) 0; }
.sec-tight { padding: var(--s-7) 0; }
.sec-field { background: var(--field); border-block: var(--hairline); }
.sec-head { max-width: var(--measure); }
.sec-head p { margin-top: var(--s-2); color: var(--ink-soft); }
.lede { font-size: var(--t-md); color: var(--ink-soft); max-width: 58ch; }

/* photo bands */
.band { margin: var(--s-6) 0 0; }
.band img { width: 100%; border-radius: var(--radius); border: var(--hairline); }
.band figcaption { margin-top: 10px; font-size: var(--t-xs); color: var(--ink-soft); }

.duo { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); margin-top: var(--s-6); align-items: stretch; }
.duo img {
  border-radius: var(--radius); border: var(--hairline);
  width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover;
}

.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-7); align-items: center; }
.split-wide { grid-template-columns: 5fr 7fr; }
/* location blocks: align to the top and keep tall photos in proportion */
.split-top { align-items: start; }
.split-top .band { height: 100%; }
.split-top .band img { height: 100%; max-height: 560px; min-height: 380px; object-fit: cover; }

/* ---------- ruled rows (no identical cards) ---------- */
.rows { margin-top: var(--s-5); border-top: var(--hairline); }
.row {
  display: grid; grid-template-columns: 200px 1fr; gap: var(--s-4);
  padding: var(--s-3) 0; border-bottom: var(--hairline);
}
.row h3 { font-size: var(--t-base); font-weight: 600; }
.row p { color: var(--ink-soft); }
.row-note { font-size: var(--t-sm); }

/* ---------- signature: both clinics ---------- */
.sig { position: relative; }
.sig-grid { display: grid; grid-template-columns: 7fr 5fr; gap: var(--s-6); align-items: start; margin-top: var(--s-6); }
#map {
  width: 100%; aspect-ratio: 4 / 3; min-height: 340px;
  border: var(--hairline); border-radius: var(--radius);
  background: var(--field);
}
.map-legend { margin-top: var(--s-2); display: flex; flex-wrap: wrap; gap: var(--s-3); font-size: var(--t-sm); color: var(--ink-soft); }
.map-legend span { display: inline-flex; align-items: center; gap: 8px; }
.map-legend a { display: inline-flex; align-items: center; min-height: 44px; padding: 4px 2px; }
.dot { width: 12px; height: 12px; border-radius: 99px; flex: none; }
.dot-a { background: var(--slate); }
.dot-b { background: var(--clay); }

.drive {
  margin-top: var(--s-4); padding: var(--s-3) 0;
  border-top: 2px solid var(--ink); border-bottom: var(--hairline);
}
.drive-n { font-family: var(--font-display); font-size: var(--t-xl); font-weight: 600; color: var(--ink); }
.drive-t { font-size: var(--t-sm); color: var(--ink-soft); margin-top: 4px; }

.cmp { width: 100%; border-collapse: collapse; margin-top: var(--s-2); }
.cmp caption { text-align: left; font-size: var(--t-sm); color: var(--ink-soft); padding-bottom: var(--s-2); }
.cmp th, .cmp td { text-align: left; padding: 12px 10px 12px 0; border-bottom: var(--hairline); vertical-align: top; font-size: var(--t-sm); }
.cmp thead th {
  font-family: var(--font-display); font-size: var(--t-sm); font-weight: 600;
  border-bottom: 2px solid var(--ink); color: var(--ink);
}
.cmp tbody th { font-weight: 500; color: var(--ink-soft); width: 34%; }
.cmp td { color: var(--ink); }
.cmp .yes { color: var(--slate); font-weight: 600; }
.cmp .ask { color: var(--ink-soft); }

/* leaflet pins */
.pin { display: grid; place-items: center; }
.pin i {
  display: block; width: 18px; height: 18px; border-radius: 99px;
  border: 3px solid var(--white); box-shadow: 0 1px 3px rgba(27,39,51,.35);
}
.pin-a i { background: var(--slate); }
.pin-b i { background: var(--clay); }
.leaflet-container { font: inherit; border-radius: var(--radius); }
.leaflet-popup-content { font-family: var(--font-body); font-size: var(--t-sm); margin: 12px 14px; }
.leaflet-popup-content strong { font-family: var(--font-display); display: block; margin-bottom: 4px; }
.leaflet-popup-content a { color: var(--slate); }

/* ---------- forms ---------- */
.form { margin-top: var(--s-5); max-width: 560px; }
.fgrid { display: grid; gap: var(--s-3); }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.field label {
  display: block; font-family: var(--font-display); font-size: var(--t-sm);
  font-weight: 600; margin-bottom: 6px; color: var(--ink);
}
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; min-height: 48px;
  font-family: var(--font-body); font-size: var(--t-base); color: var(--ink);
  background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.field textarea { min-height: 132px; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--ink-soft); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px; border-color: var(--slate);
}
.field input::placeholder, .field textarea::placeholder { color: #6E7885; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: var(--t-sm); color: var(--ink-soft); margin-top: var(--s-2); }
.form-msg {
  margin-top: var(--s-3); padding: var(--s-3);
  border: 1px solid var(--clay-deep);
  border-radius: var(--radius); background: var(--field);
  font-size: var(--t-sm); color: var(--ink);
}
.form-msg[hidden] { display: none; }
.form-msg a { font-weight: 600; }

/* ---------- footer ---------- */
.ftr { background: var(--field); border-top: var(--hairline); padding: var(--s-8) 0 var(--s-6); margin-top: var(--s-9); }
.ftr-in { width: min(100% - 40px, var(--wrap)); margin-inline: auto; }
.ftr-name { font-family: var(--font-display); font-size: var(--t-lg); font-weight: 600; color: var(--ink); }
.ftr-since { color: var(--ink-soft); margin-top: 4px; font-size: var(--t-sm); }
.ftr-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--s-5);
  margin-top: var(--s-6); padding-top: var(--s-5); border-top: var(--hairline);
}
.ftr-grid h2 { font-size: var(--t-sm); font-weight: 600; color: var(--ink); letter-spacing: 0.01em; }
.ftr-addr { margin-top: 10px; font-size: var(--t-sm); color: var(--ink-soft); line-height: 1.55; }
.ftr-line { margin-top: 8px; }
.ftr-line a {
  font-family: var(--font-display); font-size: var(--t-md); font-weight: 600;
  color: var(--slate); text-decoration: none;
  display: inline-flex; align-items: center; min-height: 44px;
}
.ftr-line a:hover { color: var(--clay); text-decoration: underline; }
.ftr-fax { font-size: var(--t-xs); color: var(--ink-soft); }
.ftr-nav ul { list-style: none; margin: 10px 0 0; padding: 0; }
.ftr-nav a {
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: var(--t-sm); color: var(--ink-soft); text-decoration: none;
}
.ftr-nav a:hover { color: var(--ink); text-decoration: underline; }
.ftr-fine { margin-top: var(--s-5); padding-top: var(--s-4); border-top: var(--hairline); }
.ftr-fine p { font-size: var(--t-xs); color: var(--ink-soft); max-width: 78ch; margin-bottom: 8px; line-height: 1.6; }
.ftr-copy { color: var(--ink-soft); }

/* ---------- mobile call bar ---------- */
.callbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  display: none; gap: 1px; background: var(--rule);
  border-top: var(--hairline);
  transform: translateY(0); transition: transform 260ms var(--ease);
}
.callbar[data-hidden="true"] { transform: translateY(110%); }
.callbar a {
  flex: 1 1 0; display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 56px; padding: 10px 12px;
  font-family: var(--font-display); font-size: var(--t-sm); font-weight: 600;
  text-decoration: none; background: var(--slate); color: var(--paper);
}
.callbar .callbar-b { background: var(--clay); }
.callbar a:active { filter: brightness(0.94); }

/* ---------- motion: soft cross-fades, no snap ---------- */
[data-rev] { opacity: 0; transform: translate3d(0, 24px, 0); }
.rev-in { opacity: 1; transform: none; transition: opacity var(--dur-reveal) var(--ease), transform var(--dur-reveal) var(--ease); }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .hero-in { grid-template-columns: 1fr; }
  .hero-shot { aspect-ratio: 16 / 10; }
  .hero-copy { padding: var(--s-7) var(--s-4); }
  .sig-grid { grid-template-columns: 1fr; }
  .split, .split-wide { grid-template-columns: 1fr; gap: var(--s-5); }
}
@media (max-width: 860px) {
  :root { --header-h: 60px; }
  .hdr-in { grid-template-columns: 1fr auto; row-gap: 0; }
  .mark { font-size: var(--t-xs); }
  .nav { justify-self: end; grid-column: 2; }
  .nav-tog { display: inline-flex; }
  .navlist {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; gap: 0; padding: var(--s-2) 20px var(--s-3);
    background: var(--paper); border-bottom: var(--hairline);
    box-shadow: var(--shadow-md);
  }
  .navlist:not([data-open]) { display: none; }
  .navlist a { padding: 12px 8px; font-size: var(--t-base); }
  .switch { display: none; }
  .callbar { display: flex; }
  body { padding-bottom: 56px; }
  .sec { padding: var(--s-7) 0; }
  .ftr { padding-top: var(--s-7); margin-top: var(--s-7); }
  .ftr-grid { grid-template-columns: 1fr; gap: var(--s-4); }
  .duo { grid-template-columns: 1fr; gap: var(--s-3); }
  .row { grid-template-columns: 1fr; gap: 6px; }
  .cmp thead th, .cmp th, .cmp td { font-size: var(--t-xs); padding-right: 8px; }
}
@media (pointer: coarse) {
  .hero-note a, .row p a, .ftr-fine a, .cmp td a {
    display: inline-flex; align-items: center; min-height: 44px;
  }
}
@media (max-width: 560px) {
  .f2 { grid-template-columns: 1fr; }
  .phone-row { flex-direction: column; align-items: flex-start; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  [data-rev] { opacity: 1 !important; transform: none !important; }
  .hero-copy::before { animation: none !important; transform: none !important; }
}
