/* Dr. Hicham Kaaki, general dentist. One stylesheet for the three languages.
   Palette: pearl white with a pale aqua, a clear aqua, and a deep teal for the booking section.
   (The token names date from the earlier green palette: "scrub" is the main colour.)
   Type: Schibsted Grotesk (Latin) and IBM Plex Sans Arabic, both self-hosted.
   Older browsers: every svh value has a vh line before it, for browsers that lack svh. */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/assets/fonts/schibsted-grotesk-latin.woff2?v=4c8b93f431") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plex Arabic";
  src: url("/assets/fonts/plex-arabic-arabic-400.woff2?v=6010e7fd0d") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "Plex Arabic";
  src: url("/assets/fonts/plex-arabic-arabic-600.woff2?v=16734a5adb") format("woff2");
  font-weight: 500 700;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
/* Latin letters and digits inside Arabic text, drawn in the same family. */
@font-face {
  font-family: "Plex Arabic";
  src: url("/assets/fonts/plex-arabic-latin-400.woff2?v=9ed8dcb02e") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plex Arabic";
  src: url("/assets/fonts/plex-arabic-latin-600.woff2?v=63f4757271") format("woff2");
  font-weight: 500 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --porcelain: #f8fcfc;
  --porcelain-2: #e7f4f4;
  --white: #ffffff;
  --ink: #0f2a2e;
  --ink-2: #496266;
  --ink-dim: #6f8588;
  --scrub: #0d8a93;
  --scrub-hover: #0a747c;
  --scrub-deep: #0a4c53;
  --mint: #d0f0ee;
  --mint-hover: #b9e7e4;
  --line: rgb(15 42 46 / 0.11);
  --line-strong: rgb(15 42 46 / 0.25);
  --on-deep: #e5f6f5;
  --on-deep-2: rgb(229 246 245 / 0.76);
  --line-deep: rgb(229 246 245 / 0.24);
  --shadow: 10 76 83;

  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-ar: "Plex Arabic", "Segoe UI", Tahoma, Arial, sans-serif;

  --wrap: 1320px;
  --gutter: clamp(16px, 4vw, 44px);
  --col-gap: clamp(16px, 2.6vw, 36px);
  --head-h: 68px;
  --radius-ctl: 12px;
  --radius-panel: 28px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}
html[lang="ar"] { --font: var(--font-ar); }

/* ------------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--head-h) + 12px);
}
body {
  margin: 0;
  background: var(--porcelain);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
html[lang="ar"] body { font-size: 1.125rem; line-height: 1.8; }
:lang(ar) { font-family: var(--font-ar); }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, canvas, iframe { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--mint); color: var(--ink); }
:focus-visible { outline: 2px solid var(--scrub); outline-offset: 3px; border-radius: 6px; }

.num { font-variant-numeric: tabular-nums; unicode-bidi: isolate; white-space: nowrap; }
.nobr { white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.wrap { width: 100%; max-width: var(--wrap); margin-left: auto; margin-right: auto; padding-left: var(--gutter); padding-right: var(--gutter); }
/* Notched phones held sideways (the page uses viewport-fit=cover): keep content clear of the notch. */
@supports (padding: max(1px, env(safe-area-inset-left))) {
  .wrap {
    padding-left: max(var(--gutter), env(safe-area-inset-left));
    padding-right: max(var(--gutter), env(safe-area-inset-right));
  }
}
.ico { width: 1.15em; height: 1.15em; fill: currentColor; flex: none; }

.skip {
  position: absolute; left: 12px; top: -80px; z-index: 100;
  padding: 10px 16px; border-radius: 10px;
  background: var(--ink); color: var(--white); text-decoration: none;
}
html[dir="rtl"] .skip { left: auto; right: 12px; }
.skip:focus { top: 12px; }

/* ------------------------------------------------------------------ buttons */

a, button { -webkit-tap-highlight-color: transparent; }
.btn:active, .callbar a:active, .head-tel:active { transform: scale(0.98); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 22px;
  border: 1.5px solid transparent; border-radius: var(--radius-ctl);
  font: inherit; font-weight: 600; font-size: 1rem; line-height: 1.2;
  text-decoration: none; cursor: pointer;
  transition: background-color 0.18s, border-color 0.18s, color 0.18s;
}
.btn-primary { background: var(--scrub); color: var(--white); }
.btn-primary:hover { background: var(--scrub-hover); }
.btn-secondary { border-color: var(--line-strong); color: var(--ink); }
.btn-secondary:hover { border-color: var(--ink); }
.btn-light { background: var(--mint); color: var(--ink); }
.btn-light:hover { background: var(--mint-hover); }
.btn-ghost { border-color: var(--line-deep); color: var(--on-deep); }
.btn-ghost:hover { border-color: var(--on-deep); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ------------------------------------------------------------------ header */

.site-head {
  position: -webkit-sticky; position: sticky; top: 0; z-index: 40;
  background: var(--porcelain);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.site-head.is-scrolled { border-bottom-color: var(--line); }
.head-in { display: flex; align-items: center; gap: clamp(12px, 2vw, 28px); height: var(--head-h); }

.wordmark { display: flex; align-items: baseline; gap: 12px; text-decoration: none; margin-inline-end: auto; min-width: 0; }
.wm-name { font-weight: 650; font-size: 1.0625rem; letter-spacing: -0.01em; white-space: nowrap; }
.wm-alt { font-size: 0.95rem; color: var(--ink-2); white-space: nowrap; }
html[lang="ar"] .wm-name { font-weight: 600; letter-spacing: 0; }

.site-nav ul { display: flex; gap: 2px; }
.site-nav a {
  display: block; padding: 8px 12px; border-radius: 10px;
  font-size: 0.95rem; color: var(--ink-2); text-decoration: none; white-space: nowrap;
  transition: color 0.15s, background-color 0.15s;
}
.site-nav a:hover { color: var(--ink); background: rgb(15 42 46 / 0.05); }

.langs ul { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 12px; }
.langs a {
  display: block; padding: 4px 10px; border-radius: 9px;
  font-size: 0.85rem; color: var(--ink-2); text-decoration: none;
}
.langs a:hover { color: var(--ink); }
.langs a[aria-current] { background: var(--ink); color: var(--porcelain); }
.lang-short { display: none; }

.head-tel {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--radius-ctl);
  background: var(--scrub); color: var(--white);
  font-weight: 600; font-size: 0.95rem; text-decoration: none;
  transition: background-color 0.18s;
}
.head-tel:hover { background: var(--scrub-hover); }

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

.hero { padding-block: clamp(16px, 3vw, 40px) clamp(40px, 6vw, 80px); }
.hero-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  align-items: center;
  min-height: min(calc(100vh - var(--head-h) - 140px), 820px);
  min-height: min(calc(100svh - var(--head-h) - 140px), 820px);
}
.hero-copy { grid-column: 1 / span 6; padding-block: 24px; }

/* The clinic photograph, with the essentials on a card over its corner. */
.hero-photo {
  position: relative;
  grid-column: 7 / span 6;
  height: clamp(460px, calc(100vh - var(--head-h) - 200px), 700px);
  height: clamp(460px, calc(100svh - var(--head-h) - 200px), 700px);
}
.photo { position: relative; overflow: hidden; border-radius: var(--radius-panel); background: var(--porcelain-2); }
.photo img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-photo .photo { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.hero-photo img { object-position: 68% 50%; }
.hero-card {
  position: absolute; bottom: 20px; inset-inline-start: 20px;
  display: grid; gap: 10px;
  max-width: calc(100% - 40px);
  padding: 18px 22px;
  border-radius: 20px;
  background: var(--white);
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -18px rgb(var(--shadow) / 0.3);
  font-size: 0.975rem;
}
.hero-card p { display: flex; align-items: center; gap: 12px; }
.hero-card .ico { color: var(--scrub); }
.hero-card a { font-weight: 600; text-decoration: none; }
.hero-card a:hover { text-decoration: underline; text-underline-offset: 3px; }

.hero-name {
  font-size: clamp(3.2rem, 7.6vw, 7.2rem);
  font-weight: 650;
  line-height: 0.92;
  letter-spacing: -0.045em;
  margin-bottom: 0.34em;
}
.hero-name .line { display: block; }
html[lang="ar"] .hero-name { font-size: clamp(3rem, 6.8vw, 6.2rem); font-weight: 600; line-height: 1.12; letter-spacing: 0; }
.hero-sub {
  max-width: 28ch;
  margin-bottom: 20px;
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
html[lang="ar"] .hero-sub { letter-spacing: 0; line-height: 1.55; }
.hero-lead { max-width: 46ch; margin-bottom: 32px; color: var(--ink-2); }
.hero-note { margin-top: 16px; font-size: 0.95rem; color: var(--ink-2); }

/* Facts under the opening screen: three short, true statements. */
.facts {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 var(--col-gap);
  margin-top: clamp(24px, 4vw, 48px);
  border-top: 1px solid var(--line);
}
.facts li { display: grid; gap: 4px; align-content: start; padding-top: 22px; }
.facts strong { font-size: clamp(1.3rem, 2.2vw, 1.75rem); font-weight: 620; letter-spacing: -0.025em; line-height: 1.15; }
html[lang="ar"] .facts strong { letter-spacing: 0; line-height: 1.5; }
.facts span { color: var(--ink-2); max-width: 36ch; }

/* One entrance, on load: the name first, then what follows it. */
@media (prefers-reduced-motion: no-preference) {
  .hero-name .line { animation: rise 1s var(--ease-out) both; }
  .hero-name .line + .line { animation-delay: 0.08s; }
  .hero-sub { animation: rise-small 0.9s 0.22s var(--ease-out) both; }
  .hero-lead { animation: rise-small 0.9s 0.3s var(--ease-out) both; }
  .hero .actions, .hero-note { animation: rise-small 0.9s 0.38s var(--ease-out) both; }
  .hero-photo .photo { animation: unveil 1.3s 0.1s var(--ease-out) both; }
  .hero-photo .photo img { animation: settle 1.8s 0.1s var(--ease-out) both; }
  .hero-card { animation: rise-small 0.9s 0.6s var(--ease-out) both; }
  /* Photos further down open up as they come into view, where the browser supports it. */
  @supports (animation-timeline: view()) {
    .sec .photo { animation: unveil linear both; animation-timeline: view(); animation-range: entry 0% entry 70%; }
  }
}
@keyframes rise { from { opacity: 0; transform: translateY(0.3em); } to { opacity: 1; transform: none; } }
@keyframes rise-small { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes unveil { from { clip-path: inset(10% 6% 0 6% round var(--radius-panel)); } to { clip-path: inset(0 round var(--radius-panel)); } }
@keyframes settle { from { transform: scale(1.08); } to { transform: none; } }

/* ------------------------------------------------------------------ line animations */

/* Lottie line drawings (site.js, anim.js). Their space is kept only when they will be drawn. */
.anim { display: none; }
html.has-anim .anim { display: block; opacity: 0; transition: opacity 0.6s var(--ease-out); }
html.has-anim .anim.is-ready { opacity: 1; }
.anim svg { width: 100% !important; height: 100% !important; }
.hero-mark { width: clamp(68px, 7vw, 92px); aspect-ratio: 470 / 380; margin-bottom: 22px; margin-inline-start: -6px; }
.book-mark {
  position: absolute; top: 50%; inset-inline-end: max(-60px, -4vw);
  width: clamp(300px, 40vw, 600px); aspect-ratio: 470 / 380;
  transform: translateY(-50%);
  pointer-events: none;
}
html.has-anim .book-mark.is-ready { opacity: 0.32; }

/* ------------------------------------------------------------------ urgent care */

.urgent { padding-block: clamp(28px, 4vw, 40px); background: var(--mint); }
.urgent-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 40px; }
.urgent-title { font-size: clamp(1.4rem, 2.4vw, 1.9rem); font-weight: 620; line-height: 1.15; letter-spacing: -0.025em; }
html[lang="ar"] .urgent-title { font-weight: 600; line-height: 1.5; letter-spacing: 0; }
.urgent-in p { max-width: 58ch; margin-top: 6px; color: var(--ink-2); }
.urgent .btn-secondary { border-color: rgb(15 42 46 / 0.35); }
.urgent + .about { border-top: 0; }

/* ------------------------------------------------------------------ sections */

.sec { padding-block: clamp(72px, 9vw, 120px); }
.sec-title {
  font-size: clamp(2.2rem, 4.6vw, 3.8rem);
  font-weight: 620;
  line-height: 1;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
html[lang="ar"] .sec-title { font-weight: 600; line-height: 1.3; letter-spacing: 0; }

/* About */
.about { border-top: 1px solid var(--line); }
.about-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 32px var(--col-gap); }
.about-grid .sec-title {
  grid-column: 1 / span 4; align-self: start;
  position: -webkit-sticky; position: sticky; top: calc(var(--head-h) + 40px);
}
.about-body { grid-column: 6 / span 7; display: grid; gap: 40px; }
.prose { display: grid; gap: 1em; max-width: 60ch; font-size: 1.2rem; }
.portrait img { width: 100%; max-width: 420px; height: auto; border-radius: var(--radius-panel); }
/* The universities' and the association's logos, each on a white card. */
.creds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.creds li {
  display: grid; place-items: center;
  min-height: 156px; padding: 22px 16px;
  border-radius: 20px; background: var(--white);
  box-shadow: inset 0 0 0 1px var(--line);
}
.creds img { width: auto; height: 108px; }
.creds .is-wide img { height: auto; width: min(100%, 176px); }
.cv li { display: grid; gap: 2px; padding-block: 20px; border-top: 1px solid var(--line); }
.cv li:last-child { border-bottom: 1px solid var(--line); }
.cv-q { font-size: clamp(1.1rem, 1.5vw, 1.3rem); font-weight: 560; line-height: 1.35; letter-spacing: -0.01em; }
html[lang="ar"] .cv-q { font-weight: 600; letter-spacing: 0; line-height: 1.6; }
.cv-i { color: var(--ink-2); }

/* Treatments: a clinic photograph held in view beside the list. */
.tx-sec { background: var(--white); border-top: 1px solid var(--line); }
.tx-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: auto 1fr;
  column-gap: var(--col-gap);
}
.tx-title { grid-column: 1 / span 5; grid-row: 1; padding-bottom: clamp(28px, 4vw, 48px); }
.tx-list { grid-column: 7 / span 6; grid-row: 1 / span 2; }
.tx-item {
  display: grid; grid-template-columns: 56px minmax(0, 1fr); column-gap: 22px; align-items: start; align-content: start;
  padding-block: 26px; border-top: 1px solid var(--line);
}
.tx-item:last-child { border-bottom: 1px solid var(--line); }
.tx-ico {
  grid-row: 1 / span 2;
  display: grid; place-items: center; width: 56px; height: 56px;
  border-radius: 16px; background: var(--porcelain-2); color: var(--scrub);
}
.tx-ico svg { width: 32px; height: 32px; overflow: visible; }
/* The filled icons are traced with a thin line that fades once they have filled in. */
.tx-ico path { stroke: currentColor; stroke-width: 0.7; stroke-opacity: 0; }
.tx-ico.is-line path { stroke-width: 1.5; stroke-opacity: 1; }
.tx-item h3 { padding-top: 3px; }
.tx-item h3 {
  margin-bottom: 8px;
  font-size: clamp(1.3rem, 1.9vw, 1.7rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.025em;
}
html[lang="ar"] .tx-item h3 { line-height: 1.5; letter-spacing: 0; }
.tx-item p { max-width: 50ch; color: var(--ink-2); }

/* Treatments: the tooth diagram held in view beside the list. site.js sets data-view to the
   treatment nearest the middle of the screen; each view plays a short sequence on the layers.
   Without the script it shows the healthy tooth. */
.tx-diagram {
  grid-column: 1 / span 5; grid-row: 2; align-self: start;
  position: -webkit-sticky; position: sticky; top: calc(var(--head-h) + 28px);
  display: grid; place-items: center;
  height: min(calc(100vh - var(--head-h) - 56px), 760px);
  height: min(calc(100svh - var(--head-h) - 56px), 760px);
  overflow: hidden;
  border-radius: var(--radius-panel);
  background: radial-gradient(120% 80% at 50% 30%, var(--white) 0%, var(--porcelain-2) 70%);
}
.dg { position: relative; height: 86%; aspect-ratio: 800 / 1338; margin-bottom: 4%; }
/* Fit the panel both ways: 86% of its height, or 90% of its width if that is smaller. */
@supports (width: 1cqw) {
  .tx-diagram { container-type: size; }
  .dg { height: min(86cqh, 150cqw); }
}
.dg > *, .dg-tooth > *, .dg-crown > div, .dg-denture > * { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.dg img { display: block; }
.dg-tooth { transform-origin: 54% 40%; }
.dg-socket, .dg-canal, .dg-gp, .dg-scan, .dg-crown > div, .dg-den-tooth {
  -webkit-mask: url("/assets/img/diagram/mask-tooth.png?v=46bac7771e") center / 100% 100% no-repeat;
  mask: url("/assets/img/diagram/mask-tooth.png?v=46bac7771e") center / 100% 100% no-repeat;
}
.dg-canal, .dg-gp {
  -webkit-mask-image: url("/assets/img/diagram/mask-pulp.png?v=e4bc6aeb13"); mask-image: url("/assets/img/diagram/mask-pulp.png?v=e4bc6aeb13");
}
.dg-crown > div, .dg-den-tooth {
  -webkit-mask-image: url("/assets/img/diagram/mask-crown.png?v=e783f7bf0a"); mask-image: url("/assets/img/diagram/mask-crown.png?v=e783f7bf0a");
}
/* Everything that only one treatment uses starts hidden. */
.dg-socket, .dg-gum, .dg-canal, .dg-gp, .dg-scan, .dg-crown, .dg-denture,
.dg-cavity, .dg-filling, .dg-tartar, .dg-spark { opacity: 0; }
/* The socket's lining: only its part in the bone is drawn, since the rest is always behind the
   tooth or, once the tooth is out, would hang in the air. */
.dg-lig { clip-path: inset(44% 0 0 0); }
/* The empty socket, in the bone only. */
.dg-socket { background: radial-gradient(60% 50% at 50% 70%, #7d2a24, #b4564a); clip-path: inset(43% 0 0 0); }
.dg-canal { background: #f2dccf; }
.dg-gp { background: linear-gradient(#e38b52, #c4652f); }
.dg-scan {
  background: linear-gradient(to bottom, transparent 0%, transparent 42%, rgb(90 215 215 / 0.7) 50%, transparent 58%, transparent 100%);
  background-size: 100% 300%;
}
.dg-crown { filter: drop-shadow(0 0 1.2px rgb(15 42 46 / 0.6)) drop-shadow(0 8px 10px rgb(var(--shadow) / 0.18)); }
.dg-crown > div { transform: scale(1.02); transform-origin: 50% 40%; }
/* Porcelain: the enamel's own drawing, paler, over a solid porcelain body. */
.dg-crown > div, .dg-den-tooth { background: linear-gradient(170deg, #f4f7f8 0%, #e7edf0 50%, #d3dce0 100%); }
.dg-porcelain { position: absolute; top: 0; left: 0; width: 100%; height: 100%; filter: saturate(0.3) brightness(1.08); }
.dg-denture { filter: drop-shadow(0 0 1.2px rgb(15 42 46 / 0.55)); }
.dg-cap {
  position: absolute; left: 20px; bottom: 18px;
  display: flex; align-items: center; gap: 10px; max-width: calc(100% - 40px);
  padding: 9px 16px 9px 12px; border-radius: 999px;
  background: var(--white); box-shadow: 0 1px 0 var(--line), 0 10px 24px -14px rgb(var(--shadow) / 0.4);
  font-weight: 600; font-size: 0.95rem;
}
.dg-cap::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--scrub); }
html[dir="rtl"] .dg-cap { left: auto; right: 20px; padding: 9px 12px 9px 16px; }
/* The list beside it: the treatment shown is in full colour. */
html.has-dg .tx-item { min-height: 30vh; min-height: 30svh; align-content: center; transition: opacity 0.4s; }
html.has-dg .tx-item:not(.is-active) { opacity: 0.45; }
/* Room after the last treatment, so it too reaches the middle while the diagram is held. */
html.has-dg .tx-list { padding-bottom: 22vh; padding-bottom: 22svh; }

/* Check-up: a scan passes over the tooth. */
[data-view="exam"] .dg-scan { animation: dg-scan 2.6s 0.3s ease-in-out 2 both; }
/* Scaling: tartar at the gum line and inflamed gums, then both cleared. */
[data-view="scaling"] .dg-tartar { animation: dg-out 0.9s 1.1s var(--ease-out) backwards; opacity: 0; }
[data-view="scaling"] .dg-gum { animation: dg-out 1s 1.5s var(--ease-out) backwards; }
/* Filling: a cavity in the biting surface, then filled in the tooth's colour. */
[data-view="filling"] .dg-cavity { animation: dg-cavity 2s 0.2s both; }
[data-view="filling"] .dg-filling { animation: dg-in 0.8s 1.4s var(--ease-out) both; }
/* Aesthetic restoration: a chipped edge rebuilt. */
[data-view="aesthetic"] .dg-tooth { animation: dg-chip 1.4s 0.2s var(--ease-out) both; }
[data-view="aesthetic"] .dg-spark { animation: dg-spark 1s 1.6s var(--ease-out) both; }
/* Root canal: an inflamed nerve, the canals cleaned, then filled and sealed. */
[data-view="rootcanal"] .dg-pulp { animation: dg-hot 1.9s 0.1s both; }
[data-view="rootcanal"] .dg-vessels { animation: dg-gone 0.6s 1.5s both; }
[data-view="rootcanal"] .dg-canal { animation: dg-in 0.6s 1.6s both; }
[data-view="rootcanal"] .dg-gp { animation: dg-gp 1.4s 2.4s ease-in-out both; }
[data-view="rootcanal"] .dg-filling { animation: dg-in 0.6s 3.8s var(--ease-out) both; }
/* Crown: the tooth shaped, then the crown seated over it. */
[data-view="crown"] .dg-tooth { animation: dg-prep 0.8s 0.3s var(--ease-out) both; }
[data-view="crown"] .dg-crown { animation: dg-seat 1.1s 1.2s var(--ease-out) both; }
/* Extraction: the tooth loosened and lifted out of its socket. */
[data-view="extraction"] .dg-tooth { animation: dg-lift 2.2s 0.3s cubic-bezier(0.5, 0, 0.3, 1) both; }
[data-view="extraction"] .dg-socket { animation: dg-socket 1s 1.5s both; }
/* Denture: where a tooth is missing, a denture tooth on its pink base is placed. */
[data-view="denture"] .dg-tooth { opacity: 0; }
[data-view="denture"] .dg-socket { opacity: 1; background: #dccbb0; }
[data-view="denture"] .dg-lig { opacity: 0; }
[data-view="denture"] .dg-denture { animation: dg-seat 1.2s 0.4s var(--ease-out) both; }

@keyframes dg-scan { 0% { opacity: 0; background-position: 0 100%; } 15%, 85% { opacity: 1; } 100% { opacity: 0; background-position: 0 0; } }
@keyframes dg-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes dg-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: scale(0.9); } }
@keyframes dg-gone { to { opacity: 0; } }
@keyframes dg-cavity { 0% { opacity: 0; } 20%, 75% { opacity: 1; } 100% { opacity: 0; } }
@keyframes dg-chip {
  0%, 35% { clip-path: polygon(40% 0, 100% 0, 100% 100%, 0 100%, 0 34%, 17% 30%, 22% 24%, 30% 21%, 34% 15%); }
  100% { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 34%, 0 30%, 0 24%, 0 21%, 0 15%); }
}
@keyframes dg-spark { 0% { opacity: 0; transform: scale(0.4) rotate(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: scale(1.1) rotate(45deg); } }
@keyframes dg-hot {
  0% { filter: none; }
  25%, 70% { filter: saturate(2) hue-rotate(-14deg) brightness(1.08); }
  100% { filter: saturate(2) hue-rotate(-14deg); opacity: 0; }
}
@keyframes dg-gp { from { opacity: 1; clip-path: inset(0 0 100% 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }
/* The prepared tooth: a tapered stump in place of the crown. */
@keyframes dg-prep {
  from { clip-path: polygon(0 0, 17% 0, 25% 0, 83% 0, 90% 0, 100% 0, 100% 100%, 0 100%); }
  to { clip-path: polygon(0 41%, 17% 41%, 25% 17%, 83% 17%, 90% 39%, 100% 39%, 100% 100%, 0 100%); }
}
@keyframes dg-seat { from { opacity: 0; transform: translateY(-38%); } 30% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes dg-lift {
  0% { transform: none; }
  14% { transform: rotate(-3deg); }
  28% { transform: rotate(3deg); }
  40% { transform: translateY(-2%) rotate(-2deg); opacity: 1; }
  100% { transform: translateY(-75%) rotate(-9deg); opacity: 0; }
}
@keyframes dg-socket { from { opacity: 0; } to { opacity: 0.55; } }
.dg-cavity, .dg-filling, .dg-spark, .dg-tartar path { transform-box: fill-box; transform-origin: center; }

/* Your first visit: four steps in order. */
.steps-sec { background: var(--porcelain-2); }
.steps {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px var(--col-gap);
  margin-top: clamp(36px, 5vw, 64px);
  counter-reset: none;
}
.steps li { position: relative; display: grid; gap: 10px; align-content: start; padding-top: 64px; }
.steps li::before {
  content: ""; position: absolute; top: 21px; left: 0; right: calc(var(--col-gap) * -1);
  height: 1px; background: var(--line-strong);
}
.steps li:last-child::before { right: 0; }
html[dir="rtl"] .steps li::before { left: calc(var(--col-gap) * -1); right: 0; }
html[dir="rtl"] .steps li:last-child::before { left: 0; }
.step-n {
  position: absolute; top: 0; left: 0;
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--scrub); color: var(--white); font-weight: 650;
}
html[dir="rtl"] .step-n { left: auto; right: 0; }
.steps h3 { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; }
html[lang="ar"] .steps h3 { letter-spacing: 0; line-height: 1.5; }
.steps p { color: var(--ink-2); }

/* Location: the details and direction buttons beside the map. */
.where-sec { background: var(--white); }
.where-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 40px var(--col-gap); align-items: center; }
.where-info { grid-column: 1 / span 5; }
.where-list { margin-block: 28px 32px; }
.where-list > div { padding-block: 14px; border-top: 1px solid var(--line); }
.where-list > div:last-child { border-bottom: 1px solid var(--line); }
.where-list dt { font-size: 0.9rem; color: var(--ink-2); }
.where-list dd { font-size: 1.2rem; font-weight: 500; }
.where-list dd a { text-decoration: none; }
.where-list dd a:hover { text-decoration: underline; text-underline-offset: 3px; }
.map {
  grid-column: 6 / span 7;
  height: clamp(320px, 42vw, 520px);
  border-radius: var(--radius-panel); overflow: hidden;
  background: var(--porcelain-2);
}
.map iframe { width: 100%; height: 100%; border: 0; }

/* Care tips: an animated tooth beside the tips, a line drawing over each. Without the
   animation the tips take the whole width. */
.tips-sec { background: var(--porcelain-2); }
.tips-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 40px var(--col-gap); }
.tips-art {
  grid-column: 1 / span 5;
  display: none; place-items: center;
  min-height: 420px;
  border-radius: var(--radius-panel);
  background: var(--white);
}
html.has-anim .tips-art { display: grid; }
.tips-anim { width: min(78%, 380px); aspect-ratio: 1; }
.tips-main { grid-column: 1 / span 12; padding-block: 8px; }
html.has-anim .tips-main { grid-column: 7 / span 6; }
.tips-intro { max-width: 46ch; margin-top: 18px; color: var(--ink-2); font-size: 1.15rem; }
.tips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px var(--col-gap); margin-top: clamp(32px, 4vw, 52px); }
.tips li { display: grid; gap: 10px; align-content: start; }
.tip-ico { width: 52px; height: 52px; color: var(--scrub); margin-bottom: 8px; }
.tip-ico svg { width: 100%; height: 100%; }

/* Icons that draw themselves in: site.js marks their item .is-in as it comes into view, each
   line (.ln, pathLength="1") is traced, then the filled icons fill in. Without the script, or with
   reduced motion, they are simply shown. */
[data-draw] .ln { stroke-dasharray: 1; }
html.has-draw [data-draw] .ln {
  transition: stroke-dashoffset 1.3s var(--ease-out), fill-opacity 0.6s 0.75s, stroke-opacity 0.5s 1.2s;
}
html.has-draw [data-draw]:not(.is-in) .ln { stroke-dashoffset: 1; fill-opacity: 0; stroke-opacity: 1; }
.tips h3 { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; }
html[lang="ar"] .tips h3 { letter-spacing: 0; line-height: 1.6; }
.tips p { color: var(--ink-2); }

/* Booking, on the deep teal: the number as the largest thing on the page. */
.visit-sec {
  position: relative; overflow: hidden;
  padding-block: clamp(80px, 11vw, 150px);
  background: var(--scrub-deep);
  color: var(--on-deep);
}
.visit-sec .book { position: relative; }
.visit-sec :focus-visible { outline-color: var(--mint); }
.visit-sec .sec-title { color: var(--white); }
.book-text { max-width: 40ch; margin-top: 20px; color: var(--on-deep-2); }
.tel-label { margin-top: clamp(40px, 6vw, 72px); font-size: 0.95rem; color: var(--on-deep-2); }
.big-tel {
  display: inline-block;
  margin-block: 6px 36px;
  font-size: clamp(3.4rem, 11vw, 9rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.045em;
  color: var(--white);
  text-decoration: none;
  transition: color 0.18s;
}
.big-tel:hover { color: var(--mint); }
html[lang="ar"] .big-tel { letter-spacing: -0.02em; }

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

.site-footer { padding-block: 64px 48px; font-size: 0.95rem; color: var(--ink-2); }
.ft { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 32px var(--col-gap); }
.ft-id { grid-column: 1 / span 5; display: grid; gap: 6px; align-content: start; }
.ft-mark { color: var(--ink); margin: 0 0 6px; }
.ft-col { grid-column: span 3; }
.ft-col + .ft-col { grid-column: span 3; }
.ft-title { margin-bottom: 12px; font-size: 0.95rem; font-weight: 600; color: var(--ink); }
.ft-links { display: grid; gap: 8px; justify-items: start; }
.ft-links a, .ft-langs a { text-decoration: none; }
.ft-links a:hover, .ft-langs a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.ft-bottom {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 28px;
  padding-top: 24px; border-top: 1px solid var(--line);
  font-size: 0.875rem;
}
.ft-credit { flex-basis: 100%; font-size: 0.8rem; }
.ft-credit a { text-decoration: none; }
.ft-credit a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ft-langs { display: flex; gap: 16px; margin-inline-start: auto; }
.ft-langs a[aria-current] { color: var(--ink); font-weight: 600; }

/* Phones and tablets: Call and WhatsApp always within reach. */
.callbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: none; gap: 8px;
  padding: 10px max(12px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: var(--porcelain);
  border-top: 1px solid var(--line);
  transition: transform 0.28s var(--ease-out);
}
.callbar a {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; border-radius: var(--radius-ctl);
  font-weight: 600; text-decoration: none;
}
.callbar a:first-child { background: var(--scrub); color: var(--white); }
.callbar a:last-child { border: 1.5px solid var(--line-strong); }

/* ------------------------------------------------------------------ 404 */

.nf { min-height: 100vh; min-height: 100svh; padding-block: 40px 80px; }
.nf-mark { margin-bottom: clamp(48px, 8vw, 96px); }
.nf-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px var(--col-gap); }
.nf-block { display: grid; gap: 16px; align-content: start; }
.nf-title { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 620; line-height: 1.1; letter-spacing: -0.03em; }
.nf-block:lang(ar) .nf-title { letter-spacing: 0; line-height: 1.4; }
.nf-block p { color: var(--ink-2); }
.nf-links { display: grid; gap: 10px; justify-items: start; margin-top: 8px; }

/* ------------------------------------------------------------------ layouts */

@media (max-width: 1180px) {
  .wm-alt { display: none; }
}

/* Tablets: still two columns, the text a little wider than the photographs. */
@media (max-width: 960px) {
  .site-nav { display: none; }
  .lang-full { display: none; }
  .lang-short { display: inline; }
  .head-tel { display: none; }
  .hero-copy { grid-column: 1 / span 7; }
  .hero-photo { grid-column: 8 / span 5; height: 520px; }
  .hero-card { inset-inline: 14px; bottom: 14px; max-width: none; padding: 14px 16px; font-size: 0.9rem; }
  .tx-title, .tx-diagram { grid-column: 1 / span 5; }
  .tx-list { grid-column: 6 / span 7; }
  .tips-art { grid-column: 1 / span 12; min-height: 0; height: 300px; }
  .tips-anim { width: auto; height: 86%; }
  html.has-anim .tips-main { grid-column: 1 / span 12; }
  .hero-name { font-size: clamp(2.8rem, 7vw, 4.4rem); }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts li { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 16px; padding-block: 16px; border-bottom: 1px solid var(--line); }
  .about-grid .sec-title { grid-column: 1 / span 12; position: static; }
  .about-body { grid-column: 1 / span 12; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps li:nth-child(2n)::before { right: 0; }
  html[dir="rtl"] .steps li:nth-child(2n)::before { left: 0; }
  .where-info, .map { grid-column: 1 / span 12; }
  .book-mark { top: auto; bottom: -40px; transform: none; width: 340px; }
  .ft-id { grid-column: 1 / span 12; }
  .ft-col, .ft-col + .ft-col { grid-column: span 6; }
  .ft-langs { margin-inline-start: 0; }
  .callbar { display: flex; }
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  /* With script: the bar waits until the opening buttons have scrolled away. */
  html.callbar-auto .callbar { transform: translateY(110%); }
  html.callbar-auto.callbar-on .callbar { transform: none; }
}

/* Phones: one column, each photograph above its section's text. */
@media (max-width: 720px) {
  :root { --head-h: 60px; --radius-panel: 20px; }
  .wm-name { font-size: 1rem; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .hero-copy { grid-column: 1; padding-block: 0; }
  .hero-mark { width: 64px; margin-bottom: 14px; }
  .hero-photo { grid-column: 1; height: auto; margin-top: 28px; }
  .hero-photo .photo { position: relative; aspect-ratio: 4 / 3; }
  .hero-card { position: relative; inset: auto; margin: -36px 12px 0; }
  .hero .actions .btn { flex: 1 1 100%; }
  .facts li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .urgent .actions { width: 100%; }
  .urgent .btn { flex: 1 1 0; padding-inline: 14px; }

  .tx-grid { display: block; }
  .tx-diagram {
    position: -webkit-sticky; position: sticky; top: var(--head-h); z-index: 5;
    height: 33vh; height: 33svh; max-height: 300px; margin-bottom: 12px;
    border-radius: 0 0 20px 20px;
  }
  .dg-cap { left: 12px; bottom: 10px; padding: 6px 12px 6px 10px; font-size: 0.85rem; }
  html[dir="rtl"] .dg-cap { left: auto; right: 12px; }
  html.has-dg .tx-item { min-height: 36vh; min-height: 36svh; }
  .tx-item { grid-template-columns: 48px minmax(0, 1fr); column-gap: 16px; padding-block: 22px; }
  .creds { gap: 8px; }
  .creds li { min-height: 96px; padding: 14px 10px; border-radius: 16px; }
  .creds img { height: 62px; }
  .creds .is-wide img { width: min(100%, 96px); }
  .tx-ico { width: 48px; height: 48px; border-radius: 14px; }
  .tx-ico svg { width: 28px; height: 28px; }

  .tips-art { height: 240px; }
  .book-mark { width: 240px; bottom: -30px; }
  html.has-anim .book-mark.is-ready { opacity: 0.2; }

  .steps { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .steps li { padding: 0 0 28px 64px; }
  html[dir="rtl"] .steps li { padding: 0 64px 28px 0; }
  .steps li::before, html[dir="rtl"] .steps li::before { top: 44px; bottom: 0; left: 21px; right: auto; width: 1px; height: auto; }
  html[dir="rtl"] .steps li::before { left: auto; right: 21px; }
  .steps li:last-child::before { display: none; }
  .map { height: 320px; border-radius: 20px; }
  .tips { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .ft-col, .ft-col + .ft-col { grid-column: 1 / span 12; }
  .nf-grid { grid-template-columns: minmax(0, 1fr); }
}

@supports not (aspect-ratio: 1) {
  .hero-mark { height: clamp(55px, 5.66vw, 74px); }
  .tips-anim { height: min(78%, 380px); }
  .book-mark { height: 30vw; }
  .dg { width: 52%; height: auto; }
  .dg::before { content: ""; display: block; padding-top: 167.25%; }
  @media (max-width: 720px) {
    .hero-photo .photo { height: 0; padding-top: 75%; }
    .dg { width: 18vh; }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* The diagram goes straight to each treatment's end state. */
  .tx-diagram * { animation-duration: 1ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; }
  .callbar, html.has-anim .anim { transition: none; }
}
