/* Goose Creek Dental Clinic — base, layout, components */

*, *::before, *::after { box-sizing: border-box; }
:where(body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol) { margin: 0; }
:where(ul, ol)[role='list'] { list-style: none; padding: 0; }
img, picture, video { max-width: 100%; height: auto; display: block; }
svg { display: block; }
.icon { display: inline-block; vertical-align: -0.14em; width: 1em; height: 1em; }
dialog { margin: auto; }  /* the reset above must not eat UA centring */

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  scroll-padding-bottom: 96px;
  -webkit-text-size-adjust: 100%;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.62;
  font-variant-numeric: oldstyle-nums proportional-nums;
  text-wrap: pretty;
  hanging-punctuation: first;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: var(--charcoal-900); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 1px; }

/* — Layout ————————————————————————————————— */
.layout {
  display: grid;
  grid-template-columns:
    [full-start] minmax(20px, 1fr)
    [content-start] min(1240px, 100% - 40px) [content-end]
    minmax(20px, 1fr) [full-end];
}
.layout > * { grid-column: content; }
.layout > .full { grid-column: full; }
.prose { max-width: 62ch; }
.section { padding-block: var(--section); }
.section--tight { padding-block: clamp(40px, 5vw, 72px); }
.section--dark { background: var(--surface-dark); color: var(--text-invert); }
.section--sunk { background: var(--surface-sunk); }

/* — Type ——————————————————————————————————— */
h1, h2, h3, .display {
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.012em;
  text-wrap: balance;
  text-transform: uppercase;
}
h1 { font-size: var(--step-4); letter-spacing: -0.022em; line-height: 0.98; max-width: 17ch; }
h2 { font-size: var(--step-2); max-width: 22ch; }
h3 { font-size: var(--step-1); letter-spacing: 0.004em; max-width: 28ch; }
h2 + p, h3 + p { margin-top: var(--s4); }
.section > h2, .section > * > h2 { margin-top: 0; }
* + h2 { margin-top: var(--s9); }
* + h3 { margin-top: var(--s7); }
p + p { margin-top: var(--s5); }

.lede { font-size: var(--step-1); line-height: 1.44; max-width: 34ch; }
.muted { color: var(--text-muted); }
.section--dark .muted { color: var(--text-invert-muted); }
.eyebrow {
  font-family: var(--display);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 500;
  color: var(--accent-ink);
  margin-bottom: var(--s4);
}
.section--dark .eyebrow { color: var(--accent); }
.tnum { font-variant-numeric: tabular-nums lining-nums; }

a { color: inherit; }
.prose a, .textlink {
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--border-strong);
  transition: text-decoration-color 150ms var(--hover);
}
.prose a:hover, .textlink:hover { text-decoration-thickness: 2px; text-decoration-color: var(--accent-ink); }
.prose a:visited { color: var(--text-muted); }

/* The one section divider on this site: the water line from the logo mark. */
.creek { display: block; width: 100%; height: 14px; color: var(--accent); opacity: 0.9; }
.creek + * { margin-top: var(--s7); }

/* — Buttons ———————————————————————————————— */
.btn {
  --btn-bg: var(--charcoal-800);
  --btn-fg: var(--bone-50);
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
  min-height: 48px;
  padding: 0 var(--s5);
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-bg);
  border-radius: var(--radius);
  font-family: var(--display);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 150ms var(--hover), transform 120ms var(--hover), border-color 150ms var(--hover);
}
.btn:not(.btn--ghost):hover { --btn-bg: var(--charcoal-900); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn[disabled], .btn[aria-disabled='true'] { opacity: 0.45; cursor: not-allowed; }
.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  border-color: var(--border-strong);
}
.btn--ghost:hover { --btn-bg: transparent; border-color: var(--text); }
.section--dark .btn, .hero .btn, .callbar .btn {
  --btn-bg: var(--bone-50);
  --btn-fg: var(--charcoal-900);
}
.section--dark .btn:not(.btn--ghost):hover,
.hero .btn:not(.btn--ghost):hover,
.callbar .btn:not(.btn--ghost):hover { --btn-bg: #fff; }
.section--dark .btn--ghost, .hero .btn--ghost, .callbar .btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--bone-50);
  border-color: oklch(0.98 0.005 78 / 0.42);
}
.section--dark .btn--ghost:hover, .hero .btn--ghost:hover,
.callbar .btn--ghost:hover {
  border-color: var(--bone-50);
  --btn-bg: oklch(0.98 0.005 78 / 0.10);
}
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s4); align-items: center; }

/* — Header ————————————————————————————————— */
.skip {
  position: absolute; left: var(--s4); top: -60px; z-index: 100;
  background: var(--bone-50); color: var(--text);
  padding: var(--s3) var(--s4); border-radius: var(--radius);
  transition: top 150ms var(--enter);
}
.skip:focus { top: var(--s3); }

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--surface-logo);
  color: var(--text-invert);
  border-bottom: 1px solid var(--border-dark);
}
.site-header .bar {
  display: flex; align-items: center; gap: var(--s6);
  min-height: 76px;
  padding-block: var(--s3);
}
.brand { display: block; flex: 0 0 auto; line-height: 0; }
.brand img { width: 218px; height: auto; }
.nav { margin-left: auto; }
.nav ul { display: flex; gap: var(--s6); list-style: none; padding: 0; margin: 0; }
.nav a {
  display: block;
  padding-block: var(--s2);
  font-family: var(--display);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.11em;
  text-decoration: none;
  color: var(--text-invert-muted);
  border-bottom: 2px solid transparent;
  transition: color 150ms var(--hover), border-color 150ms var(--hover);
}
.nav a:hover { color: var(--bone-50); border-bottom-color: var(--border-dark); }
.nav a[aria-current='page'] { color: var(--bone-50); border-bottom-color: var(--accent); }
.header-call {
  display: inline-flex; align-items: center; min-height: 44px;
  font-family: var(--display); font-size: var(--step--1);
  letter-spacing: 0.07em; text-decoration: none; white-space: nowrap;
  color: var(--bone-50);
}
.header-call:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.nav-toggle { display: none; }

/* — Hero ——————————————————————————————————— */
.hero { position: relative; background: var(--surface-darker); color: var(--text-invert); }
.hero-media { position: absolute; inset: 0; overflow: hidden; }
/* picture is the img's parent: it has to carry the height or the img spills. */
.hero-media picture { display: block; width: 100%; height: 100%; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 48% 62%; }
.hero-media::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(88deg,
    oklch(0.19 0.005 70 / 0.90) 0%,
    oklch(0.19 0.005 70 / 0.78) 42%,
    oklch(0.19 0.005 70 / 0.30) 100%);
}
.hero-body {
  position: relative;
  padding-block: clamp(88px, 15vw, 188px);
  max-width: 40rem;
}
.hero h1 { color: var(--bone-50); }
.hero .lede { margin-top: var(--s5); color: var(--text-invert-muted); max-width: 40ch; }
.hero .btn-row { margin-top: var(--s7); }

/* — Cards / routes —————————————————————————— */
.routes { display: flex; flex-wrap: wrap; gap: var(--s7); }
.route {
  flex: 1 1 320px;
  display: block;
  padding: var(--s7) var(--s6) var(--s6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 150ms var(--hover), transform 180ms var(--enter);
}
.route:hover { border-color: var(--border-strong); border-top-color: var(--accent-ink); transform: translateY(-2px); }
.route h3 { margin: 0 0 var(--s4); }
.route p { color: var(--text-muted); max-width: 40ch; }
.route .more {
  display: inline-block; margin-top: var(--s5);
  font-family: var(--display); font-size: var(--step--1);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.route:hover .more { text-decoration: underline; text-underline-offset: 0.2em; }

/* — Definition list of treatments ————————————— */
.treatments { border-top: 1px solid var(--border); }
.treatments > div {
  display: grid; gap: var(--s3) var(--s7);
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  padding-block: var(--s6);
  border-bottom: 1px solid var(--border);
}
.treatments dt { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.03em; font-size: var(--step-1); line-height: 1.1; }
.treatments dd { margin: 0; color: var(--text-muted); max-width: 58ch; }
@media (max-width: 720px) { .treatments > div { grid-template-columns: 1fr; } }

/* — Plain service list (alphabetised) ————————— */
.services { display: flex; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--border); }
.services li {
  flex: 1 1 300px;
  padding: var(--s5) var(--s5) var(--s5) 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: var(--step-0);
  line-height: 1.25;
}

/* — Quote ——————————————————————————————————— */
.quote { max-width: 46rem; }
.quote blockquote { font-size: var(--step-2); line-height: 1.24; font-family: var(--body); font-weight: 400; letter-spacing: -0.01em; text-wrap: balance; }
.quote figcaption { margin-top: var(--s5); font-family: var(--display); font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); }
.section--dark .quote figcaption { color: var(--text-invert-muted); }

/* — Figures ————————————————————————————————— */
figure.shot { margin: 0; }
figure.shot img { width: 100%; border-radius: var(--radius); }
figure.shot figcaption { margin-top: var(--s3); font-size: var(--step--1); color: var(--text-muted); }
.split { display: grid; gap: var(--s8); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.split--narrow-media { grid-template-columns: minmax(0, 5fr) minmax(0, 4fr); }
@media (max-width: 860px) { .split, .split--narrow-media { grid-template-columns: 1fr; gap: var(--s7); } }

/* — People —————————————————————————————————— */
.people { display: flex; flex-wrap: wrap; gap: var(--s8); list-style: none; padding: 0; margin: 0; }
.person { flex: 1 1 260px; }
.person img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 999px; margin-bottom: var(--s5); }
.person h3 { margin-bottom: var(--s2); }
.person .role { font-family: var(--display); font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent-ink); margin-bottom: var(--s4); }

/* Between one column and three, a bare flex wrap left the third portrait alone on
   its own row at full width — the hygienist ended up the largest image on the
   page. Lead with the dentist and pair the hygienists underneath instead. */
@media (min-width: 641px) and (max-width: 979px) {
  .people .person:first-child { flex: 1 1 100%; }
  .people .person:first-child img { max-width: 380px; }
  .people .person:first-child p { max-width: 62ch; }
  .people .person + .person { flex: 1 1 calc(50% - var(--s8)); }
  .people .person + .person img { max-width: 300px; }
}

/* — Facts (hours / address) ——————————————————— */
.facts { border-top: 1px solid var(--border); margin: 0; }
.facts > div { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s6); justify-content: space-between; padding-block: var(--s4); border-bottom: 1px solid var(--border); }
.facts dt { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.09em; font-size: var(--step--1); color: var(--text-muted); }
.facts dd { margin: 0; font-variant-numeric: tabular-nums lining-nums; }

.verify {
  display: inline-block;
  padding: 2px var(--s2);
  background: oklch(0.90 0.09 92);
  color: oklch(0.32 0.06 70);
  border-radius: var(--radius);
  font-family: var(--display);
  font-size: 0.78em;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* — Forms ——————————————————————————————————— */
.field { margin-bottom: var(--s5); }
.field label { display: block; font-family: var(--display); font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.09em; margin-bottom: var(--s2); }
.field .hint { display: block; font-size: var(--step--1); color: var(--text-muted); margin-bottom: var(--s2); }
.field input, .field textarea, .field select {
  width: 100%;
  min-height: 48px;
  padding: var(--s3) var(--s4);
  font: inherit;
  font-size: var(--step-0);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  transition: border-color 150ms var(--hover), box-shadow 150ms var(--hover);
}
.field textarea { min-height: 132px; resize: vertical; line-height: 1.55; }
.field input:hover, .field textarea:hover { border-color: var(--text-muted); }
.field input:focus-visible, .field textarea:focus-visible { border-color: var(--focus); }
.field .error { display: none; margin-top: var(--s2); font-size: var(--step--1); color: oklch(0.46 0.16 25); }
.field[data-invalid] input, .field[data-invalid] textarea { border-color: oklch(0.52 0.18 25); }
.field[data-invalid] .error { display: block; }
.form-status { margin-top: var(--s5); }
.form-done { border-left: 3px solid var(--accent); padding-left: var(--s5); }

/* — Booking dialog —————————————————————————— */
.booking::backdrop { background: oklch(0.19 0.005 70 / 0.62); }
.booking {
  width: min(560px, calc(100vw - 32px));
  max-height: min(660px, calc(100vh - 32px));
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.booking[open] { display: flex; flex-direction: column; }
.booking > form { display: flex; flex-direction: column; min-height: 0; max-height: 100%; }
.booking .head, .booking .foot { flex: 0 0 auto; }
.booking .head { display: flex; align-items: flex-start; gap: var(--s5); padding: var(--s5) var(--s5) var(--s4); border-bottom: 1px solid var(--border); }
.booking .head h2 { margin-top: var(--s2); font-size: var(--step-1); max-width: none; }
.booking .head p { font-family: var(--display); font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); }
.booking .body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--s6) var(--s5); }
.booking .body h2 { font-size: var(--step-1); margin-bottom: var(--s5); max-width: none; }
.booking .foot { display: flex; gap: var(--s4); justify-content: space-between; padding: var(--s4) var(--s5); border-top: 1px solid var(--border); background: var(--surface-sunk); }
.booking .close { margin-left: auto; background: none; border: 0; padding: var(--s2); cursor: pointer; color: var(--text-muted); font-size: 22px; line-height: 1; }
.booking .close:hover { color: var(--text); }
.booking fieldset { border: 0; padding: 0; margin: 0; }
.booking legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.choice { display: block; margin-bottom: var(--s3); }
.choice input { position: absolute; opacity: 0; width: 0; height: 0; }
.choice span {
  display: block; padding: var(--s4) var(--s5);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  cursor: pointer; transition: border-color 150ms var(--hover), background 150ms var(--hover);
}
.choice small { display: block; color: var(--text-muted); font-size: var(--step--1); margin-top: 2px; }
.choice input:hover + span { border-color: var(--text-muted); }
.choice input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.choice input:checked + span { border-color: var(--charcoal-800); background: var(--surface-sunk); box-shadow: inset 3px 0 0 var(--accent); }
.slots { display: flex; flex-wrap: wrap; gap: var(--s3); }
.slots .choice { flex: 1 1 116px; margin: 0; }
.slots .choice span { text-align: center; font-variant-numeric: tabular-nums lining-nums; padding: var(--s3); }
.choice input:disabled + span { opacity: 0.38; cursor: not-allowed; text-decoration: line-through; }
.booking .done { text-align: left; }
.booking .summary { margin-top: var(--s5); border-top: 1px solid var(--border); }
.booking .summary > div { display: flex; justify-content: space-between; gap: var(--s5); padding-block: var(--s3); border-bottom: 1px solid var(--border); }
.booking .summary dt { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.09em; font-size: var(--step--1); color: var(--text-muted); }
.booking .summary dd { margin: 0; text-align: right; }
.spinner {
  width: 1em; height: 1em; border-radius: 999px;
  border: 2px solid currentColor; border-top-color: transparent;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* — Footer ————————————————————————————————— */
.site-footer { background: var(--surface-darker); color: var(--text-invert); padding-block: var(--s9) var(--s7); }
.site-footer .cols { display: flex; flex-wrap: wrap; gap: var(--s8); justify-content: space-between; }
.site-footer h2 { font-size: var(--step-1); margin-bottom: var(--s5); }
.site-footer a { color: var(--text-invert-muted); text-decoration: none; }
.site-footer a:hover { color: var(--bone-50); text-decoration: underline; text-underline-offset: 0.2em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s3); }
.site-footer address { font-style: normal; color: var(--text-invert-muted); }
.colophon { margin-top: var(--s9); padding-top: var(--s5); border-top: 1px solid var(--border-dark); display: flex; flex-wrap: wrap; gap: var(--s5); justify-content: space-between; font-size: var(--step--1); color: var(--text-invert-muted); }

/* — Sticky mobile call bar ————————————————— */
.callbar { display: none; }

@media (max-width: 900px) {
  .site-header .bar { gap: var(--s4); min-height: 64px; }
  .brand img { width: 168px; }
  .header-call { display: none; }

  .nav {
    position: fixed;
    top: 64px; right: 0; bottom: 0;
    width: min(340px, 84vw);
    padding: var(--s7) var(--s6) var(--s8);
    background: var(--surface-logo);
    border-left: 1px solid var(--border-dark);
    box-shadow: -18px 0 40px -24px oklch(0.19 0.005 70 / 0.7);
    z-index: 1;
    visibility: hidden;
    transform: translateX(100%);
    transition: transform 240ms var(--exit), visibility 0s linear 240ms;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .nav[data-open] {
    visibility: visible;
    transform: translateX(0);
    transition: transform 300ms var(--enter), visibility 0s;
  }
  .nav ul { flex-direction: column; gap: var(--s5); }
  .nav a { font-size: var(--step-1); border-bottom-width: 0; }
  .nav a[aria-current='page'] { border-bottom-width: 2px; display: inline-block; }

  .nav-scrim {
    position: fixed; inset: 64px 0 0; z-index: 0;
    background: oklch(0.19 0.005 70 / 0.55);
    opacity: 0;
    transition: opacity 240ms var(--exit);
  }
  .nav-scrim[data-open] { opacity: 1; }

  .nav-toggle {
    display: inline-flex; align-items: center; gap: var(--s3);
    margin-left: auto; min-height: 44px; padding: 0 var(--s3);
    background: none; border: 1px solid var(--border-dark); border-radius: var(--radius);
    color: var(--bone-50); font-family: var(--display); font-size: var(--step--1);
    letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer;
  }
  .burger { position: relative; display: block; width: 18px; height: 12px; }
  .burger i {
    position: absolute; left: 0; height: 1.5px; width: 100%;
    background: currentColor; border-radius: 1px;
    transition: transform 260ms var(--enter), opacity 140ms var(--hover);
  }
  .burger i:nth-child(1) { top: 0; }
  .burger i:nth-child(2) { top: 5.25px; }
  .burger i:nth-child(3) { top: 10.5px; }
  .nav-toggle[aria-expanded='true'] .burger i:nth-child(1) { transform: translateY(5.25px) rotate(45deg); }
  .nav-toggle[aria-expanded='true'] .burger i:nth-child(2) { opacity: 0; transform: scaleX(0.4); }
  .nav-toggle[aria-expanded='true'] .burger i:nth-child(3) { transform: translateY(-5.25px) rotate(-45deg); }
  .callbar {
    display: flex; position: fixed; inset: auto 0 0; z-index: 45;
    background: var(--surface-dark); border-top: 1px solid var(--border-dark);
    padding: var(--s3) 20px calc(var(--s3) + env(safe-area-inset-bottom));
    gap: var(--s3);
  }
  .callbar .btn { justify-content: center; min-height: 50px; white-space: nowrap;
                  letter-spacing: 0.06em; padding-inline: var(--s4); }
  .callbar .btn:first-child { flex: 1 1 auto; }
  .callbar .btn--ghost { flex: 0 0 auto; }
  body { padding-bottom: 84px; }
  .hero-body { max-width: none; }
  .hero-media img { object-position: 82% 34%; }
  .hero-media::after {
    background: linear-gradient(180deg,
      oklch(0.19 0.005 70 / 0.86) 0%,
      oklch(0.19 0.005 70 / 0.74) 55%,
      oklch(0.19 0.005 70 / 0.88) 100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
