/* =====================================================================
   RAWAND — Intro + Nav + Hero
   Fonts: Cairo (Arabic) · Montserrat (English) · Cormorant Garamond Italic (one accent word)
   ===================================================================== */

:root {
  --rw-900: #5B0F1A;
  --rw-700: #7A1E29;
  --rw-500: #9E4A52;
  --rw-taupe: #A68A7A;
  --rw-stone: #D8D1C9;
  --rw-paper: #F5F3F0;
  --rw-ink-soft: rgba(91, 15, 26, .78);
  --rw-night: 43, 6, 12;

  --font-ar: 'Cairo', system-ui, sans-serif;
  --font-en: 'Montserrat', 'Cairo', system-ui, sans-serif;
  --font-accent: 'Cormorant Garamond', Georgia, serif;

  --nav-h: 84px;
  --sp: clamp(16px, 4vw, 64px);   /* side padding */
  --ease-out: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.is-locked, html.is-locked body { overflow: hidden; }
body {
  margin: 0;
  background: var(--rw-paper);
  color: var(--rw-900);
  font-family: var(--font-ar);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* film grain — static, composited once */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
  opacity: .05;
  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='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--rw-700); outline-offset: 3px; }

/* drafting-paper grid shared by intro + hero so the hand-off is seamless */
.intro-paper,
.hero-paper {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(216, 209, 201, .55) 1px, transparent 1px),
    linear-gradient(90deg, rgba(216, 209, 201, .55) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: center center;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, #000 20%, transparent 85%);
          mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, #000 20%, transparent 85%);
}

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding-inline: 24px;
  border-radius: 2px;
  font: 700 15px/1 var(--font-ar);
  white-space: nowrap;
  transition: background-color .35s var(--ease-out), color .35s var(--ease-out), border-color .35s var(--ease-out);
}
.btn svg { width: 18px; height: 18px; transition: transform .35s var(--ease-out); }
.btn:hover svg { transform: translateX(-4px); }
.btn-primary { background: var(--rw-700); color: var(--rw-paper); }
.btn-primary:hover { background: var(--rw-900); }
.btn-ghost { border: 1px solid rgba(91, 15, 26, .35); color: var(--rw-900); }
.btn-ghost:hover { border-color: var(--rw-900); background: var(--rw-900); color: var(--rw-paper); }
.btn-sm { height: 40px; padding-inline: 18px; font-size: 14px; }

/* ================================================================= INTRO */
.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--rw-paper);
}
.intro-stage { position: relative; display: grid; place-items: center; }
.intro-logo {
  display: block;
  height: min(54svh, 460px);
  width: auto;
  overflow: visible;
  color: var(--rw-900);
  fill: currentColor;
}
.intro-axes { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.axis-v, .axis-h { position: absolute; background: var(--rw-500); opacity: .45; }
.axis-v { top: 0; bottom: 0; width: 1px; transform-origin: 50% 0; }
.axis-h { left: 0; right: 0; height: 1px; transform-origin: 0 50%; opacity: .25; }

/* =================================================================== NAV */
.nav {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 60;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-inline: var(--sp);
  transition: background-color .4s var(--ease-out), box-shadow .4s var(--ease-out);
}
.nav.is-solid {
  background: rgba(245, 243, 240, .86);
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(91, 15, 26, .08);
}
.nav-brand { display: block; line-height: 0; }
.nav-logo { height: 46px; width: auto; fill: var(--rw-900); }
.nav-links { display: flex; gap: clamp(18px, 2.6vw, 40px); }
.nav-links a {
  position: relative;
  padding-block: 6px;
  font: 600 15px var(--font-ar);
}
.nav-links a::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .45s var(--ease-out);
}
.nav-links a:hover::after { transform: scaleX(1); }
.nav-actions { display: flex; align-items: center; gap: 18px; }
.nav-lang { font: 600 12px var(--font-en); letter-spacing: .2em; }
.nav-toggle { display: none; }

/* ================================================================== HERO */
.hero {
  position: relative;
  height: 100svh;
  min-height: 620px;
  overflow: hidden;
  background: var(--rw-paper);
  isolation: isolate;
}
/* the building is drawn live on this canvas (js/axo.js) */
.hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
}

/* partner labels — positioned every frame next to their layer of the building */
.hero-layers {
  position: absolute;
  inset: 0;
  z-index: 4;
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
}
.layer-tag {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  direction: ltr;
  opacity: 0;
  will-change: transform, opacity;
}
.tag-body {
  display: grid;
  gap: 5px;
  direction: rtl;
  text-align: right;
  transition: opacity .4s var(--ease-out);
}
.tag-title { font: 700 18px/1.2 var(--font-ar); color: var(--rw-900); white-space: nowrap; }
.tag-en {
  margin-inline-start: 8px;
  font: 500 10px/1 var(--font-en);
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--rw-500);
}
.tag-meta { font: 400 13px/1.4 var(--font-ar); color: var(--rw-ink-soft); white-space: nowrap; }
.tag-name { font-weight: 700; color: var(--rw-900); }

/* scroll hint: a mouse whose wheel rolls down (a swipe track on touch screens) */
.hero-scroll {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: clamp(20px, 4svh, 36px);
  transform: translateX(-50%);
  pointer-events: none;
}
.scroll-mouse {
  position: relative;
  display: block;
  width: 24px;
  height: 38px;
  border: 1.5px solid var(--rw-700);
  border-radius: 13px;
  animation: mouse-bob 2.4s ease-in-out infinite;
}
.scroll-mouse::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 7px;
  width: 3px;
  height: 7px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--rw-700);
  animation: mouse-wheel 1.8s cubic-bezier(.6, 0, .4, 1) infinite;
}
@keyframes mouse-wheel {
  0%   { transform: translateY(0); opacity: 0; }
  20%  { opacity: 1; }
  70%  { transform: translateY(11px); opacity: 0; }
  100% { transform: translateY(11px); opacity: 0; }
}
@keyframes mouse-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(3px); }
}
@media (hover: none) {
  .scroll-mouse { width: 2px; height: 40px; border: 0; border-radius: 1px; background: rgba(158, 74, 82, .3); animation: none; }
  .scroll-mouse::before { top: 0; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; animation-name: swipe-dot; }
  @keyframes swipe-dot {
    0%   { transform: translateY(0); opacity: 0; }
    20%  { opacity: 1; }
    80%  { transform: translateY(34px); opacity: 0; }
    100% { transform: translateY(34px); opacity: 0; }
  }
}

/* ================================================ shared: section sheets
   Every section after the hero is a drawing sheet with this header: title + a ruled line. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.sheet-head {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: clamp(48px, 9svh, 96px);
}
.sheet-label {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0;
  font: 800 clamp(1.4rem, 2vw, 1.9rem)/1 var(--font-ar);
  color: var(--rw-900);
  white-space: nowrap;
}
.sheet-rule {
  flex: 1;
  height: 1px;
  background: rgba(91, 15, 26, .25);
  transform-origin: right center;
}

/* ============================================================ responsive */
@media (max-width: 1080px) {
  .nav-links { gap: 20px; }
  .nav-lang { display: none; }
}

@media (max-width: 900px) {
  :root { --nav-h: 68px; }
  .nav-logo { height: 38px; }
  .nav-links {
    position: absolute;
    top: 100%;
    inset-inline: 0;
    flex-direction: column;
    gap: 0;
    padding: 8px var(--sp) 20px;
    background: rgba(245, 243, 240, .97);
    box-shadow: 0 12px 24px rgba(91, 15, 26, .08);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity .3s var(--ease-out), transform .3s var(--ease-out), visibility .3s;
  }
  .nav.is-open .nav-links { visibility: visible; opacity: 1; transform: none; }
  .nav-links a { padding-block: 14px; border-bottom: 1px solid rgba(91, 15, 26, .08); }
  .nav-toggle {
    display: grid;
    gap: 6px;
    width: 40px;
    height: 40px;
    place-content: center;
    border: 0;
    background: none;
    cursor: pointer;
  }
  .nav-toggle span { display: block; width: 22px; height: 1.5px; background: var(--rw-900); transition: transform .3s var(--ease-out); }
  .nav.is-open .nav-toggle span:first-child { transform: translateY(3.75px) rotate(45deg); }
  .nav.is-open .nav-toggle span:last-child { transform: translateY(-3.75px) rotate(-45deg); }

  .tag-en { display: none; }
}

@media (max-width: 560px) {
  .sheet-head { gap: 12px; }
  .nav-actions .btn-sm { display: none; }
  .btn { height: 46px; padding-inline: 16px; font-size: 14px; }
  .tag-title { font-size: 14px; }
  .tag-en, .tag-part { display: none; }
  .tag-meta { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .intro { display: none; }
}
