/* ============================================================
   Northgate Dental — calm blue & white
   Light + dark via custom properties. Section bg hard-swap.
   ============================================================ */

:root {
  color-scheme: light;

  /* light palette */
  --bg:      #f7fafc;
  --bg-2:    #eaf2f8;
  --bg-3:    #ffffff;
  --bg-4:    #e6eff6;
  --bg-5:    #ffffff;
  --bg-6:    #dce9f3;

  --ink:     #12283a;
  --ink-soft:#3d5a70;
  --muted:   #5c7387;
  --accent:  #1d5f8a;
  --accent-2:#0f4a6e;
  --line:    #cbdbe7;
  --card:    #ffffff;
  --on-accent:#ffffff;

  --shadow: 0 1px 2px rgba(18,40,58,.06), 0 8px 24px rgba(18,40,58,.06);

  --step--1: clamp(.78rem, .74rem + .2vw, .86rem);
  --step-0:  clamp(.95rem, .9rem + .25vw, 1.02rem);
  --step-1:  clamp(1.1rem, 1rem + .5vw, 1.3rem);
  --step-2:  clamp(1.4rem, 1.2rem + 1vw, 1.9rem);
  --step-3:  clamp(2rem, 1.5rem + 3vw, 3.4rem);
  --step-4:  clamp(2.6rem, 1.6rem + 5.5vw, 5.2rem);

  --pad: clamp(1.25rem, 4vw, 3rem);
  --radius: 10px;
}

html[data-theme="dark"] {
  color-scheme: dark;

  --bg:      #0c1a24;
  --bg-2:    #10222f;
  --bg-3:    #0f1f2b;
  --bg-4:    #12283a;
  --bg-5:    #0f1f2b;
  --bg-6:    #16303f;

  --ink:     #e8f1f7;
  --ink-soft:#c2d6e4;
  --muted:   #9db6c8;
  --accent:  #7cc0e8;
  --accent-2:#a5d6f2;
  --line:    #24404f;
  --card:    #12283a;
  --on-accent:#08202e;

  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--step-0);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color .45s ease;
}

h1, h2, h3 {
  font-family: "Fraunces", "Playfair Display", Georgia, serif;
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -.015em;
  margin: 0 0 .5em;
  text-wrap: balance;
}

h1 { font-size: var(--step-4); font-weight: 700; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); line-height: 1.25; }

p { margin: 0 0 1.1em; text-wrap: pretty; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-2); }

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

/* ---------- header ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: .7rem var(--pad);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -.01em;
  min-height: 44px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-family: "Fraunces", serif;
  font-size: 1rem;
  line-height: 1;
}

.brand-name { font-size: var(--step-0); }

.site-nav {
  display: flex;
  gap: .25rem;
  margin-left: auto;
  flex-wrap: wrap;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 .7rem;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: var(--step--1);
  letter-spacing: .02em;
  border-radius: 6px;
}
.site-nav a:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 44px;
  padding: 0 .8rem;
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  font-size: var(--step--1);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

.theme-toggle-icon {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: inset -3px -3px 0 0 var(--bg);
}

/* ---------- layout ---------- */

main { display: block; }

section {
  padding: clamp(3.5rem, 9vw, 7rem) var(--pad);
  transition: background-color .45s ease;
  scroll-margin-top: 70px;
}

.col, .hero-inner {
  max-width: 62ch;
  margin-inline: auto;
}

/* the pull-out aside sits in the right margin without overlapping the column */
.col { position: relative; }

.eyebrow {
  font-size: var(--step--1);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}

.section-intro {
  color: var(--ink-soft);
  font-size: var(--step-1);
  line-height: 1.6;
  margin-bottom: 2.5rem;
}

/* ---------- hero ---------- */

.hero { padding-top: clamp(3rem, 8vw, 6rem); }

.hero h1 { margin-bottom: .6em; }

.lede {
  font-size: var(--step-1);
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 46ch;
}

/* dictated quote — signature */
.dictated {
  font-family: "Fraunces", serif;
  font-size: var(--step-2);
  line-height: 1.35;
  color: var(--ink);
  margin: 2.5rem 0 2rem;
  max-width: 30ch;
}

.dictated .w {
  display: inline-block;
  opacity: 0;
  transform: translateY(.35em);
  animation: dictate .5s cubic-bezier(.2,.7,.3,1) forwards;
  animation-delay: var(--d, 0s);
}

.dictated::after {
  content: "";
  display: inline-block;
  width: .55ch;
  height: 1em;
  margin-left: .15ch;
  background: var(--accent);
  vertical-align: -.12em;
  animation: caret 1s steps(1, end) infinite;
}

@keyframes dictate {
  to { opacity: 1; transform: none; }
}
@keyframes caret {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 3rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 1.4rem;
  border-radius: 999px;
  font: inherit;
  font-size: var(--step-0);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background-color .2s ease, color .2s ease;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-2); color: var(--on-accent); border-color: var(--accent-2); }

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-2); }

.hero-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem 2rem;
  margin: 0;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}

.hero-facts dt {
  font-size: var(--step--1);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .3rem;
}
.hero-facts dd { margin: 0; color: var(--ink); }

/* ---------- services ---------- */

.service-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.service {
  padding: 1.6rem 0;
  border-top: 1px solid var(--line);
}
.service:last-child { border-bottom: 1px solid var(--line); }

.service h3 { margin-bottom: .45em; color: var(--ink); }
.service p { margin: 0; color: var(--ink-soft); max-width: 58ch; }

/* ---------- about ---------- */

.sub { margin-top: 2.5rem; }

.team {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.team li {
  padding: 1rem 1.1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.team-role {
  display: block;
  font-size: var(--step--1);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .3rem;
}
.team-name { display: block; color: var(--ink); }

/* ---------- asides (wide pull-outs) ---------- */

.aside {
  margin: 2.5rem 0 0;
  padding: 1.25rem 1.4rem;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.aside-label {
  font-size: var(--step--1);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .5rem;
}
.aside p:last-child { margin-bottom: 0; color: var(--ink-soft); }

@media (min-width: 1100px) {
  .col {
    max-width: 62ch;
    margin-inline: auto;
  }
  .col .aside {
    width: 20vw;
    max-width: 260px;
    margin: 2.5rem 0 0 calc(100% + 2.5rem);
  }
}

/* ---------- form ---------- */

.form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem 1.5rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.field { display: flex; flex-direction: column; gap: .4rem; }
.field-wide { grid-column: 1 / -1; }

.field label {
  font-size: var(--step--1);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.optional { text-transform: none; letter-spacing: 0; color: var(--muted); }

.field input,
.field select,
.field textarea {
  font: inherit;
  font-size: var(--step-0);
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .7rem .8rem;
  min-height: 48px;
  width: 100%;
}

.field textarea { min-height: 130px; resize: vertical; }

.field input::placeholder,
.field textarea::placeholder { color: var(--muted); opacity: 1; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  outline: 3px solid color-mix(in srgb, var(--accent) 30%, transparent);
  outline-offset: 1px;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: .25rem;
}

.form-status {
  margin: 0;
  font-size: var(--step--1);
  color: var(--ink-soft);
}
.form-status[data-state="ok"] { color: var(--accent); }
.form-status[data-state="err"] { color: #a3341f; }
html[data-theme="dark"] .form-status[data-state="err"] { color: #ff9d84; }

/* ---------- contact ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem 2.5rem;
}

.contact-block h3 {
  font-size: var(--step-0);
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .6rem;
}

.contact-block .big {
  font-family: "Fraunces", serif;
  font-size: var(--step-1);
  line-height: 1.4;
  color: var(--ink);
  margin-bottom: .4rem;
}

.muted { color: var(--muted); font-size: var(--step--1); line-height: 1.6; }

.hours { margin: 0; display: grid; gap: .35rem; }
.hours div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px dotted var(--line); padding-bottom: .3rem; }
.hours dt { color: var(--ink-soft); }
.hours dd { margin: 0; color: var(--ink); }

/* ---------- footer ---------- */

.site-foot {
  padding: 2.5rem var(--pad) 3rem;
  border-top: 1px solid var(--line);
  background: var(--bg);
  display: grid;
  gap: .35rem;
  justify-items: center;
  text-align: center;
}

.foot-brand { margin: 0; font-weight: 700; color: var(--ink); }
.site-foot .muted { margin: 0; }
.site-foot .attribution a { color: var(--muted); }
.site-foot .attribution a:hover { color: var(--accent); }

/* ---------- placeholders ---------- */

/* bracketed fill-ins the owner must replace, e.g. [Phone number] */
.ph {
  color: var(--muted);
  border-bottom: 1px dashed color-mix(in srgb, var(--accent) 55%, transparent);
  padding-bottom: 1px;
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .dictated .w { opacity: 1; transform: none; }
  .dictated::after { display: none; }
  .btn:hover { transform: none; }
}

/* ---------- small screens ---------- */

@media (max-width: 640px) {
  .site-nav { order: 3; width: 100%; margin-left: 0; }
  .theme-toggle { margin-left: auto; }
  .hero-facts { grid-template-columns: 1fr; }
}
