/* ==========================================================================
   Athar Agency — Digital Card
   Compact, one-screen card. Shared by every card page. Plain CSS.
   ========================================================================== */

/* ---------- Fonts (self-hosted) ---------- */
@font-face {
  font-family: "Alexandria Card";
  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: "Manrope Card";
  src: url("../fonts/manrope-latin.woff2") format("woff2");
  font-weight: 200 800;
  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;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #070707;
  --hero-bg: #070707;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.085);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f3f1ed;
  --text-2: #a9a8a5;
  --text-3: #858481;
  --icon: #f3f1ed;
  --focus: #ffffff;
  --primary-bg: #f3f1ed;
  --primary-fg: #070707;
  --glass: rgba(18, 18, 18, 0.55);
  --glass-line: rgba(255, 255, 255, 0.12);
  --sheet: #111111;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.8);
  --grain-opacity: 0.05;
  --ink: 255, 255, 255;
  --ink-alpha: 0.26;
  --spot: rgba(255, 255, 255, 0.9);

  --font: "Manrope Card", "Alexandria Card", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --col: 400px;
  --gutter: 18px;
  --vh: 100vh;
  --pz-h: clamp(230px, calc(var(--vh) * 0.34), 360px);
  --overlap: 44px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
@supports (height: 100svh) { :root { --vh: 100svh; } }

:root[data-theme="light"] {
  --bg: #f4f3f0;
  --surface: rgba(255, 255, 255, 0.7);
  --surface-2: #ffffff;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.16);
  --text: #0a0a0a;
  --text-2: #4d4c4a;
  --text-3: #6b6a67;
  --icon: #0a0a0a;
  --focus: #0a0a0a;
  --primary-bg: #0a0a0a;
  --primary-fg: #f4f3f0;
  --glass: rgba(20, 20, 20, 0.42);
  --glass-line: rgba(255, 255, 255, 0.16);
  --sheet: #fbfaf8;
  --shadow: 0 20px 44px -26px rgba(0, 0, 0, 0.35);
  --grain-opacity: 0.035;
  --ink: 0, 0, 0;
  --ink-alpha: 0.14;
  --spot: rgba(0, 0, 0, 0.55);
  --overlap: 0px;
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: var(--vh);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 500ms var(--ease), color 500ms var(--ease);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
p, h1, h2, h3, ul { margin: 0; padding: 0; }
ul { list-style: none; }
::selection { background: rgba(255, 255, 255, 0.25); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 14px; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* ---------- Icons ---------- */
.i {
  width: 21px;
  height: 21px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.i--sm { width: 16px; height: 16px; }
[dir="rtl"] .i--flip { transform: scaleX(-1); }

/* ---------- Motif: the logo's three circles ---------- */
.dots {
  --d: 5px;
  position: relative;
  display: inline-block;
  flex: none;
  width: calc(var(--d) * 2.64);
  height: var(--d);
  color: currentColor;
}
.dots::before, .dots::after, .dots > i {
  content: "";
  position: absolute;
  top: 0;
  width: var(--d);
  height: var(--d);
  border-radius: 50%;
  background: currentColor;
}
.dots::before { inset-inline-start: 0; }
.dots > i { inset-inline-start: calc(var(--d) * 0.82); }
.dots::after { inset-inline-start: calc(var(--d) * 1.64); }

/* ---------- Atmosphere ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}
.ink {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* ---------- Top bars ---------- */
.bar {
  position: fixed;
  z-index: 70;
  top: calc(12px + var(--safe-t));
  display: flex;
  align-items: center;
  direction: ltr;
  padding: 3px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  backdrop-filter: blur(16px) saturate(1.1);
  color: #f3f1ed;
  transition: opacity 600ms var(--ease) 500ms, transform 600ms var(--ease) 500ms;
}
.bar--start { left: 12px; }
.bar--end { right: 12px; }
.js .bar { opacity: 0; transform: translateY(-8px); }
.is-ready .bar { opacity: 1; transform: none; }
.bar__sep { width: 1px; height: 18px; background: var(--glass-line); }
.ctl {
  position: relative;
  width: 46px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  transition: background-color 300ms var(--ease), transform 200ms var(--ease);
}
.ctl:active { transform: scale(0.93); }
@media (hover: hover) { .ctl:hover { background: rgba(255, 255, 255, 0.1); } }
.ctl .i { width: 19px; height: 19px; }
.ctl__lang { font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em; line-height: 1; }
.ctl__lang[lang="ar"] { font-size: 15px; letter-spacing: 0; font-weight: 600; transform: translateY(-1px); }
.tt { width: 19px; height: 19px; overflow: visible; }
.tt__sun, .tt__moon { transform-box: fill-box; transform-origin: center; transition: transform 700ms var(--ease), opacity 450ms var(--ease); }
.tt__moon { opacity: 0; transform: rotate(-70deg) scale(0.5); }
:root[data-theme="light"] .tt__sun { opacity: 0; transform: rotate(80deg) scale(0.4); }
:root[data-theme="light"] .tt__moon { opacity: 1; transform: none; }

/* ---------- Portrait band ---------- */
.pz {
  position: relative;
  height: var(--pz-h);
  overflow: hidden;
  background: var(--hero-bg);
  pointer-events: none;
}
.pz__stage { position: absolute; inset: 0; will-change: transform; }
.pz__frame {
  position: absolute;
  top: 0;
  left: 50%;
  height: calc(var(--pz-h) * 1.28);
  aspect-ratio: 3 / 4;
  transform: translateX(-50%);
}
.pz__media {
  position: absolute;
  inset: 0;
  transition: opacity 1300ms var(--ease), transform 1700ms var(--ease);
}
.js .pz__media { opacity: 0; transform: scale(1.05); }
.is-ready .pz__media { opacity: 1; transform: none; }
.pz__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 12%;
  -webkit-mask-image:
    linear-gradient(to bottom, #000 0%, #000 42%, rgba(0, 0, 0, 0.5) 60%, transparent 77%),
    linear-gradient(to right, transparent 0%, #000 20%, #000 80%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to bottom, #000 0%, #000 42%, rgba(0, 0, 0, 0.5) 60%, transparent 77%),
    linear-gradient(to right, transparent 0%, #000 20%, #000 80%, transparent 100%);
  mask-composite: intersect;
  -webkit-user-drag: none;
  user-select: none;
}
.pz__glow {
  position: absolute;
  left: 50%;
  top: -30%;
  width: calc(var(--pz-h) * 1.6);
  aspect-ratio: 1;
  margin-left: calc(var(--pz-h) * -0.8);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025) 55%, rgba(255, 255, 255, 0) 100%);
  animation: breathe 8s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: 0.55; transform: scale(0.96); }
  50% { opacity: 1; transform: scale(1.03); }
}
.pz__light {
  position: absolute;
  left: 0;
  top: 0;
  width: 420px;
  height: 420px;
  margin: -210px 0 0 -210px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04) 55%, rgba(255, 255, 255, 0));
  mix-blend-mode: soft-light;
  opacity: 0;
  transition: opacity 600ms var(--ease);
  will-change: transform;
}
.pz.is-lit .pz__light { opacity: 1; }
.pz__fade {
  position: absolute;
  inset: auto 0 0 0;
  height: 34%;
  background: linear-gradient(to bottom, rgba(7, 7, 7, 0), var(--bg));
  opacity: 0;
  transition: opacity 500ms var(--ease);
}
:root[data-theme="light"] .pz__fade { opacity: 1; }

/* ---------- Card column ---------- */
.card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: calc(var(--col) + var(--gutter) * 2);
  margin: calc(var(--overlap) * -1) auto 0;
  padding: 0 var(--gutter) calc(20px + var(--safe-b));
}

/* identity */
.id { text-align: center; }
.id__name {
  position: relative;
  display: inline-block;
  max-width: 100%;
  overflow: clip;
  padding-block: 0.1em 0.42em;
  margin-bottom: -0.36em;
  font-size: 30px;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
:lang(ar) .id__name { font-size: 31px; font-weight: 600; letter-spacing: 0; }
.wipe { position: relative; display: block; transition: transform 1000ms var(--ease); }
.wipe__inner { display: block; transition: transform 1000ms var(--ease); }
.js .wipe { transform: translateX(var(--wipe-from, -101%)); }
.js .wipe__inner { transform: translateX(calc(var(--wipe-from, -101%) * -1)); }
[dir="rtl"] .wipe { --wipe-from: 101%; }
.is-ready .wipe, .is-ready .wipe__inner { transform: none; transition-delay: 150ms; }
.wipe__edge {
  position: absolute;
  top: 6%;
  bottom: 30%;
  inset-inline-end: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent, currentColor, transparent);
  box-shadow: 0 0 10px 1px rgba(255, 255, 255, 0.35);
  opacity: 0;
}
.is-ready .wipe__edge { animation: edge 1200ms var(--ease) 150ms both; }
@keyframes edge { 0% { opacity: 0; } 15%, 70% { opacity: 1; } 100% { opacity: 0; } }
.id__alt {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.5;
}
.id__alt[lang="en"] {
  margin-top: 11px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  margin-inline-end: -0.4em;
}
.id__title {
  margin-top: 4px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-3);
  line-height: 1.5;
}
:lang(ar) .id__title { font-size: 14px; font-weight: 400; }

/* ---------- Buttons ---------- */
.btn {
  --mx: 0px;
  --my: 0px;
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 16px;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform 500ms var(--ease), background-color 300ms var(--ease), border-color 300ms var(--ease), color 300ms var(--ease), opacity 300ms var(--ease);
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
:lang(ar) .btn { font-weight: 500; font-size: 14.5px; }
.btn .i { color: var(--icon); transition: transform 500ms var(--ease); }
.btn__label { position: relative; z-index: 1; }
.btn__fx { position: absolute; inset: 0; z-index: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
.btn__ring {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 300ms var(--ease);
}
.btn__spot, .btn__glow {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50%;
  pointer-events: none;
  transform: translate3d(var(--mx), var(--my), 0);
}
.btn__spot {
  width: 160px;
  height: 160px;
  margin: -80px 0 0 -80px;
  background: radial-gradient(closest-side, var(--spot), rgba(128, 128, 128, 0));
}
.btn__glow {
  width: 220px;
  height: 220px;
  margin: -110px 0 0 -110px;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
  opacity: 0;
  transition: opacity 300ms var(--ease);
}
.btn__press {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: 0 0 0 1px var(--line-strong), 0 0 24px -4px rgba(255, 255, 255, 0.25);
  opacity: 0;
  transition: opacity 300ms var(--ease);
}
:root[data-theme="light"] .btn__press { box-shadow: 0 0 0 1px var(--line-strong), 0 6px 18px -8px rgba(0, 0, 0, 0.3); }
.btn:active { transform: scale(0.97); transition-duration: 150ms; }
.btn:active .btn__press { opacity: 1; transition-duration: 80ms; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }
@media (hover: hover) and (pointer: fine) {
  .btn.is-magnetic { transform: translate3d(var(--tx, 0px), var(--ty, 0px), 0); }
  .btn.is-magnetic:active { transform: translate3d(var(--tx, 0px), var(--ty, 0px), 0) scale(0.97); }
  .btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
  .btn:hover .btn__ring, .btn:hover .btn__glow { opacity: 1; }
}

.btn--primary {
  width: 100%;
  min-height: 54px;
  background: var(--primary-bg);
  color: var(--primary-fg);
  border-color: transparent;
  font-size: 15px;
  box-shadow: var(--shadow);
}
.btn--primary .i { color: var(--primary-fg); }
.btn--primary .btn__glow { background: radial-gradient(closest-side, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0)); }
.btn--primary .btn__spot { background: radial-gradient(closest-side, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0)); }
:root[data-theme="light"] .btn--primary .btn__glow { background: radial-gradient(closest-side, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0)); }
:root[data-theme="light"] .btn--primary .btn__spot { background: radial-gradient(closest-side, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0)); }
@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover { background: var(--primary-bg); border-color: transparent; }
}

/* ---------- Layout of the actions ---------- */
.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile {
  flex-direction: column;
  gap: 7px;
  min-height: 66px;
  padding: 10px 4px;
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
}
:lang(ar) .tile { font-size: 12.5px; font-weight: 500; }
.tile__label { white-space: nowrap; }

.links { display: flex; flex-direction: column; gap: 8px; }
.link {
  width: 100%;
  justify-content: flex-start;
  gap: 14px;
  min-height: 58px;
  padding: 8px 14px 8px 16px;
  text-align: start;
}
[dir="rtl"] .link { padding: 8px 16px 8px 14px; }
.link__text { position: relative; z-index: 1; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.link__label { font-size: 14.5px; font-weight: 600; line-height: 1.3; }
:lang(ar) .link__label { font-weight: 500; }
.link__sub {
  font-size: 12px;
  font-weight: 450;
  color: var(--text-3);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.link .link__go { position: relative; z-index: 1; color: var(--text-3); }
@media (hover: hover) and (pointer: fine) {
  .link:hover .link__go { color: var(--text); transform: translate(2px, -2px); }
  [dir="rtl"] .link:hover .link__go { transform: scaleX(-1) translate(2px, -2px); }
  .link--sheet:hover .link__go { transform: translateX(3px); }
  [dir="rtl"] .link--sheet:hover .link__go { transform: scaleX(-1) translateX(3px); }
}

.social { display: flex; justify-content: center; gap: 10px; margin-top: 18px; }
.soc { width: 52px; min-height: 52px; padding: 0; border-radius: 16px; }

.foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
  padding-bottom: 6px;
}
.foot__copy {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-inline-end: -0.3em;
}

/* ---------- Logo ---------- */
.logo {
  --w: 46px;
  position: relative;
  display: block;
  width: var(--w);
  aspect-ratio: 171 / 154;
  pointer-events: none;
  user-select: none;
}
.logo img { width: 100%; height: 100%; -webkit-user-drag: none; }
.logo__mask {
  position: absolute;
  inset: 0;
  display: none;
  background: #0a0a0a;
  -webkit-mask: url("../brand/athar-logo-flat.svg") center / contain no-repeat;
  mask: url("../brand/athar-logo-flat.svg") center / contain no-repeat;
}
:root[data-theme="light"] .logo img, .logo--ink img { visibility: hidden; }
:root[data-theme="light"] .logo .logo__mask, .logo--ink .logo__mask { display: block; }

/* ---------- Entrance ---------- */
.js [data-in] {
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  transition: opacity 800ms var(--ease), transform 800ms var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms + 380ms);
}
.is-ready [data-in] { opacity: 1; transform: none; }
.reveal-all [data-in], .reveal-all .pz__media { opacity: 1 !important; transform: none !important; }
.reveal-all .wipe, .reveal-all .wipe__inner { transform: none !important; }

/* language crossfade */
.card { transition: opacity 240ms var(--ease); }
.is-switching .card { opacity: 0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  z-index: 96;
  left: 50%;
  bottom: calc(24px + var(--safe-b));
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 32px);
  padding: 12px 20px 12px 18px;
  border-radius: 999px;
  background: rgba(24, 24, 24, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: #f3f1ed;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 450ms var(--ease), transform 550ms var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Dialogs (services sheet & QR) ---------- */
.dlg {
  position: fixed;
  inset: 0;
  z-index: 95;
  visibility: hidden;
  transition: visibility 0s linear 560ms;
}
.dlg.is-open { visibility: visible; transition-delay: 0s; }
.dlg__scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 450ms var(--ease);
}
:root[data-theme="light"] .dlg__scrim { background: rgba(20, 20, 20, 0.45); }
.dlg.is-open .dlg__scrim { opacity: 1; }

/* services — bottom sheet */
.sheet__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 88%;
  display: flex;
  flex-direction: column;
  background: var(--sheet);
  border-radius: 24px 24px 0 0;
  border-top: 1px solid var(--line);
  box-shadow: 0 -30px 60px -30px rgba(0, 0, 0, 0.6);
  transform: translateY(100%);
  transition: transform 560ms var(--ease);
}
.dlg.is-open .sheet__panel { transform: none; }
.sheet__grab { width: 38px; height: 4px; margin: 10px auto 0; border-radius: 4px; background: var(--line-strong); }
.sheet__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px 6px 22px;
}
[dir="rtl"] .sheet__head { padding: 14px 22px 6px 20px; }
.sheet__eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--text-3);
}
.sheet__title { margin-top: 8px; font-size: 22px; font-weight: 650; letter-spacing: -0.015em; line-height: 1.3; }
:lang(ar) .sheet__title { font-weight: 600; letter-spacing: 0; }
.sheet__x {
  flex: none;
  width: 44px;
  height: 44px;
  margin: -4px -8px 0 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text-2);
  transition: background-color 300ms var(--ease), transform 200ms var(--ease);
}
[dir="rtl"] .sheet__x { margin: -4px 0 0 -8px; }
.sheet__x:active { transform: scale(0.92); }
@media (hover: hover) { .sheet__x:hover { background: var(--surface-2); color: var(--text); } }
.sheet__body { overflow-y: auto; padding: 4px 22px calc(18px + var(--safe-b)); overscroll-behavior: contain; }
.sheet__about { font-size: 13.5px; line-height: 1.7; color: var(--text-2); }
:lang(ar) .sheet__about { line-height: 1.95; }
.svc-list { margin-top: 12px; }
.svc {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}
.svc__name { font-size: 15px; font-weight: 600; line-height: 1.4; }
:lang(ar) .svc__name { font-weight: 500; }
.svc__meta { display: block; margin-top: 1px; font-size: 11.5px; color: var(--text-3); }
.svc__alt { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.svc__alt[lang="en"] { font-size: 9.5px; font-weight: 700; letter-spacing: 0.3em; text-transform: uppercase; }
.sheet__cta { margin-top: 16px; width: 100%; }

/* QR */
.qr__panel {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 20px;
  padding: 24px;
  pointer-events: none;
}
.qr__card, .qr__close { pointer-events: auto; }
.qr__card {
  width: min(340px, 100%);
  padding: 24px;
  border-radius: 26px;
  background: #f7f6f3;
  color: #0a0a0a;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition: opacity 450ms var(--ease), transform 600ms var(--ease);
}
.dlg.is-open .qr__card { opacity: 1; transform: none; transition-delay: 60ms; }
.qr__code { width: 100%; aspect-ratio: 1; }
.qr__code img { width: 100%; height: 100%; }
.qr__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}
.qr__who { min-width: 0; text-align: start; }
.qr__name { font-size: 15.5px; font-weight: 650; line-height: 1.35; }
.qr__url { font-size: 11.5px; color: #555; }
.qr__foot .logo { --w: 38px; }
.qr__close {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #f3f1ed;
  background: rgba(30, 30, 30, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.14);
  opacity: 0;
  transition: opacity 450ms var(--ease), transform 200ms var(--ease);
}
.dlg.is-open .qr__close { opacity: 1; transition-delay: 120ms; }
.qr__close:active { transform: scale(0.93); }

/* ---------- Intro (first visit) ---------- */
.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  background: var(--hero-bg);
  cursor: pointer;
  transition: opacity 500ms var(--ease), visibility 0s linear 500ms;
}
.intro-on .intro { display: grid; }
.intro.is-out { opacity: 0; visibility: hidden; pointer-events: none; }
.intro__stage { position: relative; width: 120px; aspect-ratio: 171 / 154; }
.intro__logo { width: 100%; height: 100%; opacity: 0; transform: scale(0.985); transition: opacity 500ms var(--ease), transform 900ms var(--ease); }
.intro__drop {
  position: absolute;
  top: 34.1%;
  width: 12.9%;
  aspect-ratio: 1;
  margin-left: -6.45%;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  transform: scale(0.2);
}
.intro__drop:nth-child(2) { left: 33.33%; }
.intro__drop:nth-child(3) { left: 43.86%; }
.intro__drop:nth-child(4) { left: 54.39%; }
.intro__drop::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.7);
  opacity: 0;
}
.intro.is-drops .intro__drop { animation: ink-drop 500ms var(--ease) forwards; animation-delay: calc(var(--i) * 90ms); }
.intro.is-drops .intro__drop::after { animation: ripple 900ms var(--ease) forwards; animation-delay: calc(var(--i) * 90ms + 60ms); }
@keyframes ink-drop { 0% { opacity: 0; transform: scale(0.2); } 60% { opacity: 1; } 100% { opacity: 1; transform: scale(1); } }
@keyframes ripple { 0% { opacity: 0.8; transform: scale(1); } 100% { opacity: 0; transform: scale(2.6); } }
.intro.is-logo .intro__logo { opacity: 1; transform: none; }
.intro.is-logo .intro__drop { opacity: 0; transition: opacity 400ms var(--ease) 200ms; animation: none; transform: none; }

/* view transition (theme change) */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 520ms; animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }

/* ---------- Short phones: keep everything on one screen ---------- */
@media (max-height: 700px) and (max-width: 767px) {
  :root { --pz-h: clamp(190px, calc(var(--vh) * 0.3), 230px); --overlap: 36px; }
  :root[data-theme="light"] { --overlap: 0px; }
  .id__name { font-size: 27px; }
  :lang(ar) .id__name { font-size: 28px; }
  .stack { margin-top: 16px; gap: 8px; }
  .btn--primary { min-height: 50px; }
  .tile { min-height: 60px; }
  .link { min-height: 54px; }
  .links { gap: 7px; }
  .social { margin-top: 14px; }
  .foot { margin-top: 20px; }
}

/* ---------- Tablet & desktop: centred card ---------- */
@media (min-width: 768px) {
  :root { --pz-h: clamp(290px, calc(var(--vh) * 0.38), 370px); --col: 420px; }
  .bar { top: 20px; }
  .bar--start { left: 20px; }
  .bar--end { right: 20px; }
  .id__name { font-size: 36px; }
  :lang(ar) .id__name { font-size: 37px; }
  .sheet__panel {
    left: 50%;
    right: auto;
    top: 50%;
    bottom: auto;
    width: min(460px, calc(100vw - 48px));
    max-height: min(80vh, 720px);
    border-radius: 24px;
    border: 1px solid var(--line);
    transform: translate(-50%, -46%) scale(0.98);
    opacity: 0;
    transition: transform 560ms var(--ease), opacity 400ms var(--ease);
  }
  .dlg.is-open .sheet__panel { transform: translate(-50%, -50%); opacity: 1; }
  .sheet__grab { display: none; }
  .sheet__head { padding-top: 22px; }
  .toast { bottom: 32px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }
  .pz__glow { animation: none; opacity: 0.8; transform: none; }
  .js [data-in], .js .pz__media { opacity: 1; transform: none; }
  .js .wipe, .js .wipe__inner { transform: none; }
  .wipe__edge { display: none; }
  .ink { display: none; }
}
