/* ============================================================
   BASE  —  shared design language across roster + creator hubs.
   Dark, cinematic, Arabic-first bilingual, big titles.
   NOTE: colour values are injected by brand.js as CSS vars;
   the fallbacks below only matter if that script fails to load.
   ============================================================ */

/* Fonts are SELF-HOSTED, not pulled from Google. Deliberate: the hub must
   render identically on a locked-down corporate network, and a brand opening
   this on hotel wifi should never see a flash of fallback Arabic. */
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 300; font-display: swap; src: url('fonts/ibm-plex-sans-arabic-arabic-300-normal.woff2') format('woff2'); unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0898-08E1,U+08E3-08FF,U+FB50-FDFF,U+FE70-FEFF; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 300; font-display: swap; src: url('fonts/ibm-plex-sans-arabic-latin-300-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2212,U+FEFF,U+FFFD; }
@font-face { font-family: 'IBM Plex Sans 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+0870-088E,U+0890-0891,U+0898-08E1,U+08E3-08FF,U+FB50-FDFF,U+FE70-FEFF; }
@font-face { font-family: 'IBM Plex Sans 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+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2212,U+FEFF,U+FFFD; }
@font-face { font-family: 'IBM Plex Sans 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+0870-088E,U+0890-0891,U+0898-08E1,U+08E3-08FF,U+FB50-FDFF,U+FE70-FEFF; }
@font-face { font-family: 'IBM Plex Sans 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+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2212,U+FEFF,U+FFFD; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2') format('woff2'); unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0898-08E1,U+08E3-08FF,U+FB50-FDFF,U+FE70-FEFF; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/ibm-plex-sans-arabic-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2212,U+FEFF,U+FFFD; }
@font-face { font-family: 'IBM Plex Sans 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+0870-088E,U+0890-0891,U+0898-08E1,U+08E3-08FF,U+FB50-FDFF,U+FE70-FEFF; }
@font-face { font-family: 'IBM Plex Sans 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+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2212,U+FEFF,U+FFFD; }
@font-face { font-family: 'Instrument Serif'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/instrument-serif-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Anton'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/anton-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Great Vibes'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/great-vibes-latin-400-normal.woff2') format('woff2'); }

:root {
  /* palette fallbacks only — brand.js injects the live theme (dark/light) */
  --ink: #08090a; --ink2: #101214; --ink3: #181b1f; --line: #262a30;
  --paper: #f4efe6; --muted: #8b8f97; --accent: #d8b26e; --accent2: #8c6b2f;
  --frameA: #23272d; --frameB: #0d0f11; --soft: #d9d3c8;

  /* photo scrim — stays dark in BOTH themes: text over photos needs it */
  --scrim: 8, 9, 10;
  --onphoto: #f4efe6;
  --onphoto-muted: #b9b4a9;

  --sans: 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  /* editorial display caps (latin) — Arabic glyphs fall through to Plex bold */
  --displayfont: 'Anton', 'IBM Plex Sans Arabic', sans-serif;
  --script: 'Great Vibes', cursive;

  --pad: clamp(20px, 5vw, 64px);
  --maxw: 1320px;
  --r: 14px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
  /* film grain — 'real footage as texture', cheap and resolution-independent */
  background-image:
    radial-gradient(1200px 600px at 70% -10%, rgba(216,178,110,.07), transparent 60%),
    radial-gradient(900px 500px at 0% 100%, rgba(216,178,110,.04), transparent 60%);
  background-attachment: fixed;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
[data-theme="light"] body {
  background-image:
    radial-gradient(1100px 520px at 78% -8%, rgba(43,70,216,.045), transparent 60%),
    radial-gradient(900px 500px at -6% 104%, rgba(161,39,54,.05), transparent 60%);
}
/* editorial light: white cards float on ivory with soft shadows */
[data-theme="light"] .card, [data-theme="light"] .collab,
[data-theme="light"] .reel, [data-theme="light"] .numbers > div {
  box-shadow: 0 10px 30px rgba(32,41,78,.07);
}
[data-theme="light"] .btn--accent { color: #fff; }
[data-theme="light"] .btn--accent:hover { background: var(--paper); border-color: var(--paper); color: #fff; }

body::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 9999;
  opacity: .035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-theme="light"] body::after { opacity: .05; mix-blend-mode: multiply; }

/* ---------- direction: Arabic-first, flips cleanly ---------- */
[dir="rtl"] { text-align: right; }
[lang="ar"], .ar { font-family: var(--sans); }

/* ---------- type ---------- */
.display {
  font-family: var(--displayfont);
  font-weight: 400;
  text-transform: uppercase;
  line-height: .96;
  letter-spacing: .01em;
  font-size: clamp(44px, 8.5vw, 132px);
}
[dir="rtl"] .display { font-family: var(--sans); font-weight: 500; letter-spacing: 0; line-height: 1.15; }

h2.section-title {
  font-family: var(--displayfont); font-weight: 400; text-transform: uppercase;
  font-size: clamp(28px, 4.2vw, 54px); line-height: 1; letter-spacing: .01em;
}
[dir="rtl"] h2.section-title { font-family: var(--sans); font-weight: 500; letter-spacing: 0; line-height: 1.3; }

.eyebrow {
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent); font-weight: 500;
}
[dir="rtl"] .eyebrow { letter-spacing: 0; text-transform: none; font-size: 13px; }

.muted { color: var(--muted); }

/* ---------- layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); }
section { padding-block: clamp(56px, 9vw, 128px); }
.rule { height: 1px; background: var(--line); border: 0; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 24px; border-radius: 100px; border: 1px solid var(--line);
  background: transparent; color: var(--paper);
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  cursor: pointer; text-decoration: none;
  transition: background .35s var(--ease), border-color .35s var(--ease), color .35s var(--ease);
}
.btn:hover { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.btn--accent { background: var(--accent); border-color: var(--accent); color: var(--ink); font-weight: 600; }
.btn--accent:hover { background: var(--paper); border-color: var(--paper); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px var(--pad);
  background: color-mix(in srgb, var(--ink) 82%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.wordmark {
  font-family: var(--serif); font-size: 21px; letter-spacing: .01em;
  color: var(--paper); text-decoration: none; white-space: nowrap;
}
[dir="rtl"] .wordmark { font-family: var(--sans); font-weight: 600; }
.wordmark span { color: var(--accent); }

.langtoggle {
  display: flex; border: 1px solid var(--line); border-radius: 100px; overflow: hidden;
}
.langtoggle button {
  padding: 7px 15px; background: transparent; border: 0; cursor: pointer;
  color: var(--muted); font-family: var(--sans); font-size: 12px; font-weight: 500;
  transition: background .3s var(--ease), color .3s var(--ease);
}
.langtoggle button[aria-pressed="true"] { background: var(--paper); color: var(--ink); }

.themetoggle {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
  background: transparent; color: var(--paper); cursor: pointer;
  font-size: 15px; line-height: 1; display: grid; place-items: center;
  transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.themetoggle:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); padding-block: 48px; }
footer a { color: var(--paper); }
