:root {
  --ink: #041c22;
  --sea: #0a3a45;
  --pearl: #f4f1e8;
  --sand: #d8b46a;
  --mint: #8fe3d0;
  --muted: rgba(244, 241, 232, .68);
  --line: rgba(244, 241, 232, .14);
  --display: "Alexandria", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --body: "IBM Plex Sans Arabic", system-ui, sans-serif;
  --gutter: clamp(20px, 6vw, 96px);
}

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--ink);
  color: var(--pearl);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.8;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }

.backdrop {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(60vmax 60vmax at 18% 30%, rgba(143, 227, 208, .13), transparent 62%),
    radial-gradient(50vmax 50vmax at 88% 85%, rgba(216, 180, 106, .10), transparent 60%),
    linear-gradient(160deg, #06262e 0%, var(--ink) 55%, #03151a 100%);
}
#stage {
  position: fixed; inset: 0; z-index: 1;
  width: 100%; height: 100%;
  pointer-events: none;
}
.no-webgl #stage { display: none; }
main, .footer { position: relative; z-index: 2; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: flex; align-items: center; gap: 28px;
  padding: 16px var(--gutter);
  transition: background .4s, backdrop-filter .4s, padding .4s;
}
.nav.scrolled {
  padding-block: 10px;
  background: rgba(4, 28, 34, .72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; margin-inline-end: auto; }
.brand-mark { width: 42px; height: 42px; color: var(--sand); flex: none; }
.brand-text { display: grid; line-height: 1.25; }
.brand-text strong { font-family: var(--display); font-weight: 700; font-size: 17px; }
.brand-text small { font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); font-family: system-ui, sans-serif; }
.nav-links { display: flex; gap: 26px; font-size: 15px; color: var(--muted); }
.nav-links a { transition: color .25s; }
.nav-links a:hover { color: var(--pearl); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 28px; border-radius: 999px; border: 1px solid var(--sand);
  background: var(--sand); color: #1d1503;
  font: 600 16px/1.2 var(--body); cursor: pointer;
  transition: transform .25s, box-shadow .25s, background .25s, color .25s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -10px rgba(216, 180, 106, .7); }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
.btn-ghost { background: transparent; color: var(--pearl); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--pearl); box-shadow: none; }
.btn-sm { padding: 10px 20px; font-size: 14.5px; }
.btn, .brand-text strong { white-space: nowrap; }

/* ---------- panels ---------- */
.panel {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: grid; align-items: center;
  padding: 110px var(--gutter) 70px;
}
.panel.tall { min-height: 220vh; display: block; padding-block: 0; }
.pin {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  display: grid; align-items: center;
  padding-block: 110px 70px;
}
.copy { max-width: 540px; justify-self: start; }
.flip .copy { justify-self: end; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 14px; letter-spacing: .04em; color: var(--mint);
  margin-bottom: 18px;
}
.eyebrow::before { content: ""; width: 34px; height: 1px; background: currentColor; opacity: .6; }
.eyebrow b { font-family: var(--display); font-weight: 500; color: var(--sand); }

h1, h2 { font-family: var(--display); font-weight: 800; line-height: 1.5; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: clamp(38px, 5.4vw, 76px); }
h2 { font-size: clamp(30px, 3.6vw, 52px); }
h1 em { font-style: normal; color: var(--sand); font-weight: 300; }
.lead { margin-top: 22px; color: var(--muted); font-size: clamp(16px, 1.25vw, 19px); max-width: 46ch; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.scroll-hint {
  position: absolute; bottom: 28px; inset-inline: 0; margin: auto; width: max-content;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 12.5px; color: var(--muted);
}
.scroll-hint span { width: 1px; height: 44px; background: linear-gradient(var(--sand), transparent); animation: drop 2s ease-in-out infinite; transform-origin: top; }
@keyframes drop { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* anatomy list */
.layers { margin-top: 30px; display: grid; gap: 4px; }
.layers li { display: flex; gap: 16px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--line); }
.layers i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); margin-top: 10px; flex: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 22%, transparent); }
.layers strong, .steps strong { display: block; font-family: var(--display); font-weight: 700; font-size: 18px; }
.layers span, .steps span { color: var(--muted); font-size: 15.5px; }

/* implant steps */
.steps { margin-top: 30px; counter-reset: s; display: grid; gap: 6px; }
.steps li {
  counter-increment: s; position: relative;
  padding: 14px 54px 14px 16px; border-radius: 16px;
  border: 1px solid transparent; opacity: .42;
  transition: opacity .4s, background .4s, border-color .4s, transform .4s;
}
.steps li::before {
  content: "0" counter(s); position: absolute; inset-inline-start: 16px; top: 16px;
  font: 500 15px var(--display); color: var(--sand);
}
.steps li.on { opacity: 1; background: rgba(244, 241, 232, .06); border-color: var(--line); transform: translateX(-6px); }

/* whitening meter */
.meter { margin-top: 32px; max-width: 420px; }
.meter-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; color: var(--muted); }
.meter-head output { font: 800 40px/1 var(--display); color: var(--pearl); direction: ltr; }
.meter-bar { margin-top: 14px; height: 10px; border-radius: 99px; background: linear-gradient(to left, #cdb264, #fff); position: relative; overflow: hidden; opacity: .95; }
.meter-bar i { position: absolute; inset-block: 0; inset-inline-end: 0; width: 100%; background: rgba(4, 28, 34, .78); transition: width .15s linear; }
.note { margin-top: 16px; font-size: 13px; color: var(--muted); opacity: .8; }

/* services */
.wrap { width: 100%; max-width: 1180px; margin-inline: auto; }
.section-head { margin-bottom: 44px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  padding: 30px 28px 32px; border-radius: 22px;
  background: rgba(8, 44, 53, .62);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  transition: transform .35s, border-color .35s, background .35s;
}
.card:hover { transform: translateY(-6px); border-color: rgba(216, 180, 106, .55); background: rgba(10, 58, 69, .8); }
.card b { font: 300 34px/1 var(--display); color: var(--sand); }
.card h3 { font: 700 21px/1.4 var(--display); margin: 18px 0 8px; }
.card p { color: var(--muted); font-size: 15.5px; }

/* contact */
.phone {
  display: inline-block; margin-top: 22px;
  font: 800 clamp(34px, 4.6vw, 62px)/1.1 var(--display); color: var(--sand);
}
/* nav "موقعنا" lands with the address mid-screen, i.e. the whole contact panel in view */
.address {
  scroll-margin-top: 50vh;
  display: flex; align-items: center; gap: 10px; width: fit-content;
  margin-top: 14px; color: var(--muted); font-size: 16px;
  transition: color .25s;
}
.address:hover { color: var(--pearl); }
.address svg { width: 22px; height: 22px; flex: none; color: var(--mint); }
.book { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.book label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.book input, .book select {
  width: 100%; padding: 13px 16px; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(244, 241, 232, .06);
  color: var(--pearl); font: 400 16px var(--body);
}
.book select option { color: #111; }
.book .actions { grid-column: 1 / -1; margin-top: 8px; }
.book .wide, .form-note { grid-column: 1 / -1; }
.book-lead { margin-top: 16px; }
.book select:invalid { color: var(--muted); }
.form-note { font-size: 13px; color: var(--muted); }
.form-note:empty { display: none; }
.form-note.ok { color: var(--mint); }
.form-note.err { color: #f0a59a; }
.btn:disabled { opacity: .6; cursor: progress; }

.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  padding: 26px var(--gutter); border-top: 1px solid var(--line);
  font-size: 14px; color: var(--muted); background: rgba(3, 21, 26, .7);
}

/* side dots */
.dots { position: fixed; inset-inline-end: 22px; top: 50%; transform: translateY(-50%); z-index: 9; display: grid; gap: 12px; }
.dots a { width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: background .3s, transform .3s; }
.dots a.on { background: var(--sand); transform: scale(1.6); }

/* reveal */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s cubic-bezier(.2, .7, .2, 1), transform .9s cubic-bezier(.2, .7, .2, 1); }
.reveal.in { opacity: 1; transform: none; }
.cards .reveal:nth-child(2) { transition-delay: .08s; }
.cards .reveal:nth-child(3) { transition-delay: .16s; }
.cards .reveal:nth-child(5) { transition-delay: .08s; }
.cards .reveal:nth-child(6) { transition-delay: .16s; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .nav-links { display: none; }
  .cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  body { font-size: 16px; }
  .dots { display: none; }
  .brand-text small { display: none; }
  .panel:not(.full), .pin { align-items: end; padding-bottom: 28px; }
  .panel.tall { padding-bottom: 0; }
  .copy, .flip .copy {
    justify-self: stretch; max-width: none;
    padding: 22px 20px 24px; border-radius: 24px;
    background: rgba(4, 28, 34, .66);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--line);
  }
  .lead { margin-top: 12px; }
  h1 { font-size: 34px; }
  h2 { font-size: 26px; }
  .eyebrow { margin-bottom: 10px; }
  .phone { margin-top: 12px; }
  .book { margin-top: 16px; gap: 10px; }
  .actions { margin-top: 20px; }
  .layers, .steps, .meter { margin-top: 16px; }
  .layers li { padding: 9px 0; }
  /* keep the card short so the model above it stays visible */
  .steps li { padding-block: 9px; }
  .steps li:not(.on) { display: none; }
  .steps li.on { transform: none; }
  .tall .lead { display: none; }
  .scroll-hint { display: none; }
  .book { grid-template-columns: 1fr; }
  .btn { padding: 13px 22px; }
}
@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr; }
  .nav .btn-sm { padding: 9px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { transition: none; opacity: 1; transform: none; }
  .scroll-hint span { animation: none; }
}
