:root {
  --navy: #001438;
  --navy-2: #0a1f3a;
  --navy-3: #0f2847;
  --gold: #c9a227;
  --gold-2: #e0b83a;
  --gold-dim: #9a7209;
  --sand: #f6f0e4;
  --paper: #fffdf8;
  --ink: #000814;
  --muted: #5c6b7a;
  --danger: #b42318;
  --warn: #b54708;
  --ok: #0b6b3a;
  --info: #175cd3;
  --radius: 22px;
  --nav-h: 76px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

html[dir="rtl"] { font-family: "Tajawal", "Outfit", sans-serif; }
html[dir="ltr"] { font-family: "Outfit", "Tajawal", sans-serif; }

body {
  margin: 0;
  background: var(--navy);
  color: var(--paper);
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}

/* ---------- preloader ---------- */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #000814;
  display: grid;
  place-items: center;
  transition: opacity 0.7s var(--ease), visibility 0.7s;
}
#preloader.gone {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
#preloader .mark {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  animation: pulseGold 1.8s ease-in-out infinite;
}
#preloader .bar {
  width: 180px;
  height: 2px;
  margin-top: 28px;
  background: rgba(201, 162, 39, 0.2);
  overflow: hidden;
}
#preloader .bar i {
  display: block;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, transparent, var(--gold-2), transparent);
  animation: loadSlide 1.1s ease-in-out infinite;
}
#preloader p {
  margin: 16px 0 0;
  letter-spacing: 0.28em;
  font-size: 11px;
  color: var(--gold-2);
  text-transform: uppercase;
}

@keyframes loadSlide {
  from { transform: translateX(-120%); }
  to { transform: translateX(320%); }
}
@keyframes pulseGold {
  0%, 100% { transform: scale(1); filter: saturate(1); }
  50% { transform: scale(1.04); filter: saturate(1.15); }
}

/* ---------- nav ---------- */
.nav {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 40;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: linear-gradient(180deg, rgba(0, 20, 56, 0.88), rgba(0, 20, 56, 0.18) 90%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.35s, background 0.35s;
}
.nav.scrolled {
  background: rgba(0, 20, 56, 0.92);
  border-bottom-color: rgba(201, 162, 39, 0.25);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.brand img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(201, 162, 39, 0.45);
}
.brand small {
  display: block;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--gold-2);
  font-size: 11px;
}
.nav-links {
  display: flex;
  gap: 22px;
  font-size: 14px;
  color: rgba(255, 253, 248, 0.82);
}
.nav-links a:hover { color: var(--gold-2); }
.nav-actions { display: flex; gap: 10px; align-items: center; }
.lang {
  border: 1px solid rgba(201, 162, 39, 0.45);
  background: transparent;
  color: var(--gold-2);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  letter-spacing: 0.12em;
}
.menu-btn {
  display: none;
  background: none;
  border: 0;
  color: var(--paper);
  font-size: 22px;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  padding: calc(var(--nav-h) + 40px) 6vw 80px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 20, 56, 0.92) 0%, rgba(0, 20, 56, 0.55) 48%, rgba(0, 20, 56, 0.28) 100%),
    url("../media/generated/docs-hero-giza.png") center/cover no-repeat;
  animation: kenburns 28s ease-in-out infinite alternate;
  transform-origin: 60% 40%;
}
.hero-bg::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 180px;
  background: linear-gradient(transparent, var(--navy));
}
@keyframes kenburns {
  from { transform: scale(1); }
  to { transform: scale(1.12); }
}
.gold-dust {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero-copy, .hero-stage { position: relative; z-index: 1; }
.eyebrow {
  color: var(--gold-2);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 12px;
  margin: 0 0 14px;
}
h1 {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(42px, 6vw, 86px);
  line-height: 0.95;
  margin: 0 0 18px;
  font-weight: 600;
}
h1 em {
  font-style: italic;
  color: var(--gold-2);
}
.lede {
  font-size: 18px;
  line-height: 1.7;
  max-width: 540px;
  color: rgba(255, 253, 248, 0.82);
}
.cta-row { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 13px 22px;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease), background 0.25s, color 0.25s;
}
.btn:hover { transform: translateY(-2px); }
.btn-gold {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: var(--navy);
  font-weight: 700;
}
.btn-ghost {
  border-color: rgba(255, 253, 248, 0.28);
  color: var(--paper);
  background: rgba(255, 255, 255, 0.04);
}
.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

.hero-stage {
  height: 620px;
  perspective: 1400px;
  transition: transform 0.45s var(--ease);
}
.phone {
  position: absolute;
  width: min(280px, 32vw);
  aspect-ratio: 9 / 19.4;
  border-radius: 38px;
  padding: 10px;
  background: linear-gradient(160deg, #1a1a22, #050509);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.phone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: 28px;
}
.phone.a {
  inset-inline-start: 8%;
  top: 40px;
  transform: rotateY(18deg) rotateZ(-8deg);
  animation: floatA 7s ease-in-out infinite;
  z-index: 2;
}
.phone.b {
  inset-inline-start: 38%;
  top: 0;
  transform: rotateY(-8deg);
  animation: floatB 8s ease-in-out infinite;
  z-index: 3;
  width: min(300px, 34vw);
}
.phone.c {
  inset-inline-end: 0;
  top: 90px;
  transform: rotateY(-22deg) rotateZ(7deg);
  animation: floatC 6.5s ease-in-out infinite;
  z-index: 1;
}
@keyframes floatA {
  0%, 100% { transform: rotateY(18deg) rotateZ(-8deg) translateY(0); }
  50% { transform: rotateY(18deg) rotateZ(-8deg) translateY(-18px); }
}
@keyframes floatB {
  0%, 100% { transform: rotateY(-8deg) translateY(0); }
  50% { transform: rotateY(-8deg) translateY(-26px); }
}
@keyframes floatC {
  0%, 100% { transform: rotateY(-22deg) rotateZ(7deg) translateY(0); }
  50% { transform: rotateY(-22deg) rotateZ(7deg) translateY(-14px); }
}

/* ---------- marquee ---------- */
.marquee {
  border-block: 1px solid rgba(201, 162, 39, 0.22);
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
  white-space: nowrap;
  padding: 16px 0;
  color: var(--gold-2);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 13px;
}
.marquee span {
  display: inline-block;
  padding-inline: 28px;
  animation: marquee 28s linear infinite;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
html[dir="rtl"] .marquee span { animation-name: marqueeRtl; }
@keyframes marqueeRtl {
  from { transform: translateX(0); }
  to { transform: translateX(50%); }
}

section { position: relative; padding: 96px 6vw; }
.section-kicker {
  color: var(--gold);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 12px;
  margin: 0 0 8px;
}
h2 {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(32px, 4vw, 52px);
  margin: 0 0 16px;
  font-weight: 600;
}
.sub {
  max-width: 640px;
  color: rgba(255, 253, 248, 0.72);
  line-height: 1.7;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 48px;
}
.stat {
  padding: 28px 22px;
  border: 1px solid rgba(201, 162, 39, 0.22);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent);
}
.stat b {
  display: block;
  font-family: "Cormorant Garamond", serif;
  font-size: 42px;
  color: var(--gold-2);
}
.stat span { color: rgba(255, 253, 248, 0.7); font-size: 14px; }

/* ---------- architecture ---------- */
.arch {
  background:
    linear-gradient(180deg, rgba(0, 20, 56, 0.92), rgba(10, 31, 58, 0.88)),
    url("../media/generated/docs-stack-devices.png") center/cover;
}
.flow {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.flow-card {
  background: rgba(0, 8, 20, 0.55);
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: var(--radius);
  padding: 22px;
  min-height: 180px;
  position: relative;
  overflow: hidden;
}
.flow-card::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  width: 3px;
  height: 0;
  background: var(--gold-2);
  animation: growBar 1.4s var(--ease) forwards;
}
.reveal.visible .flow-card::after { height: 100%; }
@keyframes growBar { to { height: 100%; } }
.flow-card h3 { margin: 0 0 8px; font-size: 18px; }
.flow-card p { margin: 0; color: rgba(255, 253, 248, 0.7); font-size: 14px; line-height: 1.6; }
.flow-card code {
  display: inline-block;
  margin-top: 12px;
  font-size: 12px;
  color: var(--gold-2);
}

.wire {
  margin-top: 28px;
  height: 90px;
  width: 100%;
}
.wire path {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.5;
  stroke-dasharray: 8 10;
  animation: dash 18s linear infinite;
}
@keyframes dash { to { stroke-dashoffset: -400; } }

/* ---------- pillars ---------- */
.pillars {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  grid-template-rows: 320px 240px;
  gap: 16px;
  margin-top: 40px;
}
.tile {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  isolation: isolate;
}
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  transition: transform 1.2s var(--ease);
}
.tile:hover img { transform: scale(1.12); }
.tile.wide { grid-row: span 2; }
.tile figcaption {
  position: absolute;
  inset: auto 0 0;
  padding: 22px;
  background: linear-gradient(transparent, rgba(0, 8, 20, 0.92));
}
.tile h3 { margin: 0 0 4px; }
.tile p { margin: 0; font-size: 13px; color: rgba(255, 253, 248, 0.75); }

/* ---------- gallery ---------- */
.gallery-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  flex-wrap: wrap;
}
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid rgba(201, 162, 39, 0.3);
  background: transparent;
  color: var(--paper);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
}
.chip.active {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
}
.screen-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}
.screen-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  transform: translateY(18px);
  opacity: 0;
  animation: rise 0.7s var(--ease) forwards;
}
.screen-card img {
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: top;
  background: #111;
}
.screen-card span {
  display: block;
  padding: 12px 14px 14px;
  font-size: 13px;
}
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- timeline ---------- */
.timeline {
  margin-top: 36px;
  display: grid;
  gap: 0;
}
.step {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 18px;
  padding: 22px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.step .num {
  font-family: "Cormorant Garamond", serif;
  font-size: 32px;
  color: var(--gold-2);
}
.step h3 { margin: 0 0 6px; }
.step p { margin: 0; color: rgba(255, 253, 248, 0.7); }

/* ---------- audit ---------- */
.audit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 32px;
}
.find {
  border-radius: var(--radius);
  padding: 22px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.find .tag {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 10px;
  color: var(--gold-2);
}
.find.p0 { border-color: rgba(180, 35, 24, 0.55); }
.find.p1 { border-color: rgba(181, 71, 8, 0.5); }
.find h3 { margin: 0 0 8px; font-size: 17px; }
.find p { margin: 0; color: rgba(255, 253, 248, 0.72); font-size: 14px; line-height: 1.6; }

.note {
  margin-top: 22px;
  padding: 18px 20px;
  border-radius: 16px;
  background: rgba(180, 35, 24, 0.16);
  border: 1px solid rgba(180, 35, 24, 0.4);
}

/* ---------- download ---------- */
.download {
  padding: 72px 6vw 40px;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(201, 162, 39, 0.12), transparent 55%),
    linear-gradient(180deg, rgba(0, 20, 56, 0.2), transparent);
}
.download .download-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.download .note {
  background: rgba(201, 162, 39, 0.1);
  border-color: rgba(201, 162, 39, 0.35);
  color: rgba(255, 253, 248, 0.78);
  max-width: 720px;
}

/* ---------- footer mural ---------- */
.mural {
  min-height: 420px;
  padding: 80px 6vw;
  background:
    linear-gradient(180deg, var(--navy), rgba(0, 20, 56, 0.35) 30%, rgba(0, 8, 20, 0.55)),
    url("../media/generated/docs-nile-dusk.png") center/cover;
  display: flex;
  flex-direction: column;
  justify-content: end;
}
.mural h2 { max-width: 640px; }
.copyright { margin-top: 24px; font-size: 13px; color: rgba(255, 253, 248, 0.65); }

/* ---------- lightbox ---------- */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 8, 20, 0.92);
  display: none;
  place-items: center;
  padding: 24px;
}
#lightbox.open { display: grid; }
#lightbox img {
  max-height: 90vh;
  max-width: min(420px, 92vw);
  border-radius: 24px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
}
#lightbox button {
  position: absolute;
  top: 18px;
  inset-inline-end: 18px;
  background: none;
  border: 0;
  color: white;
  font-size: 28px;
}

/* ---------- reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 960px) {
  .hero, .flow, .stats, .audit-grid { grid-template-columns: 1fr; }
  .hero-stage { height: 420px; }
  .phone { width: 160px; }
  .phone.b { width: 180px; }
  .pillars { grid-template-columns: 1fr 1fr; grid-template-rows: 220px 200px 200px; }
  .tile.wide { grid-column: span 2; grid-row: auto; height: 260px; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-h);
    inset-inline: 12px;
    background: rgba(0, 20, 56, 0.96);
    padding: 16px;
    border-radius: 16px;
    border: 1px solid rgba(201, 162, 39, 0.25);
  }
  .menu-btn { display: block; }
}
