/* =====================================================================
   Dental Authority Sites — Demo Library
   base.css · shared layer for all eight systems ("one codebase, eight skins")
   Pair with exactly ONE file from ./tokens/ — never two, never zero.
   Consumes the token API defined in design-systems/00-foundations.md.
   Structural/component markup ships with the Porcelain reference build;
   this file styles the shared inventory strictly through variables.
   ===================================================================== */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-body, 1.0625rem);
  line-height: var(--lh-body, 1.65);
  color: var(--text-body, var(--ink));
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, picture, video, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

/* ---------- Foundations defaults ---------- */
:root {
  --radius-pill: 999px;
  --space-section: clamp(4rem, 8vw, 6.5rem);
  --container: 1200px;
  --gutter: 24px;
  --speed: 180ms;           /* systems may slow (Marble/Gilt) or tighten (Quartz) */
  --ease: ease-out;
}
/* Breakpoints (reference — media queries can't read vars): 640 / 768 / 1024 / 1280 */

/* ---------- Layout ---------- */
.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--space-section); }
.section-alt { background: var(--bg-alt); }
.grid-12 { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gutter); }
.split { display: grid; gap: calc(var(--gutter) * 2); align-items: center; }
@media (min-width: 768px) { .split { grid-template-columns: 1fr 1fr; } }
.prose { max-width: 70ch; }
.prose > * + * { margin-top: 1em; }

/* ---------- Typography structure (each system refines in its token file) ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: var(--display-weight, 600);
  line-height: 1.15;
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1, clamp(2.5rem, 5vw, 3.5rem)); }
h2 { font-size: var(--fs-h2, clamp(1.875rem, 3.5vw, 2.375rem)); }
h3 { font-size: var(--fs-h3, 1.25rem); }
.eyebrow {
  display: block;
  font-family: var(--font-utility, var(--font-body));
  font-size: var(--fs-eyebrow, 0.8125rem);
  font-weight: var(--eyebrow-weight, 600);
  letter-spacing: var(--eyebrow-tracking, 0.08em);
  text-transform: uppercase;
  color: var(--eyebrow-color, var(--accent));
  margin-bottom: 0.875rem;
}
.lede { font-size: 1.125rem; color: var(--muted); }
.muted { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  font-family: var(--btn-font, var(--font-body));
  font-weight: var(--btn-weight, 600);
  font-size: var(--btn-size, 0.9375rem);
  text-transform: var(--btn-case, none);
  letter-spacing: var(--btn-tracking, 0);
  padding: var(--btn-pad, 0.875rem 1.75rem);
  border: 1px solid transparent;
  border-radius: var(--radius-btn, var(--radius-sm));
  transition: background var(--speed) var(--ease), color var(--speed) var(--ease),
              border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.btn-primary { background: var(--accent); color: var(--btn-primary-ink, var(--ink-inverse)); }
.btn-primary:hover { background: var(--accent-hover); color: var(--btn-primary-ink, var(--ink-inverse)); }
.btn-secondary {
  background: transparent;
  color: var(--btn-secondary-ink, var(--ink));
  border-color: var(--btn-secondary-border, var(--line));
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: none; border: none; padding: 0; color: var(--accent); border-radius: 0; }
.btn-ghost::after { content: "\2192"; transition: transform var(--speed) var(--ease); }
.btn-ghost:hover::after { transform: translateX(4px); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow, none);
  padding: var(--card-pad, 1.75rem);
  transition: box-shadow var(--speed) var(--ease), border-color var(--speed) var(--ease),
              transform var(--speed) var(--ease);
}

/* ---------- Forms ---------- */
.field { display: grid; gap: 0.5rem; }
.field label {
  font-family: var(--font-utility, var(--font-body));
  font-size: 0.875rem;
  font-weight: var(--label-weight, 500);
  color: var(--ink);
}
.input, .field input, .field textarea, .field select {
  width: 100%;
  background: var(--input-bg, var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.8125rem 1rem;
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.field :is(input, textarea, select):focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.field .hint { font-size: 0.8125rem; color: var(--muted); }
.field .error { font-size: 0.8125rem; color: #B4231F; }

/* ---------- Shared units ---------- */
.rule { height: 1px; background: var(--line); border: 0; }
.band { background: var(--bg-dark); color: var(--ink-inverse); }
.band h1, .band h2, .band h3 { color: var(--ink-inverse); }
.hours-table { width: 100%; border-collapse: collapse; }
.hours-table td { padding: 0.625rem 0; border-bottom: 1px solid var(--line); }
.hours-table tr.today { background: var(--accent-tint); }
.logo-strip { display: flex; flex-wrap: wrap; gap: 2rem; align-items: center; opacity: 0.75; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary { padding: 1.125rem 0; font-weight: 600; color: var(--ink); cursor: pointer; list-style: none; }
.faq-item[open] summary { color: var(--accent); }
.faq-item p { padding-bottom: 1.125rem; }
.testimonial .stars { color: var(--accent); letter-spacing: 0.1em; }
.testimonial cite { font-style: normal; color: var(--muted); font-size: 0.875rem; }

/* ---------- Header & mobile conversion bar ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--line); }
.mobile-cta-bar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 60;
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem;
  padding: 0.625rem calc(var(--gutter) * 0.75);
  padding-bottom: calc(0.625rem + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line);
}
@media (min-width: 768px) { .mobile-cta-bar { display: none; } }

/* ---------- Accessibility floor ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--ink-inverse); padding: 0.75rem 1.25rem;
}
.skip-link:focus { left: 0; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
