/* ==========================================================================
   Zworks — Contact (linktree) public page
   All themeable values are CSS variables set at runtime by app.js from config.
   ========================================================================== */

:root {
  --bg1: #121317;
  --bg2: #202329;
  --bg-image: none;
  --bg-overlay: 0.5;
  --bg-blur: 0px;
  --accent: #b11d2c;
  --text: #f4f5f7;
  --muted: #9aa0a6;
  --card-bg: rgba(27, 30, 36, 0.62);
  --card-text: #ffffff;
  --card-border: rgba(255, 255, 255, 0.1);
  --radius: 16px;
  --font-scale: 1;
  --btn-scale: 1;
  --font-family: "Tajawal", "Cairo", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

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

body {
  min-height: 100vh;
  font-family: var(--font-family);
  color: var(--text);
  background: var(--bg1);
  position: relative;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Background layer (gradient or image + dark overlay), fixed so content scrolls over it */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(160deg, var(--bg1) 0%, var(--bg2) 100%);
}
.bg-layer.has-image {
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  filter: blur(var(--bg-blur));
  transform: scale(1.04); /* hide blur edge bleed */
}
.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(8, 9, 12, var(--bg-overlay));
  pointer-events: none;
}
/* Soft brand glow accents */
.bg-overlay::before,
.bg-overlay::after {
  content: "";
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  pointer-events: none;
}
.bg-overlay::before {
  top: -20vmax; right: -10vmax;
  background: radial-gradient(circle, var(--accent), transparent 60%);
}
.bg-overlay::after {
  bottom: -25vmax; left: -15vmax;
  background: radial-gradient(circle, #2b6cff, transparent 60%);
  opacity: 0.1;
}

/* ---- Layout shell ---- */
.wrap {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  padding: clamp(28px, 7vw, 56px) clamp(16px, 5vw, 26px) 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---- Logo ---- */
.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: 16px 22px;
  border-radius: 20px;
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.7),
              0 0 0 1px rgba(255, 255, 255, 0.06);
  border: 2px solid transparent;
  background-clip: padding-box;
  position: relative;
  max-width: 78%;
  animation: pop 0.6s cubic-bezier(0.18, 0.9, 0.3, 1.2) both;
}
.logo::after { /* subtle red ring echoing the brand bow */
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 22px;
  padding: 2px;
  background: linear-gradient(135deg, var(--accent), transparent 55%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}
.logo.shape-circle { border-radius: 50%; width: 132px; height: 132px; padding: 12px; }
.logo.shape-circle::after { border-radius: 50%; inset: -2px; }
.logo img { display: block; width: 100%; height: auto; max-height: 96px; object-fit: contain; }
.logo.shape-circle img { border-radius: 50%; max-height: none; height: 100%; object-fit: contain; }

.title {
  margin: 18px 0 4px;
  font-size: calc(1.55rem * var(--font-scale));
  font-weight: 800;
  letter-spacing: 0.5px;
}
.subtitle {
  margin: 0 0 6px;
  font-size: calc(0.98rem * var(--font-scale));
  color: var(--muted);
  text-align: center;
  max-width: 36ch;
  font-weight: 500;
}

/* ---- Socials ---- */
.socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 22px 0 26px;
}
.social {
  --size: calc(46px * var(--btn-scale));
  width: var(--size);
  height: var(--size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--card-text);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  text-decoration: none;
  animation: rise 0.5s ease both;
}
.social svg { width: calc(var(--size) * 0.46); height: calc(var(--size) * 0.46); }
.social:hover, .social:focus-visible {
  transform: translateY(-3px) scale(1.06);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 24px -10px var(--accent);
  outline: none;
}

/* ---- Service buttons ---- */
.buttons { width: 100%; display: flex; flex-direction: column; gap: 13px; }

.btn {
  --pad-y: calc(15px * var(--btn-scale));
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: var(--pad-y) calc(18px * var(--btn-scale));
  border-radius: var(--radius);
  background: var(--card-bg);
  color: var(--card-text);
  border: 1px solid var(--card-border);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  text-decoration: none;
  font-family: inherit;
  font-size: calc(1.02rem * var(--font-scale));
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.22s ease, border-color 0.18s ease, background 0.18s ease;
  animation: rise 0.55s ease both;
}
.btn .ic {
  flex: 0 0 auto;
  width: calc(26px * var(--btn-scale));
  height: calc(26px * var(--btn-scale));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  transition: color 0.18s ease, transform 0.18s ease;
}
.btn .ic svg { width: 100%; height: 100%; }
.btn .txt { flex: 1 1 auto; min-width: 0; text-align: start; }
.btn .label { display: block; }
.btn .sub {
  display: block;
  font-size: calc(0.76rem * var(--font-scale));
  font-weight: 500;
  color: var(--muted);
  margin-top: 2px;
}
.btn .chev {
  flex: 0 0 auto;
  width: 18px; height: 18px;
  color: var(--muted);
  opacity: 0.7;
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.btn:hover, .btn:focus-visible {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 16px 30px -16px rgba(0, 0, 0, 0.8),
              0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
  outline: none;
}
.btn:hover .ic { transform: scale(1.12); }
.btn:hover .chev { transform: translateX(-4px); opacity: 1; }
.btn:active { transform: translateY(0) scale(0.99); }

/* gradient sheen on hover */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, color-mix(in srgb, var(--accent) 14%, transparent), transparent);
  transform: translateX(-120%);
  transition: transform 0.6s ease;
  pointer-events: none;
}
.btn:hover::before { transform: translateX(120%); }

/* Variants */
.btn.whatsapp {
  background: linear-gradient(135deg, #25d366, #128c4b);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
}
.btn.whatsapp .ic, .btn.whatsapp .sub, .btn.whatsapp .chev { color: rgba(255, 255, 255, 0.92); }
.btn.whatsapp:hover { box-shadow: 0 16px 32px -14px rgba(37, 211, 102, 0.6); border-color: rgba(255,255,255,0.3); }

.btn.primary {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #000));
  color: #fff;
  border-color: rgba(255, 255, 255, 0.16);
}
.btn.primary .ic, .btn.primary .sub, .btn.primary .chev { color: rgba(255, 255, 255, 0.9); }

/* ---- Footer ---- */
.foot {
  margin-top: 30px;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  opacity: 0.85;
}
.foot a { color: var(--muted); text-decoration: none; border-bottom: 1px dotted var(--card-border); }
.foot a:hover { color: var(--accent); }

/* ---- Loading splash ---- */
.splash {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--bg1), var(--bg2));
  z-index: 50;
  transition: opacity 0.4s ease;
}
.splash.hide { opacity: 0; pointer-events: none; }
.splash .spin {
  width: 42px; height: 42px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ---- Animations ---- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop  { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Stagger button entrance */
.btn:nth-child(1){animation-delay:.04s}.btn:nth-child(2){animation-delay:.08s}
.btn:nth-child(3){animation-delay:.12s}.btn:nth-child(4){animation-delay:.16s}
.btn:nth-child(5){animation-delay:.20s}.btn:nth-child(6){animation-delay:.24s}
.btn:nth-child(7){animation-delay:.28s}.btn:nth-child(8){animation-delay:.32s}
.btn:nth-child(9){animation-delay:.36s}.btn:nth-child(10){animation-delay:.40s}
.btn:nth-child(n+11){animation-delay:.44s}

/* Fallback for browsers without color-mix */
@supports not (color: color-mix(in srgb, red, blue)) {
  .btn:hover, .btn:focus-visible { border-color: var(--accent); }
}
