/* ========== South Main Dental — Design tokens ========== */
:root {
  --cream: #f4ede0;
  --cream-2: #ebe1d0;
  --paper: #faf6ee;
  --forest: #2d4a3e;
  --forest-deep: #1f3329;
  --moss: #4a6b5c;
  --terracotta: #c97b5a;
  --terracotta-deep: #a85f42;
  --ink: #1a1a1a;
  --ink-soft: #3a3a3a;
  --ink-mute: #6b6b6b;
  --line: #d8cfbc;
  --line-soft: #e6dcc7;

  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Inter Tight', 'Helvetica Neue', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;

  --r-sm: 4px;
  --r-md: 10px;
  --r-lg: 18px;
  --r-xl: 28px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ========== Type scale ========== */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
}
.eyebrow-dot::before {
  content: "● ";
  color: var(--terracotta);
  margin-right: 4px;
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
  font-variation-settings: "opsz" 144, "SOFT" 30;
}
.display {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(48px, 7vw, 104px);
  line-height: 0.96;
  letter-spacing: -0.035em;
}
.display em {
  font-style: italic;
  font-weight: 300;
  color: var(--forest);
}
.h2 {
  font-family: var(--font-display);
  font-weight: 350;
  font-size: clamp(36px, 4.4vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.025em;
}
.h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.015em;
}
.lede {
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 60ch;
}
.body {
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-soft);
}
.muted { color: var(--ink-mute); }

/* ========== Layout helpers ========== */
.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px;
}
.container-wide {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 32px;
}
.section { padding: 96px 0; }
.section-sm { padding: 56px 0; }
.divider {
  height: 1px;
  background: var(--line);
  width: 100%;
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: transform .15s ease, background .2s ease, color .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--forest);
  color: var(--paper);
}
.btn-primary:hover { background: var(--forest-deep); }
.btn-accent {
  background: var(--terracotta);
  color: var(--paper);
}
.btn-accent:hover { background: var(--terracotta-deep); }
.btn-ghost {
  border: 1px solid var(--ink);
  color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-link {
  padding: 0;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  padding-bottom: 2px;
}
.btn .arrow {
  display: inline-block;
  transition: transform .2s ease;
}
.btn:hover .arrow { transform: translateX(3px); }

/* ========== Nav ========== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--cream) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 40px;
  padding: 18px 32px;
  max-width: 1480px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--forest);
  color: var(--paper);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 18px;
}
.brand-text { line-height: 1; }
.brand-text small {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  margin-top: 4px;
  text-transform: uppercase;
}
.nav-links {
  display: flex;
  gap: 4px;
  justify-content: center;
  align-items: center;
}
.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1;
  color: var(--ink-soft);
  border-radius: 999px;
  transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--ink); background: var(--cream-2); }
.nav-link.active { color: var(--ink); }
.nav-link.has-menu::after {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-left: 6px;
  margin-bottom: 2px;
  opacity: .55;
}
.nav-cta { display: flex; gap: 10px; align-items: center; }
.nav-phone {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
  padding: 8px 0;
}

/* Dropdown */
.nav-item { position: relative; }
.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 8px;
  min-width: 260px;
  box-shadow: 0 20px 40px -20px rgba(31,51,41,.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .15s, transform .15s, visibility .15s;
}
.nav-item:hover .nav-dropdown,
.nav-item:focus-within .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-dropdown a {
  display: block;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--ink-soft);
  border-radius: 6px;
}
.nav-dropdown a:hover { background: var(--cream); color: var(--ink); }

/* ========== Placeholder imagery ========== */
.ph {
  position: relative;
  background:
    repeating-linear-gradient(
      135deg,
      var(--cream-2) 0,
      var(--cream-2) 14px,
      var(--cream) 14px,
      var(--cream) 28px
    );
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  padding: 16px;
}
.ph.dark {
  background:
    repeating-linear-gradient(
      135deg,
      var(--forest-deep) 0,
      var(--forest-deep) 14px,
      var(--forest) 14px,
      var(--forest) 28px
    );
  color: rgba(255,255,255,.7);
  border-color: rgba(255,255,255,.1);
}
.ph.terra {
  background:
    repeating-linear-gradient(
      135deg,
      #b56a4d 0,
      #b56a4d 14px,
      var(--terracotta) 14px,
      var(--terracotta) 28px
    );
  color: rgba(255,255,255,.85);
  border-color: rgba(0,0,0,.05);
}
.ph small {
  display: block;
  font-size: 9px;
  margin-top: 4px;
  opacity: .65;
  font-weight: 400;
}

/* ========== Footer ========== */
.footer {
  background: var(--forest);
  color: var(--paper);
  padding: 80px 0 32px;
  margin-top: 80px;
}
.footer h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(244,237,224,.55);
  margin-bottom: 20px;
  font-weight: 500;
}
.footer a { color: rgba(244,237,224,.8); }
.footer a:hover { color: var(--paper); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 56px;
  padding-bottom: 56px;
  border-bottom: 1px solid rgba(244,237,224,.12);
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 32px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(244,237,224,.4);
}

/* ========== Hover lift ========== */
.lift { transition: transform .25s ease, box-shadow .25s ease; }
.lift:hover { transform: translateY(-3px); }

/* ========== Page enter animation ========== */
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.page-fade { animation: pageIn .35s ease both; }

/* ========== Tweaks panel ========== */
.tweaks {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 100;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  width: 260px;
  box-shadow: 0 20px 60px -20px rgba(31,51,41,.3);
  font-size: 13px;
  display: none;
}
.tweaks.show { display: block; }
.tweaks h5 {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 10px;
  font-weight: 500;
}
.tweaks-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 0;
  gap: 10px;
}
.tweaks-row label { color: var(--ink-soft); font-size: 12px; }
.swatch-row { display: flex; gap: 6px; }
.swatch {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--line);
  cursor: pointer;
}
.swatch.active { box-shadow: 0 0 0 2px var(--ink); }
.tweak-seg {
  display: inline-flex;
  background: var(--cream);
  border-radius: 999px;
  padding: 2px;
}
.tweak-seg button {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--ink-mute);
}
.tweak-seg button.active {
  background: var(--ink);
  color: var(--paper);
}

/* ========== Mobile nav (hamburger + drawer) ========== */
.nav-hamburger {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: transparent;
  border: 1px solid var(--line);
  padding: 0;
  margin-left: auto;
}
.hamburger-icon {
  width: 22px;
  height: 16px;
  position: relative;
  display: inline-block;
}
.hamburger-icon span {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease, top .25s ease;
}
.hamburger-icon span:nth-child(1) { top: 0; }
.hamburger-icon span:nth-child(2) { top: 7px; }
.hamburger-icon span:nth-child(3) { top: 14px; }
.hamburger-icon.open span:nth-child(1) { top: 7px; transform: rotate(45deg); }
.hamburger-icon.open span:nth-child(2) { opacity: 0; }
.hamburger-icon.open span:nth-child(3) { top: 7px; transform: rotate(-45deg); }

.mobile-drawer {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  z-index: 60;
  background: var(--cream);
  padding-top: 88px;
  overflow-y: auto;
}
.mobile-drawer.mobile-drawer.open {
  pointer-events: auto;
}
.mobile-drawer-inner {
  display: flex;
  flex-direction: column;
  padding: 8px 24px 48px;
  max-width: 560px;
  margin: 0 auto;
}
.mobile-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 20px 4px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ink);
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  text-decoration: none;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  cursor: pointer;
}
.mobile-section-toggle { font-family: var(--font-display); }
.mobile-chev {
  font-family: var(--font-mono);
  font-size: 24px;
  color: var(--terracotta);
  font-weight: 300;
}
.mobile-section.open .mobile-link { border-bottom-color: transparent; }
.mobile-section-body {
  display: flex;
  flex-direction: column;
  padding: 4px 0 16px 16px;
  border-bottom: 1px solid var(--line-soft);
  border-left: 2px solid var(--terracotta);
  margin-left: 4px;
}
.mobile-sublink {
  padding: 12px 8px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink-soft);
  text-decoration: none;
}
.mobile-sublink:hover { color: var(--ink); }
.mobile-cta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 32px;
}

/* ========== Responsive ========== */
@media (max-width: 1100px) {
  .nav-inner { gap: 20px; padding: 16px 24px; }
  .nav-link { padding: 10px 10px; font-size: 13px; }
  .nav-phone { display: none; }
}

@media (max-width: 1024px) {
  .nav-links { display: none !important; }
  .nav-book-btn { display: none !important; }
  .nav-cta { display: none !important; }
  .nav-hamburger { display: inline-flex; }
  .mobile-drawer { display: block; }
  .nav-inner { grid-template-columns: auto auto; padding: 14px 20px; gap: 12px; }
}

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 40px !important; }
  .footer-bottom { flex-direction: column; gap: 12px; align-items: flex-start !important; }

  .section { padding: 56px 0 !important; }
  .section-sm { padding: 40px 0 !important; }
  .container, .container-wide { padding: 0 20px !important; }
}

/* ========== Mobile: stack inline-grid layouts ========== */
@media (max-width: 1024px) {
  /* All 2-col and multi-col inline grids stack */
  [style*="gridTemplateColumns"],
  [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  /* Keep the 2-col contact/name+phone form row as a compact 1-col */
  /* Padding reductions for big inline-styled cards */
  [style*="padding:56px"],
  [style*="padding: 56px"] { padding: 32px !important; }
  [style*="padding:48px"],
  [style*="padding: 48px"] { padding: 28px !important; }
  [style*="padding:'56px'"] { padding: 32px !important; }
  [style*="padding:'48px'"] { padding: 28px !important; }
  [style*="padding:'48px 56px'"] { padding: 28px 24px !important; }

  /* Kill tall fixed heights on image grids */
  [style*="height:520"],
  [style*="height: 520"],
  [style*="height:500"],
  [style*="height: 500"],
  [style*="height:600"],
  [style*="height: 600"] {
    height: auto !important;
  }

  /* Reduce giant section gaps */
  [style*="gap:64"],
  [style*="gap: 64"],
  [style*="gap:80"],
  [style*="gap: 80"] { gap: 32px !important; }
  [style*="gap:48"],
  [style*="gap: 48"] { gap: 28px !important; }

  /* Trim margin-top:80/marginTop:80 */
  [style*="marginTop:80"],
  [style*="marginTop: 80"],
  [style*="margin-top: 80"],
  [style*="margin-top:80"] { margin-top: 48px !important; }
}

@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr !important; gap: 32px !important; }
  .brand-text span:first-child,
  .brand span[style] { font-size: 22px !important; }
  .brand-text small { font-size: 9px !important; letter-spacing: 2px !important; }
  .btn { padding: 12px 18px; font-size: 13px; }
  .mobile-link { font-size: 22px; padding: 18px 4px; }
}

/* Smaller brand seal on small screens so it doesn't feel cramped */
@media (max-width: 900px) {
  [aria-hidden="true"][style*="width: 429"] { width: 240px !important; height: 240px !important; opacity: 0.04 !important; }
}

/* Make nav logo shrink nicely on narrow screens */
@media (max-width: 560px) {
  .brand svg[width="48"] { width: 40px !important; height: 40px !important; }
  .brand > div > span:first-child { font-size: 22px !important; }
  .brand > div > span:last-child { font-size: 10px !important; letter-spacing: 2px !important; }
}

/* Inputs: prevent iOS zoom on focus */
input, select, textarea { font-size: 16px; }

