/* ============================================================================
   رِماية — concept A «Midnight Velvet»
   ----------------------------------------------------------------------------
   Dark-luxury landing page. Near-black charcoal base (#0E0B14 → #1A1A1A) with
   deep-purple atmospheres; Electric #5C17FD and Violet #BB50F8 are used as
   LIGHT (glows, hairline highlights, thin gradients), never as flat fills.
   White text at 72%/52% opacity for body and meta.

   Palette and font rules: prototypes/admin/BRAND_NOTES.md · AGENTS.md §2.
   No hue outside the identity. No teal. One tiny green-free "done" tick uses
   Violet, and the completed state is marked with a violet check, per §2.
   ========================================================================== */

/* ------------------------------------------------------------------ fonts ---- */
@font-face {
  font-family: "Rimaya Arabic";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: "Rimaya Arabic";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-arabic-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F;
}
@font-face {
  font-family: "Rimaya Arabic";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: "Rimaya Arabic";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-arabic-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F;
}
@font-face {
  font-family: "Rimaya Arabic";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: "Rimaya Arabic";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-arabic-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F;
}

/* ----------------------------------------------------------------- tokens ---- */
:root {
  --ink-0: #08060d;
  --ink-1: #0e0b14;
  --ink-2: #131019;
  --ink-3: #1a1a1a;

  --deep: #331761;
  --electric: #5c17fd;
  --violet: #bb50f8;
  --white: #ffffff;

  /* tertiary text still has to pass AA on the near-black base: 0.5 white over
     #0E0B14 is ~4.9:1, which is the floor for the smallest caption here. */
  --text: rgba(255, 255, 255, 0.72);
  --text-2: rgba(255, 255, 255, 0.62);
  --text-3: rgba(255, 255, 255, 0.5);

  --hair: rgba(255, 255, 255, 0.09);
  --hair-2: rgba(255, 255, 255, 0.16);

  --glass: linear-gradient(158deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.018));
  --glass-2: linear-gradient(158deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.03));

  --font: "Rimaya Arabic", system-ui, "Segoe UI", Tahoma, sans-serif;

  --wrap: 1220px;
  --gutter: 22px;
  --nav-h: 72px;

  --r-xl: 28px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;

  --sec-y: clamp(64px, 7vw, 104px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --shadow-card: 0 30px 70px -50px rgba(0, 0, 0, 0.9), 0 2px 10px -6px rgba(0, 0, 0, 0.6);
  --shadow-pop: 0 60px 140px -70px rgba(92, 23, 253, 0.75);
}

@property --ang {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

/* ------------------------------------------------------------------ reset ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text);
  background: var(--ink-1);
  overflow-x: clip;
}

img,
svg {
  max-width: 100%;
}

img {
  height: auto;
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

b,
strong {
  font-weight: 500;
}

bdi {
  unicode-bidi: isolate;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Film grain over the whole page: static, 3% opacity, painted from a data URI
   so it costs no request. Never intercepts pointers. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

.skip {
  position: absolute;
  inset-block-start: -100px;
  inset-inline-start: 16px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--white);
  color: var(--deep);
  font-weight: 500;
}

.skip:focus {
  inset-block-start: 12px;
}

.wrap {
  width: min(100% - (var(--gutter) * 2), var(--wrap));
  margin-inline: auto;
}

/* Headings break where they read, not where the box happens to end. */
h1,
h2 {
  text-wrap: balance;
}

/* ---------------------------------------------------------------- typography - */
.sec__head {
  margin-block-end: clamp(34px, 5vw, 64px);
}

.sec__head--center {
  text-align: center;
}

.sec__title {
  font-size: clamp(30px, 4.4vw, 58px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--white);
}

.sec__sub {
  margin-block-start: 14px;
  font-size: clamp(15px, 1.4vw, 18px);
  color: var(--text-2);
  max-width: 44ch;
}

.sec__head--center .sec__sub {
  margin-inline: auto;
}

.sec__head .sec__sub bdi {
  color: var(--text);
}

/* ------------------------------------------------------------------ buttons -- */
.btn {
  --mag-x: 0px;
  --mag-y: 0px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-align: center;
  cursor: pointer;
  transform: translate3d(var(--mag-x), var(--mag-y), 0);
  transition:
    transform 0.35s var(--ease),
    background-color 0.3s var(--ease),
    border-color 0.3s var(--ease),
    box-shadow 0.4s var(--ease),
    color 0.3s var(--ease);
}

.btn--lg {
  min-height: 52px;
  padding: 15px 26px;
  font-size: 15px;
}

.btn--primary {
  color: var(--white);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 55%),
    linear-gradient(135deg, var(--electric), #7a2bff 55%, var(--violet));
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.24) inset,
    0 18px 40px -22px rgba(92, 23, 253, 0.95),
    0 0 0 1px rgba(187, 80, 248, 0.35);
}

.btn--primary:hover {
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.3) inset,
    0 26px 60px -24px rgba(92, 23, 253, 1),
    0 0 0 1px rgba(187, 80, 248, 0.6);
}

.btn--ghost,
.btn--quiet {
  color: var(--text);
  border-color: var(--hair-2);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
}

.btn--ghost:hover,
.btn--quiet:hover {
  color: var(--white);
  border-color: rgba(187, 80, 248, 0.5);
  background: rgba(187, 80, 248, 0.08);
}

/* -------------------------------------------------------------- reveal ------- */
/* Hidden only once JS is confirmed, so nothing is ever invisible without it. */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.9s var(--ease-out),
    transform 0.9s var(--ease-out);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ------------------------------------------------------------------ numbers - */
.facts {
  position: relative;
  margin-block-start: clamp(38px, 6vw, 76px);
  padding-block: clamp(30px, 4vw, 52px);
  border-block-start: 1px solid var(--hair);
}

.facts__title {
  margin-block-end: 28px;
  font-size: 15px;
  font-weight: 400;
  color: var(--text-2);
  text-align: center;
}

.facts__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.fact {
  padding-inline: 10px;
  text-align: center;
  border-inline-start: 1px solid var(--hair);
}

.fact:first-child {
  border: 0;
}

.fact__num {
  display: block;
  font-size: clamp(34px, 4.4vw, 56px);
  font-weight: 500;
  line-height: 1.1;
  color: var(--white);
  font-variant-numeric: tabular-nums;
}

.fact__label {
  display: block;
  margin-block-start: 6px;
  font-size: 12.5px;
  color: var(--text-2);
}

.facts__note {
  margin-block-start: 26px;
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ==================================================================== TRUST */
.trust {
  padding-block: var(--sec-y);
  background: linear-gradient(180deg, var(--ink-1), var(--ink-0));
}

.guards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.guard {
  --mx: 50%;
  --my: 40%;
  position: relative;
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  background: linear-gradient(158deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  transition: transform 0.5s var(--ease), border-color 0.4s var(--ease), box-shadow 0.5s var(--ease);
}

.guard::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(220px circle at var(--mx) var(--my), rgba(187, 80, 248, 0.18), transparent 62%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}

.guard.is-lit,
.guard:hover,
.guard:focus-within {
  transform: translateY(-4px);
  border-color: rgba(187, 80, 248, 0.45);
  box-shadow:
    0 40px 80px -60px rgba(187, 80, 248, 0.95),
    0 0 0 1px rgba(92, 23, 253, 0.18);
}

.guard.is-lit::after {
  opacity: 1;
}

.guard__ico {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-block-end: 16px;
  border: 1px solid rgba(187, 80, 248, 0.3);
  border-radius: 13px;
  background: radial-gradient(circle at 30% 20%, rgba(187, 80, 248, 0.26), rgba(92, 23, 253, 0.05));
  color: var(--violet);
}

.guard__ico svg {
  width: 22px;
  height: 22px;
}

.guard.is-lit .guard__ico,
.guard:hover .guard__ico,
.guard:focus-within .guard__ico {
  border-color: rgba(187, 80, 248, 0.6);
  box-shadow: 0 0 28px -4px rgba(187, 80, 248, 0.7);
}

.guard__ico {
  transition: box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
}

.guard__t {
  font-size: 15px;
  font-weight: 500;
  color: var(--white);
}

.guard__d {
  margin-block-start: 8px;
  font-size: 13px;
  color: var(--text-2);
}

/* ==================================================================== FINAL */
.final {
  position: relative;
  padding-block: clamp(90px, 13vw, 190px);
  overflow: clip;
  background: var(--ink-0);
}

.final__aurora {
  position: absolute;
  inset: -30% -20%;
  background:
    radial-gradient(34% 44% at 30% 40%, rgba(92, 23, 253, 0.5), transparent 66%),
    radial-gradient(30% 40% at 70% 62%, rgba(187, 80, 248, 0.38), transparent 68%),
    radial-gradient(46% 40% at 50% 100%, rgba(51, 23, 97, 0.85), transparent 72%);
  filter: blur(46px);
  animation: aurora 22s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes aurora {
  0% {
    transform: translate3d(-3%, 2%, 0) scale(1.04) rotate(-2deg);
  }
  50% {
    transform: translate3d(2%, -2%, 0) scale(1.1) rotate(1deg);
  }
  100% {
    transform: translate3d(4%, 3%, 0) scale(1.05) rotate(2deg);
  }
}

.final__in {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 26px;
  text-align: center;
}

.final__title {
  font-size: clamp(38px, 7.4vw, 104px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--white);
}

.final__title em {
  font-style: normal;
  background: linear-gradient(100deg, var(--violet), var(--electric));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.final__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.final__note {
  font-size: 13px;
  color: var(--text-2);
}

.final__note bdi {
  color: var(--white);
}

/* =================================================================== FOOTER */
.foot {
  padding-block: clamp(46px, 6vw, 74px) 28px;
  border-block-start: 1px solid var(--hair);
  background: var(--ink-0);
}

.foot__in {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr);
  gap: clamp(28px, 4vw, 70px);
  align-items: start;
}

.brand--foot .brand__word {
  width: 128px;
  height: 60px;
}

.brand--foot .brand__word img {
  width: 136px;
  height: 136px;
  inset-block-start: -38px;
  inset-inline-start: -1.5px;
}

.foot__tag {
  margin-block-start: 14px;
  max-width: 26ch;
  font-size: 13px;
  color: var(--text-2);
}

.foot__nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.foot__col {
  display: grid;
  gap: 10px;
  align-content: start;
}

.foot__col h3 {
  margin-block-end: 2px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
}

.foot__col a {
  font-size: 13.5px;
  color: var(--text-2);
  transition: color 0.3s var(--ease);
}

.foot__col a:hover {
  color: var(--white);
}

.foot__bar {
  margin-block-start: clamp(30px, 4vw, 52px);
  padding-block-start: 18px;
  border-block-start: 1px solid var(--hair);
  font-size: 11.5px;
  color: var(--text-3);
}

/* ============================================================== responsive == */
@media (max-width: 980px) {
  .guards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  /* A footer link is a thumb target before it is a line of text. The 10px gap
     becomes the row's own height, so the columns keep their rhythm. */
  .foot__col {
    gap: 0;
  }

  .foot__col h3 {
    margin-block: 14px 2px;
  }

  .foot__col a {
    display: flex;
    align-items: center;
    min-block-size: 44px;
  }
}

@media (max-width: 720px) {
  :root {
    --gutter: 18px;
    --nav-h: 66px;
  }

  .facts__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 10px;
  }

  .fact:nth-child(3) {
    border-inline-start: 0;
  }

  .guards,
  .foot__in,
  .foot__nav {
    grid-template-columns: 1fr;
  }

  .foot__nav {
    gap: 26px;
  }
}

/* ====================================================== desktop rhythm ==
   At ≥1024px the sections carried too much empty air: the section rhythm is
   tightened by ~27% here (mobile spacing is untouched). */
@media (min-width: 1024px) {
  :root {
    --sec-y: clamp(52px, 7.2vw, 92px);
  }

  .sec__head {
    margin-block-end: clamp(25px, 3.6vw, 46px);
  }

  .facts {
    margin-block-start: clamp(28px, 4.3vw, 55px);
    padding-block: clamp(22px, 2.9vw, 38px);
  }

  .final {
    padding-block: clamp(65px, 9.4vw, 138px);
  }

  .foot {
    padding-block: clamp(34px, 4.3vw, 54px) 22px;
  }

  .foot__bar {
    margin-block-start: clamp(22px, 2.9vw, 38px);
  }
}

/* ============================================== reduced motion + no-JS paths */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }

  .final__aurora {
    animation: none !important;
  }
}
