/* ==========================================================================
   Niagara Dental Specialists — referral network
   Design: digital "referral pad". Spectral (display) + Figtree (body).
   Brand slate blue kept from original identity; clinical teal for actions.
   ========================================================================== */

:root {
  /* Colour */
  --ink:        #22333c;
  --ink-soft:   #4d5f69;
  --brand:      #4e738a;
  --brand-deep: #375567;
  --mist:       #b6c4ce;
  --mist-soft:  #dde5ea;
  --accent:     #12907f;
  --accent-deep:#0c7264;
  --paper:      #f3f6f7;
  --white:      #ffffff;
  --line:       #d9e2e7;
  --shadow:     0 1px 2px rgba(34,51,60,.04), 0 12px 32px -18px rgba(34,51,60,.28);
  --shadow-lg:  0 1px 2px rgba(34,51,60,.05), 0 26px 60px -28px rgba(34,51,60,.36);

  /* Type */
  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --sans:  "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Rhythm */
  --wrap: 1140px;
  --gap: clamp(1.25rem, 4vw, 3rem);
  --radius: 14px;
  --radius-sm: 9px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  font-size: 1.02rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--brand-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--ink);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -.01em;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.2rem, 5.2vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.28rem; }
p { margin: 0 0 1.1rem; }

/* ---- Layout helpers ---- */
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.eyebrow {
  font-family: var(--sans);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 1rem;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: var(--mist);
}
.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 60ch; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--sans); font-weight: 600; font-size: .98rem;
  padding: .82rem 1.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease, color .18s ease;
  line-height: 1;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 22px -12px rgba(18,144,127,.8); }
.btn-primary:hover { background: var(--accent-deep); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--brand-deep); border-color: var(--mist); }
.btn-ghost:hover { background: var(--white); border-color: var(--brand); transform: translateY(-2px); }
.btn-arrow svg { transition: transform .2s ease; }
.btn-arrow:hover svg { transform: translateX(3px); }

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(243,246,247,.85);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .85rem; }
.brand-lockup { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); }
.brand-mark { width: 40px; height: 40px; flex: none; }
.brand-name { font-family: var(--serif); font-size: 1.16rem; font-weight: 600; line-height: 1.05; letter-spacing: -.01em; }
.brand-name span { display: block; font-family: var(--sans); font-size: .66rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--brand); margin-top: 2px; }

.nav { display: flex; align-items: center; gap: .4rem; }
.nav a {
  font-size: .95rem; font-weight: 500; color: var(--ink-soft);
  text-decoration: none; padding: .5rem .8rem; border-radius: 8px;
  transition: color .15s ease, background .15s ease;
}
.nav a:hover { color: var(--brand-deep); background: var(--white); }
.nav a.active { color: var(--brand-deep); }
.nav .tel {
  margin-left: .4rem; color: var(--brand-deep); font-weight: 600;
  border: 1px solid var(--mist); border-radius: 999px; padding: .5rem 1rem;
}
.nav .tel:hover { background: var(--white); border-color: var(--brand); }

.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 9px; padding: .55rem .7rem; cursor: pointer; color: var(--ink); }
.nav-toggle svg { display: block; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: .1rem;
    background: var(--white); border-bottom: 1px solid var(--line);
    padding: .6rem 1.25rem 1rem;
    box-shadow: var(--shadow); display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: .7rem .4rem; border-radius: 8px; }
  .nav .tel { margin: .4rem 0 0; text-align: center; justify-content: center; display: inline-flex; }
}

/* ---- Hero ---- */
.hero { padding-block: clamp(3rem, 7vw, 5.5rem) clamp(3rem, 6vw, 4.5rem); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.hero h1 { margin-bottom: .35em; }
.hero h1 em { font-style: italic; color: var(--brand); }
.hero .lead { margin-bottom: 1.8rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
.hero-figure { position: relative; }
.hero-figure img {
  width: 100%; height: 100%; max-height: 460px; object-fit: cover;
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.hero-figure::after {
  content: ""; position: absolute; inset: 0;
  border-radius: var(--radius); box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
  pointer-events: none;
}
.hero-badge {
  position: absolute; left: -14px; bottom: 24px;
  background: var(--white); border: 1px solid var(--line);
  border-radius: 12px; padding: .85rem 1.1rem; box-shadow: var(--shadow);
  max-width: 250px; font-size: .86rem; color: var(--ink-soft); line-height: 1.4;
}
.hero-badge strong { display: block; font-family: var(--serif); color: var(--ink); font-size: 1rem; margin-bottom: 2px; }
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-figure { order: -1; }
  .hero-badge { left: 12px; }
}

/* ---- Referral-pad card motif (signature) ---- */
.pad {
  position: relative; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem 1.6rem 1.7rem;
}
/* perforated top edge = the "tear-off referral pad" signature */
.pad::before {
  content: ""; position: absolute; left: 16px; right: 16px; top: 9px; height: 4px;
  background-image: radial-gradient(circle, var(--mist) 1.5px, transparent 1.6px);
  background-size: 11px 4px; background-repeat: repeat-x; opacity: .8;
}
.pad-index {
  font-family: var(--sans); font-size: .72rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--brand);
  display: block; margin-bottom: .7rem;
}

/* ---- Specialty grid ---- */
.specialties { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; }
@media (max-width: 900px) { .specialties { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .specialties { grid-template-columns: 1fr; } }
.spec-card {
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.spec-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--mist); }
.spec-card h3 { margin-bottom: .35rem; color: var(--ink); }
.spec-card p { font-size: .92rem; color: var(--ink-soft); margin-bottom: 1.1rem; }
.spec-card .go {
  margin-top: auto; font-family: var(--sans); font-weight: 600; font-size: .9rem;
  color: var(--accent-deep); display: inline-flex; align-items: center; gap: .4rem;
}
.spec-card:hover .go svg { transform: translateX(3px); }
.spec-card .go svg { transition: transform .2s ease; }
.spec-icon { width: 34px; height: 34px; color: var(--brand); margin-bottom: 1rem; }

/* ---- Steps (real sequence → numbered) ---- */
.steps-band { background: var(--brand-deep); color: #eaf0f3; }
.steps-band .eyebrow { color: var(--mist); }
.steps-band .eyebrow::before { background: rgba(255,255,255,.35); }
.steps-band h2 { color: #fff; }
.steps-band .lead { color: #cddae1; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; margin-top: 2.2rem; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.step { border-top: 1px solid rgba(255,255,255,.22); padding-top: 1.1rem; }
.step .num { font-family: var(--serif); font-size: 2.2rem; color: var(--mist); line-height: 1; display: block; margin-bottom: .5rem; }
.step h3 { color: #fff; font-size: 1.15rem; margin-bottom: .3rem; }
.step p { color: #c7d5dc; font-size: .95rem; margin: 0; }

/* ---- Section heading block ---- */
.sec-head { max-width: 62ch; margin-bottom: 2.4rem; }

/* ---- Doctor / service page ---- */
.doc-hero { display: grid; grid-template-columns: 320px 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
@media (max-width: 780px) { .doc-hero { grid-template-columns: 1fr; } }
.doc-photo { position: relative; }
.doc-photo img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; aspect-ratio: 3/4; object-fit: cover; background: var(--mist-soft); }
.doc-name { margin-bottom: .1rem; }
.doc-role { font-family: var(--sans); font-weight: 700; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-deep); margin: 0 0 1.3rem; }
.doc-bio p { color: var(--ink-soft); max-width: 65ch; }
.doc-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }
.credentials { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.4rem; padding: 0; list-style: none; }
.credentials li { font-size: .82rem; font-weight: 600; color: var(--brand-deep); background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: .35rem .85rem; }

.page-hero { padding-block: clamp(2.5rem, 6vw, 4rem) clamp(1.5rem,4vw,2.5rem); }
.crumb { font-size: .85rem; color: var(--ink-soft); margin-bottom: 1.4rem; }
.crumb a { color: var(--brand-deep); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }

/* ---- Forms ---- */
.form-wrap { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.5rem, 4vw, 2.6rem); position: relative; box-shadow: var(--shadow); }
.form-wrap::before {
  content: ""; position: absolute; left: 20px; right: 20px; top: 10px; height: 4px;
  background-image: radial-gradient(circle, var(--mist) 1.5px, transparent 1.6px);
  background-size: 11px 4px; background-repeat: repeat-x; opacity: .7;
}
.form-note { font-size: .92rem; color: var(--ink-soft); margin: -.4rem 0 1.8rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem 1.3rem; }
.field { display: flex; flex-direction: column; gap: .4rem; }
.field.full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } .field.full { grid-column: auto; } }
label { font-size: .82rem; font-weight: 600; color: var(--ink); letter-spacing: .01em; }
label .req { color: var(--accent-deep); }
input[type=text], input[type=email], input[type=tel], input[type=date], select, textarea {
  font-family: var(--sans); font-size: .98rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: .7rem .85rem; width: 100%; transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
textarea { resize: vertical; min-height: 92px; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); background: #fff;
  box-shadow: 0 0 0 3px rgba(18,144,127,.14);
}
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234e738a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .8rem center; padding-right: 2.3rem; }

fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1.1rem 1.2rem 1.3rem; margin: 0; grid-column: 1 / -1; background: var(--paper); }
legend { font-family: var(--sans); font-size: .82rem; font-weight: 700; letter-spacing: .04em; color: var(--brand-deep); padding: 0 .5rem; }
.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem .9rem; margin-top: .3rem; }
@media (max-width: 500px){ .choice-grid { grid-template-columns: 1fr; } }
.choice { display: flex; align-items: flex-start; gap: .55rem; font-size: .93rem; font-weight: 500; color: var(--ink-soft); cursor: pointer; }
.choice input { width: auto; margin-top: .2rem; accent-color: var(--accent); }
.form-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .6rem; }
.form-actions .small { font-size: .84rem; color: var(--ink-soft); }

.form-alert { grid-column: 1/-1; border-radius: var(--radius-sm); padding: .9rem 1.1rem; font-size: .95rem; margin-bottom: .4rem; }
.form-alert.ok { background: #e5f4f1; border: 1px solid #bfe3db; color: #0c5a4f; }
.form-alert.err { background: #fbecec; border: 1px solid #f2cccc; color: #99312b; }

/* ---- Callout / promise ---- */
.promise {
  background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 1.6rem 1.8rem; box-shadow: var(--shadow);
}
.promise p { font-family: var(--serif); font-size: 1.22rem; font-style: italic; color: var(--ink); margin: 0; }

/* ---- Info strip ---- */
.info-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
@media (max-width: 720px) { .info-strip { grid-template-columns: 1fr; } }
.info-item .eyebrow { margin-bottom: .5rem; }
.info-item a { color: var(--ink); text-decoration: none; font-size: 1.08rem; font-weight: 600; }
.info-item a:hover { color: var(--brand-deep); }

/* ---- Footer ---- */
.site-footer { background: var(--ink); color: #c3d0d7; padding-block: 3.2rem 2rem; margin-top: 1rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; gap: 1.6rem; } }
.site-footer h4 { color: #fff; font-family: var(--sans); font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 1rem; }
.site-footer a { color: #c3d0d7; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-brand .brand-name { color: #fff; }
.footer-brand .brand-name span { color: var(--mist); }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; font-size: .95rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 2.4rem; padding-top: 1.4rem; font-size: .84rem; color: #8ca0a9; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .6rem; }

/* ---- Reveal on scroll ---- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---- Focus visibility ---- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.skip-link { position: absolute; left: -999px; top: 0; background: #fff; color: var(--brand-deep); padding: .6rem 1rem; z-index: 100; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }
