/* Dr Ali Khazzaal — site styles. Fonts and tokens first, then base, layout, sections, components, motion. */

/* Self-hosted (SIL OFL) Latin subsets: no render-blocking third-party CSS. Arabic uses system fonts. */
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/dm-sans-latin.woff2") format("woff2");
  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: "Manrope";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../assets/fonts/manrope-800-latin.woff2") format("woff2");
  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 {
  /* Color */
  --navy: #15172d;
  --navy-80: #3d4060;
  --indigo: #5141d8;
  --indigo-deep: #3e2fbf;
  --lavender: #f1eefc;
  --lavender-deep: #e3dcfa;
  --yellow: #ffce43;
  --yellow-deep: #f4bd1f;
  --white: #ffffff;
  --line: #e4e1f2;
  --danger: #b4232f;
  --success: #17794a;

  /* Type */
  --font-head: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "DM Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-ar: "Segoe UI", "Noto Sans Arabic", Tahoma, "Geeza Pro", sans-serif;
  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --text-lg: clamp(1.125rem, 0.6vw + 1rem, 1.3125rem);
  --h1: clamp(2.5rem, 3.6vw + 1.2rem, 4.6rem);
  --h2: clamp(2rem, 2.8vw + 1.1rem, 3.5rem);
  --h3: 1.25rem;

  /* Space (4px-based) */
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --s7: 3rem;
  --s8: 4rem;
  --s9: 6rem;
  --s10: 8rem;

  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 32px;
  --pill: 999px;
  --shadow: 0 1px 2px rgb(21 23 45 / 0.06), 0 12px 32px -12px rgb(21 23 45 / 0.18);
  --shadow-lg: 0 30px 60px -24px rgb(33 24 110 / 0.35);
  --header-h: 76px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --container: 1200px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --gutter: clamp(var(--s4), 4vw, var(--s6));
  color-scheme: light;
}

/* ---------- Base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--navy);
  background: var(--white);
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
svg { flex-shrink: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}
h2 { font-size: var(--h2); }
h3 { font-size: var(--h3); letter-spacing: -0.01em; line-height: 1.25; }
p { margin: 0; text-wrap: pretty; }

a { color: var(--indigo); text-underline-offset: 0.18em; }
a:hover { color: var(--indigo-deep); }

:focus-visible {
  outline: 3px solid var(--indigo);
  outline-offset: 3px;
  border-radius: 6px;
}

[id] { scroll-margin-top: calc(var(--header-h) + var(--safe-top) + var(--s4)); }
[hidden] { display: none !important; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: max(var(--s4), var(--safe-left));
  top: -100px;
  z-index: 100;
  padding: var(--s3) var(--s5);
  background: var(--navy);
  color: var(--white);
  border-radius: var(--pill);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: var(--s3); color: var(--white); }

main:focus { outline: none; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  /* Keep content clear of the notch / rounded corners in landscape. */
  padding-left: max(var(--gutter), var(--safe-left));
  padding-right: max(var(--gutter), var(--safe-right));
}

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--indigo);
  margin-bottom: var(--s4);
}

.section { padding-block: clamp(var(--s7), 8vw, var(--s9)); }

.section-head { max-width: 46rem; margin-bottom: clamp(var(--s6), 5vw, var(--s8)); }
.section-head--split {
  max-width: none;
  display: grid;
  gap: var(--s4) var(--s8);
  align-items: end;
}
.section-intro {
  margin-top: var(--s4);
  font-size: var(--text-lg);
  color: var(--navy-80);
  max-width: 38rem;
}
.section-head--split .section-intro { margin-top: 0; }

.note {
  margin-top: var(--s6);
  font-size: var(--text-sm);
  color: var(--navy-80);
  max-width: 65ch;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 52px;
  padding: 0.8rem 1.6rem;
  border: 2px solid transparent;
  border-radius: var(--pill);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 0.25s var(--ease), background-color 0.2s, box-shadow 0.25s var(--ease), color 0.2s, border-color 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn svg { transition: transform 0.25s var(--ease); }
.btn:hover svg { transform: translateX(3px); }

.btn-book { background: var(--yellow); color: var(--navy); box-shadow: 0 10px 24px -12px rgb(244 189 31 / 0.9); }
.btn-book:hover { background: var(--yellow-deep); color: var(--navy); }
.btn-primary { background: var(--indigo); color: var(--white); }
.btn-primary:hover { background: var(--indigo-deep); color: var(--white); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--indigo); color: var(--indigo); }
.btn-whatsapp { background: var(--navy); color: var(--white); }
.btn-whatsapp:hover { background: #262a4d; color: var(--white); }
.btn-whatsapp svg { color: #25d366; }
.btn-whatsapp:hover svg { transform: none; }
.btn-sm { min-height: 44px; padding: 0.55rem 1.2rem; font-size: 0.9375rem; }
.btn-block { width: 100%; }

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  min-height: 44px;
  padding: 0;
  background: none;
  border: 0;
  font-weight: 700;
  color: var(--indigo);
}
.btn-link svg { transition: transform 0.25s var(--ease); }
.btn-link:hover svg { transform: translateX(4px); }

.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  min-height: 44px;
  min-width: 44px;
  padding: 0 var(--s4);
  border-radius: var(--pill);
  border: 1.5px solid var(--line);
  background: var(--white);
  font-weight: 700;
  font-size: var(--text-sm);
  transition: border-color 0.2s, color 0.2s;
}
.btn-icon:hover { border-color: var(--indigo); color: var(--indigo); }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: var(--safe-top);
  background: rgb(255 255 255 / 0.86);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.site-header.is-scrolled { border-color: var(--line); box-shadow: 0 8px 24px -20px rgb(21 23 45 / 0.4); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
  color: var(--navy);
  text-decoration: none;
  min-height: 44px;
}
.brand:hover { color: var(--navy); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--lavender);
  color: var(--indigo);
}
.brand-mark svg { width: 34px; height: 34px; }
.brand-text { display: grid; line-height: 1.15; }
.brand-name { font-family: var(--font-head); font-weight: 800; font-size: 1.0625rem; letter-spacing: 0.04em; }
.brand-tag { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.1em; color: var(--navy-80); }

.menu-toggle {
  display: none;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--white);
}
.menu-toggle-bars,
.menu-toggle-bars::before,
.menu-toggle-bars::after {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--navy);
  transition: transform 0.3s var(--ease), opacity 0.2s;
}
.menu-toggle-bars { position: relative; }
.menu-toggle-bars::before,
.menu-toggle-bars::after { content: ""; position: absolute; left: 0; }
.menu-toggle-bars::before { top: -6px; }
.menu-toggle-bars::after { top: 6px; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

.site-menu { display: flex; align-items: center; gap: var(--s5); }
.nav-list { display: flex; gap: var(--s1); list-style: none; margin: 0; padding: 0; }
.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--s3);
  color: var(--navy);
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--pill);
}
.nav-link::after {
  content: "";
  position: absolute;
  left: var(--s3);
  right: var(--s3);
  bottom: 6px;
  height: 2px;
  border-radius: 2px;
  background: var(--indigo);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.nav-link:hover { color: var(--indigo); }
.nav-link:hover::after,
.nav-link[aria-current]::after { transform: scaleX(1); }
.nav-link[aria-current] { color: var(--indigo); font-weight: 700; }
.menu-contact { display: none; }

@media (max-width: 1079px) {
  .menu-toggle { display: grid; }
  .site-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: var(--s4);
    padding: var(--s4) max(var(--gutter), var(--safe-right)) calc(var(--s6) + var(--safe-bottom)) max(var(--gutter), var(--safe-left));
    background: var(--white);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px -24px rgb(21 23 45 / 0.35);
    max-height: calc(100dvh - var(--header-h) - var(--safe-top));
    overflow-y: auto;
  }
  .site-menu.is-open { display: flex; animation: menu-in 0.28s var(--ease); }
  .nav-list { flex-direction: column; }
  .nav-link { width: 100%; min-height: 52px; font-size: 1.125rem; padding-inline: var(--s3); }
  .nav-link::after { display: none; }
  .nav-link[aria-current] { background: var(--lavender); }
  .menu-contact {
    display: grid;
    gap: var(--s2);
    padding-top: var(--s4);
    border-top: 1px solid var(--line);
  }
  .menu-contact-link {
    display: flex;
    align-items: center;
    gap: var(--s3);
    min-height: 48px;
    padding: 0 var(--s3);
    color: var(--navy);
    font-weight: 700;
    text-decoration: none;
    border-radius: var(--radius-sm);
  }
  .menu-contact-link svg { color: var(--indigo); }
  .menu-contact-link:hover { background: var(--lavender); color: var(--navy); }
  .site-menu .btn-book { min-height: 52px; }
}

.brand,
.brand-text { min-width: 0; }
.header-inner .brand { flex: 1 1 auto; }
.menu-toggle { flex: none; }

@media (max-width: 420px) {
  .brand-tag { font-size: 0.625rem; letter-spacing: 0.04em; }
  .brand-name { font-size: 0.9375rem; }
}
@media (max-width: 340px) {
  .header-inner { gap: var(--s3); }
  .brand { gap: var(--s2); }
  .brand-mark { width: 40px; height: 40px; border-radius: 12px; }
  .brand-mark svg { width: 30px; height: 30px; }
  .brand-tag { line-height: 1.25; letter-spacing: 0.03em; text-wrap: balance; }
}

/* Short landscape phones: slimmer header, two-column menu panel. */
@media (max-height: 520px) and (min-width: 560px) {
  :root { --header-h: 60px; }
  .menu-toggle { width: 44px; height: 44px; }
}
@media (max-height: 520px) and (min-width: 560px) and (max-width: 1079px) {
  .site-menu.is-open {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    column-gap: var(--s6);
    row-gap: var(--s2);
    padding-top: var(--s3);
    padding-bottom: calc(var(--s4) + var(--safe-bottom));
  }
  .nav-list { grid-row: 1 / span 2; gap: 0; }
  .nav-link { min-height: 44px; font-size: 1.0625rem; }
  .menu-contact { padding-top: 0; border-top: 0; gap: 0; align-self: start; }
  .menu-contact-link { min-height: 44px; }
  .site-menu .btn-book { min-height: 48px; align-self: end; }
}

@keyframes menu-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding-block: clamp(var(--s6), 6vw, var(--s9)) clamp(var(--s8), 8vw, var(--s10));
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto 45%;
  height: 120%;
  background: radial-gradient(closest-side, rgb(81 65 216 / 0.14), transparent 70%), radial-gradient(closest-side at 70% 60%, var(--lavender-deep), transparent 75%);
  z-index: -1;
  pointer-events: none;
}

.hero-grid {
  display: grid;
  gap: clamp(var(--s7), 6vw, var(--s9));
  align-items: center;
}

.hero-title { font-size: var(--h1); letter-spacing: -0.035em; line-height: 1.02; }
.hero-title .line { display: block; }
.hero-title .accent { color: var(--indigo); }

.lede {
  margin-top: var(--s5);
  font-size: var(--text-lg);
  color: var(--navy-80);
  max-width: 34rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s6); }

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3) var(--s5);
  margin: var(--s7) 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-sm);
  font-weight: 500;
}
.hero-points li { display: inline-flex; align-items: center; gap: var(--s2); }
.hero-points svg { color: var(--indigo); }

.hero-media {
  position: relative;
  margin: 0;
  justify-self: center;
  width: min(100%, 440px);
}
.hero-photo {
  aspect-ratio: 468 / 600;
  border-radius: 220px 220px var(--radius-lg) var(--radius-lg);
  overflow: hidden;
  background: var(--lavender);
  box-shadow: var(--shadow-lg);
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }

.hero-badge {
  position: absolute;
  left: -8%;
  bottom: 14%;
  display: flex;
  align-items: center;
  gap: var(--s3);
  max-width: 15rem;
  padding: var(--s3) var(--s4) var(--s3) var(--s3);
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.9375rem;
  line-height: 1.25;
  animation: float 6s ease-in-out infinite;
}
.hero-badge svg {
  width: 40px;
  height: 40px;
  padding: 6px;
  border-radius: 12px;
  background: var(--indigo);
  color: var(--white);
}
.hero-name {
  position: absolute;
  right: -4%;
  top: 10%;
  padding: var(--s2) var(--s4);
  background: var(--navy);
  color: var(--white);
  border-radius: var(--pill);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@media (min-width: 960px) {
  .hero-grid { grid-template-columns: 1.15fr 0.85fr; }
  .hero-media { justify-self: end; }
}
@media (max-width: 520px) {
  .hero-title { font-size: clamp(1.9rem, calc((100vw - 2rem) / 8.2), 2.6rem); }
  .hero-badge { left: 0; bottom: 6%; max-width: 13rem; font-size: 0.875rem; }
  .hero-name { right: 0; }
  .hero-actions .btn { width: 100%; }
  .hero-points { margin-top: var(--s6); }
  .hero-grid { gap: var(--s6); }
}

/* Landscape phones: two columns so the photo never becomes a full-width giant. */
@media (max-height: 520px) and (min-width: 560px) {
  .hero { padding-block: var(--s5) var(--s7); }
  .hero-grid { grid-template-columns: minmax(0, 1fr) auto; gap: var(--s6); align-items: center; }
  .hero-title { font-size: clamp(1.9rem, 4.6vw, 2.75rem); }
  .eyebrow { margin-bottom: var(--s3); }
  .lede { margin-top: var(--s3); font-size: 1.0625rem; }
  .hero-actions { margin-top: var(--s4); }
  .hero-actions .btn { width: auto; }
  .hero-points { margin-top: var(--s4); gap: var(--s2) var(--s4); }
  .hero-media { width: clamp(11rem, 30vw, 15rem); justify-self: end; margin-right: var(--s5); }
  .hero-badge { left: -8%; bottom: 8%; max-width: 11.5rem; font-size: 0.8125rem; padding: var(--s2) var(--s3) var(--s2) var(--s2); }
  .hero-badge svg { width: 32px; height: 32px; padding: 5px; }
  .hero-name { right: -6%; top: 6%; }
}

/* ---------- Procedures ---------- */

.procedures { background: linear-gradient(180deg, var(--white), var(--lavender) 40%, var(--lavender)); }

.procedure-grid { display: grid; gap: var(--s4); }

.procedure {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  padding: clamp(var(--s5), 3vw, var(--s6));
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.procedure:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.procedure p { color: var(--navy-80); flex-grow: 1; }
.procedure .btn-link { align-self: flex-start; }
.procedure-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: var(--s3);
  border-radius: 20px;
  background: var(--lavender);
  color: var(--indigo);
}

.procedure--featured { background: var(--indigo); border-color: var(--indigo); color: var(--white); }
.procedure--featured p { color: rgb(255 255 255 / 0.86); }
.procedure--featured .procedure-icon { background: rgb(255 255 255 / 0.14); color: var(--white); }
.procedure--featured .btn-link { color: var(--yellow); }
.procedure--featured .btn-link:focus-visible { outline-color: var(--yellow); }

@media (max-width: 380px) {
  .procedure { padding: var(--s5) var(--s4); }
}
@media (min-width: 540px) and (max-width: 859px) {
  .procedure-grid { grid-template-columns: 1fr 1fr; }
  .procedure:last-child { grid-column: 1 / -1; }
}
@media (min-width: 860px) {
  .procedure-grid { grid-template-columns: 1fr 1.08fr 1fr; align-items: stretch; }
  .procedure--featured { transform: translateY(calc(-1 * var(--s5))); }
  .procedure--featured:hover { transform: translateY(calc(-1 * var(--s5) - 4px)); }
}

/* ---------- Approach ---------- */

.approach-grid { display: grid; gap: clamp(var(--s7), 6vw, var(--s9)); align-items: center; }

.approach-media { margin: 0; position: relative; }
.approach-media img {
  width: 100%;
  aspect-ratio: 636 / 462;
  object-fit: cover;
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 140px;
  box-shadow: var(--shadow-lg);
}
.approach-media figcaption { margin-top: var(--s3); font-size: var(--text-sm); color: var(--navy-80); }
.approach-media::before {
  content: "";
  position: absolute;
  inset: auto auto -22px calc(-1 * var(--s3));
  width: 45%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--lavender);
  z-index: -1;
}

.steps { list-style: none; margin: var(--s6) 0 0; padding: 0; display: grid; gap: var(--s2); }
.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s5);
  padding: var(--s5) 0;
  border-top: 1px solid var(--line);
}
.step:last-child { border-bottom: 1px solid var(--line); }
.step-num { font-family: var(--font-head); font-weight: 800; font-size: 1.125rem; color: var(--indigo); padding-top: 2px; }
.step p { margin-top: var(--s2); color: var(--navy-80); max-width: 65ch; }

.approach-media figcaption { position: relative; }
@media (max-width: 520px) {
  .approach-media img { border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 88px; }
  .approach-media::before { inset: auto auto -14px -8px; width: 38%; }
  .step { gap: var(--s4); }
}
@media (min-width: 960px) {
  .approach-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-height: 520px) and (min-width: 560px) {
  .approach-grid { grid-template-columns: 1fr 1fr; gap: var(--s6); align-items: start; }
  .steps { margin-top: var(--s4); }
  .step { padding: var(--s4) 0; }
}

/* ---------- Gallery ---------- */

.gallery { background: var(--white); }

@media (min-width: 860px) {
  .section-head--split { grid-template-columns: 1fr 1fr; }
}

.filters { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s6); }
.filter {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  min-height: 44px;
  padding: 0 var(--s5);
  border-radius: var(--pill);
  border: 1.5px solid var(--line);
  background: var(--white);
  font-weight: 700;
  font-size: var(--text-sm);
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.filter,
.gallery-tile { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
/* Phones: rows of pills fill the width evenly instead of leaving a ragged edge. */
@media (max-width: 520px) {
  .filter { flex: 1 1 auto; justify-content: center; padding-inline: var(--s4); }
}
.filter:hover { border-color: var(--indigo); color: var(--indigo); }
.filter[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--white); }
.filter-count {
  display: inline-grid;
  place-items: center;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 0.4rem;
  border-radius: var(--pill);
  background: var(--lavender);
  color: var(--indigo);
  font-size: 0.8125rem;
}
.filter[aria-pressed="true"] .filter-count { background: rgb(255 255 255 / 0.16); color: var(--white); }

.gallery-tile {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--lavender);
  cursor: zoom-in;
}
.gallery-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}
.gallery-tile:hover img,
.gallery-tile:focus-visible img { transform: scale(1.05); }
.gallery-tile:focus-visible { outline-offset: 4px; }

.tile-caption {
  position: absolute;
  inset: auto 0 0 0;
  display: grid;
  justify-items: start;
  gap: var(--s2);
  padding: var(--s7) var(--s4) var(--s4);
  text-align: left;
  color: var(--white);
  background: linear-gradient(to top, rgb(13 14 32 / 0.92) 0%, rgb(13 14 32 / 0.78) 55%, transparent 100%);
  transition: transform 0.4s var(--ease), opacity 0.4s;
}
/* A solid chip keeps the label legible over any photo, light or dark. */
.tile-category {
  padding: 3px 10px;
  border-radius: var(--pill);
  background: var(--yellow);
  color: var(--navy);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.4;
  text-transform: uppercase;
}
.tile-text { font-weight: 500; font-size: var(--text-sm); line-height: 1.4; text-shadow: 0 1px 6px rgb(13 14 32 / 0.6); }

@media (hover: hover) {
  .gallery-grid .tile-caption { opacity: 0; transform: translateY(12px); }
  .gallery-grid .gallery-tile:hover .tile-caption,
  .gallery-grid .gallery-tile:focus-visible .tile-caption { opacity: 1; transform: none; }
}

/* Featured: large image + editorial text panel */
.gallery-feature { display: grid; gap: var(--s5); margin-bottom: var(--s5); }
.gallery-feature:empty { display: none; }
.feature-media { aspect-ratio: 4 / 3; max-height: 640px; }
.feature-media .gallery-tile { border-radius: var(--radius-lg); }
.feature-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--s3);
  padding: clamp(var(--s5), 3vw, var(--s7));
  border-radius: var(--radius-lg);
  background: var(--lavender);
}
.feature-label { display: inline-flex; align-items: center; gap: var(--s2); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--indigo); }
.feature-label::before { content: ""; width: 24px; height: 2px; background: currentColor; }
.feature-caption { font-family: var(--font-head); font-weight: 800; font-size: clamp(1.4rem, 1.4vw + 1rem, 2rem); line-height: 1.2; letter-spacing: -0.02em; text-wrap: balance; }
.feature-meta { color: var(--navy-80); font-size: var(--text-sm); }
.feature-panel .btn { align-self: flex-start; margin-top: var(--s3); }

@media (min-width: 860px) {
  .gallery-feature { grid-template-columns: 1.7fr 1fr; }
  .feature-media { aspect-ratio: auto; height: clamp(380px, 42vw, 560px); }
}

/* Masonry: 8px rows; JS sets each item's row span from its aspect ratio. */
.gallery-grid {
  --max-cols: 1; /* what the width allows; JS may set a smaller --cols for few photos */
  --cols: var(--max-cols);
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-auto-rows: 8px;
  grid-auto-flow: dense;
  column-gap: var(--s5);
  list-style: none;
  margin: 0;
  padding: 0;
}
.gallery-grid > li { margin-bottom: var(--s5); }
.gallery-grid > li:nth-child(3n + 2) .gallery-tile { border-radius: var(--radius) var(--radius) var(--radius) 72px; }
.gallery-grid > li:nth-child(3n + 2) .tile-caption { padding-left: calc(var(--s4) + 24px); } /* clear of the 72px corner */
@media (min-width: 520px) { .gallery-grid { --max-cols: 2; } }
@media (min-width: 960px) { .gallery-grid { --max-cols: 3; } }

.gallery-empty {
  padding: var(--s7) var(--s5);
  border-radius: var(--radius-lg);
  background: var(--lavender);
  text-align: center;
  color: var(--navy-80);
}

/* ---------- Social ---------- */

.follow { background: var(--lavender); }
.social-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--s4);
  list-style: none;
  margin: 0;
  padding: 0;
}
.social-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s6);
  min-height: 170px;
  padding: var(--s5);
  border-radius: var(--radius-lg);
  background: var(--brand, var(--navy));
  color: var(--brand-fg, var(--white));
  text-decoration: none;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.social-tile[data-platform="instagram"] { --brand: linear-gradient(45deg, #8134af 0%, #dd2a7b 50%, #f58529 100%); --brand-fg: #fff; }
.social-tile[data-platform="facebook"] { --brand: #0866ff; --brand-fg: #fff; }
.social-tile[data-platform="tiktok"],
.social-tile[data-platform="x"] { --brand: #000; --brand-fg: #fff; }
.social-tile[data-platform="youtube"] { --brand: #cc0000; --brand-fg: #fff; }
.social-tile[data-platform="whatsapp"] { --brand: #25d366; --brand-fg: #15172d; }
.social-tile[data-platform="telegram"] { --brand: #26a5e4; --brand-fg: #15172d; }
.social-tile[data-platform="snapchat"] { --brand: #fffc00; --brand-fg: #15172d; }
.social-tile:hover { color: var(--brand-fg, var(--white)); transform: translateY(-5px) rotate(-1deg); box-shadow: var(--shadow-lg); }
.social-tile svg { width: 44px; height: 44px; transition: transform 0.35s var(--ease); }
.social-tile:hover svg { transform: scale(1.08); }
.social-name { font-family: var(--font-head); font-weight: 800; font-size: 1.25rem; }
.social-handle { display: block; font-size: var(--text-sm); font-weight: 500; opacity: 0.9; overflow-wrap: anywhere; }

.social-small { display: flex; flex-wrap: wrap; gap: var(--s2); list-style: none; margin: var(--s5) 0 0; padding: 0; }
.social-small a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.08);
  color: var(--white);
  transition: background-color 0.2s, transform 0.25s var(--ease);
}
.social-small a:hover { background: var(--indigo); color: var(--white); transform: translateY(-2px); }
.social-small svg { width: 20px; height: 20px; }

/* ---------- FAQ ---------- */

.faq-grid { display: grid; gap: var(--s6); }
@media (min-width: 960px) {
  .faq-grid { grid-template-columns: 0.8fr 1.2fr; gap: var(--s9); align-items: start; }
  .faq .section-head { position: sticky; top: calc(var(--header-h) + var(--s6)); }
}

.accordion { border-top: 1px solid var(--line); }
.accordion-item { border-bottom: 1px solid var(--line); }
.accordion-item h3 { font-size: 1.125rem; }
.accordion-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  width: 100%;
  min-height: 72px;
  padding: var(--s4) 0;
  background: none;
  border: 0;
  text-align: left;
  font: inherit;
  letter-spacing: inherit;
  transition: color 0.2s;
}
.accordion-trigger:hover { color: var(--indigo); }
.accordion-icon {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--lavender);
  transition: background-color 0.2s, transform 0.35s var(--ease);
}
.accordion-icon::before,
.accordion-icon::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 14px;
  height: 2px;
  margin: -1px 0 0 -7px;
  border-radius: 2px;
  background: var(--indigo);
  transition: transform 0.35s var(--ease);
}
.accordion-icon::after { transform: rotate(90deg); }
.accordion-trigger[aria-expanded="true"] .accordion-icon { background: var(--indigo); }
.accordion-trigger[aria-expanded="true"] .accordion-icon::before,
.accordion-trigger[aria-expanded="true"] .accordion-icon::after { background: var(--white); transform: rotate(180deg); }
.accordion-panel { padding: 0 var(--s8) var(--s5) 0; color: var(--navy-80); max-width: 65ch; }
.accordion-panel:not([hidden]) { animation: fade-up 0.35s var(--ease); }
@media (max-width: 520px) {
  .accordion-panel { padding-right: var(--s2); }
  .accordion-trigger { min-height: 64px; }
}
@media (max-height: 520px) and (min-width: 560px) {
  .faq-grid { grid-template-columns: 0.8fr 1.2fr; gap: var(--s6); align-items: start; }
}

/* ---------- Visit ---------- */

.visit-grid { display: grid; gap: clamp(var(--s6), 5vw, var(--s8)); align-items: stretch; }
@media (min-width: 960px) { .visit-grid { grid-template-columns: 1fr 1.1fr; } }

.visit-copy h2 { margin-bottom: var(--s6); }
.visit-address,
.visit-phone {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s4);
  align-items: start;
  padding: var(--s5) 0;
  border-top: 1px solid var(--line);
  font-style: normal;
}
.visit-address > svg,
.visit-phone > svg { color: var(--indigo); margin-top: 2px; }
.address-en { font-size: var(--text-lg); font-weight: 500; }
.address-ar { margin-top: var(--s2); font-family: var(--font-ar); font-size: var(--text-lg); color: var(--navy-80); text-align: right; }
.visit-phone { grid-template-columns: auto 1fr auto; align-items: center; border-bottom: 1px solid var(--line); }
.visit-label { font-size: var(--text-sm); color: var(--navy-80); }
.phone-link {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.4rem, 1.5vw + 1rem, 1.9rem);
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--navy);
  text-decoration: none;
  white-space: nowrap;
}
.phone-link:hover { color: var(--indigo); }
.copy-btn[data-copied] { border-color: var(--success); color: var(--success); }
.copy-status { grid-column: 2 / -1; font-size: var(--text-sm); color: var(--success); font-weight: 700; min-height: 1.4em; }
.copy-status:empty { display: none; }
.visit-actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s6); }
@media (max-width: 520px) { .visit-actions .btn { width: 100%; } }
/* Narrow phones: the copy button drops under the number instead of pushing past the gutter. */
@media (max-width: 400px) {
  .visit-phone { grid-template-columns: auto minmax(0, 1fr); }
  .visit-phone .copy-btn { grid-column: 2; justify-self: start; }
  .phone-link { font-size: clamp(1.3rem, 7vw, 1.6rem); }
}
@media (max-height: 520px) and (min-width: 560px) {
  .visit-grid { grid-template-columns: 1fr 1fr; gap: var(--s6); }
  .visit-copy h2 { margin-bottom: var(--s4); }
  .visit-address, .visit-phone { padding-block: var(--s4); }
  .map-frame { min-height: 280px; }
}

.map-frame {
  position: relative;
  min-height: 360px;
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 120px;
  overflow: hidden;
  background: var(--lavender);
}
.map-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.map-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s4);
  padding: var(--s6);
  text-align: center;
  color: var(--indigo);
}
.map-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-pin {
  position: relative;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: var(--shadow);
  animation: float 5s ease-in-out infinite;
}
.map-placeholder .btn,
.map-note { position: relative; }
.map-note { font-size: var(--text-sm); color: var(--navy-80); max-width: 22rem; }

/* ---------- CTA ---------- */

.cta { padding-block: var(--s4) clamp(var(--s8), 8vw, var(--s10)); }
.cta-inner {
  position: relative;
  display: grid;
  justify-items: center;
  gap: var(--s5);
  /* The box itself is the .container: keep a gutter (and safe areas) outside it, padding inside. */
  width: min(var(--container), 100% - max(var(--gutter), var(--safe-left)) - max(var(--gutter), var(--safe-right)));
  margin-left: auto;
  margin-right: auto;
  padding: clamp(var(--s7), 7vw, var(--s9)) clamp(var(--s4), 4vw, var(--s6));
  text-align: center;
  border-radius: var(--radius-lg);
  background: var(--lavender);
  overflow: hidden;
  isolation: isolate;
}
.cta-inner::before,
.cta-inner::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  z-index: -1;
}
.cta-inner::before { width: 420px; height: 420px; right: -140px; top: -200px; background: radial-gradient(closest-side, rgb(81 65 216 / 0.18), transparent); }
.cta-inner::after { width: 300px; height: 300px; left: -100px; bottom: -160px; background: radial-gradient(closest-side, rgb(255 206 67 / 0.35), transparent); }
.cta h2 { font-size: clamp(2.2rem, 4vw + 1rem, 4.25rem); }
.cta p { font-size: var(--text-lg); color: var(--navy-80); }

/* ---------- Footer ---------- */

.site-footer { background: var(--navy); color: rgb(255 255 255 / 0.78); padding-top: var(--s8); }
.site-footer a { color: var(--white); text-decoration: none; }
.site-footer a:hover { color: var(--yellow); }
.site-footer :focus-visible { outline-color: var(--yellow); }
.footer-grid { display: grid; gap: var(--s7); padding-bottom: var(--s7); }
.footer-brand .brand { color: var(--white); }
.footer-brand .brand-tag { color: rgb(255 255 255 / 0.7); }
.footer-brand .brand-mark { background: rgb(255 255 255 / 0.1); color: var(--white); }
.footer-brand p { margin-top: var(--s4); max-width: 22rem; }
.footer-heading { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--white); margin-bottom: var(--s3); }
.footer-nav ul,
.footer-contact ul { list-style: none; margin: 0; padding: 0; display: grid; }
.footer-nav a,
.footer-contact a { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; }
.footer-contact .btn { margin-top: var(--s4); }
.footer-contact .btn-book { color: var(--navy); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s2) var(--s5);
  padding-top: var(--s5);
  padding-bottom: calc(var(--s5) + var(--safe-bottom));
  border-top: 1px solid rgb(255 255 255 / 0.12);
  font-size: var(--text-sm);
}
.demo-label { color: rgb(255 255 255 / 0.72); }
.footer-grid { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 480px) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s7) var(--s6); }
  .footer-brand { grid-column: 1 / -1; }
}
@media (min-width: 760px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .footer-brand { grid-column: auto; }
}
@media (max-height: 520px) and (min-width: 560px) {
  .site-footer { padding-top: var(--s6); }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: var(--s6); padding-bottom: var(--s5); }
  .footer-brand { grid-column: auto; }
}

/* ---------- Dialogs ---------- */

.modal {
  width: min(100% - 2 * max(var(--s4), var(--safe-left), var(--safe-right)), 620px);
  max-height: min(calc(100dvh - 2 * var(--s4) - var(--safe-top) - var(--safe-bottom)), 900px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--white);
  color: var(--navy);
  box-shadow: var(--shadow-lg);
  overflow: auto;
  overscroll-behavior: contain;
}
.modal::backdrop { background: rgb(21 23 45 / 0.55); backdrop-filter: blur(4px); }
.modal[open] { animation: dialog-in 0.35s var(--ease); }
.modal[open]::backdrop { animation: fade 0.35s ease; }
.modal-body { --pad: clamp(var(--s5), 5vw, var(--s7)); position: relative; padding: var(--pad); }
.modal-body > .eyebrow { padding-right: 3.5rem; }
.modal-body h2 { font-size: clamp(1.75rem, 2vw + 1rem, 2.4rem); margin-bottom: var(--s4); padding-right: var(--s7); }
.modal-body h3 { font-size: 1.0625rem; margin: var(--s5) 0 var(--s1); }
.modal-body > p:not(.eyebrow) { color: var(--navy-80); }
.modal-body > .btn { margin-top: var(--s6); }
.modal-note {
  margin-top: var(--s5);
  padding: var(--s4);
  border-radius: var(--radius-sm);
  background: var(--lavender);
  font-size: var(--text-sm);
}
.modal-lede { margin-bottom: var(--s5); }
/* Sticky, zero-height row so the close button stays reachable while the dialog scrolls. */
.modal-close {
  position: sticky;
  top: var(--s3);
  z-index: 3;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: calc(var(--s3) - var(--pad)) calc(var(--s3) - var(--pad)) calc(var(--pad) - var(--s3) - 48px) auto;
  box-shadow: 0 0 0 4px var(--white);
  border: 0;
  border-radius: 50%;
  background: var(--lavender);
  color: var(--navy);
  transition: background-color 0.2s, transform 0.3s var(--ease);
}
.modal-close:hover { background: var(--lavender-deep); transform: rotate(90deg); }

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* Form */
.field { display: grid; gap: var(--s1); margin: 0 0 var(--s4); padding: 0; border: 0; min-width: 0; }
.field label,
.field legend { font-weight: 700; font-size: var(--text-sm); padding: 0; margin-bottom: var(--s1); }
.field input:not([type="radio"]):not([type="checkbox"]),
.field select,
.field textarea {
  width: 100%;
  min-height: 52px;
  padding: 0.7rem 1rem;
  font-size: max(16px, 1rem); /* 16px+ stops iOS zooming into fields */
  border: 1.5px solid #cdc8e4;
  border-radius: 14px;
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:hover,
.field select:hover,
.field textarea:hover { border-color: #a9a2cf; }
.field input:focus,
.field select:focus,
.field textarea:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 4px rgb(81 65 216 / 0.18); }
.field [aria-invalid="true"] { border-color: var(--danger) !important; }
.field-hint { font-size: 0.875rem; color: var(--navy-80); }
.field-error { font-size: 0.875rem; font-weight: 700; color: var(--danger); }
.field-error:empty { display: none; }
.choice-row { display: flex; flex-wrap: wrap; gap: var(--s2); }
.choice { position: relative; flex: 1 1 7rem; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; font-size: 16px; }
.choice span {
  display: grid;
  place-items: center;
  min-height: 48px;
  padding: 0 var(--s4);
  border: 1.5px solid #cdc8e4;
  border-radius: var(--pill);
  font-weight: 500;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}
.choice input:hover + span { border-color: var(--indigo); }
.choice input:checked + span { background: var(--indigo); border-color: var(--indigo); color: var(--white); font-weight: 700; }
.choice input:focus-visible + span { outline: 3px solid var(--indigo); outline-offset: 3px; }
fieldset[data-invalid] .choice span { border-color: var(--danger); }

/* Phones in landscape: compact dialogs, two-column booking form. */
@media (max-height: 520px) and (min-width: 560px) {
  .modal-body { --pad: var(--s5); }
  .modal-body h2 { font-size: 1.5rem; margin-bottom: var(--s2); }
  .modal-body .eyebrow { margin-bottom: var(--s2); }
  .modal-lede { margin-bottom: var(--s3); }
  .modal--booking { width: min(100% - 2 * max(var(--s4), var(--safe-left), var(--safe-right)), 720px); }
  #booking-form { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--s4); align-items: start; }
  #booking-form fieldset.field,
  #booking-form .btn-block { grid-column: 1 / -1; }
}

.summary { display: grid; gap: 0; margin: var(--s5) 0; }
.summary div { display: grid; grid-template-columns: 9rem 1fr; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.summary dt { font-weight: 700; font-size: var(--text-sm); color: var(--navy-80); }
.summary dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 420px) { .summary div { grid-template-columns: 1fr; gap: 0; } }
.demo-notice {
  padding: var(--s4) var(--s5);
  border-radius: var(--radius-sm);
  background: #fff6d9;
  border: 1.5px solid var(--yellow);
  font-weight: 700;
}
.summary-actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s5); }

/* ---------- Lightbox ---------- */

.lightbox {
  --thumb: 64px;
  --cap-h: 6.5rem;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #0b0c18;
  color: var(--white);
  overflow: hidden;
  overscroll-behavior: contain;
}
.lightbox[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; animation: fade 0.3s ease; }
/* The page behind must not scroll (wheel, keys or touch chaining) while the viewer is open. */
html:has(.lightbox[open]) { overflow: hidden; }
.lightbox::backdrop { background: #0b0c18; }
.lightbox :focus-visible { outline-color: var(--yellow); }
.lightbox-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(var(--s3), var(--safe-top)) max(var(--s4), var(--safe-right)) var(--s3) max(var(--s4), var(--safe-left));
}
.lightbox-count { font-weight: 700; font-size: var(--text-sm); letter-spacing: 0.08em; color: rgb(255 255 255 / 0.75); font-variant-numeric: tabular-nums; }
.lightbox-btn {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.1);
  color: var(--white);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s, transform 0.25s var(--ease);
}
.lightbox-btn:hover { background: rgb(255 255 255 / 0.2); }
.lightbox-btn:active { background: rgb(255 255 255 / 0.28); }
.lightbox-prev svg { transform: rotate(180deg); }

/* Horizontal drags belong to us; vertical pans and pinch-zoom stay with the browser. */
.lightbox-stage {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: stretch;
  gap: var(--s4);
  padding: 0 max(var(--s4), var(--safe-right)) 0 max(var(--s4), var(--safe-left));
  min-height: 0;
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
}
.lightbox-prev,
.lightbox-next { align-self: center; }
@media (hover: hover) and (pointer: fine) {
  .lightbox-stage { cursor: grab; }
  .lightbox-stage.is-dragging { cursor: grabbing; }
}
.lightbox-figure {
  container-type: size;
  margin: 0;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s3);
}
.lightbox-stage.is-dragging .lightbox-figure { will-change: transform, opacity; }
.lightbox-media { position: relative; display: grid; place-items: center; min-width: 3rem; min-height: 3rem; }
.lightbox-media img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100cqw;
  max-height: calc(100cqh - var(--cap-h));
  object-fit: contain;
  border-radius: var(--radius-sm);
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}
.lightbox-media.is-loading::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border-radius: 50%;
  border: 3px solid rgb(255 255 255 / 0.2);
  border-top-color: var(--yellow);
  animation: lightbox-spin 0.8s linear infinite;
}
@keyframes lightbox-spin { to { transform: rotate(360deg); } }
.lightbox-figure figcaption {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-height: 0;
  padding-inline: var(--s2);
  text-align: center;
  max-width: 42rem;
  text-wrap: balance;
}
.lightbox-category { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--yellow); }
.lightbox-caption { font-size: var(--text-base); line-height: 1.35; }

/* Thumbnails: one scrolling row; JS centres the active one (and pads long rows so the ends can centre too). */
.lightbox-thumbs {
  position: relative;
  display: flex;
  gap: var(--s2);
  margin: 0;
  padding: var(--s3) max(var(--s4), var(--safe-right)) max(var(--s4), var(--safe-bottom)) max(var(--s4), var(--safe-left));
  list-style: none;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.lightbox-thumbs::-webkit-scrollbar { display: none; }
.lightbox-thumbs > li { flex: none; }
.lightbox-thumbs > li:first-child { margin-left: auto; }
.lightbox-thumbs > li:last-child { margin-right: auto; }
.lightbox-thumbs.is-long { padding-inline: calc(50% - var(--thumb) / 2); }
.lightbox-thumbs button {
  display: block;
  width: var(--thumb);
  height: var(--thumb);
  padding: 0;
  border: 2px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  background: #1b1d33;
  opacity: 0.55;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.2s, border-color 0.2s;
}
.lightbox-thumbs button:hover { opacity: 0.9; }
.lightbox-thumbs button[aria-current="true"] { opacity: 1; border-color: var(--yellow); }
.lightbox-thumbs img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Phones in portrait: swipe is the main control, so the arrows shrink and float over the photo. */
@media (max-width: 640px) {
  .lightbox { --thumb: 56px; }
  .lightbox-stage { grid-template-columns: minmax(0, 1fr); padding-inline: var(--s3); }
  .lightbox-prev,
  .lightbox-next { position: absolute; top: 50%; margin-top: -22px; z-index: 1; width: 44px; height: 44px; background: rgb(11 12 24 / 0.55); }
  .lightbox-prev { left: max(var(--s2), var(--safe-left)); }
  .lightbox-next { right: max(var(--s2), var(--safe-right)); }
  .lightbox-caption { font-size: 1rem; }
}

/* Phones in landscape: the photo gets the height. The top bar floats over the corners, the caption
   and thumbnails shrink, and every inset respects the notch. */
@media (max-height: 520px) and (orientation: landscape) {
  .lightbox { --thumb: 44px; --cap-h: 2.9rem; }
  .lightbox[open] { grid-template-rows: minmax(0, 1fr) auto; }
  .lightbox-top {
    position: absolute;
    inset: 0 0 auto 0;
    z-index: 2;
    pointer-events: none;
    padding: max(var(--s1), var(--safe-top)) max(var(--s3), var(--safe-right)) 0 max(var(--s3), var(--safe-left));
  }
  .lightbox-top > * { pointer-events: auto; }
  .lightbox-count { padding: 4px 10px; border-radius: var(--pill); background: rgb(11 12 24 / 0.55); font-size: 0.8125rem; }
  .lightbox-btn { width: 44px; height: 44px; }
  .lightbox-stage {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: var(--s3);
    padding-inline: max(var(--s3), var(--safe-left)) max(var(--s3), var(--safe-right));
    padding-top: var(--s1);
  }
  .lightbox-prev,
  .lightbox-next { position: static; margin: 0; background: rgb(255 255 255 / 0.1); }
  .lightbox-figure { gap: var(--s1); }
  .lightbox-figure figcaption { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 0 var(--s2); max-width: 36rem; }
  .lightbox-category { font-size: 0.6875rem; }
  .lightbox-caption { font-size: 0.8125rem; line-height: 1.3; }
  .lightbox-thumbs { padding-block: var(--s1) max(var(--s1), var(--safe-bottom)); }
  .lightbox-thumbs button { border-radius: 10px; }
  .modal { max-height: calc(100dvh - 2 * var(--s3)); }
}
/* ---------- Reveal (enhancement only: JS adds .reveal-ready) ---------- */

.reveal-ready .reveal:not(.is-visible) { opacity: 0; transform: translateY(28px); }
.reveal-ready .reveal { transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal-ready .reveal:not(.is-visible) { opacity: 1; transform: none; }
  .btn:hover,
  .procedure:hover,
  .social-tile:hover { transform: none; }
  .gallery-tile:hover img,
  .gallery-tile:focus-visible img { transform: none; }
  .gallery-grid .tile-caption { transition: none; }
  .lightbox-media.is-loading::after { animation: none; }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}
