/* ==========================================================================
   KHEDMA Medical — styles
   Palette sampled from the logo. Arabic-first (RTL), mobile-first friendly.
   ========================================================================== */

/* ---------- Fonts (self-hosted, Arabic + Latin subsets) ---------- */
@font-face {
  font-family: 'Alexandria';
  src: url('../fonts/alexandria-arabic.woff2') format('woff2');
  font-weight: 100 900; font-style: normal; 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: 'Alexandria';
  src: url('../fonts/alexandria-latin.woff2') format('woff2');
  font-weight: 100 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: 'IBM Plex Sans Arabic'; src: url('../fonts/plex-arabic-400.woff2') 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: 'IBM Plex Sans Arabic'; src: url('../fonts/plex-arabic-500.woff2') format('woff2'); font-weight: 500; 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: 'IBM Plex Sans Arabic'; src: url('../fonts/plex-arabic-600.woff2') format('woff2'); font-weight: 600; 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: 'IBM Plex Sans Arabic'; src: url('../fonts/plex-arabic-700.woff2') format('woff2'); font-weight: 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; }
@font-face { font-family: 'IBM Plex Sans Arabic'; src: url('../fonts/plex-latin-400.woff2') 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: 'IBM Plex Sans Arabic'; src: url('../fonts/plex-latin-500.woff2') format('woff2'); font-weight: 500; 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: 'IBM Plex Sans Arabic'; src: url('../fonts/plex-latin-600.woff2') format('woff2'); font-weight: 600; 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: 'IBM Plex Sans Arabic'; src: url('../fonts/plex-latin-700.woff2') format('woff2'); font-weight: 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; }
@font-face { font-family: 'Aref Ruqaa'; src: url('../fonts/ruqaa-arabic-400.woff2') 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: 'Aref Ruqaa'; src: url('../fonts/ruqaa-arabic-700.woff2') format('woff2'); font-weight: 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; }

/* ---------- Tokens ---------- */
:root {
  --night: #0D1326;
  --night-2: #121A33;
  --night-3: #18223F;
  --navy: #2A3555;           /* logo navy */
  --gold: #DBC079;           /* logo gold */
  --gold-hover: #E7D195;
  --mist: #E9ECF5;
  --slate: #A3ACC8;
  --slate-2: #7C87A8;
  --line: rgba(163, 172, 200, .16);
  --paper: #FBFAF6;
  --ink: #1D3B8F;            /* ballpoint blue, prescription only */

  --f-display: 'Alexandria', 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
  --f-body: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
  --f-hand: 'Aref Ruqaa', 'IBM Plex Sans Arabic', serif;

  --wrap: 1240px;
  --gutter: clamp(20px, 4.5vw, 44px);
  --header-h: 76px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
html.menu-open, html.modal-open { overflow: hidden; }
body {
  margin: 0;
  background: var(--night);
  color: var(--mist);
  font-family: var(--f-body);
  font-size: 1.0625rem;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-family: var(--f-display); font-weight: 750; line-height: 1.3; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
::selection { background: var(--gold); color: var(--night); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 8px; }
[hidden] { display: none !important; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.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; inset-inline-start: 16px; top: -60px; z-index: 100; background: var(--gold); color: var(--night); padding: 10px 16px; border-radius: 10px; font-weight: 600; transition: top .2s; }
.skip-link:focus { top: 16px; }
.noscript { color: var(--slate); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 24px;
  border-radius: 999px; border: 1px solid transparent;
  font-family: var(--f-body); font-weight: 600; font-size: 1rem; line-height: 1;
  white-space: nowrap; cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s, transform .2s var(--ease), box-shadow .2s;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-gold { background: var(--gold); color: #17203D; box-shadow: 0 14px 34px -16px rgba(219, 192, 121, .7); }
.btn-gold:hover { background: var(--gold-hover); transform: translateY(-1px); }
.btn-gold:active { transform: translateY(0); }
.btn-ghost { border-color: rgba(233, 236, 245, .24); color: var(--mist); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-sm { min-height: 44px; padding: 0 18px; font-size: .92rem; }
.btn-sm svg { width: 18px; height: 18px; }
.btn-lg { min-height: 56px; padding: 0 28px; font-size: 1.05rem; }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--mist);
  cursor: pointer; transition: border-color .2s, color .2s, background-color .2s;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { border-color: var(--gold); color: var(--gold); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h);
  display: flex; align-items: center;
  transition: background-color .3s, box-shadow .3s;
}
.site-header.is-scrolled, .menu-open .site-header {
  background: rgba(13, 19, 38, .82);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 1px 0 var(--line);
}
.header-row { display: flex; align-items: center; gap: 24px; }

.brand { display: inline-flex; align-items: center; gap: 12px; flex: none; min-height: 44px; }
.brand-tile {
  width: 42px; height: 42px; border-radius: 11px; background: #fff;
  display: grid; place-items: center; flex: none;
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .7);
}
.brand-tile svg { width: 26px; height: 24px; }
.brand-words { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.brand-en { font-family: var(--f-display); font-weight: 600; font-size: .98rem; letter-spacing: .34em; margin-inline-start: -.34em; color: var(--gold); }
.brand-ar { font-size: .78rem; font-weight: 500; color: var(--slate); }

.nav { display: flex; gap: 4px; margin-inline-start: auto; }
.nav a { padding: 8px 14px; border-radius: 999px; font-size: .95rem; font-weight: 500; color: var(--slate); transition: color .2s, background-color .2s; }
.nav a:hover { color: var(--mist); background: rgba(255, 255, 255, .05); }

.menu-btn {
  display: none; margin-inline-start: auto; width: 46px; height: 46px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer;
  position: relative;
}
.menu-btn span { position: absolute; inset-inline-start: 13px; width: 18px; height: 2px; border-radius: 2px; background: var(--mist); transition: transform .3s var(--ease), top .3s var(--ease); }
.menu-btn span:first-child { top: 18px; }
.menu-btn span:last-child { top: 25px; }
.menu-btn[aria-expanded="true"] span:first-child { top: 21.5px; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { top: 21.5px; transform: rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 45;
  padding: calc(var(--header-h) + 20px) var(--gutter) calc(32px + env(safe-area-inset-bottom));
  background: rgba(13, 19, 38, .98);
  display: flex; flex-direction: column; gap: 32px;
  overflow-y: auto;
}
.mobile-menu nav { display: flex; flex-direction: column; }
.mobile-menu nav a { font-family: var(--f-display); font-weight: 700; font-size: 1.75rem; padding: 14px 0; border-bottom: 1px solid var(--line); }
.mobile-menu .btn { align-self: stretch; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(76px, 9vw, 128px); }
.section-head { display: grid; gap: 16px; max-width: 720px; }
.section-head h2 { font-size: clamp(2rem, 3.7vw, 3.2rem); font-weight: 800; line-height: 1.28; }
.section-head p { color: var(--slate); font-size: 1.1rem; max-width: 36em; }
.section-head.center { margin-inline: auto; text-align: center; }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative; isolation: isolate; overflow: clip;
  padding-top: calc(var(--header-h) + clamp(28px, 6vh, 72px));
  padding-bottom: clamp(24px, 4vh, 48px);
}
/* ECG paper: the grid of a heart monitor, fading out from the centre */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(rgba(150, 172, 235, .075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150, 172, 235, .075) 1px, transparent 1px),
    linear-gradient(rgba(150, 172, 235, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150, 172, 235, .035) 1px, transparent 1px);
  background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(110% 85% at 50% 35%, #000 30%, transparent 75%);
  mask-image: radial-gradient(110% 85% at 50% 35%, #000 30%, transparent 75%);
}
.hero::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  width: 760px; height: 760px; inset-inline-end: -140px; top: 2%;
  background: radial-gradient(closest-side, rgba(219, 192, 121, .13), rgba(42, 53, 85, .25) 55%, transparent 75%);
}

.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
  grid-template-areas: "copy media" "pulse pulse";
  column-gap: clamp(32px, 5vw, 72px); row-gap: clamp(10px, 2.5vh, 28px); align-items: center;
}
.hero-copy { grid-area: copy; }
.hero-media { grid-area: media; }
.hero-pulse { grid-area: pulse; }

/* Alexandria is wide: line 1 measures ~10.9em, so the size follows the column */
.hero-title { font-size: clamp(2.3rem, 4.05vw, 3.75rem); font-weight: 800; line-height: 1.24; }
.hero-title .line { display: block; overflow: hidden; padding-block: .1em .34em; margin-block: -.1em -.34em; }
.hero-title .line > span { display: block; }

.hero-lede { margin-top: 28px; max-width: 31em; color: var(--slate); font-size: clamp(1.06rem, 1.25vw, 1.2rem); line-height: 1.9; }
.hero-actions { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 12px; }

.hero-media { position: relative; display: grid; place-items: center; }

/* Fanned covers behind the phone */
.hero-back {
  position: absolute; top: 50%; width: 52%; max-width: 270px; aspect-ratio: 9 / 16;
  border-radius: 22px; overflow: hidden;
  filter: brightness(.42) saturate(.8);
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .9);
}
.hero-back img { width: 100%; height: 100%; object-fit: cover; }
.hero-back.b1 { inset-inline-start: 4%; transform: translateY(-44%) rotate(8deg); }
.hero-back.b2 { inset-inline-end: 4%; transform: translateY(-56%) rotate(-8deg); }

/* The reel: a phone-style viewer cycling through the real work */
.reel {
  position: relative; z-index: 2; display: block;
  /* sized so phone + heartbeat line fit in the first screen */
  width: clamp(210px, min(20vw, calc((100vh - 330px) / 2.19)), 290px);
  width: clamp(210px, min(20vw, calc((100svh - 330px) / 2.19)), 290px);
  padding: 9px; border: 0; border-radius: 40px; cursor: pointer; text-align: start; color: #fff;
  background: linear-gradient(160deg, #2a3557, #0b1022 62%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .1),
    0 0 0 1px rgba(0, 0, 0, .45),
    0 60px 100px -40px rgba(0, 0, 0, .9),
    0 0 90px -30px rgba(219, 192, 121, .35);
  transition: transform .4s var(--ease);
}
.reel:hover { transform: translateY(-4px); }
.reel-screen { display: block; border-radius: 31px; overflow: hidden; background: #070b17; }
.reel-top { display: block; padding: 12px 12px 10px; }
.reel-progress { display: flex; gap: 3px; }
.reel-progress i { flex: 1; height: 2.5px; border-radius: 2px; background: rgba(255, 255, 255, .22); position: relative; overflow: hidden; }
.reel-progress i::after { content: ""; position: absolute; inset: 0; background: #fff; transform: scaleX(0); transform-origin: right; }
.reel-progress i.done::after { transform: scaleX(1); }
.reel-progress i.active::after { animation: reel-fill var(--reel-dur, 4.2s) linear forwards; }
.reel.is-paused .reel-progress i.active::after,
.reel.is-away .reel-progress i.active::after,
.modal-open .reel-progress i.active::after { animation-play-state: paused; }
@keyframes reel-fill { to { transform: scaleX(1); } }

.reel-head { display: flex; align-items: center; gap: 9px; margin-top: 10px; line-height: 1.25; }
.reel-avatar { width: 30px; height: 30px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 0 0 2px #070b17, 0 0 0 3.5px var(--gold); }
.reel-avatar svg { width: 17px; height: 16px; }
.reel-id { display: flex; flex-direction: column; align-items: flex-start; }
.reel-name { display: inline-flex; align-items: center; gap: 4px; font-family: var(--f-display); font-weight: 600; font-size: .74rem; }
.reel-name .tick { width: 12px; height: 12px; color: #4F8DF7; }
.reel-sub { font-size: .7rem; color: rgba(255, 255, 255, .6); }

.reel-media { display: block; position: relative; aspect-ratio: 9 / 16; background: #0b1022; }
.reel-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .7s ease; }
.reel-media img.is-on { opacity: 1; }

.reel-bottom { display: block; padding: 11px 13px 14px; }
.reel-actions { display: flex; align-items: center; gap: 13px; }
.reel-actions svg { width: 19px; height: 19px; }
.reel-actions .save { margin-inline-start: auto; }
.reel-caption { display: block; margin-top: 7px; font-size: .74rem; line-height: 1.5; color: rgba(255, 255, 255, .86); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reel-caption b { font-family: var(--f-display); font-weight: 600; }

/* The heartbeat that becomes growth */
.hero-pulse {
  position: relative; width: min(100vw, 1680px); margin-inline: calc(50% - min(50vw, 840px));
}
.pulse {
  width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 0 7px rgba(219, 192, 121, .35));
  -webkit-mask-image: linear-gradient(to left, transparent 0, #000 14%);
  mask-image: linear-gradient(to left, transparent 0, #000 14%);
}
.pulse path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.pulse .base { stroke: rgba(219, 192, 121, .13); }
.pulse .trace { stroke: var(--gold); }
.is-drawing .pulse .trace { stroke-dashoffset: 0 !important; transition: stroke-dashoffset 2.5s cubic-bezier(.62, 0, .34, 1) .5s; }

.pulse-label {
  position: absolute; white-space: nowrap; font-size: .9rem; font-weight: 500; color: var(--slate);
  padding: 2px 12px; border-radius: 999px; background: rgba(13, 19, 38, .7); border: 1px solid var(--line);
}
.pulse-label.l1 { left: 66.2%; top: 23.6%; transform: translate(-50%, calc(-100% - 14px)); }
.pulse-label.l2 { left: 17%; top: 14.8%; transform: translate(18px, calc(-100% - 6px)); color: var(--gold); border-color: rgba(219, 192, 121, .35); }
.pulse-dot {
  position: absolute; left: 17%; top: 14.8%; width: 14px; height: 14px; border-radius: 50%;
  background: var(--gold); transform: translate(-50%, -50%);
  box-shadow: 0 0 22px rgba(219, 192, 121, .85);
}
.js .pulse-label, .js .pulse-dot { opacity: 0; }
.js .is-drawing .pulse-label.l1 { animation: fade-in .6s ease 1.35s forwards; }
.js .is-drawing .pulse-label.l2 { animation: fade-in .6s ease 3s forwards; }
.js .is-drawing .pulse-dot { animation: dot-in .5s var(--ease) 2.9s forwards, heartbeat 2.6s ease-out 3.6s infinite; }
@keyframes dot-in { from { opacity: 0; transform: translate(-50%, -50%) scale(.2); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes heartbeat {
  0% { box-shadow: 0 0 22px rgba(219, 192, 121, .85), 0 0 0 0 rgba(219, 192, 121, .5); }
  70%, 100% { box-shadow: 0 0 22px rgba(219, 192, 121, .85), 0 0 0 16px rgba(219, 192, 121, 0); }
}
@keyframes fade-in { to { opacity: 1; } }

/* Load sequence (runs once) */
.js .hero-title .line > span { transform: translateY(108%); animation: rise 1s var(--ease) forwards; }
.js .hero-title .line:nth-child(2) > span { animation-delay: .09s; }
.js .hero-title .line:nth-child(3) > span { animation-delay: .18s; }
.js .hero-lede { opacity: 0; animation: fade-up .9s var(--ease) .38s forwards; }
.js .hero-actions { opacity: 0; animation: fade-up .9s var(--ease) .5s forwards; }
.js .hero-media { opacity: 0; animation: fade-up 1.1s var(--ease) .25s forwards; }
@keyframes rise { to { transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   WORK
   ========================================================================== */
.work-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 28px 40px; margin-bottom: clamp(36px, 5vw, 56px); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px;
  border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--slate);
  font-size: .94rem; font-weight: 500; cursor: pointer; transition: background-color .2s, color .2s, border-color .2s;
}
.filter:hover { color: var(--mist); border-color: rgba(233, 236, 245, .3); }
.filter[aria-pressed="true"] { background: var(--mist); border-color: var(--mist); color: var(--night); }
.filter .count { font-family: var(--f-display); font-size: .78rem; opacity: .65; }

.works { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 44px 22px; }
.work-btn { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: start; cursor: pointer; border-radius: 20px; }
.work-btn:focus-visible { outline-offset: 6px; }
.work-thumb {
  display: block; position: relative; aspect-ratio: 9 / 16; overflow: hidden;
  border-radius: 18px; background: var(--night-2);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .07), 0 28px 50px -32px rgba(0, 0, 0, .95);
}
.work-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.work-btn:hover .work-thumb img { transform: scale(1.035); }
.work-play {
  position: absolute; inset-inline-end: 10px; bottom: 10px; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: rgba(9, 13, 28, .66); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .14);
  transition: background-color .25s, color .25s, transform .25s var(--ease);
}
.work-play svg { width: 14px; height: 14px; transform: translateX(1px); }
.work-btn:hover .work-play { background: var(--gold); color: #17203D; transform: scale(1.08); }
.work-title { display: block; margin-top: 16px; font-family: var(--f-display); font-weight: 650; font-size: 1.1rem; line-height: 1.45; color: var(--mist); }
.work-sub { display: flex; align-items: flex-start; gap: 7px; margin-top: 4px; font-size: .9rem; line-height: 1.6; color: var(--slate-2); }
.work-sub svg { width: 15px; height: 15px; flex: none; margin-top: 4px; }

::view-transition-group(*) { animation-duration: .45s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }

/* ==========================================================================
   SERVICES — the prescription
   ========================================================================== */
.rx-section .section-head { margin-bottom: clamp(36px, 5vw, 60px); }
.rx {
  position: relative; max-width: 980px; margin-inline: auto;
  background: var(--paper); color: #222B47; border-radius: 10px 10px 22px 22px; overflow: hidden;
  box-shadow: 0 60px 120px -50px rgba(0, 0, 0, .95), 0 30px 60px -30px rgba(0, 0, 0, .55);
  transform: rotate(-.4deg);
}
.rx-head {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  padding: 22px clamp(20px, 4.5vw, 48px); background: var(--navy); color: #fff;
}
.rx-brand { display: flex; align-items: center; gap: 14px; }
.rx-tile { width: 52px; height: 52px; border-radius: 13px; background: #fff; display: grid; place-items: center; flex: none; }
.rx-tile svg { width: 32px; height: 30px; }
.rx-name { font-family: var(--f-display); font-weight: 700; font-size: 1.32rem; line-height: 1.25; }
.rx-en { font-family: var(--f-display); font-size: .74rem; letter-spacing: .2em; color: var(--gold); line-height: 1.4; }
.rx-tagline { font-size: .98rem; color: rgba(255, 255, 255, .78); }

.rx-body { position: relative; padding: clamp(24px, 4.5vw, 48px) clamp(20px, 4.5vw, 48px) 30px; }
.rx-watermark { position: absolute; width: 44%; max-width: 380px; aspect-ratio: 115.4 / 106.7; height: auto; top: 52%; inset-inline-start: 50%; transform: translate(50%, -50%); opacity: .03; pointer-events: none; --mark-k: #2A3555; --mark-dot: #2A3555; }

.rx-fields { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 40px; }
.rx-field { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding-bottom: 6px; border-bottom: 1px dashed #C9CEDC; }
.rx-field.wide { grid-column: 1 / -1; }
.rx-label { flex: none; font-size: .9rem; font-weight: 500; color: #69728F; }
.hand { font-family: var(--f-hand); font-weight: 700; color: var(--ink); font-size: 1.42rem; line-height: 1.55; }

.rx-symbol { position: relative; margin: 26px 0 12px; font-family: var(--f-display); font-weight: 700; font-size: 2.7rem; line-height: 1; color: var(--navy); }
.rx-symbol span span { font-size: .55em; font-weight: 600; vertical-align: -.25em; margin-inline-start: -.06em; }

.rx-list { position: relative; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 48px; }
.rx-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; }
.rx-num { font-size: 1.7rem; line-height: 1.25; min-width: 1ch; }
.rx-list h3 { font-family: var(--f-hand); font-weight: 700; color: var(--ink); font-size: clamp(1.32rem, 2vw, 1.55rem); line-height: 1.45; }
.rx-list p { margin-top: 4px; font-size: .97rem; line-height: 1.75; color: #4D5676; }

.rx-foot { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 22px 36px; flex-wrap: wrap; margin-top: 34px; padding-top: 22px; border-top: 1px dashed #C9CEDC; }
.rx-usage { flex: 1 1 320px; }
.rx-usage .hand { font-size: 1.3rem; }
.rx-sign { position: relative; display: flex; align-items: center; gap: 4px; }
.rx-sign .rx-label { align-self: flex-start; }
.rx-signature { width: 170px; height: auto; color: var(--ink); }
.rx-signature path { fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.rx-stamp { width: 118px; height: 118px; flex: none; color: #2C43A0; opacity: .8; transform: rotate(-14deg); margin-inline-start: -46px; mix-blend-mode: multiply; }
.js .rx-stamp { opacity: 0; transform: rotate(-14deg) scale(1.35); }
.js .rx.is-signed .rx-stamp { animation: stamp .4s cubic-bezier(.3, 1.5, .5, 1) 1.35s forwards; }
.rx.is-signed .rx-signature path { stroke-dashoffset: 0 !important; transition: stroke-dashoffset 1.3s cubic-bezier(.5, 0, .3, 1); }
.rx.is-signed .rx-signature path + path { transition-delay: 1s; transition-duration: .4s; }
@keyframes stamp { to { opacity: .8; transform: rotate(-14deg) scale(1); } }

.rx-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 18px; padding: 13px clamp(20px, 4.5vw, 48px); background: #F1EFE8; border-top: 3px solid var(--gold); font-size: .9rem; color: #5B6480; }
.rx-band a { font-weight: 600; color: var(--navy); }
.rx-band a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.rx-cta { margin-top: clamp(40px, 5vw, 56px); display: flex; justify-content: center; }

/* ==========================================================================
   PROCESS — the clinical visit
   ========================================================================== */
.process .section-head { margin-bottom: clamp(44px, 6vw, 72px); }
.steps { position: relative; list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 32px; }
.steps::before {
  content: ""; position: absolute; top: 22px; inset-inline: 22px 0; height: 1px;
  background: linear-gradient(to left, var(--gold), rgba(219, 192, 121, .08));
}
.step { position: relative; }
.step-node {
  position: relative; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--night); border: 1px solid rgba(219, 192, 121, .55); color: var(--gold);
  font-family: var(--f-display); font-weight: 600; font-size: 1rem;
}
.step h3 { margin-top: 22px; font-size: 1.45rem; font-weight: 700; }
.step p { margin-top: 10px; color: var(--slate); font-size: 1rem; line-height: 1.85; max-width: 22em; }

/* ==========================================================================
   FOUNDER & CERTIFICATES
   ========================================================================== */
.about-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(40px, 6vw, 96px); align-items: center; }
.about-copy h2 { font-size: clamp(2rem, 3.7vw, 3.2rem); font-weight: 800; line-height: 1.28; }
.founder { margin-top: 30px; padding-inline-start: 18px; border-inline-start: 2px solid var(--gold); }
.founder-name { font-family: var(--f-display); font-weight: 700; font-size: 1.55rem; line-height: 1.35; }
.founder-role { margin-top: 2px; color: var(--gold); font-size: 1rem; font-weight: 500; }
.about-text { margin-top: 24px; color: var(--slate); font-size: 1.1rem; line-height: 1.95; max-width: 32em; }

.certs { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 24px; }
.cert-btn {
  display: block; width: 100%; padding: 0; border: 0; cursor: zoom-in; background: #fff;
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .1), 0 34px 60px -34px rgba(0, 0, 0, .95);
  transition: transform .35s var(--ease), box-shadow .35s;
}
.cert-btn img { width: 100%; aspect-ratio: 1.414; object-fit: cover; }
.cert-btn:hover { transform: translateY(-4px); box-shadow: 0 0 0 1px rgba(219, 192, 121, .5), 0 40px 70px -34px rgba(0, 0, 0, .95); }
.cert-title { margin-top: 18px; font-family: var(--f-display); font-weight: 650; font-size: 1.12rem; line-height: 1.45; }
.cert-meta { margin-top: 6px; color: var(--slate); font-size: .94rem; line-height: 1.75; }

/* ==========================================================================
   CONTACT
   ========================================================================== */
.cta { position: relative; border-top: 1px solid var(--line); background: radial-gradient(70% 90% at 85% 0%, rgba(42, 53, 85, .55), transparent 70%); }
.cta-inner { position: relative; }
.cta-beat { width: 150px; height: auto; margin-bottom: 26px; overflow: visible; }
.cta-beat path { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cta-title { font-size: clamp(1.9rem, 3.55vw, 3.25rem); font-weight: 800; line-height: 1.35; max-width: 22em; }
.cta-title > span { display: block; }
.cta-lede { margin-top: 24px; color: var(--slate); font-size: 1.15rem; max-width: 34em; }
.cta-actions { margin-top: 38px; display: flex; flex-wrap: wrap; gap: 12px; }
.cta-number { margin-top: 18px; color: var(--slate-2); font-size: .95rem; }
.cta-number a { color: var(--mist); font-weight: 600; }
.cta-number a:hover { color: var(--gold); }

.socials { display: flex; gap: 10px; margin-top: 26px; }
.socials a { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); color: var(--slate); transition: color .2s, border-color .2s; }
.socials a:hover { color: var(--gold); border-color: var(--gold); }
.socials svg { width: 19px; height: 19px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 44px 0 calc(28px + env(safe-area-inset-bottom)); }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; }
.footer-tag { color: var(--slate); font-size: 1rem; }
.footer-row .socials { margin-top: 0; }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; margin-top: 32px; padding-top: 22px; border-top: 1px solid var(--line); font-size: .88rem; color: var(--slate-2); }

/* ---------- Developer credit (Y&N Studio): the web developer's card, not KHEDMA's ---------- */
.yn-credit, .yn-card { --yn-bg: var(--night-2); --yn-text: var(--mist); --yn-muted: var(--slate); --yn-line: var(--line); --yn-accent: var(--gold); }
.yn-credit { min-height: 44px; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; transition: color .2s; }
.yn-credit:hover { color: var(--yn-accent); }
.yn-card {
  width: min(340px, 100% - 32px); padding: 22px;
  border: 1px solid var(--yn-line); border-radius: 20px;
  background: var(--yn-bg); color: var(--yn-text);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .9);
  overscroll-behavior: contain;
}
.yn-card::backdrop { background: rgba(5, 8, 18, .6); }
.yn-card:popover-open { animation: yn-in .3s cubic-bezier(.16, 1, .3, 1); }
.yn-title { margin: 0; font-weight: 700; line-height: 1.6; }
.yn-text { margin: 2px 0 0; color: var(--yn-muted); font-size: .94rem; line-height: 1.7; }
.yn-links { display: grid; gap: 8px; margin-top: 18px; }
.yn-links a {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 16px;
  border: 1px solid var(--yn-line); border-radius: 14px; color: inherit; font-size: .95rem; font-weight: 500; text-decoration: none;
  transition: color .2s, border-color .2s;
}
.yn-links a[hidden] { display: none; }
.yn-links a:hover { border-color: var(--yn-accent); color: var(--yn-accent); }
.yn-links svg { width: 20px; height: 20px; flex: none; }
.yn-credit:focus-visible, .yn-links a:focus-visible { outline: 2px solid var(--yn-accent); outline-offset: 3px; }
.yn-credit, .yn-links a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
@keyframes yn-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes yn-sheet-in { from { transform: translateY(100%); } }
@supports not selector(:popover-open) { .yn-card { display: none; } }
@media (max-width: 480px) {
  .yn-card { width: 100%; margin: auto 0 0; padding-bottom: calc(22px + env(safe-area-inset-bottom)); border-width: 1px 0 0; border-radius: 22px 22px 0 0; }
  .yn-card:popover-open { animation-name: yn-sheet-in; }
}
@media (prefers-reduced-motion: reduce) { .yn-card:popover-open { animation: none; } }

/* ---------- Floating WhatsApp (mobile) ---------- */
.wa-fab {
  position: fixed; z-index: 40; inset-inline-end: 16px; bottom: calc(16px + env(safe-area-inset-bottom));
  width: 56px; height: 56px; border-radius: 50%; display: none; place-items: center;
  background: var(--gold); color: #17203D; box-shadow: 0 16px 34px -12px rgba(0, 0, 0, .8), 0 0 0 4px rgba(13, 19, 38, .55);
  opacity: 0; transform: translateY(24px) scale(.85); pointer-events: none;
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.wa-fab svg { width: 26px; height: 26px; }
.wa-fab.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.menu-open .wa-fab { opacity: 0; pointer-events: none; }

/* ==========================================================================
   DIALOGS
   ========================================================================== */
dialog { color: var(--mist); }
dialog::backdrop { background: rgba(5, 8, 18, .84); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

.lightbox {
  width: min(1080px, 100% - 32px); max-width: none; max-height: calc(100dvh - 32px); padding: 0; border: 0;
  border-radius: 26px; background: var(--night-2); overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07), 0 50px 140px -30px rgba(0, 0, 0, .9);
}
.lightbox[open] { animation: dialog-in .4s var(--ease); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.lb-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); max-height: calc(100dvh - 32px); }
.lb-media { position: relative; height: min(84dvh, 820px); aspect-ratio: 9 / 16; background: #000; touch-action: pan-y; }
.lb-media img, .lb-media video { width: 100%; height: 100%; object-fit: contain; }
.lb-panel { display: flex; flex-direction: column; gap: 14px; padding: 28px clamp(22px, 3vw, 36px) 28px; overflow-y: auto; }
.lb-top { display: flex; align-items: center; justify-content: space-between; }
.lb-count { font-family: var(--f-display); font-size: .9rem; color: var(--slate-2); letter-spacing: .08em; }
.lb-type { margin-top: 10px; color: var(--gold); font-size: .95rem; font-weight: 500; }
.lb-title { font-size: clamp(1.6rem, 2.6vw, 2.2rem); font-weight: 800; line-height: 1.3; }
.lb-hook { color: var(--slate); font-size: 1.05rem; line-height: 1.8; }
.lb-meta { margin: 8px 0 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.lb-meta div { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.lb-meta dt { color: var(--slate-2); font-size: .92rem; }
.lb-meta dd { margin: 0; font-size: .98rem; }
.lb-actions { display: grid; gap: 10px; margin-top: 10px; }
.lb-actions .btn { width: 100%; }
.lb-nav { display: flex; gap: 10px; margin-top: auto; padding-top: 14px; }

.viewer {
  width: min(1200px, 100% - 32px); max-width: none; max-height: calc(100dvh - 32px); padding: 0; border: 0;
  background: transparent; overflow: visible;
}
.viewer[open] { animation: dialog-in .35s var(--ease); display: grid; justify-items: center; gap: 14px; }
.viewer img { max-height: calc(100dvh - 140px); width: auto; border-radius: 12px; background: #fff; box-shadow: 0 40px 120px -30px rgba(0, 0, 0, .9); }
.viewer-caption { color: var(--slate); font-size: .95rem; text-align: center; max-width: 60ch; }
.viewer-close { position: fixed; top: 16px; inset-inline-end: 16px; background: rgba(13, 19, 38, .8); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1100px) {
  .works { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-media { min-height: 540px; }
}

@media (max-width: 900px) {
  :root { --header-h: 68px; }
  .nav, .header-cta { display: none; }
  .menu-btn { display: block; }
  .brand-tile { width: 38px; height: 38px; border-radius: 10px; }
  .brand-tile svg { width: 23px; height: 21px; }

  .hero-grid { grid-template-columns: 1fr; grid-template-areas: "copy" "pulse" "media"; row-gap: 28px; }
  .hero-title { font-size: clamp(2.5rem, 7vw, 3.6rem); }
  .hero-pulse { margin-block: 18px 6px; }
  .hero-media { padding-block: 8px 16px; }
  .hero-back { width: 46%; max-width: 230px; }
  .reel { width: min(66vw, 270px); }

  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 44px 28px; }
  .steps::before { display: none; }

  .about-grid { grid-template-columns: 1fr; }
  .wa-fab { display: grid; }
}

@media (max-width: 720px) {
  .works { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 14px; }
  .work-title { font-size: 1rem; margin-top: 12px; }
  .work-sub { font-size: .82rem; }
  .work-sub svg { width: 13px; height: 13px; margin-top: 3px; }
  .work-thumb { border-radius: 14px; }

  .rx { transform: none; border-radius: 8px 8px 18px 18px; }
  .rx-fields { grid-template-columns: 1fr; }
  .rx-list { grid-template-columns: 1fr; gap: 22px; }
  .rx-foot { align-items: flex-start; }
  .rx-sign { width: 100%; justify-content: flex-end; }
  .rx-tagline { display: none; }

  .lightbox { width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .lb-grid { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); height: 100%; max-height: none; }
  .lb-media { width: 100%; height: 50dvh; aspect-ratio: auto; }
  .lb-panel { padding: 18px 20px 0; gap: 10px; }
  .lb-title { font-size: 1.6rem; }
  .lb-meta div { padding: 9px 0; }
  .lb-actions { position: sticky; bottom: 0; margin-top: 4px; padding: 16px 0 calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(to bottom, rgba(18, 26, 51, 0), var(--night-2) 22%); }
  .lb-top { position: absolute; top: 12px; inset-inline: 12px; z-index: 2; pointer-events: none; }
  .lb-top > * { pointer-events: auto; }
  .lb-top .icon-btn { background: rgba(9, 13, 28, .7); border-color: rgba(255, 255, 255, .2); }
  .lb-count { background: rgba(9, 13, 28, .7); padding: 4px 10px; border-radius: 999px; color: var(--mist); }
  .lb-type { margin-top: 0; }
  .lb-nav { order: -1; position: absolute; top: calc(25dvh - 22px); inset-inline: 10px; justify-content: space-between; padding: 0; margin: 0; pointer-events: none; z-index: 2; }
  .lb-nav .icon-btn { pointer-events: auto; background: rgba(9, 13, 28, .6); border-color: rgba(255, 255, 255, .2); }
}

@media (max-width: 560px) {
  body { font-size: 1rem; }
  .hero-title { font-size: clamp(2.15rem, 10.2vw, 2.7rem); line-height: 1.3; }
  /* on phones the three lines flow and balance instead of forcing breaks */
  .hero-title .line, .hero-title .line > span { display: inline; padding: 0; margin: 0; overflow: visible; }
  .js .hero-title .line > span { transform: none; animation: none; }
  .js .hero-title { opacity: 0; animation: fade-up .9s var(--ease) .1s forwards; }
  .hero-actions .btn { flex: 1 1 100%; }
  .steps { grid-template-columns: 1fr; gap: 0; }
  .step { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 18px; padding-bottom: 34px; }
  .step::before { content: ""; position: absolute; top: 44px; bottom: 0; inset-inline-start: 22px; width: 1px; background: linear-gradient(to bottom, rgba(219, 192, 121, .5), rgba(219, 192, 121, .08)); }
  .step:last-child::before { display: none; }
  .step-node { grid-row: 1 / span 2; }
  .step h3 { margin-top: 4px; font-size: 1.3rem; }
  .certs { grid-template-columns: 1fr; }
  .pulse-label { font-size: .74rem; padding: 1px 9px; }
  .pulse-label.l1 { transform: translate(-50%, calc(-100% - 8px)); }
  .pulse-label.l2 { transform: translate(12px, calc(-100% - 4px)); }
  .pulse-dot { width: 10px; height: 10px; }
  .cta-actions .btn { flex: 1 1 100%; }
  .rx-stamp { width: 96px; height: 96px; margin-inline-start: -36px; }
  .rx-signature { width: 140px; }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}
