/* Public pages: a person's link page, the landing page, gone / not found.

   Light only, on purpose. The brand logos are drawn for a light ground (the
   grey "VIRTUAL" wordmark disappears on dark) and there is no white Academy
   mark, so a dark theme would mean a worse logo on four of five pages.

   Brand colours come from brands.py via the brand-<key> class on <body>.
   Never set them inline: the CSP has no 'unsafe-inline' for styles. */

@font-face {
  font-family: "Montserrat";
  src: url("fonts/montserrat-latin-var.woff2") format("woff2");
  font-weight: 500 600;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #21313f;
  --muted: #5b6878;
  --line: #e4e8ef;
  --canvas: #f3f5f9;
  --surface: #ffffff;
  --radius: 14px;
  --font: "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans Arabic", "Noto Sans", sans-serif;
  --display: Montserrat, "Segoe UI", Arial, "Noto Sans Arabic", sans-serif;
  --ease: cubic-bezier(.25, 1, .5, 1);

  --brand: #002060;
  --brand-2: #1b75bc;
  --brand-ink: #002060;
  --brand-soft: #eaf3fa;
}

/* VCxO Group, Virtual CFO and Virtual CHRO share one palette in the group's
   own material; the logo is what tells them apart. */
.brand-group, .brand-cfo, .brand-chro {
  --brand: #002060; --brand-2: #1b75bc; --brand-ink: #002060; --brand-soft: #eaf3fa;
}
/* CLO's accent is nearly its primary, so its band reads as solid burgundy;
   the diagonals carry the texture. */
.brand-clo {
  --brand: #6e1d2d; --brand-2: #6d1f2f; --brand-ink: #6e1d2d; --brand-soft: #f6ecee;
}
/* Academy teal is 4.3:1 against white - fine for a band, short of 4.5:1 for
   button text - so text and buttons use a slightly deeper shade of it. */
.brand-academy {
  --brand: #35877e; --brand-2: #00a651; --brand-ink: #2a6f68; --brand-soft: #e7f3f0;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background:
    radial-gradient(circle at 1px 1px, rgba(16, 32, 64, .085) 1px, transparent 0) 0 0 / 22px 22px,
    var(--canvas);
}
/* Two soft glows in the brand colour, fixed to the viewport. z-index -1 puts
   them under the content and over the dot grid (the body background is
   painted on the canvas, below everything). */
body::before, body::after {
  content: "";
  position: fixed;
  z-index: -1;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--brand-2) 16%, transparent), transparent);
}
body::before { left: -220px; bottom: -200px; }
body::after { right: -240px; top: 38%; background: radial-gradient(closest-side, color-mix(in srgb, var(--brand) 12%, transparent), transparent); }

a { color: var(--brand-ink); }
img { max-width: 100%; }

.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; }

:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }

.wrap {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.top { display: flex; justify-content: center; padding: 8px 0 20px; }
.top img { height: 46px; width: auto; display: block; }

/* ---- hero band ---------------------------------------------------------- */

/* Full width, in the brand's colours, with the house diagonals and a soft
   light at the top right. Its bottom 150px is room for the card to overlap. */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(120deg, var(--brand) 0%, var(--brand-2) 100%);
  border-radius: 0 0 50% 50% / 0 0 34px 34px;
  color: #fff;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(115deg, transparent 0 46px, rgba(255, 255, 255, .11) 46px 48px);
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent);
  mask-image: linear-gradient(180deg, #000 30%, transparent);
}
.hero::after {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  right: -180px;
  top: -260px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .22), transparent);
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 22px 16px 150px;
  display: grid;
  justify-items: center;
  gap: 16px;
}
/* The logos are drawn for a light ground; on the band they go white. */
.hero-logo img { height: 46px; width: auto; display: block; filter: brightness(0) invert(1); }
.over-hero { margin-top: -78px; position: relative; z-index: 1; padding-top: 0; }
@media (min-width: 720px) {
  .hero-inner { padding: 34px 16px 170px; }
  .hero-logo img { height: 52px; }
}

/* ---- profile card --------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(16, 32, 64, .05), 0 18px 40px -22px rgba(16, 32, 64, .35);
}

.profile { text-align: center; padding: 0 20px 22px; }

.avatar {
  width: 112px;
  height: 112px;
  margin: -56px auto 12px;
  border-radius: 50%;
  border: 4px solid var(--surface);
  background: var(--brand-soft);
  color: var(--brand-ink);
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 0 2px var(--brand-2), 0 8px 20px -8px rgba(16, 32, 64, .45);
  font: 600 36px/1 var(--display);
  letter-spacing: .02em;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.name {
  margin: 0;
  font: 600 24px/1.25 var(--display);
  color: var(--brand-ink);
  letter-spacing: -.005em;
}
.name-ar { margin: 2px 0 0; font-size: 17px; font-weight: 600; color: var(--ink); }
.role { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; }
.role strong { color: var(--ink); font-weight: 600; }
.role-ar { margin: 0; color: var(--muted); font-size: 14.5px; }
.bio {
  margin: 14px auto 0;
  max-width: 34ch;
  font-size: 14.5px;
  color: var(--ink);
  white-space: pre-line;
}

.actions { display: flex; gap: 8px; justify-content: center; margin-top: 18px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: 600 14.5px/1 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s var(--ease), background-color .15s var(--ease), border-color .15s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn:hover { border-color: var(--brand-2); }
.btn-primary { background: var(--brand-ink); border-color: var(--brand-ink); color: #fff; flex: 1; max-width: 240px; }
.btn-primary:hover { background: var(--brand); border-color: var(--brand); }
.btn-square { width: 44px; padding: 0; color: var(--brand-ink); }

/* ---- links ----------------------------------------------------------- */

.links { display: grid; gap: 10px; margin-top: 16px; }

.link {
  --k: var(--brand-ink);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 10px 14px 10px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease),
              background-color .18s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.link:hover {
  border-color: var(--k);
  background: color-mix(in srgb, var(--k) 4%, var(--surface));
  box-shadow: 0 10px 24px -16px var(--k);
  transform: translateY(-2px);
}
.link:active { transform: scale(.985); }
/* The tile carries the link's own colour, so LinkedIn reads as LinkedIn at a
   glance. A faint highlight on top keeps it from looking flat. */
.link-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(140deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 60%), var(--k);
  color: #fff;
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: 0 4px 10px -6px var(--k);
  transition: transform .2s var(--ease);
}
.link-icon .icon { width: 22px; height: 22px; }
.link:hover .link-icon { transform: scale(1.07) rotate(-4deg); }
.link-label { flex: 1; min-width: 0; font-weight: 600; font-size: 15.5px; overflow-wrap: anywhere; }
.link-go { color: #9aa6b5; width: 18px; height: 18px; transition: transform .18s var(--ease), color .18s var(--ease); }
.link:hover .link-go { color: var(--k); transform: translateX(3px); }
[dir="rtl"] .link-go { transform: scaleX(-1); }
[dir="rtl"] .link:hover .link-go { transform: scaleX(-1) translateX(3px); }

/* Link colours. The networks keep their own; website links take the page's
   brand, so a page of plain links still looks like VCFO, CHRO, CLO or Academy.
   Same values in panel.css - keep the two in step. */
.k-website   { --k: var(--brand-ink); }
.k-linkedin  { --k: #0a66c2; }
.k-whatsapp  { --k: #25d366; }
.k-email     { --k: #f97316; }
.k-phone     { --k: #0ea5e9; }
.k-booking   { --k: #7c3aed; }
.k-document  { --k: #e11d48; }
.k-video     { --k: #ff0000; }
.k-facebook  { --k: #1877f2; }
.k-x         { --k: #111111; }
.k-instagram { --k: #d6249f; }
.k-instagram .link-icon {
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 26px 2px 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.empty {
  margin-top: 16px;
  padding: 18px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .6);
}

.foot {
  margin-top: 32px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--brand-ink); text-decoration: underline; }
.foot-mark { height: 22px; width: auto; display: block; margin: 0 auto 6px; opacity: .9; }

.owner-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff8e6;
  border: 1px solid #f3dfa6;
  font-size: 13.5px;
}
.owner-bar a { font-weight: 600; white-space: nowrap; }
.hero .owner-bar {
  width: 100%;
  margin: 0;
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .28);
  color: #fff;
}
.hero .owner-bar a { color: #fff; }

/* ---- QR dialog and toast --------------------------------------------- */

dialog {
  border: none;
  border-radius: 20px;
  padding: 0;
  width: min(340px, calc(100vw - 32px));
  box-shadow: 0 24px 60px -20px rgba(16, 32, 64, .45);
  text-align: center;
  color: var(--ink);
}
dialog::backdrop { background: rgba(14, 24, 40, .55); }
/* Padding lives inside, so a click on the dialog element itself is always the backdrop. */
.dialog-inner { padding: 22px; }
dialog h2 { margin: 0 0 4px; font: 600 18px/1.3 var(--display); color: var(--brand-ink); }
dialog p { margin: 0 0 14px; color: var(--muted); font-size: 13.5px; overflow-wrap: anywhere; }
.qr-img { width: 100%; max-width: 260px; height: auto; display: block; margin: 0 auto 16px; border-radius: 12px; border: 1px solid var(--line); }
.dialog-actions { display: flex; gap: 8px; justify-content: center; }

/* The phone number box on a computer. The number is the point, so it is big,
   and one click selects all of it for anyone who copies by hand. */
dialog .call-number {
  margin: 10px 0 20px;
  font: 600 26px/1.2 var(--display);
  color: var(--ink);
  letter-spacing: .01em;
  user-select: all;
}
.btn-call { background: var(--brand-ink); border-color: var(--brand-ink); color: #fff; }
.btn-call:hover { background: var(--brand); border-color: var(--brand); }
.btn-text {
  margin-top: 14px;
  border: none;
  background: none;
  color: var(--muted);
  font: 500 13.5px/1 var(--font);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #1b2433;
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5);
  z-index: 10;
  animation: toast-in .2s var(--ease) both;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---- landing ---------------------------------------------------------- */

.landing { text-align: center; padding-top: 40px; }
.landing .hero-logo { width: 240px; height: auto; margin: 0 auto 18px; display: block; }
.landing h1 { margin: 0 0 8px; font: 600 26px/1.25 var(--display); color: #002060; }
.landing p.lead { margin: 0 auto 26px; color: var(--muted); max-width: 36ch; }
.brand-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; }
.brand-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 86px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .15s var(--ease), transform .15s var(--ease);
}
.brand-tile:hover { border-color: #1b75bc; transform: translateY(-1px); }
.brand-tile img { max-height: 48px; width: auto; }
.brand-tile.wide { grid-column: 1 / -1; }
.landing .section-title { margin: 0 2px 12px; }

.message { text-align: center; padding-top: 30px; }
.message h1 { font: 600 22px/1.3 var(--display); color: var(--brand-ink); margin: 18px 0 8px; }
.message p { color: var(--muted); margin: 0 auto 22px; max-width: 34ch; }

/* Entrance: the card, then the links one after another. Only when the person
   has not asked for less motion. */
@media (prefers-reduced-motion: no-preference) {
  .card, .links .link, .section-title, .foot { animation: rise .45s var(--ease) both; }
  .links .link:nth-child(1) { animation-delay: .08s; }
  .links .link:nth-child(2) { animation-delay: .13s; }
  .links .link:nth-child(3) { animation-delay: .18s; }
  .links .link:nth-child(4) { animation-delay: .23s; }
  .links .link:nth-child(5) { animation-delay: .28s; }
  .links .link:nth-child(6) { animation-delay: .33s; }
  .links .link:nth-child(n+7) { animation-delay: .38s; }
  .section-title, .foot { animation-delay: .3s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

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