/* ==================================================================
   BEOC DIGITAL CARD – styles
   Colours, fonts and the card size are the first lines below.
   ================================================================== */
:root {
  --navy: #142A4F;
  --navy-2: #1d3b69;
  --navy-d: #0A1526;
  --red: #C8202B;
  --gold: #D4A017;
  --cream: #FAF7F1;
  --ink: #1E1F22;
  --muted: #6b7486;
  --white: #ffffff;

  --display: "Montserrat", system-ui, sans-serif;
  --body: "Open Sans", system-ui, sans-serif;

  --card-w: min(88vw, 400px);   /* card width */
  --ratio: 400 / 620;            /* card shape (width / height) */
  --radius: 22px;
  --flip-speed: .85s;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 0 max(28px, env(safe-area-inset-bottom));
  background: radial-gradient(120% 90% at 30% 10%, #183259 0%, var(--navy-d) 62%, #060d19 100%);
  font-family: var(--body);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
svg .fill { fill: currentColor; stroke: none; }
button { font: inherit; cursor: pointer; }

/* ---------- moving background glow ---------- */
.aura { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aura span { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(80px); opacity: .32; animation: drift 22s ease-in-out infinite alternate; }
.aura span:nth-child(1) { background: var(--red); left: -25vmax; top: -20vmax; opacity: .18; }
.aura span:nth-child(2) { background: var(--navy-2); right: -25vmax; top: 10vmax; animation-duration: 28s; }
.aura span:nth-child(3) { background: var(--gold); left: 10vmax; bottom: -40vmax; opacity: .12; animation-duration: 34s; }
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.15); } }

.stage { display: flex; flex-direction: column; align-items: center; gap: 22px; }

/* ---------- THE CARD ---------- */
.card {
  width: var(--card-w);
  aspect-ratio: var(--ratio);
  perspective: 1800px;
  cursor: grab;
  outline: none;
  touch-action: pan-y;               /* vertical scroll still works, sideways drags flip */
  -webkit-tap-highlight-color: transparent;
  user-select: none; -webkit-user-select: none;
  animation: arrive 1.1s cubic-bezier(.2, .9, .2, 1) both;
  --gx: 50%; --gy: 30%; --glare: 0;
}
.card.dragging { cursor: grabbing; }
.card:focus-visible .tilt { outline: 3px solid var(--gold); outline-offset: 8px; border-radius: var(--radius); }
@keyframes arrive {
  from { opacity: 0; transform: translateY(46px) rotateX(28deg) scale(.92); }
  to { opacity: 1; transform: none; }
}

.tilt, .inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; }
.tilt { transition: transform .45s cubic-bezier(.2, .8, .2, 1); will-change: transform; }
.tilt.live { transition: transform .08s linear; }
.inner { transition: transform var(--flip-speed) cubic-bezier(.3, 1.25, .45, 1); will-change: transform; }
.inner.no-anim { transition: none; }

.face {
  position: absolute; inset: 0;
  border-radius: var(--radius);
  overflow: hidden;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 40px 70px -28px rgba(0, 0, 0, .75), 0 0 0 1px rgba(255, 255, 255, .07);
  display: flex; flex-direction: column;
  transform: translateZ(1px);
}

/* three-colour flag rule at the top */
.flag { position: absolute; top: 0; left: 0; right: 0; height: 6px; display: flex; z-index: 4; }
.flag i { flex: 1; transform-origin: left; animation: draw .9s .5s cubic-bezier(.6, 0, .2, 1) both; }
.flag i:nth-child(1) { background: var(--red); }
.flag i:nth-child(2) { background: var(--gold); animation-delay: .62s; }
.flag i:nth-child(3) { background: var(--white); animation-delay: .74s; }
.back .flag i:nth-child(3) { background: var(--navy); }
@keyframes draw { from { transform: scaleX(0); } }

/* light that follows your finger / mouse */
.glare {
  position: absolute; inset: 0; z-index: 5; pointer-events: none; border-radius: inherit;
  background: radial-gradient(circle at var(--gx) var(--gy), rgba(255, 255, 255, .34), rgba(255, 255, 255, 0) 55%);
  mix-blend-mode: soft-light; opacity: var(--glare); transition: opacity .4s;
}
.back .glare { background: radial-gradient(circle at calc(100% - var(--gx)) var(--gy), rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 55%); mix-blend-mode: overlay; }

/* ---------- FRONT ---------- */
.front {
  background: radial-gradient(130% 90% at 30% 22%, var(--navy-2) 0%, var(--navy) 48%, var(--navy-d) 100%);
  color: var(--white); text-align: center;
  align-items: center; justify-content: center;
  padding: 40px 28px;
}
.grid-lines {
  position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 70%); mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 70%);
}
.watermark {
  position: absolute; width: 118%; left: -9%; top: 50%; translate: 0 -50%;
  opacity: .07; pointer-events: none;
  animation: float 14s ease-in-out infinite alternate;
}
@keyframes float { to { transform: rotate(-4deg) scale(1.05); } }
.front-mark { position: relative; z-index: 2; transform: translateZ(40px); }
.wordmark {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(64px, 19vw, 96px); letter-spacing: .05em; line-height: 1;
  display: flex; justify-content: center;
}
.wordmark span { display: inline-block; animation: rise .8s cubic-bezier(.2, .9, .2, 1.2) both; background: linear-gradient(180deg, #fff 30%, #c9d5ea); -webkit-background-clip: text; background-clip: text; color: transparent; }
@keyframes rise { from { opacity: 0; transform: translateY(40%) rotateX(-70deg); filter: blur(6px); } }
.tagline {
  margin-top: 18px;
  font-family: var(--display); font-weight: 600;
  font-size: clamp(9.5px, 2.6vw, 11.5px); letter-spacing: .3em; text-transform: uppercase; line-height: 2;
  color: rgba(255, 255, 255, .72);
  animation: fade .9s 1s both;
}
.tagline::before { content: ""; display: block; width: 40px; height: 2px; margin: 0 auto 14px; background: var(--red); border-radius: 2px; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } }
.front-place {
  position: absolute; top: 26px; left: 0; right: 0;
  font-family: var(--display); font-weight: 600; font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase;
  color: rgba(255, 255, 255, .42); animation: fade .9s 1.2s both;
}
.flip-hint {
  position: absolute; bottom: 24px; left: 0; right: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--display); font-weight: 600; font-size: 10px; letter-spacing: .2em; text-transform: uppercase;
  color: rgba(255, 255, 255, .5); animation: fade .9s 1.4s both;
}
.flip-hint svg { font-size: 14px; animation: spin 3s ease-in-out infinite; }
@keyframes spin { 0%, 70% { transform: rotate(0); } 90%, 100% { transform: rotate(360deg); } }
/* a streak of light that sweeps across every few seconds */
.shine { position: absolute; inset: -40%; z-index: 3; pointer-events: none; background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, .13) 49%, rgba(255, 255, 255, .02) 53%, transparent 58%); animation: sweep 7s 2s ease-in-out infinite; transform: translateX(-60%); }
@keyframes sweep { 0% { transform: translateX(-60%); } 22%, 100% { transform: translateX(60%); } }

/* ---------- BACK ---------- */
.back {
  transform: rotateY(180deg) translateZ(1px);
  background: linear-gradient(180deg, #fff 0%, var(--cream) 60%);
  padding: 30px 20px 22px;
  justify-content: space-between; gap: 14px;
}
.back-top { display: flex; align-items: center; gap: 14px; }
.back-logo { width: 62px; height: auto; flex-shrink: 0; }
.back-title strong { display: block; font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: .06em; color: var(--navy); line-height: 1.1; }
.back-title span { display: block; font-family: var(--display); font-weight: 600; font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.mission h2 { font-family: var(--display); font-weight: 700; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--red); display: flex; align-items: center; gap: 10px; }
.mission h2::after { content: ""; flex: 1; height: 1px; background: rgba(20, 42, 79, .14); }
.mission p { margin-top: 8px; font-size: clamp(12.5px, 3.3vw, 13.5px); line-height: 1.6; color: #3d4452; }

.contact { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 6px 9px 9px; border-radius: 14px;
  background: var(--white); border: 1px solid rgba(20, 42, 79, .09);
  color: var(--navy); text-decoration: none; font-weight: 600; font-size: 13.5px; letter-spacing: -.01em;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.row:hover, .row:focus-visible { transform: translateY(-2px); border-color: rgba(20, 42, 79, .22); box-shadow: 0 10px 22px -12px rgba(20, 42, 79, .45); }
.row:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.row .ico { width: 36px; height: 36px; border-radius: 10px; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 17px; flex-shrink: 0; }
.row .label { flex: 1; min-width: 0; line-height: 1.25; }
.row small { display: block; font-family: var(--display); font-weight: 600; font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: #8a93a4; }
.row .val { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy { width: 30px; height: 30px; border-radius: 9px; border: 0; background: transparent; color: #8a93a4; display: grid; place-items: center; font-size: 16px; flex-shrink: 0; transition: background .15s, color .15s; }
.copy:hover, .copy:focus-visible { background: rgba(20, 42, 79, .07); color: var(--navy); outline: none; }
.copy.done { color: #1f8a4c; }

.socials { display: flex; justify-content: center; gap: 12px; }
.social { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--navy); font-size: 20px; transition: transform .2s cubic-bezier(.3, 1.6, .5, 1), background .2s; }
.social:hover, .social:focus-visible { transform: translateY(-4px) scale(1.08); outline: none; }
.social.ig:hover, .social.ig:focus-visible { background: linear-gradient(45deg, #f9a825, #e1306c 50%, #833ab4); }
.social.fb:hover, .social.fb:focus-visible { background: #1877F2; }
.social.wa:hover, .social.wa:focus-visible { background: #25D366; }
.social.in:hover, .social.in:focus-visible { background: #0a66c2; }
.social.web:hover, .social.web:focus-visible { background: var(--gold); }

/* back items slide in one after another when the card turns */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s cubic-bezier(.2, .8, .2, 1); transition-delay: 0s; }
.card.is-back .reveal { opacity: 1; transform: none; transition-delay: calc(.32s + var(--i) * .07s); }

/* ---------- ACTION BUTTONS ---------- */
.actions { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; animation: fade .8s 1.3s both; }
.act {
  display: inline-flex; align-items: center; gap: 9px;
  height: 48px; padding: 0 20px; border-radius: 100px;
  background: rgba(255, 255, 255, .08); color: #fff;
  border: 1px solid rgba(255, 255, 255, .16);
  font-family: var(--display); font-weight: 700; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
  backdrop-filter: blur(10px);
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.act svg { font-size: 18px; }
.act:hover, .act:focus-visible { transform: translateY(-2px); background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .3); outline: none; }
.act:active { transform: scale(.97); }
.act-main { background: var(--white); color: var(--navy); border-color: var(--white); }
.act-main:hover, .act-main:focus-visible { background: #fff; box-shadow: 0 12px 30px -10px rgba(212, 160, 23, .6); }
.act-icon { width: 48px; padding: 0; justify-content: center; }
.foot { font-family: var(--display); font-weight: 600; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: rgba(255, 255, 255, .34); text-align: center; padding: 0 20px; animation: fade .8s 1.5s both; }

/* ---------- QR DIALOG ---------- */
.qr { margin: auto; border: 0; background: transparent; padding: 0; max-width: 92vw; }
.qr::backdrop { background: rgba(5, 11, 22, .78); backdrop-filter: blur(6px); }
.qr[open] .qr-box { animation: pop .45s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes pop { from { opacity: 0; transform: translateY(20px) scale(.92); } }
.qr-box { position: relative; width: 330px; max-width: 92vw; background: var(--cream); border-radius: 26px; padding: 28px 26px 22px; text-align: center; }
.qr-logo { width: 54px; margin: 0 auto 10px; }
.qr-box h2 { font-family: var(--display); font-weight: 800; font-size: 18px; color: var(--navy); }
.qr-code { margin: 16px auto 12px; width: 230px; max-width: 100%; aspect-ratio: 1; background: #fff; border-radius: 18px; padding: 14px; box-shadow: inset 0 0 0 1px rgba(20, 42, 79, .08); }
.qr-code svg { width: 100%; height: 100%; stroke: none; }
.qr-url { font-size: 12px; color: var(--muted); word-break: break-all; }
.qr-x { position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(20, 42, 79, .07); color: var(--navy); display: grid; place-items: center; font-size: 18px; }

/* ---------- TOAST ---------- */
.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 50;
  transform: translate(-50%, 140%); opacity: 0;
  display: flex; align-items: center; gap: 10px;
  background: var(--white); color: var(--navy); padding: 12px 20px; border-radius: 100px;
  font-family: var(--display); font-weight: 700; font-size: 13px;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .6);
  transition: transform .4s cubic-bezier(.2, 1.3, .4, 1), opacity .3s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast svg { color: #1f8a4c; font-size: 18px; }

/* ---------- phones ---------- */
@media (max-width: 440px) {
  .actions { gap: 8px; flex-wrap: nowrap; }
  .act { height: 46px; padding: 0 14px; gap: 7px; font-size: 11px; letter-spacing: .08em; }
  .act-icon { display: none; }
}
@media (max-width: 360px) { .act span { display: none; } .act { width: 46px; padding: 0; justify-content: center; } .act-main span { display: inline; } .act-main { width: auto; padding: 0 14px; } }

/* ---------- small phones ---------- */
@media (max-height: 700px) and (max-width: 420px) {
  :root { --card-w: min(84vw, 360px); }
  .back { padding: 24px 18px 16px; gap: 10px; }
  .mission p { font-size: 12px; line-height: 1.5; }
  .row { padding: 7px 8px; }
  .social { width: 40px; height: 40px; font-size: 18px; }
}

/* ---------- less motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
  .inner { transition: transform .01s; }
  .tilt { transition: none; }
  .reveal { transition: none; }
}
