/* ==========================================================================
   Showroom Dentistry — shared foundation
   Tokens, reset, typography, buttons, forms, the appointment dialog, and the
   concept-switcher bar. Everything layout-specific lives in the per-direction
   stylesheet (precision.css / gallery.css / touring.css).
   ========================================================================== */

@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-400.woff2") format("woff2");
}

@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-400-italic.woff2") format("woff2");
}

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/instrument-sans-var.woff2") format("woff2");
}

:root {
  --navy-900: #030d1a;
  --navy: #06162a;
  --navy-700: #0e2742;
  --gold: #c99a4b;
  --gold-bright: #dcb26a;
  /* Brand gold is ~2.5:1 on white; text on light surfaces uses the dark variant. */
  --gold-on-light: #8b6320;
  --gold-text: var(--gold-on-light);
  --ink: #0a1a2c;
  --paper: #ffffff;
  --bone: #f5f3ef;
  --muted: #5d6a79;
  --line: rgb(6 22 42 / 12%);
  --line-strong: rgb(6 22 42 / 22%);
  --on-dark: rgb(255 255 255 / 74%);
  --on-dark-faint: rgb(255 255 255 / 14%);

  --serif: Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --container: 1240px;
  --gutter: clamp(20px, 5vw, 72px);
  --radius: 0px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  color: var(--ink);
  font-family: var(--sans);
  font-synthesis: none;
  color-scheme: only light;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body { margin: 0; background: var(--paper); font-size: 16px; line-height: 1.55; }

button, a, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4 { font-weight: 400; margin: 0; text-wrap: balance; }
p { text-wrap: pretty; }
figure { margin: 0; }

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 12px 20px;
  background: var(--gold);
  color: var(--navy);
  font-size: 14px;
  font-weight: 600;
  transform: translateY(-250%);
  transition: transform .2s var(--ease);
}

.skip-link:focus-visible { transform: none; }

.container { width: min(100% - var(--gutter) * 2, var(--container)); margin-inline: auto; }
.container-wide { width: min(100% - var(--gutter) * 2, 1440px); margin-inline: auto; }

.eyebrow {
  margin: 0;
  color: var(--gold-text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

/* Buttons ------------------------------------------------------------------ */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 24px;
  border: 1px solid var(--gold-text);
  border-radius: var(--radius);
  background: transparent;
  color: var(--gold-text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  transition: background .22s var(--ease), color .22s var(--ease), border-color .22s var(--ease), transform .22s var(--ease);
}

.button-lg { min-height: 54px; padding: 0 30px; }
.button-primary { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.button-primary:hover { background: var(--gold-bright); border-color: var(--gold-bright); }
.button-ghost:hover { background: var(--gold); border-color: var(--gold); color: var(--navy); }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid currentColor;
  color: var(--gold-text);
  font-size: 14px;
  font-weight: 600;
}

.text-link span { transition: transform .22s var(--ease); }
.text-link:hover span { transform: translateX(4px); }

/* Brand mark --------------------------------------------------------------- */

.site-brand { display: inline-flex; align-items: center; gap: 13px; }

.site-brand strong {
  display: block;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 400;
  letter-spacing: .17em;
  line-height: 1;
}

.site-brand small {
  display: block;
  margin-top: 5px;
  color: var(--gold-text);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .46em;
}

.mark {
  width: 52px;
  height: 44px;
  flex: none;
  object-fit: contain;
}

/* Placeholder marking ------------------------------------------------------ */

[data-placeholder] {
  text-decoration: underline dotted rgb(6 22 42 / 30%);
  text-underline-offset: 4px;
}

.on-dark [data-placeholder],
.site-footer [data-placeholder] { text-decoration-color: rgb(255 255 255 / 30%); }

.placeholder-note {
  margin: 0;
  padding: 18px 0;
  color: var(--muted);
  font-size: 12px;
}

/* Concept switcher --------------------------------------------------------- */

.viewer {
  position: relative;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 48px;
  padding: 8px clamp(16px, 3vw, 40px);
  background: var(--navy-900);
  color: rgb(255 255 255 / 62%);
  font-size: 12px;
  --gold-text: var(--gold);
}

.viewer-back { display: inline-flex; gap: 8px; transition: color .2s var(--ease); }
.viewer-back:hover { color: white; }

.viewer-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 999px;
  background: rgb(255 255 255 / 4%);
}

.viewer-switch a {
  padding: 6px 16px;
  border-radius: 999px;
  font-weight: 600;
  transition: background .2s var(--ease), color .2s var(--ease);
}

.viewer-switch a:hover { color: white; }
.viewer-switch a[aria-current="page"] { background: var(--gold); color: var(--navy); }

.viewer-note {
  color: rgb(255 255 255 / 56%);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.capture .viewer { display: none; }

/* Appointment dialog ------------------------------------------------------- */

.appointment-dialog {
  width: min(680px, calc(100% - 32px));
  max-width: 680px;
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: 20px;
  color: var(--ink);
  box-shadow: 0 40px 110px rgb(3 13 26 / 42%);
  overflow: auto;
}

.appointment-dialog::backdrop { background: rgb(3 13 26 / 74%); backdrop-filter: blur(5px); }

.dialog-panel { position: relative; padding: clamp(34px, 4vw, 52px); }
.appointment-dialog h2 { margin: 14px 0 0; font-family: var(--serif); font-size: clamp(2rem, 3.4vw, 2.75rem); line-height: 1.05; letter-spacing: -.02em; }
.appointment-dialog p:not(.eyebrow) { margin: 14px 0 0; max-width: 50ch; color: var(--muted); font-size: 15px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
.form-grid label { display: grid; gap: 7px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  transition: border-color .2s var(--ease);
}

.form-grid textarea { min-height: 120px; resize: vertical; }
.form-grid input:hover, .form-grid select:hover, .form-grid textarea:hover { border-color: var(--ink); }
.form-grid .form-wide { grid-column: 1 / -1; }

.consent {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  margin-top: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.consent input { margin-top: 3px; accent-color: var(--gold); }
.dialog-submit { width: 100%; margin-top: 24px; }
.appointment-success { padding: 10px 0; }
.appointment-success .button { margin-top: 28px; }

.dialog-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: none;
  cursor: pointer;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}

.dialog-close:hover { background: var(--bone); border-color: var(--line-strong); }
.dialog-close svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }

@media (max-width: 640px) {
  .appointment-dialog {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
  }
  .dialog-panel { padding: 32px 22px 26px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .form-wide { grid-column: auto; }
  .viewer { flex-wrap: wrap; gap: 10px 14px; }
  .viewer-note { display: none; }
  .viewer-switch { width: 100%; }
  .viewer-switch a { flex: 1; text-align: center; padding: 7px 8px; }
}

/* Shared reveal ------------------------------------------------------------ */

[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
}

[data-reveal].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
