:root {
  color-scheme: light;
  --bg: #f4f4f1;
  --surface: #ffffff;
  --surface-soft: #f8f8f6;
  --text: #111214;
  --muted: #6f7278;
  --line: rgba(17,18,20,.11);
  --accent: #1769ff;
  --accent-soft: rgba(23,105,255,.10);
  --shadow: 0 18px 50px rgba(17,18,20,.09);
  --shadow-hover: 0 22px 54px rgba(17,18,20,.14);
  --ring: rgba(23,105,255,.28);
  --header: rgba(244,244,241,.82);
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101112;
  --surface: #191a1c;
  --surface-soft: #151618;
  --text: #f7f7f5;
  --muted: #a2a5aa;
  --line: rgba(255,255,255,.11);
  --accent: #6ba6ff;
  --accent-soft: rgba(107,166,255,.13);
  --shadow: 0 20px 56px rgba(0,0,0,.30);
  --shadow-hover: 0 24px 64px rgba(0,0,0,.42);
  --ring: rgba(107,166,255,.30);
  --header: rgba(16,17,18,.82);
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -8%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 30%),
    var(--bg);
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: background-color .28s ease, color .28s ease;
}
html[lang="ar"] body { font-family: "Noto Kufi Arabic", system-ui, sans-serif; }
button, a { font: inherit; }
button { color: inherit; }
a { color: inherit; }
img, svg { display: block; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; }

.loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: var(--bg);
  opacity: 1;
  visibility: visible;
  transition: opacity .55s ease, visibility .55s ease;
}
.loader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-scene { width: 92px; height: 92px; perspective: 500px; }
.loader-cube {
  position: relative;
  width: 68px;
  height: 68px;
  margin: 12px;
  transform-style: preserve-3d;
  animation: loaderTurn 1.35s cubic-bezier(.6,.05,.35,1) infinite;
}
.loader-cube span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
  backface-visibility: hidden;
}
.loader-cube span:nth-child(1) { transform: translateZ(13px); }
.loader-cube span:nth-child(2) { transform: rotateY(180deg) translateZ(13px); }
.loader-cube img { width: 48px; height: 48px; object-fit: contain; border-radius: 14px; }
@keyframes loaderTurn {
  0% { transform: rotateY(-8deg) rotateX(6deg) scale(.94); }
  50% { transform: rotateY(188deg) rotateX(-4deg) scale(1); }
  100% { transform: rotateY(352deg) rotateX(6deg) scale(.94); }
}

.page { width: min(100% - 22px, 560px); margin: 0 auto; padding: 10px 0 calc(34px + env(safe-area-inset-bottom)); }
.topbar {
  position: sticky;
  top: 8px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--header);
  backdrop-filter: blur(18px);
  box-shadow: 0 8px 24px rgba(17,18,20,.06);
}
.brand-mini { display: flex; align-items: center; gap: 9px; min-width: 0; padding-inline: 6px; text-decoration: none; }
.brand-mini img { width: 38px; height: 38px; border-radius: 12px; object-fit: cover; }
.brand-mini span { font-size: 11px; font-weight: 800; letter-spacing: .09em; white-space: nowrap; }
.actions { display: flex; align-items: center; gap: 7px; }
.icon-button {
  min-width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.icon-button:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 42%, var(--line)); }
.icon-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lang-button { font-size: 11px; font-weight: 800; letter-spacing: .06em; }

.profile {
  padding: 34px 12px 18px;
  text-align: center;
}
.logo-stage {
  position: relative;
  width: 138px;
  height: 138px;
  margin: 0 auto 20px;
  perspective: 900px;
}
.logo-halo {
  position: absolute;
  inset: 5px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 50%;
  animation: haloTurn 16s linear infinite;
}
.logo-halo::before,
.logo-halo::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--line);
}
.logo-halo::before { inset: 13px; }
.logo-halo::after { inset: 28px; border-color: color-mix(in srgb, var(--accent) 18%, transparent); }
.logo-halo i {
  position: absolute;
  top: -4px;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 55%, transparent);
}
@keyframes haloTurn { to { transform: rotate(360deg); } }
.logo-card {
  position: absolute;
  inset: 18px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transform-style: preserve-3d;
  will-change: transform;
  animation: logoFloat 5s ease-in-out infinite;
  transition: transform .18s ease-out, box-shadow .25s ease;
}
.logo-card::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255,255,255,.14), transparent 44%);
  pointer-events: none;
  transform: translateZ(8px);
}
.logo-card img { width: 100%; height: 100%; object-fit: cover; border-radius: 25px; transform: translateZ(14px); }
@keyframes logoFloat {
  0%, 100% { transform: rotateX(3deg) rotateY(-4deg) translateY(0); }
  50% { transform: rotateX(-3deg) rotateY(4deg) translateY(-5px); }
}
.profile-kicker { margin: 0 0 8px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
html[lang="ar"] .profile-kicker { letter-spacing: 0; }
h1 { margin: 0; font-size: clamp(30px, 9vw, 45px); line-height: 1.08; letter-spacing: -.055em; }
html[lang="ar"] h1 { line-height: 1.45; letter-spacing: -.025em; }
.profile-copy { max-width: 430px; margin: 10px auto 0; color: var(--muted); font-size: 13px; line-height: 1.75; }
.social-row { display: flex; justify-content: center; gap: 10px; margin-top: 18px; }
.social-circle {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 6px 16px rgba(17,18,20,.05);
  transition: transform .2s ease, box-shadow .2s ease;
}
.social-circle:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.social-circle img { width: 19px; height: 19px; }

.links { display: grid; gap: 11px; }
.link-card {
  display: grid;
  grid-template-columns: 48px minmax(0,1fr) 34px;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  text-align: start;
  text-decoration: none;
  box-shadow: 0 7px 18px rgba(17,18,20,.045);
  cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
button.link-card { width: 100%; }
.link-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 38%, var(--line)); box-shadow: var(--shadow-hover); }
.link-card.featured {
  min-height: 80px;
  color: #fff;
  border-color: transparent;
  background: #15171b;
}
html[data-theme="dark"] .link-card.featured { color: #111214; background: #f4f4f1; }
.link-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}
.featured .link-icon { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.12); }
html[data-theme="dark"] .featured .link-icon { background: rgba(17,18,20,.08); border-color: rgba(17,18,20,.08); }
.link-icon img { width: 22px; height: 22px; }
.link-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.link-copy { min-width: 0; }
.link-copy strong { display: block; font-size: 14px; line-height: 1.4; }
.link-copy small { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.featured .link-copy small { color: rgba(255,255,255,.62); }
html[data-theme="dark"] .featured .link-copy small { color: rgba(17,18,20,.60); }
.arrow { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-soft); }
.featured .arrow { background: rgba(255,255,255,.10); }
html[data-theme="dark"] .featured .arrow { background: rgba(17,18,20,.08); }
.arrow svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
html[dir="rtl"] .arrow svg { transform: scaleX(-1); }

.contact-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
  margin-top: 11px;
}
.person {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 7px 18px rgba(17,18,20,.045);
}
.person-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.person-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 800; }
.person h2 { margin: 12px 0 3px; font-size: 17px; }
.person p { margin: 0; color: var(--muted); direction: ltr; text-align: start; font-size: 11px; }
.person-actions { display: flex; gap: 7px; margin-top: 13px; }
.person-actions a {
  flex: 1;
  min-height: 37px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
  text-decoration: none;
  font-size: 10px;
  font-weight: 800;
}
.person-actions img, .person-actions svg { width: 14px; height: 14px; }
.person-actions svg { fill: none; stroke: currentColor; stroke-width: 1.9; }
.footer { padding: 24px 8px 4px; color: var(--muted); text-align: center; font-size: 10px; line-height: 1.8; }
.footer a { text-underline-offset: 3px; }

.sheet {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  align-items: end;
  padding: 12px;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .26s ease, visibility .26s ease;
}
.sheet.is-open { opacity: 1; visibility: visible; }
.sheet-panel {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-hover);
  transform: translateY(26px) scale(.985);
  transition: transform .34s cubic-bezier(.2,.8,.2,1);
}
.sheet.is-open .sheet-panel { transform: translateY(0) scale(1); }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 12px; }
.sheet-head p { margin: 0; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.sheet-head h2 { margin: 3px 0 0; font-size: 18px; }
.sheet-list { display: grid; gap: 9px; }
.sheet-contact {
  display: grid;
  grid-template-columns: 45px 1fr 32px;
  align-items: center;
  gap: 11px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-soft);
  text-decoration: none;
}
.sheet-contact strong { display: block; font-size: 13px; }
.sheet-contact small { display: block; margin-top: 3px; color: var(--muted); direction: ltr; text-align: start; font-size: 10px; }
.sheet-wa { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 13px; background: rgba(37,211,102,.11); }
.sheet-wa img { width: 22px; height: 22px; }
.toast { position: fixed; left: 50%; bottom: 18px; z-index: 150; transform: translate(-50%, 14px); padding: 10px 13px; border-radius: 12px; background: var(--text); color: var(--bg); font-size: 10px; font-weight: 800; opacity: 0; visibility: hidden; transition: .22s ease; }
.toast.is-visible { opacity: 1; visibility: visible; transform: translate(-50%,0); }

@media (max-width: 390px) {
  .page { width: min(100% - 14px, 560px); }
  .brand-mini span { display: none; }
  .profile { padding-top: 28px; }
  .contact-strip { grid-template-columns: 1fr; }
}
@media (min-width: 700px) {
  .page { padding-top: 22px; }
  .profile { padding-top: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
