/* Brightwater Family Medicine — demonstration host for the Maggy embed.
   Self-contained: no external fonts or assets, so the page renders identically
   wherever it is shown and makes no third-party request. */

:root {
  --bg: #fbf8f3;
  --surface: #ffffff;
  --surface-2: #f4efe7;
  --ink: #1d2a2e;
  --muted: #56666b;
  --line: #e7e1d7;
  --brand: #1f6f63;
  --brand-deep: #134a42;
  --brand-soft: #e2f0ec;
  --accent: #b4472f;
  --sun: #e8a33d;
  --focus: #1f6f63;
  --banner-bg: #fff4d6;
  --banner-ink: #5a4410;
  --sky-top: #fbe3bd;
  --sky-bottom: #fbf6ee;
  --hill-far: #a9d1c6;
  --hill-near: #5f9f90;
  /* The "Our care" band carries white text, so it must stay DARK in both modes. */
  --band: #134a42;

  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(29 42 46 / 6%), 0 12px 32px -12px rgb(29 42 46 / 22%);
  --wrap: 1120px;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111a1c;
    --surface: #172225;
    --surface-2: #1c2a2d;
    --ink: #eaf1ef;
    --muted: #a3b5b2;
    --line: #29393c;
    --brand: #4fb3a2;
    --brand-deep: #2d8577;
    --brand-soft: #1e3431;
    --accent: #e0775e;
    --sun: #f0b458;
    --focus: #6fd0bf;
    --banner-bg: #3a2f14;
    --banner-ink: #f6e2ad;
    --sky-top: #2a3f3c;
    --sky-bottom: #172528;
    --hill-far: #2d5a53;
    --hill-near: #3c7a6d;
    --band: #0f302c;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 12px 32px -12px rgb(0 0 0 / 60%);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--serif);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  font-weight: 600;
}
h1 { font-size: clamp(2.1rem, 4.6vw, 3.5rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.35rem); }
h3 { font-size: 1.2rem; }
p  { margin: 0 0 1em; }

a { color: var(--brand); }
a:focus-visible, .btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 8px;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
}
.skip:focus { left: 8px; }

/* ---- the honesty banner: always the first thing anyone reads ---- */
.demo-banner {
  background: var(--banner-bg);
  color: var(--banner-ink);
  font-size: 0.9rem;
  line-height: 1.45;
  padding: 10px var(--gutter);
  text-align: center;
  border-bottom: 1px solid color-mix(in srgb, var(--banner-ink) 18%, transparent);
}

/* ---- header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark { width: 38px; height: 38px; flex: none; }
.brand-mark rect { fill: var(--brand); }
.brand-mark path { fill: var(--bg); }
.brand-name {
  display: flex;
  flex-direction: column;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.05;
}
.brand-sub {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a:not(.btn) {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}
.site-nav a:not(.btn):hover { color: var(--brand); }

/* ---- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-small { padding: 9px 16px; font-size: 0.9rem; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
@media (prefers-reduced-motion: reduce) { .btn, .btn:hover { transition: none; transform: none; } }

.eyebrow {
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.6em;
}
.fine { font-size: 0.85rem; color: var(--muted); }

/* ---- hero ---- */
.hero { padding: clamp(40px, 7vw, 96px) 0 clamp(32px, 5vw, 64px); }
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
}
.lede { font-size: 1.15rem; color: var(--muted); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 22px; }
.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  list-style: none;
  padding: 0;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.hero-points li::before { content: "✓"; color: var(--brand); font-weight: 700; margin-right: 8px; }
.hero-svg { width: 100%; height: auto; display: block; }
.art .sky-a   { stop-color: var(--sky-top); }
.art .sky-b   { stop-color: var(--sky-bottom); }
.art .sun-a   { stop-color: var(--sun); }
.art .sun-b   { stop-color: var(--accent); }
.art .water-a { stop-color: var(--brand); }
.art .water-b { stop-color: var(--brand-deep); }
.art .hill-far  { fill: var(--hill-far); }
.art .hill-near { fill: var(--hill-near); }
.art .ripples { stroke: var(--bg); opacity: .4; }
.art .frame   { stroke: var(--line); }

/* ---- Ask Maggy ---- */
.ask {
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: clamp(48px, 7vw, 96px) 0;
}
.ask-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
}
.checks { list-style: none; padding: 0; margin: 0 0 18px; }
.checks li { padding-left: 30px; position: relative; margin-bottom: 10px; }
.checks li::before {
  content: "";
  position: absolute;
  left: 0; top: 5px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 5px var(--brand);
}

.maggy-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.maggy-card-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.maggy-card-title { margin-left: 8px; font-size: 0.82rem; font-weight: 600; color: var(--muted); }

/* The frame's height is fixed so the page never jumps as Maggy renders; the
   embed is built to scroll inside a constrained frame. */
.maggy-slot { position: relative; height: 640px; }
.maggy-slot iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--surface);
}
/* The placeholder sits ABOVE the frame until Maggy says READY, so a slow or
   refused frame never shows a raw browser error page inside the card. */
.maggy-placeholder {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--surface);
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
}
.maggy-placeholder[hidden] { display: none; }
.ph-icon { width: 56px; height: 56px; margin-bottom: 6px; }
.ph-title { color: var(--ink); font-weight: 600; margin: 0; }
.ph-body { margin: 0; max-width: 28em; font-size: 0.95rem; }

/* ---- services ---- */
.services, .approach, .visit { padding: clamp(48px, 7vw, 96px) 0; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.card p { color: var(--muted); margin: 0; }

/* ---- approach ---- */
/* ⚠️ Was var(--brand-deep), which LIGHTENS in dark mode to #2d8577: white body
   text on it measured ~4.1:1, under the 4.5:1 AA minimum. --band stays dark. */
.approach { background: var(--band); color: #f3f8f6; }
.approach .eyebrow { color: #9fd9cd; }
.approach-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
}
.stats { display: grid; gap: 14px; margin: 0; }
.stats div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: rgb(255 255 255 / 8%);
}
.stats dt { opacity: .8; }
.stats dd { margin: 0; font-weight: 600; }

/* ---- visit ---- */
.visit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 5vw, 64px);
  align-items: start;
}
.phone a { font-size: 1.5rem; font-family: var(--serif); text-decoration: none; }
.hours {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.hours th, .hours td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--line); }
.hours tr:last-child th, .hours tr:last-child td { border-bottom: 0; }
.hours th { font-weight: 500; }
.hours td { color: var(--muted); text-align: right; }

/* ---- footer ---- */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: 0.88rem; color: var(--muted); }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.footer-row p { margin: 0; }
.powered { color: var(--brand); font-weight: 600; }

/* ---- responsive ---- */
@media (max-width: 900px) {
  .hero-grid, .ask-grid, .approach-grid, .visit-grid { grid-template-columns: 1fr; }
  .hero-art { max-width: 420px; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .site-nav a:not(.btn) { display: none; }
  .card-grid { grid-template-columns: 1fr; }
  .maggy-slot { height: 600px; }
  .hero-art { display: none; }
  .hours th, .hours td { padding: 12px 14px; }
  .hours td { white-space: nowrap; }
}
