:root {
  color-scheme: light;
  --ink: #202124;
  --charcoal: #34343b;
  --graphite: #56565e;
  --muted: #716d68;
  --paper: #f7f4ee;
  --white: #ffffff;
  --line: #e4ddd2;
  --orange: #f58220;
  --orange-dark: #af5514;
  --gold: #f7b84a;
  --mist: #fff8ee;
  --shadow: 0 24px 70px rgba(32, 33, 36, 0.18);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

body[data-language="ar"] {
  font-family: "IBM Plex Sans Arabic", "Noto Kufi Arabic", "Noto Sans Arabic", "Cairo", "Tajawal", "Segoe UI", Tahoma, Arial, sans-serif;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.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;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto minmax(170px, 1fr);
  align-items: center;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  color: var(--white);
  transition: background 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.site-header.is-elevated {
  color: var(--charcoal);
  background: rgba(247, 244, 238, 0.94);
  box-shadow: 0 1px 0 rgba(32, 33, 36, 0.08);
  backdrop-filter: blur(16px);
}

.brand {
  width: clamp(90px, 8vw, 130px);
  height: auto;
  display: grid;
  align-items: center;
  overflow: visible;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.site-header.is-elevated .brand {
  opacity: 1;
  pointer-events: auto;
}

.brand img {
  grid-area: 1 / 1;
  width: 100%;
  height: auto;
  object-fit: contain;
  transition: opacity 200ms ease;
}

.logo-dark {
  opacity: 0;
}

.site-header.is-elevated .logo-light {
  opacity: 0;
}

.site-header.is-elevated .logo-dark {
  opacity: 1;
}

nav,
.header-tools,
.hero-actions,
.clientele {
  display: flex;
  align-items: center;
}

nav {
  gap: clamp(16px, 3vw, 34px);
  font-size: 0.95rem;
  font-weight: 850;
}

.header-tools {
  justify-self: end;
  gap: 10px;
}

.language-toggle,
.header-action,
.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 900;
}

.language-toggle {
  padding: 10px 14px;
  color: inherit;
  border: 1px solid currentColor;
  background: transparent;
  cursor: pointer;
}

.header-action {
  padding: 10px 18px;
  color: var(--white);
  background: var(--orange);
}

.site-header.is-elevated .header-action {
  color: var(--white);
}

.nav-toggle {
  display: none;
  width: 46px;
  height: 46px;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 180ms ease, opacity 180ms ease;
}

.site-header.nav-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-header.nav-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.site-header.nav-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.hero {
  position: relative;
  min-height: 92vh;
  min-height: 92dvh;
  display: grid;
  align-items: center;
  overflow: hidden;
  padding-bottom: 110px;
  background: var(--charcoal);
}

.hero-image,
.hero-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-image {
  object-fit: cover;
  transform-origin: center;
  animation: hero-zoom 22s var(--ease-out-quart) forwards;
}

@keyframes hero-zoom {
  from { transform: scale(1); }
  to { transform: scale(1.045); }
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(32, 33, 36, 0.88) 0%, rgba(32, 33, 36, 0.68) 38%, rgba(32, 33, 36, 0.16) 72%),
    linear-gradient(0deg, rgba(245, 130, 32, 0.2), rgba(32, 33, 36, 0.02));
}

[dir="rtl"] .hero-overlay {
  background:
    linear-gradient(270deg, rgba(32, 33, 36, 0.88) 0%, rgba(32, 33, 36, 0.68) 38%, rgba(32, 33, 36, 0.16) 72%),
    linear-gradient(0deg, rgba(245, 130, 32, 0.2), rgba(32, 33, 36, 0.02));
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(770px, calc(100% - 36px));
  margin-inline-start: clamp(18px, 7vw, 96px);
  padding-top: 86px;
  color: var(--white);
}

.hero-brand,
.hero-content h1,
.hero-copy,
.hero-actions {
  opacity: 0;
  animation: hero-rise 800ms var(--ease-out-quart) forwards;
}

.hero-brand { animation-delay: 120ms; }
.hero-content h1 { animation-delay: 300ms; }
.hero-copy { animation-delay: 460ms; }
.hero-actions { animation-delay: 600ms; }

@keyframes hero-rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-brand {
  width: min(540px, 82vw);
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-bottom: 42px;
  background: transparent;
  box-shadow: none;
}

.hero-brand img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.hero-brand .eyebrow {
  margin: 0;
  color: var(--orange);
  font-size: clamp(1.35rem, 2.1vw, 2.05rem);
  font-weight: 850;
  line-height: 1.18;
  text-align: center;
  text-transform: none;
  width: 100%;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.42);
}

.brand-underline {
  width: min(112px, 32%);
  height: 3px;
  margin-top: 8px;
  border-radius: 999px;
  background: var(--orange);
  box-shadow: 0 6px 20px rgba(245, 130, 32, 0.42);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--orange);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

[dir="rtl"] .eyebrow {
  text-transform: none;
}

[dir="rtl"] .hero-brand .eyebrow {
  font-size: clamp(1.2rem, 1.9vw, 1.78rem);
}

h1,
h2,
h3,
p,
span,
a {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 13ch;
  margin: 0;
  font-size: clamp(2.8rem, 6.45vw, 5.45rem);
  line-height: 1.07;
  letter-spacing: 0;
}

[dir="rtl"] h1 {
  max-width: 15ch;
  line-height: 1.24;
  font-weight: 900;
}

h2 {
  margin: 0;
  color: var(--charcoal);
  font-size: clamp(2rem, 4.8vw, 4.6rem);
  line-height: 1.1;
  letter-spacing: 0;
}

[dir="rtl"] h2 {
  line-height: 1.28;
  font-weight: 850;
}

h3 {
  margin: 0 0 10px;
  color: var(--charcoal);
  font-size: 1.25rem;
}

.hero-copy {
  width: min(620px, 100%);
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: clamp(1.06rem, 2vw, 1.24rem);
  line-height: 1.65;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  padding: 12px 18px;
  border: 1px solid transparent;
}

.button.primary {
  color: var(--ink);
  background: var(--orange);
  box-shadow: 0 14px 30px rgba(245, 130, 32, 0.3);
}

.button.secondary {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.46);
  background: rgba(255, 255, 255, 0.08);
}

.quick-panel {
  width: min(1120px, calc(100% - 36px));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: -58px auto 0;
  position: relative;
  z-index: 3;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  box-shadow: var(--shadow);
}

.quick-panel article {
  min-height: 132px;
  padding: clamp(22px, 4vw, 34px);
  background: var(--white);
}

.quick-panel strong {
  display: block;
  color: var(--orange);
  font-size: clamp(1.7rem, 4vw, 3.2rem);
  line-height: 1;
}

.quick-panel span,
.section-copy p,
.mission-band p,
.service-cards p,
.quality p,
.branch-card p,
.branch-card span,
.contact p,
.contact-panel span {
  color: var(--muted);
  line-height: 1.65;
}

.branch-card p {
  text-wrap: balance;
}

.section,
.mission-band,
.quality,
.contact {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.section {
  padding: clamp(80px, 12vw, 138px) 0;
}

.intro,
.quality,
.contact,
.home-visit {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(34px, 7vw, 86px);
  align-items: center;
}

.section-copy p {
  max-width: 620px;
  font-size: 1.04rem;
}

.photo-mosaic {
  display: grid;
  grid-template-columns: 1.05fr 0.85fr;
  grid-template-rows: 230px 230px;
  gap: 14px;
}

.photo-mosaic img,
.service-cards img,
.quality > img,
.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-mosaic img {
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.photo-mosaic .large {
  grid-row: span 2;
}

.mission-band {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(32px, 7vw, 78px);
  align-items: center;
  padding: clamp(48px, 6vw, 80px) clamp(20px, 5vw, 72px);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(245, 130, 32, 0.96), rgba(247, 184, 74, 0.92)),
    var(--orange);
  box-shadow: var(--shadow);
}

.mission-band h2,
.mission-band p,
.mission-band .eyebrow {
  color: var(--white);
}

.mission-band p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
}

.section-heading {
  max-width: 850px;
  margin-bottom: 34px;
}

.department-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.department-grid span,
.clientele span {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  font-weight: 950;
}

.department-grid span {
  color: var(--charcoal);
  border: 1px solid rgba(245, 130, 32, 0.24);
  background: linear-gradient(180deg, var(--white), var(--mist));
}

.service-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 34px;
}

.service-cards article,
.branch-card,
.contact-panel,
.home-visit-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 1px 0 rgba(32, 33, 36, 0.03);
}

.service-cards article {
  overflow: hidden;
}

.service-cards img {
  height: 260px;
}

.service-cards h3,
.service-cards p {
  margin-inline: 24px;
}

.service-cards h3 {
  margin-top: 24px;
}

.service-cards p {
  margin-bottom: 26px;
}

.quality {
  padding: clamp(80px, 12vw, 138px) 0;
}

.quality > img {
  min-height: 540px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.clientele {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.clientele span {
  min-height: 48px;
  color: var(--orange-dark);
  border: 1px solid rgba(245, 130, 32, 0.24);
  background: var(--mist);
}

.gallery {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
  grid-auto-rows: 260px;
  gap: 14px;
  padding-top: 0;
}

.gallery img {
  border-radius: 8px;
}

.gallery img:first-child {
  grid-row: span 2;
}

.branch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.branch-card {
  min-height: 560px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
}

.branch-map {
  width: 100%;
  height: 200px;
  border: 0;
  border-radius: 8px;
}

.branch-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.branch-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--orange-dark);
}

.branch-hours,
.branch-phones {
  display: grid;
  gap: 2px;
}

.branch-card .branch-directions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid rgba(245, 130, 32, 0.24);
  border-radius: 8px;
  background: var(--mist);
  text-align: center;
  margin-top: auto;
}

.branch-card a,
.contact-panel a:not(.button) {
  color: var(--orange-dark);
  font-weight: 950;
}

.contact {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(34px, 7vw, 86px);
  align-items: center;
  padding: clamp(48px, 6vw, 80px) clamp(20px, 5vw, 72px);
  border-radius: 8px;
  background: var(--charcoal);
  box-shadow: var(--shadow);
}

.contact .eyebrow {
  color: var(--orange);
}

.contact h2 {
  color: var(--white);
}

.contact > div > p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
}

.medical-disclaimer {
  width: min(880px, calc(100% - 36px));
  margin: 0 auto;
  padding: 24px 0 max(56px, calc(20px + env(safe-area-inset-bottom) + 100px));
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.7;
  text-align: center;
}

.contact-panel,
.home-visit-panel {
  display: grid;
  gap: 16px;
  padding: clamp(20px, 3vw, 30px);
  box-shadow: var(--shadow);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(245, 130, 32, 0.32);
  outline-offset: 3px;
}

.quick-panel-link {
  display: contents;
}

.form-fields {
  display: grid;
  gap: 18px;
}

.form-fields[hidden] {
  display: none;
}

.form-row {
  display: grid;
  gap: 8px;
}

.form-row-split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.form-row label {
  font-weight: 950;
  font-size: 0.92rem;
  color: var(--charcoal);
}

.form-row input,
.form-row select,
.form-row textarea {
  font: inherit;
  color: var(--ink);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.form-row textarea {
  resize: vertical;
  min-height: 90px;
}

.home-visit-panel button.button {
  width: 100%;
  border: 1px solid transparent;
  cursor: pointer;
  appearance: none;
}

.home-visit-panel button.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-message {
  padding: 12px 14px;
  border-radius: 8px;
  font-weight: 900;
}

.form-message.is-success {
  color: #1c6b3c;
  background: rgba(28, 107, 60, 0.1);
}

.form-message.is-error {
  color: #b3261e;
  background: rgba(179, 38, 30, 0.1);
}

@media (max-width: 1020px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .nav-toggle {
    display: inline-flex;
  }

  nav {
    display: none;
    position: absolute;
    inset-inline: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    padding: 8px clamp(18px, 4vw, 56px) 18px;
    background: rgba(247, 244, 238, 0.98);
    backdrop-filter: blur(16px);
    box-shadow: 0 16px 30px rgba(32, 33, 36, 0.16);
  }

  .site-header.nav-open nav {
    display: flex;
  }

  nav a {
    padding: 14px 4px;
    color: var(--charcoal);
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
  }

  nav a:last-child {
    border-bottom: none;
  }

  .department-grid,
  .service-cards,
  .branch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .site-header {
    gap: 12px;
    padding-inline: 14px;
  }

  .brand {
    width: 84px;
    height: auto;
  }

  .language-toggle,
  .header-action {
    min-height: 42px;
    padding: 9px 11px;
    font-size: 0.88rem;
  }

  .hero {
    min-height: 92vh;
  }

  .hero-content {
    padding-top: 112px;
  }

  .hero-brand {
    width: min(350px, 78vw);
  }

  h1 {
    font-size: clamp(2.35rem, 10.7vw, 3.8rem);
  }

  .quick-panel,
  .intro,
  .mission-band,
  .quality,
  .contact,
  .home-visit,
  .department-grid,
  .service-cards,
  .branch-grid,
  .gallery,
  .form-row-split {
    grid-template-columns: 1fr;
  }

  .quick-panel {
    margin-top: -34px;
  }

  .photo-mosaic {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(3, 230px);
  }

  .photo-mosaic .large,
  .gallery img:first-child {
    grid-row: auto;
  }

  .quality > img {
    min-height: 320px;
  }

  .gallery {
    grid-auto-rows: 240px;
  }

  .medical-disclaimer {
    font-size: 0.78rem;
  }
}

@media (max-width: 420px) {
  .site-header {
    gap: 8px;
    padding-inline: 10px;
  }

  .brand {
    width: 70px;
    height: auto;
  }

  .header-tools {
    gap: 6px;
  }

  .language-toggle,
  .header-action {
    padding: 8px 9px;
    font-size: 0.8rem;
  }

  .nav-toggle {
    width: 40px;
    height: 40px;
  }

  .hero-content {
    padding-top: 100px;
  }

  h1 {
    font-size: clamp(2rem, 11vw, 3rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }

  .hero-brand,
  .hero-content h1,
  .hero-copy,
  .hero-actions,
  .has-scroll-reveal .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}

/*
  Scroll reveal system. Elements are fully visible by default — the
  hidden -> visible transition only applies once script.js confirms
  IntersectionObserver support and adds `.has-scroll-reveal` to <html>,
  so no-JS visitors and reduced-motion visitors always see full content.
*/
.has-scroll-reveal .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 650ms var(--ease-out-quart), transform 650ms var(--ease-out-quart);
  transition-delay: calc(var(--i, 0) * 70ms);
}

.has-scroll-reveal .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Photos: scale + fade instead of rise */
.has-scroll-reveal .reveal--photo {
  transform: scale(0.96);
  transition-duration: 750ms;
  transition-delay: calc(var(--i, 0) * 90ms);
}

/* Pills / tags: quick fade + gentle pop, fast stagger */
.has-scroll-reveal .reveal--pill {
  transform: scale(0.92);
  transition-duration: 400ms;
  transition-delay: calc(var(--i, 0) * 35ms);
}

/* Branch cards: lighter, quicker than the service cards — logistical, not persuasive */
.has-scroll-reveal .reveal--light {
  transform: translateY(16px);
  transition-duration: 400ms;
}

/* Mission band: one weighty scale + fade, no rise */
.has-scroll-reveal .reveal--band {
  transform: scale(0.97);
  transition-duration: 750ms;
  transition-timing-function: var(--ease-out-quint);
}

/* Quality photo: directional slide, mirrors for RTL */
.has-scroll-reveal .reveal--side {
  transform: translateX(-32px);
  transition-duration: 750ms;
}

[dir="rtl"] .has-scroll-reveal .reveal--side {
  transform: translateX(32px);
}

/* Fine print: quiet fade only, no movement */
.has-scroll-reveal .reveal--fade {
  transform: none;
  transition-duration: 500ms;
}

/* Service card imagery gets a subtle inner scale as the card reveals */
.has-scroll-reveal .service-cards article img {
  transform: scale(1.08);
  transition: transform 750ms var(--ease-out-quart);
}

.has-scroll-reveal .service-cards article.is-visible img {
  transform: scale(1);
}

.whatsapp-fab {
  position: fixed;
  inset-block-end: max(20px, env(safe-area-inset-bottom));
  inset-inline-end: 20px;
  z-index: 15;
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #25d366;
  color: var(--white);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.whatsapp-fab svg {
  width: 32px;
  height: 32px;
}

.whatsapp-fab:hover,
.whatsapp-fab:focus-visible {
  transform: scale(1.06);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.34);
}

@media (max-width: 760px) {
  .whatsapp-fab {
    width: 72px;
    height: 72px;
    inset-inline-end: 16px;
    inset-block-end: max(18px, env(safe-area-inset-bottom));
  }

  .whatsapp-fab svg {
    width: 38px;
    height: 38px;
  }
}
