/* Kingsmead Dental - porcelain, scrub-green ink, brass.
   Type: Newsreader (display) + Hanken Grotesk (body). 4px rhythm. */

@font-face {
  font-family: 'Newsreader';
  src: url('/assets/fonts/Newsreader-var.woff2') format('woff2');
  font-weight: 400 600;
  font-display: swap;
}
@font-face {
  font-family: 'Hanken Grotesk';
  src: url('/assets/fonts/HankenGrotesk-var.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --paper: #EEF1EE;
  --sheet: #F7F9F7;
  --ink: #16332B;
  --deep: #0B231D;
  --line: #D3DCD5;
  --brass: #8F6F35;
  --brass-bright: #CBA856;
  --muted: #5D6B63;
  --muted-dark: #93A69C;
  --danger: #A2402F;

  --sans: 'Hanken Grotesk', system-ui, sans-serif;
  --serif: 'Newsreader', Georgia, serif;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px;

  --w: 1180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--brass); color: #fff; }

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

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

img { display: block; max-width: 100%; }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.06; letter-spacing: -0.01em; }

/* ---------- stage (fixed 3D canvas or frame-sequence) ---------- */

#stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
#stage canvas, #stage .seq-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#stage .seq-frame { object-fit: contain; object-position: center 52%; }
#stage .seq-frame.at-hero { object-position: center 24%; }

body { transition: background-color 0.45s ease; }
body.stage-dark { background: var(--deep); }

/* prerender mode: capture only the canvas, no page chrome */
body.prerender > *:not(#stage) { display: none !important; }
body.prerender, body.prerender * { transition: none !important; }

/* sections that reveal the stage must be transparent; all others opaque */
.reveal-stage { background: transparent; }

/* ---------- top bar ---------- */

.topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s4) var(--s5);
  max-width: var(--w);
  margin: 0 auto;
}
.wordmark {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.005em;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.wordmark .tab {
  width: 14px; height: 18px;
  border-radius: 3px 3px 5px 5px;
  background: linear-gradient(180deg, #F6F2E8 0%, #E9DCC0 100%);
  border: 1px solid #D9CBA8;
  flex: none;
}
.topnav { display: flex; align-items: center; gap: var(--s5); }
.topnav .tel { font-size: 15px; font-weight: 600; text-decoration: none; }
.topnav .tel:hover { color: var(--brass); }

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }
.btn.on-dark { border-color: var(--brass-bright); background: var(--brass-bright); color: var(--deep); }
.btn.on-dark:hover { background: transparent; color: var(--brass-bright); }
.btn.ghost.on-dark { background: transparent; color: var(--brass-bright); border-color: var(--muted-dark); }
.btn.ghost.on-dark:hover { background: var(--brass-bright); color: var(--deep); border-color: var(--brass-bright); }

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

.hero {
  position: relative;
  z-index: 2;
  min-height: 92svh;
  max-width: var(--w);
  margin: 0 auto;
  padding: 140px var(--s5) var(--s7);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
}
.hero > * { pointer-events: auto; }
.hero .kicker { max-width: 560px; }
.hero h1 {
  font-size: clamp(46px, 6.4vw, 92px);
  max-width: 8.5em;
}
.hero p.lede {
  max-width: 46ch;
  margin-top: var(--s4);
  font-size: 18px;
  color: var(--muted);
}
.hero .cta-row { display: flex; gap: var(--s3); margin-top: var(--s5); flex-wrap: wrap; }

/* shade ramp strip */
.ramp {
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg,
    #FBF9F2 0%, #F3EDDF 12%, #EBDFC2 25%, #DFCDA4 38%, #D2B988 50%,
    #C2A26E 62%, #AE8C55 74%, #96703F 86%, #7C5A2E 100%);
  border: 1px solid rgba(22, 51, 43, 0.12);
}
.ramp-cap {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 6px;
}
.hero .ramp-wrap { margin-top: var(--s6); max-width: 560px; }

/* ---------- generic section chrome ---------- */

section { position: relative; }
.wrap { max-width: var(--w); margin: 0 auto; padding: var(--s9) var(--s5); }
.wrap.tight { padding-top: var(--s8); padding-bottom: var(--s8); }

.sec-head { max-width: 640px; margin-bottom: var(--s6); }
.sec-head h2 { font-size: clamp(32px, 3.6vw, 46px); }
.sec-head p { margin-top: var(--s3); color: var(--muted); font-size: 17px; }
.on-dark-text, .stage-dark .sec-head p { color: var(--muted-dark); }

/* ---------- facts strip ---------- */

.facts { background: var(--paper); }
.facts .grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.facts .cell {
  padding: var(--s5) var(--s4);
  border-left: 1px solid var(--line);
}
.facts .cell:first-child { border-left: 0; }
.facts .num { font-family: var(--serif); font-size: 30px; font-weight: 500; }
.facts .lbl { font-size: 14px; color: var(--muted); margin-top: 2px; }

/* ---------- treatments ---------- */

.treatments { background: var(--sheet); border-top: 1px solid var(--line); }
.trow {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s5);
  align-items: baseline;
  padding: var(--s4) var(--s2);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  border-radius: 6px;
}
.trow:hover { background: #EFF4F0; color: inherit; }
.trow:hover .tname { color: var(--brass); }
.trow .tname { font-family: var(--serif); font-size: 26px; font-weight: 500; transition: color 0.15s ease; }
.trow .tdesc { color: var(--muted); font-size: 15.5px; margin-top: 2px; }
.trow .tfee { font-size: 15px; font-weight: 600; white-space: nowrap; }
.trow .tfee span { display: block; text-align: right; font-weight: 400; color: var(--muted); font-size: 12.5px; }

/* ---------- procedure runway (dark) ---------- */

.runway { position: relative; height: 300vh; z-index: 2; }
.runway .pin {
  position: sticky;
  top: 0;
  height: 100svh;
  max-width: var(--w);
  margin: 0 auto;
  padding: var(--s6) var(--s5);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}
.runway .pin > * { pointer-events: auto; }

.runway .steps {
  display: flex;
  gap: var(--s4);
  justify-content: space-between;
  list-style: none;
  margin-top: auto;
}
.runway .step {
  flex: 1;
  padding: var(--s4);
  border: 1px solid rgba(203, 168, 86, 0.28);
  border-radius: 10px;
  background: rgba(11, 35, 29, 0.78);
  backdrop-filter: blur(4px);
  color: #E9EFEA;
  opacity: 0.32;
  transition: opacity 0.3s ease, border-color 0.3s ease;
}
.runway .step.active { opacity: 1; border-color: var(--brass-bright); }
.runway .step .no {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brass-bright);
  letter-spacing: 0.06em;
}
.runway .step h3 { font-size: 21px; margin: 4px 0 6px; }
.runway .step p { font-size: 14.5px; line-height: 1.5; color: var(--muted-dark); }
.runway .step .ramp { margin-top: 10px; height: 8px; opacity: 0.9; }

.runway .hint {
  align-self: center;
  font-size: 13px;
  color: var(--muted-dark);
  padding: 6px 14px;
  border: 1px solid rgba(147, 166, 156, 0.3);
  border-radius: 999px;
  margin-bottom: var(--s4);
  transition: opacity 0.4s ease;
}

.runway .run-head { color: #E9EFEA; max-width: 560px; }
.runway .run-head h2 { font-size: clamp(30px, 3.4vw, 44px); }
.runway .run-head p { color: var(--muted-dark); margin-top: var(--s3); }

/* ---------- fees ---------- */

.fees { background: var(--paper); }
.fees .cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 var(--s7);
}
.fgroup { padding: var(--s5) 0; border-bottom: 1px solid var(--line); }
.fgroup h3 { font-size: 24px; margin-bottom: var(--s3); }
.frow {
  display: flex;
  align-items: baseline;
  gap: var(--s2);
  padding: 7px 0;
  font-size: 16px;
}
.frow .name { color: var(--ink); }
.frow .dots { flex: 1; border-bottom: 1.5px dotted #B9C4BC; transform: translateY(-4px); min-width: 24px; }
.frow .amt { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.frow .amt small { font-weight: 400; color: var(--muted); }
.fees .note {
  margin-top: var(--s5);
  font-size: 14.5px;
  color: var(--muted);
  max-width: 60ch;
  border-left: 3px solid var(--brass);
  padding-left: var(--s3);
}

/* ---------- team ---------- */

.team { background: var(--sheet); border-top: 1px solid var(--line); }
.team .cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s5); }
.team .card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.team .card img { width: 100%; aspect-ratio: 4 / 4.6; object-fit: cover; }
.team .card .pad { padding: var(--s4); }
.team .card h3 { font-size: 22px; }
.team .card .role { color: var(--brass); font-size: 14px; font-weight: 600; margin-top: 2px; }
.team .card .gdc { color: var(--muted); font-size: 13px; margin-top: 6px; }
.team .after { margin-top: var(--s5); color: var(--muted); font-size: 15.5px; max-width: 68ch; }

/* ---------- first visit ---------- */

.visit { background: var(--paper); }
.visit .flow { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--s7); align-items: start; }
.vstep { display: grid; grid-template-columns: 52px 1fr; gap: var(--s3); padding: var(--s4) 0; border-bottom: 1px solid var(--line); }
.vstep:last-child { border-bottom: 0; }
.vstep .n { font-family: var(--serif); font-size: 26px; color: var(--brass); font-weight: 500; }
.vstep h3 { font-size: 20px; }
.vstep p { color: var(--muted); font-size: 15.5px; margin-top: 2px; }
.visit figure { position: sticky; top: var(--s5); }
.visit figure img { border-radius: 12px; border: 1px solid var(--line); width: 100%; }
.visit figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* ---------- booking ---------- */

.book { background: var(--sheet); border-top: 1px solid var(--line); }
.book .split { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: var(--s7); align-items: start; }

form .field { margin-bottom: var(--s4); }
form label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
form .req { color: var(--brass); }
form input, form select, form textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 14px;
}
form input:hover, form select:hover, form textarea:hover { border-color: #B9C4BC; }
form textarea { min-height: 96px; resize: vertical; }
form .two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
form .hp { position: absolute; left: -4000px; opacity: 0; height: 0; overflow: hidden; }

.form-note { font-size: 13.5px; color: var(--muted); margin-top: var(--s3); }
.form-msg { margin-top: var(--s3); font-size: 15px; font-weight: 600; display: none; padding: 12px 16px; border-radius: 8px; }
.form-msg.ok { display: block; background: #E4EFE7; color: #1E5138; border: 1px solid #BFD9C7; }
.form-msg.err { display: block; background: #F4E4DF; color: var(--danger); border: 1px solid #E0C4BB; }

.book .aside img { border-radius: 12px; border: 1px solid var(--line); margin-bottom: var(--s5); }
.hours { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.hours td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.hours td:last-child { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.book .addr { margin-top: var(--s5); font-style: normal; font-size: 15.5px; line-height: 1.7; }
.book .addr b { font-family: var(--serif); font-size: 18px; }
.book .emergency {
  margin-top: var(--s4);
  font-size: 14.5px;
  color: var(--ink);
  background: #EFE9DA;
  border: 1px solid #DFD3B4;
  border-radius: 8px;
  padding: 12px 16px;
}

/* ---------- faq ---------- */

.faq { background: var(--paper); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s4);
  padding: var(--s4) var(--s2);
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 500;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .pm { font-family: var(--sans); font-size: 22px; color: var(--brass); flex: none; transition: transform 0.2s ease; }
.faq details[open] summary .pm { transform: rotate(45deg); }
.faq .a { padding: 0 var(--s2) var(--s5); max-width: 68ch; color: var(--muted); }

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

footer { background: var(--deep); color: #C8D4CD; position: relative; z-index: 2; }
footer .wrap { padding: var(--s8) var(--s5) var(--s5); }
footer .cols { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: var(--s7); }
footer h3 { color: #E9EFEA; font-size: 20px; margin-bottom: var(--s3); }
footer a { color: #C8D4CD; }
footer a:hover { color: var(--brass-bright); }
footer .fmot { font-family: var(--serif); font-size: 26px; color: #E9EFEA; margin-bottom: var(--s3); }
footer .fine { font-size: 13px; color: #7E9187; margin-top: var(--s7); display: flex; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; }
footer .fine a { color: #7E9187; }

/* ---------- dashboard ---------- */

.dash-body { background: var(--paper); min-height: 100svh; }
.dash {
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--s7) var(--s5);
}
.dash h1 { font-size: 34px; }
.dash .sub { color: var(--muted); margin-top: 4px; }
.login-card {
  max-width: 420px;
  margin: var(--s7) auto 0;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: var(--s6);
}
.stat-row { display: flex; gap: var(--s3); margin: var(--s5) 0; flex-wrap: wrap; }
.chip {
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--sheet);
  cursor: pointer;
}
.chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip .cnt { opacity: 0.65; font-weight: 400; margin-left: 6px; }
.btable { width: 100%; border-collapse: collapse; background: var(--sheet); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.btable th {
  text-align: left;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #EFF3F0;
}
.btable td { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 15px; vertical-align: top; }
.btable tr:last-child td { border-bottom: 0; }
.pill { font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; display: inline-block; }
.pill.new { background: #EFE9DA; color: #6B5A22; }
.pill.confirmed { background: #E4EFE7; color: #1E5138; }
.pill.cancelled { background: #F1E3DF; color: var(--danger); }
.rowbtn {
  font: inherit; font-size: 13.5px; font-weight: 600;
  border: 1px solid var(--line); background: #fff;
  border-radius: 7px; padding: 5px 10px; cursor: pointer; margin-right: 6px;
}
.rowbtn:hover { border-color: var(--ink); }
.rowbtn.stop:hover { border-color: var(--danger); color: var(--danger); }

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .facts .grid { grid-template-columns: 1fr 1fr; }
  .facts .cell:nth-child(3) { border-left: 0; }
  .facts .cell:nth-child(n+3) { border-top: 1px solid var(--line); }
  .fees .cols { grid-template-columns: 1fr; gap: 0; }
  .team .cards { grid-template-columns: 1fr; max-width: 460px; }
  .visit .flow { grid-template-columns: 1fr; }
  .visit figure { position: static; }
  .book .split { grid-template-columns: 1fr; }
  footer .cols { grid-template-columns: 1fr; gap: var(--s6); }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap { padding: var(--s8) var(--s4); }
  .topbar { padding: var(--s3) var(--s4); }
  .topnav .tel { display: none; }
  .hero { min-height: 88svh; padding: 120px var(--s4) var(--s6); }
  .hero h1 { font-size: clamp(40px, 11vw, 56px); }
  .hero .ramp-wrap { max-width: 100%; }
  .ramp-cap span:nth-child(2) { display: none; }
  .trow { grid-template-columns: 1fr auto; }
  .trow .tfee span { display: none; }
  .runway { height: 340vh; }
  .runway .steps { flex-direction: column; gap: var(--s3); }
  .runway .hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
