/* Vividy landing — the page is one poster image; everything else is overlay chrome. */

:root {
  --bg: #0a0510;
  --ink: #ffffff;
  --mute: rgba(255, 255, 255, .62);
  --brand-a: #ff2d8a;
  --brand-b: #a855f7;
  --brand-c: #ffb347;
  --glass: rgba(14, 8, 24, .62);
  --line: rgba(255, 255, 255, .14);
  --dur: .26s;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  font-family: "Outfit", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

body {
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: smooth;
  background: #070510;
}

body.locked { touch-action: none; }

/* ---------------- the page: one long poster, scroll to the end ---------------- */
.stage {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  cursor: pointer;
  isolation: isolate;
}

.backdrop {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(64px) saturate(1.25) brightness(.42);
  transform: scale(1.06);
  z-index: 0;
  pointer-events: none;
  user-select: none;
}

.poster {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  user-select: none;
  -webkit-user-drag: none;
  animation: fadeIn .32s ease both;
}

/* keeps the fixed language pill from covering the last rows of the poster */
.tray {
  display: block;
  height: calc(76px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(4, 4, 9, 0), rgba(4, 4, 9, 1) 60%);
}

@keyframes fadeIn {
  from { opacity: .0; transform: scale(.995); }
  to   { opacity: 1; transform: none; }
}

.poster.swapping { animation: swapIn .34s ease both; }

@keyframes swapIn {
  from { opacity: .25; transform: scale(.994); }
  to   { opacity: 1; transform: none; }
}

/* ---------------- language switch ---------------- */
.langbar {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
}

.lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--mute);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-decoration: none;
  transition: color var(--dur) ease, background var(--dur) ease;
}

.lang:hover { color: #fff; background: rgba(255, 255, 255, .08); }

.lang.on {
  color: #fff;
  background: linear-gradient(100deg, var(--brand-a), var(--brand-b) 62%, var(--brand-c));
  box-shadow: 0 6px 18px rgba(168, 85, 247, .38);
}

html[dir="rtl"] .lang { letter-spacing: 0; }

/* ---------------- download sheet ---------------- */
.veil {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(6, 3, 12, .68);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur) ease, visibility var(--dur) ease;
}

.veil.on { opacity: 1; visibility: visible; }

.card {
  position: relative;
  width: 100%;
  max-width: 358px;
  padding: 26px 22px 20px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(28, 16, 44, .96), rgba(12, 7, 22, .98));
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .62), inset 0 1px 0 rgba(255, 255, 255, .08);
  text-align: center;
  transform: translateY(10px) scale(.97);
  opacity: 0;
  transition: transform .3s cubic-bezier(.22, .9, .28, 1), opacity .3s ease;
}

.veil.on .card { transform: none; opacity: 1; }

.card .x {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .07);
  color: rgba(255, 255, 255, .72);
  cursor: pointer;
  transition: background var(--dur) ease, color var(--dur) ease;
}

.card .x:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.card .x svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.card .mark {
  width: 54px;
  height: 54px;
  margin: 2px auto 12px;
  filter: drop-shadow(0 8px 22px rgba(168, 85, 247, .5));
}

.card .mark svg { width: 100%; height: 100%; display: block; }

.card h2 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.28;
  font-weight: 700;
  letter-spacing: -.01em;
}

.card .sub {
  margin: 0 0 18px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--mute);
}

.card .go {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 54px;
  border-radius: 999px;
  background: linear-gradient(100deg, var(--brand-a), var(--brand-b) 58%, var(--brand-c));
  color: #fff;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: .01em;
  text-decoration: none;
  box-shadow: 0 14px 34px rgba(232, 42, 138, .36);
  transition: transform var(--dur) ease, box-shadow var(--dur) ease, filter var(--dur) ease;
}

.card .go:hover { transform: translateY(-1px); filter: brightness(1.05); }
.card .go:active { transform: translateY(0) scale(.994); }
.card .go svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.card .note {
  margin: 12px 0 0;
  font-size: 12.5px;
  color: rgba(255, 255, 255, .74);
}

.card .meta {
  margin: 4px 0 0;
  font-size: 11.5px;
  letter-spacing: .02em;
  color: rgba(255, 255, 255, .38);
}

/* ---------------- toast ---------------- */
.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: 66px;
  transform: translate(-50%, 8px);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(20, 12, 32, .92);
  border: 1px solid var(--line);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- locale typography ---------------- */
body.lang-ar { font-family: "Cairo", "Segoe UI", system-ui, sans-serif; }
body.lang-ar .card h2 { font-size: 19px; line-height: 1.45; }
body.lang-ar .card .go { font-size: 16px; letter-spacing: 0; }
body.lang-ar .lang { letter-spacing: 0; }

body.lang-zh { font-family: "Outfit", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif; }

/* ---------------- responsive ---------------- */
@media (max-width: 420px) {
  .card { max-width: 340px; padding: 24px 18px 18px; border-radius: 22px; }
  .card h2 { font-size: 19px; }
  .langbar { bottom: max(10px, env(safe-area-inset-bottom, 0px)); }
}

/* landscape phones: poster becomes wide, keep sheet compact */
@media (max-height: 500px) and (orientation: landscape) {
  .card { max-width: 320px; padding: 18px 18px 14px; }
  .card .mark { width: 42px; height: 42px; margin-bottom: 8px; }
  .card .sub { margin-bottom: 12px; }
  .langbar { bottom: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .veil, .poster, .lang { transition: none; animation: none; }
}

/* Arabic font is only needed when the locale is active — loaded by PHP-side <link> if present */
@font-face {
  font-family: "Outfit";
  src: url("../f/outfit.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Cairo";
  src: url("../f/cairo.ttf") format("truetype");
  font-weight: 200 1000;
  font-display: swap;
}

