/* Glass Bio Link • iOS-style Dock */

/* ---------- CSS Variables ---------- */
:root {
  --bg: #0b0f1a;
  --text: #e6ebf2;
  --muted: #a6b0c0;
  --brand: #4da3ff;
  --accent: #8b7cff;
  --success: #45d08f;

  --glass: rgba(255, 255, 255, 0.08);
  --glass-strong: rgba(255, 255, 255, 0.14);
  --border: rgba(255, 255, 255, 0.22);
  --inner: rgba(255, 255, 255, 0.35);

  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 12px;

  --shadow-lg: 0 20px 45px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 6px 16px rgba(0, 0, 0, 0.28);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f8fb;
    --text: #0e1625;
    --muted: #5b6473;
    --glass: rgba(255, 255, 255, 0.65);
    --glass-strong: rgba(255, 255, 255, 0.8);
    --border: rgba(0, 0, 0, 0.08);
    --inner: rgba(255, 255, 255, 0.92);
    --shadow-lg: 0 24px 60px rgba(13, 31, 58, 0.18);
    --shadow-md: 0 16px 32px rgba(13, 31, 58, 0.16);
    --shadow-sm: 0 8px 20px rgba(13, 31, 58, 0.14);
  }
}

/* ---------- Base ---------- */
* { 
  box-sizing: border-box; 
}

html, body { 
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: "Inter", "Cairo", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: var(--bg);
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

/* Prevent horizontal scroll */
html {
  overflow-x: hidden;
}

.background {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1200px 800px at 80% -10%, rgba(141, 122, 255, 0.35), transparent 60%),
    radial-gradient(1200px 800px at 20% 110%, rgba(64, 181, 255, 0.35), transparent 60%),
    radial-gradient(800px 600px at 50% 10%, rgba(21, 220, 160, 0.2), transparent 40%),
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.2));
}

/* Subtle grain */
.background::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.04'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.page {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  width: 100%;
  max-width: 100vw;
  padding: clamp(16px, 4vw, 32px) clamp(12px, 4vw, 28px) clamp(16px, 4vw, 32px);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  margin: 0 auto;
  box-sizing: border-box;
}

/* ---------- Top Navigation ---------- */
.topnav { display: none; }

/* ---------- Back Button ---------- */
.back-btn {
  position: absolute;
  top: clamp(16px, 4vw, 32px);
  left: clamp(12px, 4vw, 28px);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s ease;
  z-index: 10;
  backdrop-filter: saturate(160%) blur(20px);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
}

.back-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: var(--glass-strong);
}

.back-btn:active {
  transform: translateY(0);
}

.back-btn svg {
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease;
}

.back-btn:hover svg {
  transform: translateX(-2px);
}

/* ---------- Glass helper ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--border);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  backdrop-filter: saturate(160%) blur(20px);
  box-shadow: var(--shadow-md);
  will-change: transform, box-shadow;
}

/* Fallback for browsers that don't support backdrop-filter */
@supports not (backdrop-filter: blur(20px)) {
  .glass {
    background: var(--glass-strong);
  }
}

/* ---------- Profile ---------- */
.profile {
  width: 100%;
  max-width: min(720px, calc(100vw - 48px));
  border-radius: var(--radius-lg);
  padding: clamp(20px, 5vw, 28px) clamp(16px, 4vw, 28px);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(12px, 3vw, 18px) clamp(16px, 3vw, 20px);
  align-items: center;
  margin: 0 auto;
  box-sizing: border-box;
  position: relative;
}

.avatar-wrap { 
  position: relative; 
  width: clamp(70px, 12vw, 84px); 
  height: clamp(70px, 12vw, 84px); 
}
.avatar {
  width: 100%; 
  height: 100%; 
  border-radius: 50%;
  display: block; 
  object-fit: cover; 
  border: 2px solid rgba(255,255,255,.5);
  box-shadow: var(--shadow-sm);
}
/* removed online-dot */

.identity { align-self: center; }
.name { margin: 0; font-weight: 700; font-size: clamp(22px, 3.4vw, 34px); letter-spacing: .3px; font-family: "Cinzel Decorative", "Outfit", system-ui, sans-serif; display: inline-flex; align-items: center; gap: 8px; }
.badge-verified { flex: 0 0 auto; display: inline-grid; place-items: center; vertical-align: middle; filter: drop-shadow(0 2px 6px rgba(29,155,240,.4)); }
.bio { margin: 6px 0 10px; color: var(--muted); font-size: clamp(14px, 2.6vw, 16px); font-family: "Poppins", "Inter", system-ui, sans-serif; }

/* keep badge aligned next to name on all breakpoints */
@media (max-width: 520px) {
  .name { justify-content: center; text-align: center; }
}

.socials { 
  display: flex; 
  gap: clamp(8px, 2vw, 12px); 
  flex-wrap: wrap;
  justify-content: center;
}
.social {
  width: clamp(32px, 8vw, 36px); 
  height: clamp(32px, 8vw, 36px); 
  display: grid; 
  place-items: center;
  color: var(--text); 
  opacity: .85; 
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.04));
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}
.social:hover { 
  opacity: 1; 
  transform: translateY(-2px); 
  box-shadow: var(--shadow-sm); 
}
.social:active {
  transform: translateY(0);
}
.social .social-icon-img { 
  width: clamp(18px, 5vw, 22px); 
  height: clamp(18px, 5vw, 22px); 
  display: block; 
  object-fit: cover; 
  border-radius: 4px; 
}

/* ---------- Links ---------- */
.links { 
  width: 100%;
  max-width: min(720px, calc(100vw - 48px));
  margin: clamp(16px, 4vw, 22px) auto 0; 
  box-sizing: border-box;
}
.section-title {
  margin: 0 clamp(4px, 2vw, 6px) clamp(8px, 2vw, 12px); 
  font-size: clamp(11px, 2.5vw, 12px); 
  text-transform: uppercase; 
  letter-spacing: .22em; 
  color: var(--muted);
}
.link-list { 
  list-style: none; 
  padding: 0; 
  margin: 0; 
  display: grid; 
  gap: clamp(10px, 2.5vw, 14px); 
}

.link-card {
  position: relative;
  display: grid;
  grid-template-columns: clamp(40px, 10vw, 44px) 1fr auto;
  align-items: center;
  gap: clamp(10px, 2.5vw, 12px);
  padding: clamp(12px, 3vw, 14px) clamp(14px, 3vw, 16px);
  border-radius: var(--radius-lg);
  color: var(--text);
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
  min-height: 60px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}
.link-card .icon {
  width: clamp(40px, 10vw, 44px); 
  height: clamp(40px, 10vw, 44px); 
  display: grid; 
  place-items: center; 
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.05));
  border: 1px solid var(--border);
  font-size: 0;
}
.link-card .icon .icon-img { 
  width: clamp(20px, 5vw, 22px); 
  height: clamp(20px, 5vw, 22px); 
  object-fit: cover; 
  display: block; 
  border-radius: 4px; 
}
.link-card .label { 
  font-weight: 800; 
  font-size: clamp(18px, 4.5vw, 22px); 
  letter-spacing: .3px; 
  font-family: "Dancing Script", "Great Vibes", "Allura", cursive, "Brush Script MT", "Lucida Handwriting", serif;
  word-break: break-word;
}
.link-card .arrow { opacity: .8; color: var(--muted); }
.link-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); background: var(--glass-strong); }
.link-card:active { transform: translateY(0); }

/* ---------- Contact ---------- */
.contact { 
  width: min(720px, calc(100% - 24px)); 
  margin: 0 auto; 
  border-radius: var(--radius-lg); 
  padding: clamp(16px, 4vw, 18px); 
}

/* Page with back button spacing */
.contact-page {
  padding-top: clamp(80px, 12vw, 100px);
  display: grid;
  place-items: center;
  align-content: center;
}
.contact .contact-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 14px; border-radius: 12px; color: var(--text); text-decoration: none; border: 1px solid var(--border); }
/* Contact form styling */
.contact-form { margin-top: 8px; }
.form-grid { 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: clamp(10px, 2.5vw, 12px); 
}
.field { display: grid; gap: 6px; }
.field label { font-size: 12px; color: var(--muted); }
.input { 
  width: 100%; 
  padding: clamp(10px, 2.5vw, 12px); 
  border-radius: 12px; 
  border: 1px solid var(--border); 
  background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.06)); 
  color: var(--text); 
  outline: none; 
  transition: border-color .18s ease, box-shadow .18s ease; 
  font-size: clamp(14px, 3vw, 16px);
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(77,163,255,.18); }
.textarea { resize: vertical; min-height: 120px; }
.btn-primary { background: linear-gradient(180deg, var(--accent), var(--brand)); color: white; border: 1px solid rgba(255,255,255,.65); }
.btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.contact-status { margin: 0; font-size: 12px; color: var(--muted); align-self: center; }
/* Enhanced responsive breakpoints */
@media (max-width: 768px) {
  .page {
    padding: clamp(12px, 3vw, 20px) clamp(8px, 3vw, 16px) clamp(12px, 3vw, 20px);
  }
  
  .profile {
    max-width: calc(100vw - 32px);
    padding: clamp(16px, 4vw, 24px) clamp(12px, 3vw, 20px);
  }
  
  .links {
    max-width: calc(100vw - 32px);
    margin-top: clamp(12px, 3vw, 18px);
  }
  
  .back-btn {
    top: clamp(12px, 3vw, 20px);
    left: clamp(8px, 3vw, 16px);
    width: 40px;
    height: 40px;
  }
  
  .back-btn svg {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 520px) {
  .form-grid { grid-template-columns: 1fr; }
  
  .page {
    padding: clamp(8px, 2vw, 16px) clamp(6px, 2vw, 12px) clamp(8px, 2vw, 16px);
  }
  
  .profile {
    max-width: calc(100vw - 24px);
    padding: clamp(12px, 3vw, 18px) clamp(8px, 2vw, 16px);
  }
  
  .links {
    max-width: calc(100vw - 24px);
  }
  
  .socials {
    justify-content: center;
    gap: clamp(6px, 1.5vw, 10px);
  }
  
  .back-btn {
    top: clamp(8px, 2vw, 16px);
    left: clamp(6px, 2vw, 12px);
    width: 36px;
    height: 36px;
  }
  
  .back-btn svg {
    width: 16px;
    height: 16px;
  }
}

/* Specific fix for iPhone SE and similar 375px width devices */
@media (max-width: 375px) and (min-width: 325px) {
  .page {
    padding: 12px 16px;
  }
  
  .profile {
    max-width: 343px; /* 375 - 32px padding */
    padding: 16px 20px;
    grid-template-columns: auto 1fr;
    gap: 14px 16px;
  }
  
  .links {
    max-width: 343px;
    margin-top: 16px;
  }
  
  .avatar-wrap {
    width: 70px;
    height: 70px;
  }
  
  .name {
    font-size: 24px;
    line-height: 1.2;
  }
  
  .bio {
    font-size: 14px;
    margin: 8px 0 12px;
  }
  
  .socials {
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-start;
    max-width: 100%;
  }
  
  .social {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }
  
  .social .social-icon-img {
    width: 20px;
    height: 20px;
  }
  
  .link-card {
    padding: 14px 16px;
    min-height: 56px;
    grid-template-columns: 44px 1fr auto;
    gap: 12px;
  }
  
  .link-card .icon {
    width: 44px;
    height: 44px;
  }
  
  .link-card .icon .icon-img {
    width: 22px;
    height: 22px;
  }
  
  .link-card .label {
    font-size: 18px;
    word-break: break-word;
    overflow-wrap: break-word;
  }
}

@media (max-width: 360px) {
  .page {
    padding: clamp(6px, 1.5vw, 12px) clamp(4px, 1.5vw, 8px) clamp(6px, 1.5vw, 12px);
  }
  
  .profile {
    max-width: calc(100vw - 16px);
    padding: clamp(10px, 2.5vw, 16px) clamp(6px, 2vw, 12px);
    gap: clamp(8px, 2vw, 12px);
  }
  
  .links {
    max-width: calc(100vw - 16px);
  }
  
  .socials {
    gap: clamp(4px, 1vw, 8px);
  }
  
  .link-list {
    gap: clamp(8px, 2vw, 12px);
  }
}

/* ---------- Dock ---------- */
.dock {
  position: fixed;
  left: 0; right: 0; /* ليكون دائماً في المنتصف مهما كان العرض */
  bottom: max(42px, calc(42px + env(safe-area-inset-bottom)));
  transform: none;
  width: 100%;
  display: grid; place-items: center; /* يحافظ على توسيط الـ tray */
  pointer-events: none;
  z-index: 40;
}

.ios16 {
  position: relative;
  display: grid;
  place-items: end center;
}

/* iOS16 Tabbar */
.ios16 .tabbar {
  pointer-events: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 8px;
  width: clamp(240px, 52vw, 380px);
  height: 56px;
  padding: 6px 8px 10px;
  border-radius: 26px; /* rounder view box */
  background: rgba(255, 255, 255, 0.32); /* more transparent glass */
  border: 1px solid rgba(255, 255, 255, 0.45);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  backdrop-filter: blur(18px) saturate(170%);
  box-shadow: 0 28px 70px rgba(13, 31, 58, 0.26);
  position: relative;
}

.ios16 .tabbar::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.45), rgba(255,255,255,.08));
  opacity: .55;
  pointer-events: none;
}
.ios26 .tray {
  pointer-events: auto;
  display: grid;
  grid-auto-flow: column;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 3vw, 20px);
  width: max-content; /* الشريط بقدر الأيقونات الثلاث بالضبط */
  max-width: calc(100% - 28px); /* لا يتجاوز حافة الشاشة على الأجهزة الصغيرة */
  height: clamp(72px, 16vw, 80px);
  padding: clamp(10px, 3vw, 16px) clamp(16px, 4vw, 20px);
  border-radius: 28px;
  background: rgba(255,255,255,.68);
  border: 1px solid rgba(255,255,255,.9);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 
    0 20px 50px rgba(13,31,58,.16), 
    inset 0 1px 0 rgba(255,255,255,.7),
    0 4px 12px rgba(0,0,0,.1);
}
.tbtn { 
  position: relative; 
  pointer-events: auto; 
  appearance: none; 
  border: 0; 
  background: transparent; 
  color: #0e1625; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  height: 100%; 
  width: clamp(72px, 18vw, 80px); 
  border-radius: 22px; 
  cursor: pointer; 
  transition: transform 0.2s ease, background 0.2s ease;
}
.tbtn .bubble { 
  position: absolute; 
  inset: clamp(5px, 1.5vw, 6px); 
  border-radius: 22px; 
  background: rgba(255,255,255,.45); 
  opacity: 0; 
  -webkit-backdrop-filter: blur(12px) saturate(150%); 
  backdrop-filter: blur(12px) saturate(150%); 
  transition: opacity .2s ease, transform .2s ease; 
}
.tbtn .ticon { 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  width: 100%;
  height: 100%;
}
.tbtn .ticon svg { 
  width: clamp(32px, 8vw, 36px); 
  height: clamp(32px, 8vw, 36px); 
}
.tbtn .ticon .dock-icon-img { 
  width: clamp(32px, 8vw, 36px); 
  height: clamp(32px, 8vw, 36px); 
  display: block; 
  object-fit: cover; 
  border-radius: 8px; 
}
.tbtn .tlabel { display: none; }
.tbtn.active .bubble { opacity: 1; transform: none; box-shadow: none; }
.tbtn.active .ticon, .tbtn.active .tlabel { color: #0a5cff; }
.tbtn:hover { transform: none; }

/* remove ripple on tray buttons */
.tbtn.ripple::after { display: none !important; }

/* Enhanced dock responsive adjustments */
@media (max-width: 768px) {
  .dock { 
    bottom: max(28px, calc(28px + env(safe-area-inset-bottom))); 
  }
  .ios26 .tray { 
    width: max-content; 
    max-width: calc(100% - 28px); 
    height: clamp(68px, 15vw, 76px); 
    padding: clamp(8px, 2.5vw, 12px) clamp(12px, 3vw, 16px); 
    border-radius: 24px; 
    gap: clamp(10px, 2.5vw, 16px); 
  }
  .tbtn { 
    width: clamp(68px, 17vw, 76px); 
    height: 100%;
    border-radius: 20px;
  }
  .tbtn .ticon svg, .tbtn .ticon .dock-icon-img { 
    width: clamp(30px, 7.5vw, 34px); 
    height: clamp(30px, 7.5vw, 34px); 
  }
}

@media (max-width: 480px) {
  .dock { 
    bottom: max(24px, calc(24px + env(safe-area-inset-bottom))); 
  }
  .ios26 .tray { 
    max-width: calc(100% - 24px); 
    height: clamp(64px, 13vw, 72px); 
    padding: clamp(7px, 2vw, 10px) clamp(10px, 2.5vw, 14px); 
    gap: clamp(8px, 2vw, 12px); 
  }
  .tbtn { 
    width: clamp(64px, 16vw, 72px); 
  }
  .tbtn .ticon svg, .tbtn .ticon .dock-icon-img { 
    width: clamp(28px, 6.5vw, 32px); 
    height: clamp(28px, 6.5vw, 32px); 
  }
}

@media (max-width: 360px) {
  .dock { 
    bottom: max(22px, calc(22px + env(safe-area-inset-bottom))); 
  }
  .ios26 .tray { 
    height: clamp(60px, 12vw, 68px); 
    max-width: calc(100% - 20px); 
    padding: clamp(6px, 1.8vw, 8px) clamp(8px, 2.2vw, 12px); 
    gap: clamp(6px, 1.8vw, 10px); 
  }
  .tbtn { 
    width: clamp(60px, 15vw, 68px); 
  }
  .tbtn .ticon svg, .tbtn .ticon .dock-icon-img { 
    width: clamp(26px, 6vw, 30px); 
    height: clamp(26px, 6vw, 30px); 
  }
}

/* Extra small screens */
@media (max-width: 320px) {
  .dock { 
    bottom: max(20px, calc(20px + env(safe-area-inset-bottom))); 
  }
  .ios26 .tray { 
    height: clamp(56px, 11vw, 64px); 
    max-width: calc(100% - 16px); 
    padding: clamp(5px, 1.5vw, 7px) clamp(7px, 2vw, 10px); 
    gap: clamp(5px, 1.5vw, 8px); 
  }
  .tbtn { 
    width: clamp(56px, 14vw, 64px); 
  }
  .tbtn .ticon svg, .tbtn .ticon .dock-icon-img { 
    width: clamp(24px, 5.5vw, 28px); 
    height: clamp(24px, 5.5vw, 28px); 
  }
}

@media (max-height: 700px) {
  .dock { 
    bottom: max(16px, calc(16px + env(safe-area-inset-bottom))); 
  }
}

@media (max-height: 600px) {
  .dock { 
    bottom: max(12px, calc(12px + env(safe-area-inset-bottom))); 
  }
  .page {
    padding-bottom: clamp(8px, 2vw, 16px);
  }
}
.tab { position: relative; height: 44px; border-radius: 14px; padding: 0 8px; display: grid; grid-template-rows: 24px auto; grid-template-columns: 1fr; place-items: center; color: #0e1625; background: transparent; appearance: none; border: 0; cursor: pointer; transition: transform .18s ease; }
.tab .pill { position: absolute; inset: 2px; border-radius: 12px; background: rgba(255,255,255,.2); opacity: 0; transition: opacity .25s ease, transform .25s ease; -webkit-backdrop-filter: blur(8px) saturate(140%); backdrop-filter: blur(8px) saturate(140%); }
.tab .tab-icon { display: grid; place-items: center; color: #0e1625; }
.tab .tab-label { margin-top: 4px; font-weight: 700; color: #5b6473; font-size: 10.5px; letter-spacing: .2px; }
.tab.active .pill { opacity: 1; box-shadow: 0 6px 18px rgba(13,31,58,.12), inset 0 0 0 1px rgba(255,255,255,.6); transform: translateY(-2px); }
.tab.active .tab-icon { color: #0a5cff; }
.tab.active .tab-label { color: #0a5cff; }
.tab:hover { transform: translateY(-1px); }

.fab-search {
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  width: 66px;
  height: 66px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #0e1625;
  background: rgba(255, 255, 255, 0.70);
  border: 1px solid rgba(0,0,0,.08);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  box-shadow: 0 14px 32px rgba(13,31,58,.16), inset 0 0 0 1px rgba(255,255,255,.65);
  pointer-events: auto;
}

.fab-search::after {
  content: "";
  position: absolute;
  inset: auto -14px -16px -14px;
  height: 22px;
  background: radial-gradient(60% 70% at 50% 0%, rgba(77,163,255,.35), transparent 70%);
  filter: blur(10px);
  border-radius: 50%;
  pointer-events: none;
}

@media (max-width: 480px) {
  .dock { width: calc(100% - 16px); }
  .ios16 .tabbar { width: 100%; height: 74px; }
  .fab-search { bottom: 26px; width: 60px; height: 60px; }
}

/* active highlight is blue for all tabs */

.dock-btn, .dock-center {
  position: relative;
  appearance: none; border: 0; background: transparent; color: var(--text);
  display: grid; place-items: center; gap: 6px; cursor: pointer;
  width: 62px; height: 50px; border-radius: 16px; transition: transform .18s ease, background .18s ease, color .18s ease;
}
.dock-btn .btn-label { font-size: 10px; color: var(--muted); margin-top: 2px; }
.dock-btn.active, .dock-btn:hover { background: rgba(255,255,255,.08); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.dock-btn.active .btn-label { color: var(--text); font-weight: 600; }

.dock-center {
  width: 76px; height: 64px; border-radius: 22px;
  background: linear-gradient(180deg, var(--accent), var(--brand));
  color: white; box-shadow: 0 10px 26px rgba(251, 252, 253, 0.45), inset 0 0 0 1px rgba(255,255,255,.6);
  transform: translateY(-18px);
}
.ripple::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  background: radial-gradient(120px 120px at var(--rx, 50%) var(--ry, 50%), rgba(255,255,255,.35), transparent 45%);
  transition: opacity .25s ease;
}
.ripple.is-animating::after { opacity: 1; animation: ripple .6s ease-out; }
@keyframes ripple { from { transform: scale(.96); } to { transform: scale(1.08); opacity: 0; } }

/* ---------- Utilities ---------- */

/* Critical performance optimizations */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Prevent layout shift */
.avatar, .social-icon-img, .icon-img, .dock-icon-img {
  aspect-ratio: 1;
}

/* Improve text rendering on mobile */
@media (max-width: 768px) {
  body {
    -webkit-font-smoothing: subpixel-antialiased;
    -moz-osx-font-smoothing: auto;
  }
  
  .name, .bio, .label {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}
/* Enhanced profile responsive layout */
@media (max-width: 768px) {
  .profile { 
    grid-template-columns: auto 1fr; 
    gap: clamp(10px, 2.5vw, 16px) clamp(12px, 2.5vw, 18px);
  }
  .socials { 
    justify-content: flex-start; 
  }
}

@media (max-width: 520px) and (min-width: 376px) {
  .profile { 
    grid-template-columns: 1fr; 
    text-align: center; 
    gap: clamp(12px, 3vw, 16px);
  }
  .avatar-wrap { 
    justify-self: center; 
  }
  .socials { 
    justify-content: center; 
  }
  .identity {
    text-align: center;
  }
}

/* Keep side-by-side layout for 375px and smaller */
@media (max-width: 375px) {
  .profile { 
    grid-template-columns: auto 1fr; 
    text-align: left; 
    gap: 14px 16px;
  }
  .avatar-wrap { 
    justify-self: start; 
  }
  .socials { 
    justify-content: flex-start; 
  }
  .identity {
    text-align: left;
  }
}

@media (max-width: 360px) {
  .profile {
    padding: clamp(8px, 2vw, 14px) clamp(6px, 1.5vw, 12px);
  }
  .socials {
    gap: clamp(4px, 1vw, 6px);
  }
}

/* Performance optimizations for mobile */
* {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-perspective: 1000;
  perspective: 1000;
}

/* Smooth scrolling for supported browsers */
html {
  scroll-behavior: smooth;
}

/* Improve touch targets for mobile */
@media (max-width: 768px) {
  .link-card, .social, .tbtn, .btn {
    min-height: 56px; /* iOS recommended minimum touch target - increased for better usability */
    min-width: 56px;
  }
  
  .link-card {
    padding: clamp(16px, 4vw, 18px) clamp(18px, 4vw, 20px);
  }
  
  .social {
    width: clamp(44px, 10vw, 48px);
    height: clamp(44px, 10vw, 48px);
  }
  
  /* Ensure dock buttons are always accessible */
  .tbtn {
    min-height: 56px;
    min-width: 56px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { 
    transition: none !important; 
    animation: none !important; 
    scroll-behavior: auto !important;
  }
}

/* Large screens optimization */
@media (min-width: 1400px) {
  .page {
    max-width: 800px;
    margin: 0 auto;
  }
  
  .profile,
  .links {
    max-width: 720px;
  }
}

/* Very small screens */
@media (max-width: 280px) {
  .page {
    padding: 4px;
  }
  
  .profile {
    max-width: calc(100vw - 8px);
    padding: 8px;
  }
  
  .links {
    max-width: calc(100vw - 8px);
  }
  
  .name {
    font-size: clamp(18px, 4vw, 22px);
  }
  
  .bio {
    font-size: clamp(12px, 2.2vw, 14px);
  }
}

/* Fix for landscape orientation on small devices */
@media (max-height: 500px) and (orientation: landscape) {
  .page {
    padding: 8px 16px;
  }
  
  .profile {
    padding: 12px 16px;
  }
  
  .socials {
    gap: 6px;
  }
}

/* Specific fix for 375x667 devices and similar aspect ratios */
@media (max-width: 375px) and (max-height: 700px) {
  .page {
    padding: 10px 16px 20px;
    min-height: 100vh;
  }
  
  .profile {
    margin-bottom: 8px;
  }
  
  .links {
    margin-top: 12px;
  }
  
  .link-list {
    gap: 10px;
  }
  
  /* Ensure proper spacing for content that might be cut off */
  .profile .identity {
    min-height: auto;
  }
  
  .socials {
    margin-top: 8px;
  }
}

/* Ensure proper word breaking for Arabic text */
.name, .bio, .label {
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}


