/* WAGEN — Digital Business Card
   Palette and type follow the printed card: graphite front, warm paper back,
   logo red used sparingly, IBM Plex Sans + Plex Mono. */

@font-face { font-family: "Plex Sans"; font-weight: 400; font-display: swap; src: url(assets/fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Plex Sans"; font-weight: 500; font-display: swap; src: url(assets/fonts/ibm-plex-sans-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Plex Sans"; font-weight: 600; font-display: swap; src: url(assets/fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Plex Mono"; font-weight: 400; font-display: swap; src: url(assets/fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Plex Mono"; font-weight: 500; font-display: swap; src: url(assets/fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); }
/* Arabic files are only fetched when Arabic text is actually rendered. */
@font-face { font-family: "Plex Sans Arabic"; font-weight: 400; font-display: swap; src: url(assets/fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Plex Sans Arabic"; font-weight: 500; font-display: swap; src: url(assets/fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Plex Sans Arabic"; font-weight: 600; font-display: swap; src: url(assets/fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }

:root {
  --bg: #0d0e11;
  --ink: #121317;
  --ink-2: #17181d;
  --ink-3: #1e2026;
  --paper: #f2f1ec;
  --text: #f2f1ec;
  --muted: #9b9ca3;
  --faint: #6c6e76;
  --line: rgba(242, 241, 236, .09);
  --line-2: rgba(242, 241, 236, .16);
  --red: #e42226;
  --red-soft: rgba(228, 34, 38, .55);

  --sans: "Plex Sans", "Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --pad: clamp(20px, 6vw, 36px);
  color-scheme: dark;
}
html[lang="ar"] { --sans: "Plex Sans Arabic", "Plex Sans", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
/* Engineering-drawing grid, fading out from the hero */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(242, 241, 236, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(242, 241, 236, .035) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 80% 55% at 50% 18%, #000 10%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 55% at 50% 18%, #000 10%, transparent 75%);
}
p, h1, h2, ul { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; border-radius: 10px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ───────── Layout ───────── */
.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 0;
}
.card {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: max(14px, env(safe-area-inset-top)) var(--pad) calc(28px + env(safe-area-inset-bottom));
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(242, 241, 236, .055), transparent 60%),
    linear-gradient(180deg, var(--ink) 0%, var(--ink) 100%);
  isolation: isolate;
}
@media (min-width: 560px) {
  .page { padding: 48px 24px; }
  .card {
    min-height: 0;
    border: 1px solid var(--line);
    border-radius: 26px;
    padding: 18px 36px 34px;
    overflow: hidden;
    box-shadow:
      0 1px 0 rgba(255, 255, 255, .04) inset,
      0 40px 80px -30px rgba(0, 0, 0, .8),
      0 18px 36px -18px rgba(0, 0, 0, .6);
  }
}

/* ───────── Top bar ───────── */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  border-bottom: 1px solid var(--line);
}
.micro {
  font: 500 10.5px/1 var(--mono);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
}
html[lang="ar"] .micro:not([dir="ltr"]) { font-family: var(--sans); letter-spacing: 0; font-size: 12px; }
.micro .sep { color: var(--red); margin: 0 .2em; }
.lang {
  font: 500 13px/1 system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  color: var(--muted);
  min-height: 44px;
  min-width: 44px;
  padding: 0 2px 0 14px;
  transition: color .2s;
}
html[lang="ar"] .lang { font: 500 10.5px/1 var(--mono); letter-spacing: .22em; padding: 0 14px 0 2px; }
.lang:hover { color: var(--text); }

/* ───────── Hero ───────── */
.hero {
  padding: clamp(18px, 4.5vh, 56px) 0 clamp(22px, 4vh, 36px);
  text-align: center;
}
.stage {
  position: relative;
  padding: 22px 14px 26px;
  margin: 0 -6px;
}
.mark {
  position: absolute;
  width: 12px; height: 12px;
  border-color: var(--line-2);
  border-style: solid;
  border-width: 0;
  opacity: 0;
  animation: fade .8s var(--ease) 1.1s forwards;
}
.mark.tl { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.mark.tr { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.mark.bl { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.mark.br { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }

.logo {
  position: relative;
  width: min(100%, 400px);
  margin: 0 auto;
  aspect-ratio: 666 / 236;
  /* "Drive-in" reveal: the car is lit from tail to nose */
  -webkit-mask-image: linear-gradient(90deg, #000 0 45%, transparent 55% 100%);
  mask-image: linear-gradient(90deg, #000 0 45%, transparent 55% 100%);
  -webkit-mask-size: 260% 100%;
  mask-size: 260% 100%;
  -webkit-mask-position: 100% 0;
  mask-position: 100% 0;
  animation: drive-in 1.5s var(--ease-io) .25s forwards;
}
.logo img { width: 100%; height: 100%; display: block; }
.sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 38%, rgba(255, 255, 255, .0) 42%, rgba(255, 255, 255, .95) 50%, rgba(255, 255, 255, 0) 58%, transparent 62%);
  background-size: 300% 100%;
  background-position: 120% 0;
  -webkit-mask: url(assets/wagen-logo.svg) center / 100% 100% no-repeat;
  mask: url(assets/wagen-logo.svg) center / 100% 100% no-repeat;
  mix-blend-mode: overlay;
  opacity: .9;
}
.logo.shine .sheen { animation: sheen 1.6s var(--ease-io) forwards; }
.horizon {
  position: absolute;
  left: 8%; right: 8%;
  bottom: 14px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--red-soft) 30%, var(--red) 50%, var(--red-soft) 70%, transparent);
  opacity: 0;
  transform: scaleX(.2);
  animation: horizon 1.4s var(--ease) 1s forwards;
}
.horizon::after {
  content: "";
  position: absolute;
  left: 20%; right: 20%; top: 0;
  height: 18px;
  background: radial-gradient(50% 100% at 50% 0%, rgba(228, 34, 38, .22), transparent);
}

.tagline {
  margin-top: clamp(20px, 3.6vh, 32px);
  font-weight: 500;
  font-size: clamp(17px, 4.6vw, 19px);
  letter-spacing: -.005em;
  color: var(--text);
}

/* Germany → GCC route */
.route {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  max-width: 300px;
  margin: 16px auto 0;
}
.node { display: grid; gap: 5px; text-align: start; }
.node.end { text-align: end; }
.place { font-size: 14px; color: var(--muted); line-height: 1; }
.code { font: 500 10px/1 var(--mono); letter-spacing: .24em; color: var(--faint); }
.track { position: relative; height: 12px; color: var(--red); }
.track .line {
  position: absolute; left: 0; right: 4px; top: 50%;
  height: 1px;
  background: linear-gradient(90deg, rgba(242, 241, 236, .12), rgba(242, 241, 236, .3));
  transform-origin: left center;
  transform: scaleX(0);
  animation: draw 1.1s var(--ease) 1.2s forwards;
}
.track .line::before {
  content: "";
  position: absolute; left: -2px; top: -2px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--muted);
}
.track .head { position: absolute; right: 0; top: 0; opacity: 0; animation: fade .4s var(--ease) 2.1s forwards; }
.track .glint {
  position: absolute; top: 50%; left: 0;
  width: 34px; height: 1px; margin-top: 0;
  background: linear-gradient(90deg, transparent, var(--red));
  opacity: 0;
  animation: glint 5.5s var(--ease-io) 2.6s infinite;
}
[dir="rtl"] .track { transform: scaleX(-1); }

/* ───────── Person ───────── */
.person {
  position: relative;
  padding: 2px 0 2px 16px;
  margin: 4px 0 20px;
}
.person::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 3px; bottom: 3px;
  width: 3px;
  border-radius: 2px;
  background: var(--red);
}
[dir="rtl"] .person { padding: 2px 16px 2px 0; }
.name { font-weight: 600; font-size: 22px; line-height: 1.2; letter-spacing: -.01em; }
.role { margin-top: 4px; font-size: 14px; color: var(--muted); }

/* ───────── Contact rows ───────── */
.contacts ul { border-top: 1px solid var(--line); }
.row {
  position: relative;
  border-bottom: 1px solid var(--line);
}
.row::after {
  /* red hairline that runs along the row on hover/press */
  content: "";
  position: absolute;
  inset-inline-start: 0;
  bottom: -1px;
  width: 100%;
  height: 1px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .55s var(--ease);
  pointer-events: none;
}
[dir="rtl"] .row::after { transform-origin: right center; }
.row-link {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  padding: 12px 0;
  padding-inline-end: 4px;
  border-radius: 12px;
  transition: transform .25s var(--ease);
}
.row:has(.copy) .row-link { padding-inline-end: 56px; }
.ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--ink-3);
  border: 1px solid var(--line);
  color: var(--text);
  transition: background .3s, border-color .3s, color .3s;
}
.ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ico svg .fill { fill: currentColor; stroke: none; }
.txt { flex: 1; min-width: 0; display: grid; gap: 3px; }
.label { font-weight: 500; font-size: 16px; line-height: 1.25; }
.value {
  font: 400 13.5px/1.3 var(--mono);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: start;
}
[dir="rtl"] .value { text-align: right; }
html[lang="ar"] .value[data-i18n] { font-family: var(--sans); font-size: 13.5px; }
.go {
  flex: none;
  color: var(--faint);
  transition: transform .35s var(--ease), color .3s;
}
.go svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] .go svg { transform: scaleX(-1); }
.row:has(.copy) .go { display: none; }

.copy {
  position: absolute;
  inset-inline-end: 0;
  top: 50%;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  color: var(--faint);
  transition: color .2s, background .2s, transform .2s var(--ease);
}
.copy svg { grid-area: 1 / 1; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: opacity .25s, transform .35s var(--ease); }
.copy .i-done { opacity: 0; transform: scale(.6); color: var(--paper); stroke-width: 1.8; }
.copy.done .i-copy { opacity: 0; transform: scale(.6); }
.copy.done .i-done { opacity: 1; transform: none; }
.copy:hover { color: var(--text); background: rgba(242, 241, 236, .06); }
.copy:active { transform: scale(.92); }

@media (hover: hover) {
  .row:hover::after, .row:focus-within::after { transform: scaleX(1); }
  .row-link:hover .ico { background: var(--paper); border-color: var(--paper); color: var(--ink); }
  .row-link:hover .go { color: var(--text); transform: translateX(3px); }
  [dir="rtl"] .row-link:hover .go { transform: translateX(-3px); }
}
.row-link:active { transform: scale(.985); }
.row-link:active .ico { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.row:has(.row-link:active)::after { transform: scaleX(1); transition-duration: .3s; }

/* ───────── Actions ───────── */
.actions {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 10px;
  margin-top: 22px;
}
@media (max-width: 340px) { .actions { grid-template-columns: 1fr; } }
@media (max-width: 340px) { .value { font-size: 12.5px; } }
.actions.single { grid-template-columns: 1fr; }
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 18px;
  border-radius: 14px;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: .005em;
  white-space: nowrap;
  overflow: hidden;
  transition: transform .2s var(--ease), background .3s, border-color .3s, color .3s;
}
.btn svg { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.btn.primary { background: var(--paper); color: var(--ink); }
.btn.primary::after {
  /* red underline, like the stripe on the back of the printed card */
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 3px;
  background: var(--red);
  transform: scaleX(0);
  transition: transform .45s var(--ease);
}
.btn.ghost { border: 1px solid var(--line-2); color: var(--text); background: rgba(242, 241, 236, .02); }
@media (hover: hover) {
  .btn.primary:hover::after { transform: scaleX(1); }
  .btn.ghost:hover { border-color: rgba(242, 241, 236, .38); background: rgba(242, 241, 236, .06); }
}
.btn:active { transform: scale(.97); }
.btn[hidden] { display: none; }

/* ───────── Footer ───────── */
.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 44px;
}
.foot .micro { font-size: 9.5px; color: var(--faint); }
html[lang="ar"] .foot .place-mini { font-size: 12px; }
.route-mini { display: inline-flex; align-items: center; gap: 8px; color: var(--text) !important; }
.route-mini svg { fill: none; stroke: var(--red); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.place-mini { display: none; }
@media (min-width: 380px) { .place-mini { display: inline; } }
.stripe {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: var(--red);
  transform-origin: left center;
  transform: scaleX(0);
  animation: draw 1.2s var(--ease) 1.6s forwards;
}
[dir="rtl"] .stripe { transform-origin: right center; }

/* ───────── Share sheet ───────── */
.sheet {
  width: 100%;
  max-width: 480px;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 24px 24px 0 0;
  background: var(--ink-2);
  color: var(--text);
  box-shadow: 0 -1px 0 var(--line-2), 0 -30px 60px -20px rgba(0, 0, 0, .7);
}
.sheet::backdrop { background: rgba(5, 6, 8, .66); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sheet[open] { animation: sheet-up .45s var(--ease); }
.sheet[open]::backdrop { animation: fade .3s ease; }
@media (min-width: 560px) {
  .sheet { margin: auto; max-width: 400px; border-radius: 24px; box-shadow: 0 0 0 1px var(--line-2), 0 40px 80px -20px rgba(0, 0, 0, .8); }
}
.sheet-inner { padding: 22px var(--pad) calc(26px + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.sheet h2 { font-weight: 600; font-size: 18px; }
.close { display: grid; place-items: center; width: 44px; height: 44px; margin-inline-end: -10px; border-radius: 12px; color: var(--muted); }
.close:hover { color: var(--text); background: rgba(242, 241, 236, .06); }
.close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.qr {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 18px;
  border-radius: 18px;
  background: #fff;
  color: #121317;
}
.qr img { width: min(100%, 236px); height: auto; aspect-ratio: 1; image-rendering: pixelated; }
.qr figcaption { font: 500 10px/1.2 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: #5b5d63; text-align: center; }
html[lang="ar"] .qr figcaption { font-family: var(--sans); letter-spacing: 0; font-size: 12.5px; text-transform: none; }
.sheet-url {
  margin: 14px 0 18px;
  font: 400 12.5px/1.4 var(--mono);
  color: var(--muted);
  text-align: center;
  word-break: break-all;
}
.sheet-actions { display: grid; gap: 10px; }

/* ───────── Toast ───────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  translate: -50% 16px;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 500;
  font-size: 14px;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .6);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, translate .35s var(--ease);
  z-index: 10;
}
.toast.show { opacity: 1; translate: -50% 0; }

/* ───────── Entrance ───────── */
.reveal { opacity: 0; animation: rise .9s var(--ease) forwards; animation-delay: calc(var(--i, 0) * 70ms + 600ms); }
[data-d="0"] { --i: -6; }
[data-d="3"] { --i: 3; } [data-d="4"] { --i: 4; } [data-d="5"] { --i: 5; } [data-d="6"] { --i: 6; }
[data-d="7"] { --i: 7; } [data-d="8"] { --i: 8; } [data-d="9"] { --i: 9; } [data-d="10"] { --i: 10; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes draw { to { transform: scaleX(1); } }
@keyframes drive-in { to { -webkit-mask-position: 0 0; mask-position: 0 0; } }
@keyframes sheen { from { background-position: 120% 0; } to { background-position: -20% 0; } }
@keyframes horizon { to { opacity: .9; transform: none; } }
@keyframes glint {
  0% { left: 0; opacity: 0; }
  8% { opacity: 1; }
  38% { left: calc(100% - 34px); opacity: 1; }
  46%, 100% { left: calc(100% - 34px); opacity: 0; }
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .track .glint { display: none; }
}
