/* =========================================================================
   Teradix Digital Business Card — Design System
   Tokens sourced from the Teradix (Nomow "Default") brand system.
   ========================================================================= */

:root {
  /* Brand colors */
  --tx-primary: #D262FF;
  --tx-primary-dark: #AD46FF;
  --tx-secondary: #010B2E;   /* deep navy canvas */
  --tx-accent: #e7ff5a;      /* electric lime */
  --tx-success: #10B981;
  --tx-info: #3B82F6;

  /* Brand gradients */
  --tx-grad-brand: linear-gradient(135deg, #D262FF 0%, #AD46FF 100%);
  --tx-grad-dark:  linear-gradient(135deg, #010B2E 0%, #0226ff 100%);
  --tx-grad-accent: linear-gradient(90deg, #e7ff5a 0%, #06fffb 100%);

  /* Neutrals */
  --n-50:#fafafa; --n-100:#f5f5f5; --n-200:#e5e5e5; --n-300:#d4d4d4;
  --n-400:#a3a3a3; --n-500:#737373; --n-600:#525252; --n-700:#404040;
  --n-800:#262626; --n-900:#171717; --n-950:#0a0a0a;

  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --fs-h1: 32px; --fs-h2: 24px; --fs-body: 16px; --fs-caption: 13px;
  --lh-body: 1.6;

  /* Spacing scale (4px unit) */
  --s1:4px; --s2:8px; --s3:12px; --s4:16px; --s5:24px;
  --s6:32px; --s7:48px; --s8:64px; --s9:96px;

  /* Radius */
  --r-sm:4px; --r-md:8px; --r-lg:12px; --r-xl:16px; --r-2xl:24px; --r-full:9999px;

  /* Shadows */
  --sh-md:0 4px 6px -1px rgba(0,0,0,0.1);
  --sh-lg:0 10px 15px -3px rgba(0,0,0,0.1);
  --sh-xl:0 20px 25px -5px rgba(0,0,0,0.25);
  --sh-glow:0 0 60px -8px rgba(210,98,255,0.55);

  /* Surfaces */
  --card-bg: rgba(255,255,255,0.06);
  --card-border: rgba(255,255,255,0.12);
}

/* ----------------------------------------------------------------- Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: #fff;
  background: var(--tx-secondary);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ----------------------------------------------------------------- Layout */
.page {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  padding: var(--s5) var(--s4) var(--s7);
  overflow: hidden;
}

/* Ambient brand glow behind the hero */
.page::before {
  content: "";
  position: absolute;
  top: -160px; left: 50%;
  width: 460px; height: 460px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(210,98,255,0.35) 0%, rgba(173,70,255,0.10) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.page > * { position: relative; z-index: 1; }

/* ----------------------------------------------------------------- Brand bar */
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s2) 0 var(--s6);
}
.brand img { height: 30px; width: auto; opacity: 0.95; }

/* ----------------------------------------------------------------- Rep card */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r-2xl);
  padding: var(--s6) var(--s5) var(--s5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--sh-xl);
  text-align: center;
}

.avatar-wrap {
  width: 116px; height: 116px;
  margin: 0 auto var(--s4);
  border-radius: var(--r-full);
  padding: 3px;
  background: var(--tx-grad-brand);
  box-shadow: var(--sh-glow);
}
.avatar {
  width: 100%; height: 100%;
  border-radius: var(--r-full);
  object-fit: cover;
  background: var(--n-800);
  border: 3px solid var(--tx-secondary);
}
.avatar-fallback {
  width: 100%; height: 100%;
  border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; font-weight: 700; color: #fff;
  background: var(--tx-grad-dark);
  border: 3px solid var(--tx-secondary);
}

.rep-name {
  font-size: var(--fs-h1);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.rep-title {
  margin-top: var(--s2);
  font-size: var(--fs-body);
  font-weight: 500;
  color: var(--n-300);
}
.rep-company {
  margin-top: var(--s1);
  font-size: var(--fs-caption);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: var(--tx-grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ----------------------------------------------------------------- Buttons */
.actions { margin-top: var(--s5); display: flex; flex-direction: column; gap: var(--s3); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s3);
  width: 100%;
  padding: 15px 24px;
  border-radius: var(--r-lg);
  font-size: var(--fs-body);
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: transform .15s ease, box-shadow .15s ease, background .2s ease;
  will-change: transform;
}
.btn:active { transform: scale(0.98); }
.btn svg { width: 20px; height: 20px; flex: none; }

.btn-primary {
  background: var(--tx-grad-brand);
  color: #fff;
  box-shadow: 0 8px 24px -6px rgba(173,70,255,0.6);
}
.btn-primary:hover { box-shadow: 0 10px 30px -6px rgba(210,98,255,0.75); }

.btn-accent {
  background: var(--tx-accent);
  color: var(--tx-secondary);
}
.btn-accent:hover { filter: brightness(1.05); }

.btn-ghost {
  background: rgba(255,255,255,0.05);
  color: #fff;
  border: 1px solid var(--card-border);
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); }

/* ----------------------------------------------------------------- Quick contact row */
.contact-row {
  margin-top: var(--s5);
  display: flex;
  justify-content: center;
  gap: var(--s3);
}
.contact-row a {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--card-border);
  transition: background .2s ease, transform .15s ease;
}
.contact-row a:hover { background: rgba(255,255,255,0.12); transform: translateY(-2px); }
.contact-row svg { width: 20px; height: 20px; color: #fff; }

/* ----------------------------------------------------------------- Value props */
.section-label {
  margin: var(--s7) 0 var(--s4);
  text-align: center;
  font-size: var(--fs-caption);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--n-400);
}
.values { display: flex; flex-direction: column; gap: var(--s3); }
.value {
  display: flex;
  align-items: flex-start;
  gap: var(--s4);
  padding: var(--s4) var(--s5);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r-xl);
}
.value-icon {
  flex: none;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-md);
  background: var(--tx-grad-brand);
}
.value-icon svg { width: 20px; height: 20px; color: #fff; }
.value h3 { font-size: var(--fs-body); font-weight: 600; }
.value p { font-size: var(--fs-caption); color: var(--n-400); line-height: 1.5; margin-top: 2px; }

/* ----------------------------------------------------------------- Trust strip
   Rotating customer-logo cells — ported from the Teradix marketing site's
   trust band, adapted to the card's narrow column (3 cols x 2 rows). */
.trust { margin-top: var(--s7); }
.trust-note {
  text-align: center;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--n-500);
  margin-bottom: var(--s5);
  padding: 0 var(--s4);
}
.trust-note .hl {
  color: var(--tx-accent); font-weight: 700;
  text-shadow: 0 0 12px rgba(231,255,90,0.25);
}
.trust-cells {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
}
.trust-cell {
  position: relative;
  height: 82px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  border-right: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background .3s ease;
}
.trust-cell:nth-child(3n) { border-right: none; }
.trust-cell:nth-child(n+4) { border-bottom: none; }
.trust-cell:hover { background: rgba(255,255,255,0.02); }
.trust-logo {
  height: 28px; width: auto;
  max-width: 70%; max-height: 28px;
  object-fit: contain;
  /* render every logo as clean white to match the dark canvas */
  filter: brightness(0) invert(1);
  opacity: 0.72;
  transition: opacity .3s ease;
  will-change: transform, opacity;
}
.trust-cell:hover .trust-logo { opacity: 1; }
/* per-logo sizing so tightly-cropped marks don't dominate padded ones */
.trust-logo[src*="wadi-group"]     { max-height: 20px; max-width: 48%; }
.trust-logo[src*="arabian-cement"] { max-height: 23px; max-width: 56%; }
.trust-logo[src*="cenomi"]         { max-height: 24px; }
.trust-logo[src*="kayan"]          { max-height: 30px; }
.trust-logo.is-leaving  { animation: trustOut .45s cubic-bezier(.4,0,.2,1) forwards; }
.trust-logo.is-entering { animation: trustIn .55s cubic-bezier(.22,1,.36,1) forwards; }
@keyframes trustOut { from { opacity:.72; transform: translateY(0); }  to { opacity:0; transform: translateY(-18px); } }
@keyframes trustIn  { from { opacity:0;  transform: translateY(20px); } to { opacity:.72; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .trust-logo.is-leaving, .trust-logo.is-entering { animation: none !important; opacity: .72; transform: none; }
}

/* ----------------------------------------------------------------- Footer */
.foot {
  margin-top: var(--s7);
  text-align: center;
  color: var(--n-500);
  font-size: var(--fs-caption);
}
.foot a { color: var(--n-300); font-weight: 500; }

/* ----------------------------------------------------------------- Toast */
.toast {
  position: fixed;
  left: 50%; bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: var(--tx-secondary);
  border: 1px solid var(--tx-primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--r-full);
  font-size: var(--fs-caption);
  font-weight: 500;
  box-shadow: var(--sh-xl);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ----------------------------------------------------------------- Motion */
@media (prefers-reduced-motion: no-preference) {
  .card, .values > *, .brand { animation: rise .6s cubic-bezier(.16,.84,.44,1) both; }
  .values > *:nth-child(1) { animation-delay: .05s; }
  .values > *:nth-child(2) { animation-delay: .12s; }
  .values > *:nth-child(3) { animation-delay: .19s; }
  @keyframes rise { from { opacity:0; transform: translateY(16px); } to { opacity:1; transform:none; } }
}

@media (min-width: 520px) {
  :root { --fs-h1: 34px; }
}
