/* Carey Family Dentistry — Design System
   Palette: mimics jacksondentalnj.com — clean white, deep eggplant purple, charcoal text
   Type: Fraunces (display) / Inter (body) / IBM Plex Mono (utility/data)
   Signature: "patient card" motif — folded-corner cards + hand-drawn accent underline
*/

:root {
  --bg: #FFFFFF;
  --bg-deep: #F5F1FA;
  --card: #FFFFFF;
  --ink: #2B2B2E;
  --ink-soft: #5A5760;
  --forest: #3F1D63;
  --forest-light: #6C3FA3;
  --forest-pale: #F1E7FA;
  --amber: #6C3FA3;
  --amber-deep: #4A2472;
  --line: #E7DEF2;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(46,33,64,0.04), 0 8px 24px -12px rgba(46,33,64,0.18);
  --maxw: 1120px;
}

@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
  .reveal.in { opacity: 1; transform: none; }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3, h4 {
  font-family: 'Fraunces', Georgia, serif;
  color: var(--forest);
  line-height: 1.12;
  margin: 0 0 .5em;
  font-weight: 600;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.1rem, 4.4vw, 3.4rem); font-weight: 560; }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; color: var(--ink-soft); max-width: 62ch; }
p.lede { font-size: 1.15rem; color: var(--ink); }

.mono {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: .82rem;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--amber-deep);
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 72px 0; }
.section.tight { padding: 44px 0; }
.section.deep { background: var(--forest); color: #F2ECFA; }
.section.deep h2, .section.deep h3 { color: #F2ECFA; }
.section.deep p { color: #D9C9EC; }
.section.pale { background: var(--forest-pale); }

/* --- underline signature --- */
.underline {
  position: relative;
  white-space: nowrap;
}
.underline svg { position: absolute; left: 0; bottom: -0.14em; width: 100%; height: 0.3em; }

/* --- header / nav --- */
.top-strip {
  background: var(--forest);
  color: #E7DAF2;
  font-family: 'Inter', sans-serif;
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .01em;
}
.top-strip .wrap { display: flex; justify-content: space-between; align-items: center; padding: 10px 24px; flex-wrap: wrap; gap: 6px 18px; }
.top-strip a { color: #F0E8FB; text-decoration: none; font-weight: 600; }
.top-strip a:hover { text-decoration: underline; }

header.site-header {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--line);
}
.nav-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 9px; background: var(--forest);
  display: flex; align-items: center; justify-content: center;
  color: #F0E8FB; font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.15rem;
  flex-shrink: 0;
}
.brand-name { font-family: 'Fraunces', serif; font-weight: 600; color: var(--forest); font-size: 1.12rem; line-height: 1.1; }
.brand-name span { display: block; font-family: 'IBM Plex Mono', monospace; font-size: .66rem; color: var(--ink-soft); font-weight: 400; letter-spacing: .04em; text-transform: uppercase; margin-top: 2px;}

nav.primary { display: flex; align-items: center; gap: 26px; }
nav.primary a { text-decoration: none; color: var(--ink); font-size: .95rem; font-weight: 500; position: relative; }
nav.primary a:hover { color: var(--forest); }
.has-drop { position: relative; }
.dropdown {
  position: absolute; top: 100%; left: 0; margin-top: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); min-width: 230px; padding: 8px; display: none;
}
.has-drop:hover .dropdown, .has-drop:focus-within .dropdown { display: block; }
.dropdown a { display: block; padding: 9px 12px; border-radius: 8px; font-size: .92rem; }
.dropdown a:hover { background: var(--forest-pale); }

.nav-actions { display: flex; align-items: center; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; font-weight: 600; font-size: .92rem;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--amber); color: #FFFFFF; }
.btn-primary:hover { box-shadow: 0 6px 18px -6px rgba(108,63,163,.6); }
.btn-outline { background: transparent; border-color: var(--forest); color: var(--forest); }
.btn-outline:hover { background: var(--forest); color: #F2ECFA; }
.btn-ghost { background: transparent; color: var(--forest); padding: 11px 14px; }
.btn-sm { padding: 8px 15px; font-size: .84rem; }
.btn-block { width: 100%; justify-content: center; }

.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 6px; }
.menu-toggle span { display: block; width: 22px; height: 2px; background: var(--forest); margin: 5px 0; }

/* --- hero --- */
.hero { padding: 60px 0 76px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.eyebrow { font-family: 'IBM Plex Mono', monospace; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--amber-deep); display: inline-block; margin-bottom: 14px; }
.hero-actions { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.hero-card {
  background: var(--card); border-radius: 20px; border: 1px solid var(--line);
  box-shadow: var(--shadow); padding: 26px; position: relative;
}
.hero-card::before {
  content: ""; position: absolute; top: 0; right: 0; width: 26px; height: 26px;
  background: linear-gradient(135deg, var(--bg) 50%, transparent 50%);
  border-bottom-left-radius: 6px;
}
.hero-card .doc-row { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.hero-card .doc-row:last-child { border-bottom: none; }
.doc-avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--forest-pale); display:flex; align-items:center; justify-content:center; font-family:'Fraunces',serif; color: var(--forest); font-weight:600; flex-shrink:0; overflow: hidden; }
.doc-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.doc-photo { width: 100%; aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; margin-bottom: 16px; background: var(--forest-pale); }
.doc-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.doc-name { font-weight: 600; color: var(--forest); font-size: .98rem; }
.doc-role { font-size: .82rem; color: var(--ink-soft); }

/* --- trust strip --- */
.trust-strip { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.trust-item { display: flex; align-items: center; gap: 8px; font-size: .92rem; color: var(--ink); font-weight: 500; }
.trust-item svg { color: var(--amber-deep); flex-shrink: 0; }

/* --- cards / grids --- */
.grid { display: grid; gap: 22px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; position: relative; box-shadow: var(--shadow);
}
.card.folded::after {
  content: ""; position: absolute; top: 0; right: 0; width: 22px; height: 22px;
  background: linear-gradient(135deg, var(--bg) 50%, transparent 51%);
}
.card h3 { margin-bottom: 8px; }
.card a.card-link { text-decoration: none; color: var(--amber-deep); font-weight: 600; font-size: .9rem; display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; }
.card a.card-link:hover { text-decoration: underline; }

.service-card { display: flex; flex-direction: column; height: 100%; }
.service-card .idx { font-family: 'IBM Plex Mono', monospace; font-size: .74rem; color: var(--ink-soft); margin-bottom: 10px; }

/* --- band / CTA --- */
.band {
  background: var(--forest); color: #F2ECFA; border-radius: 20px; padding: 44px;
  display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
}
.band h3 { color: #F2ECFA; margin-bottom: 6px; }
.band p { color: #D9C9EC; margin-bottom: 0; }
.band.amber { background: var(--amber); color: #FFFFFF; }
.band.amber h3, .band.amber p { color: #FFFFFF; }
.band.amber p { opacity: .82; }

/* --- lists / checks --- */
ul.check { list-style: none; padding: 0; margin: 0 0 1em; }
ul.check li { position: relative; padding-left: 28px; margin-bottom: 10px; color: var(--ink-soft); }
ul.check li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--amber-deep); font-weight: 700; }

ol.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
ol.steps li { counter-increment: step; position: relative; padding-left: 46px; margin-bottom: 22px; }
ol.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -2px;
  width: 32px; height: 32px; border-radius: 50%; background: var(--forest-pale); color: var(--forest);
  font-family: 'Fraunces', serif; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: .92rem;
}
ol.steps strong { color: var(--forest); display: block; margin-bottom: 2px; }

/* --- breadcrumb --- */
.crumb { font-size: .82rem; color: var(--ink-soft); margin-bottom: 18px; font-family: 'IBM Plex Mono', monospace; }
.crumb a { color: var(--ink-soft); text-decoration: none; }
.crumb a:hover { color: var(--forest); text-decoration: underline; }

/* --- faq --- */
details.faq-item { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px 22px; margin-bottom: 12px; }
details.faq-item summary { cursor: pointer; padding: 16px 0; font-weight: 600; color: var(--forest); font-family: 'Fraunces', serif; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px;}
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary::after { content: "+"; font-size: 1.4rem; color: var(--amber-deep); transition: transform .2s ease; flex-shrink: 0; }
details.faq-item[open] summary::after { transform: rotate(45deg); }
details.faq-item p { padding-bottom: 16px; margin: 0; }

/* --- footer --- */
footer.site-footer { background: var(--forest); color: #E3D6F0; padding: 64px 0 28px; }
footer h4 { color: #F0E8FB; font-family: 'IBM Plex Mono', monospace; text-transform: uppercase; font-size: .78rem; letter-spacing: .06em; margin-bottom: 16px; }
footer .grid.cols-4 { gap: 32px; }
footer p, footer a { color: #C9B8DC; font-size: .92rem; }
footer a { text-decoration: none; }
footer a:hover { color: #F0E8FB; }
footer ul { list-style: none; padding: 0; margin: 0; }
footer li { margin-bottom: 9px; }
.foot-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 44px; padding-top: 22px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: .8rem; color: #A99AB8; }

/* --- sticky mobile bar --- */
.mobile-cta { display: none; }

/* --- emergency banner --- */
.emg-banner { background: #F6E8DD; border: 1px solid #E4C8A8; border-radius: var(--radius); padding: 20px 24px; display: flex; gap: 16px; align-items: flex-start; }
.emg-banner strong { color: var(--amber-deep); }

/* --- responsive --- */
@media (max-width: 920px) {
  nav.primary, .nav-actions .btn-outline { display: none; }
  .menu-toggle { display: block; }
  .hero-grid { grid-template-columns: 1fr; }
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  footer .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .band { flex-direction: column; align-items: flex-start; }
  .top-strip-info { display: none; }
  .top-strip .wrap { justify-content: center; padding: 9px 24px; }
  .top-strip-call { text-align: center; }
  .mobile-cta {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
    background: var(--forest); padding: 10px 14px; gap: 10px; box-shadow: 0 -6px 20px rgba(0,0,0,.15);
  }
  .mobile-cta .btn { flex: 1; }
  body { padding-bottom: 64px; }
}
@media (max-width: 600px) {
  .grid.cols-3, .grid.cols-4, .grid.cols-2 { grid-template-columns: 1fr; }
  .section { padding: 52px 0; }
  .top-strip-call { display: flex; flex-direction: column; gap: 2px; }
  .top-strip-call span.sep { display: none; }
}

/* mobile nav drawer */
.mobile-nav { display: none; flex-direction: column; gap: 2px; padding: 10px 24px 20px; border-top: 1px solid var(--line); background: var(--bg); }
.mobile-nav.open { display: flex; }
.mobile-nav a { padding: 11px 4px; text-decoration: none; color: var(--ink); font-weight: 500; border-bottom: 1px solid var(--line); }
.mobile-nav .sub { padding-left: 14px; font-size: .92rem; color: var(--ink-soft); }
