/* Self-hosted Jasmine Systems Typography (CSP 'self' compliant, zero external requests) */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/PlusJakartaSans-latin-400-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/CormorantGaramond-latin-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/CormorantGaramond-latin-600.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/IBMPlexSansArabic-arabic-400.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/IBMPlexSansArabic-arabic-600.woff2') format('woff2');
}

/* ============================================================================
   JASMINE SYSTEMS — Arabian Desert Day (Sunlit & Full) / Night (Starry & Vast)
   ============================================================================ */
:root {
  --font-sans: 'Plus Jakarta Sans', 'IBM Plex Sans Arabic', system-ui, -apple-system, sans-serif;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --max-w: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Default: Starry Sinai & Red Sea Night (Vast, Deep, Luminous) */
  --bg: #071019;
  --bg-elev: #0d1b2a;
  --surface: rgba(13, 27, 42, 0.80);
  --surface-solid: #102133;
  --surface-hi: rgba(20, 41, 60, 0.90);
  --border: rgba(96, 188, 200, 0.17);
  --border-strong: rgba(96, 188, 200, 0.36);
  --ink: #f6f2ea;
  --mute: #9bb5c4;
  --dim: #6c8799;
  --accent: #38b6c4;      /* Red Sea & North Coast turquoise reef */
  --accent-hi: #8be0e8;   /* Luminous Sharm / Hurghada shallows */
  --accent-deep: #1b7f8e; /* Deep Nile & Red Sea drop-off */
  --sand: #df9b74;        /* Moonlit Sinai mountain sandstone */
  --on-accent: #051319;
  --shadow: 0 24px 64px rgba(2, 9, 16, 0.58);
  --nav-bg: rgba(7, 16, 25, 0.76);
  --hero-glow: radial-gradient(ellipse 72% 52% at 50% 0%, rgba(56, 182, 196, 0.16), transparent 68%),
               radial-gradient(ellipse 50% 40% at 85% 15%, rgba(223, 155, 116, 0.08), transparent 70%);
}

html[data-theme="day"] {
  /* Sunlit Sinai Mountains, North Coast Turquoise & Nile Day */
  --bg: #fbf7f0;
  --bg-elev: #f3ebdd;
  --surface: rgba(255, 253, 248, 0.86);
  --surface-solid: #ffffff;
  --surface-hi: #f6eee0;
  --border: rgba(155, 114, 78, 0.18);
  --border-strong: rgba(155, 114, 78, 0.36);
  --ink: #1a1714;
  --mute: #635648;
  --dim: #8c7b69;
  --accent: #0f7b8a;      /* North Coast & Sharm El Sheikh reef turquoise */
  --accent-hi: #0a5e6b;   /* Deep Nile & Red Sea teal */
  --accent-deep: #1b5678; /* Nile horizon blue */
  --sand: #c26d4a;        /* Sinai mountain rose-terracotta sandstone */
  --on-accent: #fffdf9;
  --shadow: 0 22px 54px rgba(108, 72, 38, 0.10);
  --nav-bg: rgba(251, 247, 240, 0.84);
  --hero-glow: radial-gradient(ellipse 75% 55% at 80% -8%, rgba(244, 184, 118, 0.30), transparent 68%),
               radial-gradient(ellipse 65% 48% at 15% 5%, rgba(15, 123, 138, 0.12), transparent 66%);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); color: var(--ink); }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.6s var(--ease), color 0.6s var(--ease);
}
html[dir="rtl"] body { font-family: 'IBM Plex Sans Arabic', var(--font-sans); }
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }

/* Live Arabian Sky Canvas */
#skyCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* 3D Brand Reveal Entry Curtain */
.intro-splash {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100lvh;
  height: 100dvh;
  z-index: 200;
  background: #000000;
  display: block;
  overflow: hidden;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.8s var(--ease), visibility 0.8s;
}
.intro-splash.out { opacity: 0; visibility: hidden; pointer-events: none; }
.intro-pic { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.intro-fallback, .intro-vid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center center;
  pointer-events: none;
}
.intro-vid { z-index: 1; background: transparent; }
.intro-hint {
  position: fixed;
  left: 50%;
  bottom: max(28px, env(safe-area-inset-bottom, 28px));
  transform: translateX(-50%);
  z-index: 3;
  color: rgba(245, 242, 235, 0.82);
  font: 500 12.5px/1.2 var(--font-sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 9px 20px;
  border-radius: 999px;
  background: rgba(14, 21, 37, 0.62);
  border: 1px solid rgba(187, 217, 248, 0.22);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 0.7s ease;
  white-space: nowrap;
}
.intro-splash.ready .intro-hint { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .intro-vid { display: none !important; }
  .intro-hint { opacity: 1; }
}

/* Container & Layout */
.wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
}

/* Top Navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.5s var(--ease), border-color 0.5s var(--ease);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 74px;
}
.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  height: 36px;
  width: auto;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.25));
}
.brand-word {
  height: 17px;
  width: auto;
}
.brand-word-light { display: none; }
html[data-theme="day"] .brand-word-dark { display: none; }
html[data-theme="day"] .brand-word-light { display: block; }
html[data-theme="day"] .brand-mark { filter: drop-shadow(0 2px 8px rgba(40, 28, 12, 0.22)); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--mute);
}
.nav-links a { transition: color 0.2s ease; }
.nav-links a:hover { color: var(--ink); }

.nav-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}
.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  transition: border-color 0.25s ease, transform 0.2s ease, background-color 0.25s ease;
}
.chip-btn:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.chip-btn:active { transform: scale(0.97); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  transition: transform 0.22s var(--ease), box-shadow 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 10px 28px rgba(29, 91, 140, 0.26);
}
.btn-primary:hover { background: var(--accent-hi); }
.btn-ghost {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--accent); }

/* Hero */
.hero {
  position: relative;
  padding: clamp(72px, 11vh, 132px) 0 clamp(64px, 9vh, 112px);
  background: var(--hero-glow);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(32px, 5vw, 68px);
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 18px;
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--sand);
}
.hero h1 {
  margin: 0 0 22px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(44px, 6.2vw, 76px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
html[dir="rtl"] .hero h1 { font-family: 'IBM Plex Sans Arabic', var(--font-sans); font-size: clamp(36px, 5vw, 60px); line-height: 1.18; }
.hero-lead {
  margin: 0 0 32px;
  max-width: 54ch;
  font-size: clamp(16px, 1.45vw, 18.5px);
  line-height: 1.68;
  color: var(--mute);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 42px;
}
.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}
.metric b {
  display: block;
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  line-height: 1.15;
}
.metric span {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--mute);
}

/* Hero Visual Card (Live Brand Film Frame) */
.hero-frame {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: #050810;
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 10;
}
.hero-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-frame-bar {
  position: absolute;
  inset: auto 14px 14px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(7, 11, 20, 0.72);
  border: 1px solid rgba(187, 217, 248, 0.18);
  backdrop-filter: blur(12px);
  color: #f5f2eb;
  font-size: 13px;
}
.hero-frame-bar button {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(187, 217, 248, 0.34);
  background: rgba(116, 176, 236, 0.16);
  color: #f5f2eb;
  font-size: 12.5px;
  font-weight: 600;
}
.hero-frame-bar button:hover { background: rgba(116, 176, 236, 0.30); }

/* Sections */
section.band {
  position: relative;
  z-index: 2;
  padding: clamp(64px, 9vh, 112px) 0;
  border-top: 1px solid var(--border);
}
.sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: clamp(32px, 4.5vh, 52px);
}
.sec-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(34px, 4.2vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.015em;
}
html[dir="rtl"] .sec-head h2 { font-family: 'IBM Plex Sans Arabic', var(--font-sans); font-size: clamp(28px, 3.6vw, 42px); }
.sec-head p {
  margin: 0;
  max-width: 48ch;
  color: var(--mute);
  font-size: 15.5px;
}

/* Systems Grid */
.systems-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.sys-card {
  display: flex;
  flex-direction: column;
  padding: 28px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  transition: transform 0.28s var(--ease), border-color 0.28s ease;
}
.sys-card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.sys-card.featured {
  grid-column: span 2;
  background: linear-gradient(145deg, var(--surface-hi), var(--surface));
}
.sys-tag {
  display: inline-flex;
  align-self: flex-start;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(116, 176, 236, 0.12);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}
html[data-theme="day"] .sys-tag { background: rgba(29, 91, 140, 0.08); }
.sys-card h3 {
  margin: 0 0 10px;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.25;
}
.sys-card p {
  margin: 0 0 20px;
  color: var(--mute);
  font-size: 14.8px;
  flex: 1;
}
.sys-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.sys-specs span {
  font-size: 12px;
  color: var(--mute);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
}

/* Ads & Videos Showcase */
.media-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
}
.media-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform 0.28s var(--ease), border-color 0.28s ease;
}
.media-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.media-card.wide { grid-column: span 8; }
.media-card.tall { grid-column: span 4; }
.media-card.half { grid-column: span 6; }
.media-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #060912;
  overflow: hidden;
}
.media-card.tall .media-thumb { aspect-ratio: 9 / 11; }
.media-thumb img, .media-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}
.media-card:hover .media-thumb img,
.media-card:hover .media-thumb video { transform: scale(1.03); }
.play-pill {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.38);
  background: rgba(7, 11, 20, 0.64);
  backdrop-filter: blur(10px);
  color: #ffffff;
  font-size: 20px;
  display: grid;
  place-items: center;
  transition: transform 0.22s var(--ease), background-color 0.22s ease;
}
.media-card:hover .play-pill { transform: translate(-50%, -50%) scale(1.08); background: var(--accent); color: var(--on-accent); }
.media-meta {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.media-meta h3 { margin: 0 0 3px; font-size: 16.5px; font-weight: 600; }
.media-meta span { font-size: 13px; color: var(--mute); }
.media-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 220px;
  padding: 28px;
  background: linear-gradient(160deg, var(--surface), var(--bg-elev));
  border-style: dashed;
}
.media-slot b { font-size: 15.5px; margin-bottom: 6px; color: var(--ink); }
.media-slot span { font-size: 13.5px; color: var(--mute); max-width: 34ch; }

/* Architecture / Craft Pillars */
.pillars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.pillar {
  padding: 24px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}
.pillar-num {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  color: var(--sand);
  line-height: 1;
  margin-bottom: 12px;
}
.pillar h3 { margin: 0 0 8px; font-size: 16.5px; font-weight: 600; }
.pillar p { margin: 0; font-size: 14px; color: var(--mute); }

/* Contact CTA Band */
.cta-box {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 32px;
  align-items: center;
  padding: clamp(32px, 5vw, 56px);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--surface-hi), var(--surface));
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
}
.cta-box h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.08;
}
html[dir="rtl"] .cta-box h2 { font-family: 'IBM Plex Sans Arabic', var(--font-sans); font-size: clamp(26px, 3.2vw, 38px); }
.cta-box p { margin: 0; color: var(--mute); font-size: 15.5px; max-width: 50ch; }
.cta-actions { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; justify-self: end; }

/* Video Lightbox Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(4, 7, 14, 0.88);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal[hidden] { display: none; }
.modal-box {
  position: relative;
  width: min(1040px, 100%);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000000;
  border: 1px solid rgba(187, 217, 248, 0.22);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.75);
}
.modal-box video { width: 100%; max-height: 82vh; background: #000; }
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(7, 11, 20, 0.72);
  color: #fff;
  font-size: 18px;
}

/* Footer */
footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--border);
  padding: 36px 0 48px;
  color: var(--mute);
  font-size: 13.5px;
}
.foot-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 980px) {
  .hero-grid, .cta-box { grid-template-columns: 1fr; }
  .cta-actions { justify-self: start; }
  .systems-grid { grid-template-columns: 1fr; }
  .sys-card.featured { grid-column: span 1; }
  .media-card.wide, .media-card.tall, .media-card.half { grid-column: span 12; }
  .media-card.tall .media-thumb { aspect-ratio: 16 / 10; }
  .pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .nav-links { display: none; }
  .hero-metrics { grid-template-columns: 1fr 1fr; }
  .pillars { grid-template-columns: 1fr; }
}


/* Atmospheric Directional Lighting & Tactile Depth (No Flat Surfaces) */
.sys-card, .media-card, .pillar {
  background:
    radial-gradient(ellipse 90% 60% at 8% 0%, rgba(56, 182, 196, 0.12), transparent 58%),
    radial-gradient(ellipse 65% 50% at 95% 100%, rgba(223, 155, 116, 0.08), transparent 60%),
    linear-gradient(155deg, rgba(20, 41, 60, 0.88) 0%, rgba(11, 24, 38, 0.94) 100%);
  box-shadow: 0 22px 54px rgba(2, 9, 16, 0.50), 0 4px 14px rgba(2, 9, 16, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
html[data-theme="day"] .sys-card,
html[data-theme="day"] .media-card,
html[data-theme="day"] .pillar {
  background:
    radial-gradient(ellipse 85% 55% at 95% 0%, rgba(244, 184, 118, 0.16), transparent 58%),
    radial-gradient(ellipse 70% 50% at 5% 0%, rgba(15, 123, 138, 0.07), transparent 58%),
    linear-gradient(155deg, rgba(255, 255, 254, 0.96) 0%, rgba(250, 244, 234, 0.92) 100%);
  box-shadow: 0 18px 44px rgba(108, 72, 38, 0.11), 0 3px 10px rgba(108, 72, 38, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}
.btn-primary {
  background: linear-gradient(145deg, #56cbd6 0%, #2ba4b3 52%, #137987 100%);
  box-shadow: 0 12px 28px rgba(19, 121, 135, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.36);
}
html[data-theme="day"] .btn-primary {
  background: linear-gradient(145deg, #1693a3 0%, #0f7b8a 55%, #0a5e6b 100%);
  box-shadow: 0 12px 28px rgba(15, 123, 138, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
