/* The Dentist.
   Light treatment-room palette: porcelain paper, graphite ink, steel rules,
   the lime of the clinic's wordmark and the pistachio of its Anthos A5 upholstery. */
:root {
  --paper: #f3f4f1;
  --white: #ffffff;
  --ink: #24272a;
  --ink-2: #565b60;
  --steel: #9a9ea2;
  --line: #dadddb;
  --lime: #b9d532;
  --lime-soft: #eef5d2;
  --olive: #55650c;
  --pistachio: #8fc13f;
  --graphite: #2f3134;
  --font: 'Saira', system-ui, sans-serif;
  --gutter: clamp(20px, 6vw, 96px);
  --col: 34rem;
}
[lang="ar"] { --font: 'Noto Kufi Arabic', 'Saira', system-ui, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 18px; font-weight: 420; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
[lang="ar"] body { line-height: 1.85; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--lime); color: var(--ink); }
:focus-visible { outline: 2px solid var(--olive); outline-offset: 3px; border-radius: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-2); }
.skip { position: fixed; top: -60px; inset-inline-start: 16px; z-index: 50; background: var(--lime); color: var(--ink); padding: 8px 14px; text-decoration: none; }
.skip:focus { top: 12px; }

/* soft studio sweep behind the 3D stage */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(60% 70% at 72% 52%, #ffffff 0%, rgba(255,255,255,0) 70%),
    linear-gradient(180deg, #f7f8f6 0%, var(--paper) 60%, #eceeea 100%);
}
[dir="rtl"] body::before { background: radial-gradient(60% 70% at 28% 52%, #ffffff 0%, rgba(255,255,255,0) 70%), linear-gradient(180deg, #f7f8f6 0%, var(--paper) 60%, #eceeea 100%); }
#stage { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -1; transition: opacity .2s linear; }

/* ── Header: the logo sits on its own graphite sign, like the clinic's ── */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 20; display: flex; align-items: center; gap: clamp(12px, 2.4vw, 36px);
  padding: 12px var(--gutter); transition: background .3s, box-shadow .3s;
}
.top.scrolled { background: rgba(243, 244, 241, .86); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px); box-shadow: 0 1px 0 var(--line); }
.brand { margin-inline-end: auto; background: var(--graphite); padding: 9px 14px 9px 12px; border-radius: 4px; }
.brand img { height: 30px; width: auto; }

.top nav { display: flex; gap: clamp(14px, 2.2vw, 30px); }
.top nav a { text-decoration: none; color: var(--ink-2); font-size: 15px; padding: 6px 0; border-bottom: 1.5px solid transparent; }
.top nav a:hover { color: var(--ink); border-color: var(--lime); }
.lang { background: none; border: 0; color: var(--ink-2); font: 15px 'Noto Kufi Arabic', 'Saira', sans-serif; cursor: pointer; padding: 6px 4px; }
.lang:hover { color: var(--ink); }
@media (max-width: 860px) { .top nav { display: none; } .brand img { height: 26px; } }

/* ── Buttons ─────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font: 600 16px/1 var(--font); text-decoration: none; cursor: pointer;
  padding: 16px 24px; border-radius: 3px; border: 1.5px solid transparent;
  transition: transform .15s ease, background .2s, color .2s, border-color .2s;
}
.btn:active { transform: translateY(1px); }
.btn-lime { background: var(--lime); color: var(--ink); }
.btn-lime:hover { background: #c6e23f; }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: rgba(255,255,255,.5); }
.btn-ghost:hover { background: var(--ink); color: var(--white); }
.btn-sm { padding: 11px 16px; font-size: 14px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ── Type ────────────────────────────────────────── */
h1, h2, h3 { margin: 0; font-weight: 520; color: var(--ink); }
.hero-title { font-size: clamp(46px, 7.2vw, 112px); line-height: .98; letter-spacing: -.02em; font-variation-settings: 'wdth' 112; font-weight: 520; margin: .25em 0 .35em; max-width: 9ch; }
[lang="ar"] .hero-title { font-weight: 650; line-height: 1.25; letter-spacing: 0; max-width: 12ch; font-size: clamp(42px, 6vw, 92px); }
h2 { font-size: clamp(34px, 4.2vw, 60px); line-height: 1.05; font-variation-settings: 'wdth' 108; font-weight: 520; }
[lang="ar"] h2 { line-height: 1.35; font-weight: 650; }
h3 { font-size: clamp(26px, 2.5vw, 34px); line-height: 1.15; font-variation-settings: 'wdth' 104; font-weight: 560; }
[lang="ar"] h3 { font-weight: 650; }
p { margin: 0 0 1em; max-width: 60ch; }
.lede { font-size: clamp(18px, 1.5vw, 21px); color: var(--ink-2); }

/* the logo's twin rules: a full rule above, an offset rule below */
.rules { position: relative; padding: .5em 0 .6em; margin-bottom: 1.1em; }
.rules::before, .rules::after { content: ''; position: absolute; height: 3px; background: var(--steel); inset-inline-end: 0; }
.rules::before { top: 0; inset-inline-start: 0; }
.rules::after { bottom: 0; inset-inline-start: 18%; }

/* ── Sections ────────────────────────────────────── */
.col { max-width: var(--col); }
section { position: relative; padding-inline: var(--gutter); }

.hero { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding-top: 110px; padding-bottom: 80px; }
.status { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 15px; margin: 0; background: var(--white); padding: 6px 12px 6px 10px; border-radius: 99px; box-shadow: 0 0 0 1px var(--line); }
.status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--steel); }
.status.open .dot { background: #7fa313; box-shadow: 0 0 0 0 rgba(127, 163, 19, .55); animation: ping 2.2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 9px rgba(127, 163, 19, 0); } 100% { box-shadow: 0 0 0 0 rgba(127, 163, 19, 0); } }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.6em; }
.cue { position: absolute; bottom: 28px; inset-inline-start: var(--gutter); display: flex; align-items: center; gap: 14px; color: var(--ink-2); font-size: 14px; margin: 0; }
.cue-line { width: 1.5px; height: 46px; background: linear-gradient(var(--olive), transparent); animation: drip 2.4s ease-in-out infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* page load: the headline rises word by word while the chair settles in */
.split .w { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .06em; }
.split .w > span { display: inline-block; transform: translateY(105%); animation: rise .9s cubic-bezier(.2, .8, .2, 1) forwards; animation-delay: calc(var(--i) * 70ms + 250ms); }
@keyframes rise { to { transform: none; } }

.intro { padding-top: 18vh; padding-bottom: 8vh; }
.step { min-height: 100vh; display: flex; align-items: center; }
.step .col { padding-block: 8vh; }

/* Your visit */
.photo { margin: 0 0 22px; border-radius: 4px; overflow: hidden; aspect-ratio: 45 / 32; background: var(--line); box-shadow: 0 30px 60px -30px rgba(36, 39, 42, .35); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.num { margin: 0 0 .1em; font: 500 64px/1 'Saira', sans-serif; font-variation-settings: 'wdth' 112; color: var(--olive); }
.vstep h3 { margin-bottom: .45em; }
.vstep p:not(.num) { color: var(--ink-2); }

/* Tooth */
.anatomy { height: 280vh; }
.anatomy .sticky { position: sticky; top: 0; height: 100vh; display: flex; align-items: center; }
.anatomy .col p { color: var(--ink-2); }
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 1; }
.lab { direction: ltr; text-align: left; position: absolute; top: 0; left: 0; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; opacity: 0; transition: opacity .5s; white-space: nowrap; }
.lab.on { opacity: 1; }
.lab i { grid-row: span 2; width: 64px; height: 1.5px; background: var(--ink); position: relative; }
.lab i::before { content: ''; position: absolute; left: -4px; top: -3.5px; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 2px var(--ink); }
.lab b { font-weight: 650; color: var(--ink); font-size: 16px; line-height: 1.2; }
.lab span { font-size: 13px; color: var(--ink-2); line-height: 1.3; }
.lab[data-part="dentin"] { transition-delay: .1s; } .lab[data-part="pulp"] { transition-delay: .2s; } .lab[data-part="root"] { transition-delay: .3s; }
@media (max-width: 900px) { .lab i { width: 28px; } .lab span { display: none; } }

.step .card h3 { margin-bottom: .55em; padding-inline-start: 18px; border-inline-start: 3px solid var(--lime); }
.step .card p { color: var(--ink-2); }
.ask { background: none; border: 0; padding: 4px 0; color: var(--ink); font: 500 15px var(--font); cursor: pointer; border-bottom: 2px solid var(--lime); }
.ask:hover { color: var(--olive); }
.shades { border: 0; padding: 0 0 20px; margin: 0 0 1.4em; }
.shades legend { font-size: 14px; color: var(--ink-2); margin-bottom: 10px; padding: 0; }
#shadeRow { display: flex; gap: 6px; }
.shade { width: 44px; height: 70px; border-radius: 3px 3px 18px 18px; border: 2px solid rgba(36,39,42,.08); cursor: pointer; position: relative; padding: 0; transition: transform .2s; }
.shade span { position: absolute; bottom: -22px; left: 0; right: 0; font: 12px var(--font); color: var(--ink-2); }
.shade:hover { transform: translateY(-4px); }
.shade[aria-pressed="true"] { border-color: var(--ink); transform: translateY(-6px); }
.shade[aria-pressed="true"] span { color: var(--ink); font-weight: 600; }

/* Smile band: photos drift sideways as you scroll */
.smiles { padding-block: 14vh; overflow: hidden; background: var(--white); }
.smiles-line { font-size: clamp(26px, 3vw, 40px); line-height: 1.25; font-weight: 500; font-variation-settings: 'wdth' 104; max-width: 24ch; margin-bottom: 1.4em; }
.smile-track { display: flex; gap: clamp(12px, 2vw, 28px); width: max-content; will-change: transform; padding-inline-start: 8vw; }
.sm { margin: 0; width: clamp(220px, 24vw, 380px); aspect-ratio: 4 / 5; border-radius: 4px; overflow: hidden; transform: translateY(var(--lift, 0)); transition: transform .2s linear; background: var(--line); }
.sm img { width: 100%; height: 100%; object-fit: cover; }
.sm1 { margin-top: 8vh; } .sm3 { margin-top: 5vh; }

@media (max-width: 900px) {
  .hero { justify-content: flex-end; padding-top: 50vh; }
  .anatomy .sticky { align-items: flex-end; padding-bottom: 6vh; }
  .step { align-items: flex-end; padding-bottom: 6vh; }
  .card, .anatomy .col, .vstep .col { background: rgba(255,255,255,.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: 18px; border-radius: 4px; box-shadow: 0 10px 30px -12px rgba(36,39,42,.25); }
  .vstep .photo { aspect-ratio: 16 / 9; }
  .num { font-size: 44px; }
  .shade { width: 38px; height: 60px; }
}

/* ── Jaw ─────────────────────────────────────────── */
.jaw { padding-block: 14vh 12vh; background: var(--paper); }
.jaw-head { max-width: 46rem; }
.jaw-head p { color: var(--ink-2); }
.jaw-grid { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(280px, 1fr); gap: clamp(16px, 3vw, 40px); margin-top: 2.2em; align-items: stretch; }
.jaw-stage { position: relative; min-height: 540px; border-radius: 6px; background: radial-gradient(70% 60% at 50% 45%, #ffffff, #e7eae6); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
#archCanvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; }
.jaw-tools { position: absolute; inset: auto 16px 16px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; pointer-events: none; }
.jaw-tools > * { pointer-events: auto; }
.hint { margin: 0; font-size: 14px; color: var(--ink-2); }
.seg { display: inline-flex; border: 1px solid var(--steel); border-radius: 3px; overflow: hidden; background: var(--white); }
.seg button { background: none; border: 0; color: var(--ink-2); font: 14px var(--font); padding: 9px 14px; cursor: pointer; }
.seg button + button { border-inline-start: 1px solid var(--steel); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--white); }
.hover-tag { position: absolute; top: 16px; inset-inline-start: 16px; margin: 0; font-size: 14px; color: var(--olive); font-weight: 500; min-height: 1.4em; }
.jaw-panel { border-top: 3px solid var(--steel); padding-top: 22px; display: flex; flex-direction: column; gap: 14px; }
.tooth-num { margin: 0; font: 500 clamp(64px, 7vw, 104px)/.9 'Saira', sans-serif; font-variation-settings: 'wdth' 112; color: var(--olive); }
.tooth-name { margin: 0; font-size: 19px; min-height: 3.2em; }
.tooth-select, input, select, textarea {
  width: 100%; background: var(--white); color: var(--ink); border: 1px solid #c4c8c6; border-radius: 3px; padding: 12px 14px; font: 16px var(--font);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--olive); box-shadow: 0 0 0 3px rgba(185, 213, 50, .35); }
.problems { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.problems legend { font-size: 14px; color: var(--ink-2); padding: 0; margin-bottom: 8px; }
.problems[disabled] { opacity: .5; }
.problems label { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); background: var(--white); border-radius: 3px; cursor: pointer; font-size: 16px; }
.problems label:has(input:checked) { border-color: var(--olive); background: var(--lime-soft); }
.problems input { width: auto; accent-color: var(--olive); }
@media (max-width: 900px) { .jaw-grid { grid-template-columns: 1fr; } .jaw-stage { min-height: 420px; } }

/* ── Find us ─────────────────────────────────────── */
.visit { padding-block: 14vh 10vh; background: var(--white); }
.visit-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(28px, 5vw, 80px); margin-top: 2em; }
address { font-style: normal; font-size: 21px; line-height: 1.5; margin-bottom: .6em; }
.tel { font: 500 clamp(28px, 3vw, 40px) 'Saira', sans-serif; font-variation-settings: 'wdth' 112; text-decoration: none; color: var(--ink); direction: ltr; unicode-bidi: isolate; border-bottom: 3px solid var(--lime); }
.map { aspect-ratio: 16 / 10; border-radius: 4px; overflow: hidden; margin: 22px 0 10px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.map iframe { width: 100%; height: 100%; border: 0; filter: saturate(.7); }
.link { color: var(--ink); text-decoration-color: var(--lime); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.visit h3 { margin: 1.6em 0 .6em; font-size: 24px; }
.hours { border-collapse: collapse; width: 100%; max-width: 26rem; }
.hours td { padding: 9px 0; border-bottom: 1px solid var(--line); }
.hours td + td { text-align: end; color: var(--ink-2); direction: ltr; }
[dir="rtl"] .hours td + td { text-align: left; }
.hours tr.today td { color: var(--ink); font-weight: 600; }
.hours tr.today td:first-child::after { content: attr(data-today); font-size: 12px; font-weight: 500; margin-inline-start: 10px; background: var(--lime); padding: 2px 7px; border-radius: 99px; }
.book { background: var(--paper); border-radius: 4px; padding: clamp(22px, 3vw, 40px); align-self: start; border-top: 4px solid var(--lime); }
.book h3 { margin: 0 0 1em; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; color: var(--ink-2); margin-bottom: 6px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.err { color: #b3261e; font-size: 14px; margin: 6px 0 0; }
.help { font-size: 14px; color: var(--ink-2); margin: 12px 0 0; }
@media (max-width: 900px) { .visit-grid { grid-template-columns: 1fr; } }

/* ── Footer: back to the graphite of the sign ─────── */
.foot { padding: 60px var(--gutter) 40px; background: var(--graphite); color: #d9dcda; display: grid; gap: 4px; }
.foot-mark img { height: 52px; width: auto; margin-bottom: 18px; }

.foot p { margin: 0; color: #c3c6c4; font-size: 15px; }
.foot .muted { color: #9a9ea2; }
.foot a { text-decoration: none; }
.credits { margin-top: 18px !important; font-size: 13px !important; color: #8d9195 !important; max-width: 70ch; }

/* No WebGL: keep everything else working */
.fallback-mark { display: none; }
.no-3d .jaw-stage { display: none; }
.no-3d .jaw-grid { grid-template-columns: minmax(0, 28rem); }

@media (prefers-reduced-motion: reduce) {
  .split .w > span { animation: none; transform: none; }
  .status.open .dot, .cue-line { animation: none; }
  .sm { transform: none; }
}
