:root {
  --color-bg: #FAF8F5;
  --color-surface: #FFFFFF;
  --color-text: #2B2B2B;
  --color-muted: #5E6470;
  --color-accent: #2F5D62;
  --color-accent-hover: #244A4E;
  --color-callout-bg: #EEF4F4;
  --radius: 12px;
  --max-width: 1100px;
  /* Height of the sticky header; refined by script once the page loads */
  --header-h: 77px;
}

@media (min-width: 1024px) {
  :root {
    --header-h: 85px;
  }
}

html {
  scroll-padding-top: var(--header-h);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2 {
  font-family: "Lora", Georgia, serif;
  color: var(--color-text);
  line-height: 1.2;
}

h1 {
  font-size: 2rem;
  margin: 0 0 16px;
}

h2 {
  font-size: 1.35rem;
  margin: 0 0 24px;
}

@media (min-width: 640px) {
  h2 {
    font-size: 1.6rem;
  }
}

p {
  margin: 0 0 16px;
}

a {
  color: var(--color-accent);
  text-decoration: underline;
  transition: color 150ms ease;
}

a:hover {
  color: var(--color-accent-hover);
}

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

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

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

@media (min-width: 1024px) {
  .container {
    padding: 0 24px;
  }
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
  cursor: pointer;
}

.button-primary {
  background: var(--color-accent);
  color: #FFFFFF;
  border-color: var(--color-accent);
}

.button-primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  color: #FFFFFF;
}

.button-secondary {
  background: transparent;
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.button-secondary:hover {
  background: var(--color-callout-bg);
  color: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}

#contact .button-primary {
  display: flex;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.contact-note {
  color: var(--color-muted);
  font-size: 0.95rem;
  margin-top: 12px;
  margin-bottom: 0;
}

/* Header */

header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-callout-bg);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
  position: relative;
}

.site-name {
  font-family: "Lora", Georgia, serif;
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0;
  padding-right: 16px;
  flex: 1 1 0;
  min-width: 0;
}

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  flex-shrink: 0;
  background: transparent;
  border: 2px solid var(--color-accent);
  border-radius: var(--radius);
  cursor: pointer;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-accent);
  position: relative;
}

.nav-toggle-bars::before {
  content: "";
  position: absolute;
  top: -6px;
}

.nav-toggle-bars::after {
  content: "";
  position: absolute;
  top: 6px;
}

.primary-nav {
  display: none;
  width: 100%;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.primary-nav.is-open {
  display: flex;
}

.primary-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.primary-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 600;
}

.primary-nav a:hover {
  color: var(--color-accent);
}

.primary-nav .button-primary,
.primary-nav .button-primary:hover {
  color: #FFFFFF;
}

@media (min-width: 1024px) {
  .site-name {
    font-size: 1.2rem;
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .nav-toggle {
    display: none;
  }

  .primary-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: auto;
    margin-top: 0;
    gap: 24px;
  }

  .primary-nav ul {
    flex-direction: row;
    gap: 24px;
  }
}

/* Hero */

.hero {
  padding: 64px 0;
}

.hero-inner {
  display: flex;
  flex-direction: column-reverse;
  gap: 32px;
  align-items: center;
}

.hero-text {
  text-align: center;
}

.subhead {
  color: var(--color-muted);
  font-size: 1.1rem;
}

.hero-phone {
  font-weight: 600;
  margin: 24px 0 0;
}

.phone-number {
  color: var(--color-accent);
  white-space: nowrap;
}

.hero-image {
  display: flex;
  justify-content: center;
}

.img-placeholder {
  background-color: var(--color-callout-bg);
  border-radius: var(--radius);
  display: block;
  object-fit: cover;
  color: transparent;
  font-size: 0;
  text-indent: -9999px;
  overflow: hidden;
}

.headshot {
  width: 240px;
  height: 240px;
  border-radius: 50%;
}

.speaking-gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 24px;
  max-width: 480px;
}

.speaking-image {
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 5;
  margin: 0;
}

@media (min-width: 640px) {
  .speaking-gallery {
    grid-template-columns: repeat(2, 1fr);
    max-width: none;
  }
}

@media (min-width: 1024px) {
  .hero-inner {
    flex-direction: row;
    text-align: left;
    justify-content: space-between;
  }

  .hero-text {
    text-align: left;
  }

  .button-group {
    justify-content: flex-start;
  }

  #contact .button-primary {
    display: inline-flex;
    margin-left: 0;
    margin-right: 0;
  }

  .headshot {
    width: 320px;
    height: 320px;
  }
}

/* Sections */

main section {
  padding: 64px 0;
}

main section:nth-child(even) {
  background: var(--color-surface);
}

/* Section titles stay pinned below the header while their section is on screen.
   The border-image outset paints the title's background edge to edge. */
main section h2 {
  --band-bg: var(--color-bg);
  --band-line: var(--band-bg);
  position: sticky;
  top: var(--header-h);
  z-index: 10;
  padding: 12px 0;
  margin-bottom: 12px;
  border-image: linear-gradient(to top, var(--band-line) 1px, var(--band-bg) 1px) fill 0 / 0 / 0 100vmax;
}

main section:nth-child(even) h2 {
  --band-bg: var(--color-surface);
}

main section h2.is-stuck {
  --band-line: var(--color-callout-bg);
}

/* Large screens show most sections whole, so titles scroll normally there */
@media (min-width: 1024px) {
  main section h2 {
    position: static;
    border-image: none;
  }
}

@media (min-width: 1024px) {
  main section {
    padding: 96px 0;
  }
}

/* Services card grid */

.services-layout {
  display: grid;
  gap: 32px;
}

.services-figure {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.services-image {
  width: 100%;
  height: auto;
  border: 1px solid var(--color-callout-bg);
  box-shadow: 0 8px 24px rgba(43, 43, 43, 0.12);
}

.services-figure figcaption {
  margin-top: 16px;
}

.figure-caption {
  display: block;
  font-family: "Lora", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.figure-credit {
  display: block;
  color: var(--color-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* Flex rather than grid so an incomplete last row stays centered */
.card-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.card {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  background: var(--color-bg);
  border: 1px solid var(--color-callout-bg);
  border-radius: var(--radius);
  padding: 24px;
  font-weight: 600;
}

@media (min-width: 640px) {
  .card {
    flex: 0 0 calc((100% - 16px) / 2);
  }
}

@media (min-width: 1024px) {
  .services-layout {
    grid-template-columns: 5fr 7fr;
    align-items: center;
    gap: 48px;
  }

  .services-figure {
    max-width: none;
  }
}

/* Clinical */

.clinical-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.clinical-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-callout-bg);
  border-radius: var(--radius);
  padding: 24px;
}

.clinical-item h3 {
  font-size: 1.05rem;
  line-height: 1.4;
  margin: 10px 0 4px;
}

.clinical-item p {
  color: var(--color-muted);
  font-size: 0.95rem;
  margin: 0;
}

.clinical-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-callout-bg);
  color: var(--color-accent);
}

.clinical-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (min-width: 640px) {
  .clinical-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.callout {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--color-callout-bg);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 24px;
}

.callout .clinical-icon {
  background: var(--color-surface);
}

.callout p {
  margin: 0;
  color: var(--color-text);
}

/* Contact */

#contact .contact-note {
  margin-bottom: 24px;
}

.contact-details {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 24px;
}

/* Footer */

footer {
  background: var(--color-surface);
  color: var(--color-text);
  border-top: 1px solid var(--color-callout-bg);
  padding: 32px 0;
}

footer p {
  margin: 0 0 8px;
}

footer .disclaimer {
  color: var(--color-muted);
  font-size: 0.9rem;
  margin-bottom: 0;
}
