/* ==========================================================================
   AL-HOSAM DIGITAL FOUNDRY — DIRIYAH PEARL (LIGHT) × NEOM OBSIDIAN (DARK)
   Luxury Saudi Editorial + 60 FPS Kinetic Motion | 100% Bilingual AR & EN
   Pure CSS + Modern Web Guidance 2026 (light-dark, @starting-style, scroll())
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Alexandria:wght@400;500;600;700;800;900&family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Syne:wght@600;700;800&display=swap");

/* Cross-Document MPA View Transitions + Circular Light/Dark Morph */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0.44s;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  }
  html.theme-morphing::view-transition-old(root),
  html.theme-morphing::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
  }
  html.theme-morphing::view-transition-old(root) { z-index: 1; }
  html.theme-morphing::view-transition-new(root) { z-index: 9999; }
}

/* MWG dark-mode-toggle: Dark Mode default synced with <meta name="color-scheme"> */
:root {
  color-scheme: dark;

  &:has(> head > meta[name="color-scheme"][content="dark"]) {
    color-scheme: dark;
  }
  &:has(> head > meta[name="color-scheme"][content="light"]) {
    color-scheme: light;
  }

  /* Diriyah Pearl (Light) <-> NEOM Obsidian (Dark) */
  --bg: light-dark(#faf8f3, #060a0c);
  --bg-soft: light-dark(#f2eee5, #0c1317);
  --surface: light-dark(#ffffff, #10191e);
  --surface-elev: light-dark(rgba(255, 255, 255, 0.84), rgba(16, 25, 30, 0.82));
  --line: light-dark(rgba(15, 28, 24, 0.11), rgba(236, 244, 240, 0.11));
  --line-strong: light-dark(rgba(15, 28, 24, 0.28), rgba(236, 244, 240, 0.26));

  --ink: light-dark(#0c1714, #f6f4ee);
  --ink-soft: light-dark(#44554f, #9cb0a8);
  --ink-muted: light-dark(#6c7d77, #6d817a);

  --emerald: light-dark(#047857, #10b981);
  --emerald-deep: light-dark(#065f46, #34d399);
  --emerald-ink: light-dark(#ffffff, #03150f);
  --emerald-tint: light-dark(rgba(4, 120, 87, 0.09), rgba(16, 185, 129, 0.14));

  --gold: light-dark(#b5801e, #eab308);
  --gold-tint: light-dark(rgba(181, 128, 30, 0.11), rgba(234, 179, 8, 0.15));

  --shadow-lg: light-dark(
    0 32px 80px -28px rgba(12, 23, 20, 0.18),
    0 36px 90px -24px rgba(0, 0, 0, 0.82)
  );
  --shadow-sm: light-dark(
    0 12px 30px -14px rgba(12, 23, 20, 0.11),
    0 16px 38px -16px rgba(0, 0, 0, 0.65)
  );
}

/* Explicit fallback tokens for browsers without light-dark() */
[data-resolved-theme="light"] {
  --bg: #faf8f3;
  --bg-soft: #f2eee5;
  --surface: #ffffff;
  --surface-elev: rgba(255, 255, 255, 0.84);
  --line: rgba(15, 28, 24, 0.11);
  --line-strong: rgba(15, 28, 24, 0.28);
  --ink: #0c1714;
  --ink-soft: #44554f;
  --ink-muted: #6c7d77;
  --emerald: #047857;
  --emerald-deep: #065f46;
  --emerald-ink: #ffffff;
  --emerald-tint: rgba(4, 120, 87, 0.09);
  --gold: #b5801e;
  --gold-tint: rgba(181, 128, 30, 0.11);
  --shadow-lg: 0 32px 80px -28px rgba(12, 23, 20, 0.18);
  --shadow-sm: 0 12px 30px -14px rgba(12, 23, 20, 0.11);
}

[data-resolved-theme="dark"] {
  --bg: #060a0c;
  --bg-soft: #0c1317;
  --surface: #10191e;
  --surface-elev: rgba(16, 25, 30, 0.82);
  --line: rgba(236, 244, 240, 0.11);
  --line-strong: rgba(236, 244, 240, 0.26);
  --ink: #f6f4ee;
  --ink-soft: #9cb0a8;
  --ink-muted: #6d817a;
  --emerald: #10b981;
  --emerald-deep: #34d399;
  --emerald-ink: #03150f;
  --emerald-tint: rgba(16, 185, 129, 0.14);
  --gold: #eab308;
  --gold-tint: rgba(234, 179, 8, 0.15);
  --shadow-lg: 0 36px 90px -24px rgba(0, 0, 0, 0.82);
  --shadow-sm: 0 16px 38px -16px rgba(0, 0, 0, 0.65);
}

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

html {
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: 102px;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans Arabic", system-ui, -apple-system, sans-serif;
  line-height: 1.76;
  overflow-x: hidden;
  max-width: 100%;
  -webkit-font-smoothing: antialiased;
}

html[dir="ltr"] body {
  font-family: "Plus Jakarta Sans", "IBM Plex Sans Arabic", system-ui, sans-serif;
}

h1, h2, h3, h4, .disp {
  font-family: "Alexandria", "Syne", sans-serif;
  letter-spacing: 0;
  margin: 0;
}

html[dir="ltr"] h1,
html[dir="ltr"] h2,
html[dir="ltr"] h3,
html[dir="ltr"] h4,
html[dir="ltr"] .disp {
  font-family: "Syne", "Plus Jakarta Sans", sans-serif;
  letter-spacing: -0.025em;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; color: inherit; }

:is(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--emerald);
  outline-offset: 2px;
}

/* Native CSS Scroll-Driven Progress Hairline (MWG scroll-progress-indicator) */
.f-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 100;
  background: linear-gradient(90deg, var(--emerald), var(--gold));
  transform-origin: right center;
  transform: scaleX(0);
}
html[dir="ltr"] .f-progress { transform-origin: left center; }

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    @keyframes f-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
    .f-progress {
      animation: f-grow auto linear;
      animation-timeline: scroll(root);
    }
  }
}

/* ==========================================================================
   FLOATING ARCHITECTURAL HEADER
   ========================================================================== */
.f-header {
  position: fixed;
  top: 14px;
  left: 0;
  right: 0;
  z-index: 80;
  padding-inline: 20px;
  pointer-events: none;
}

.f-header-pill {
  pointer-events: auto;
  max-width: 1260px;
  margin-inline: auto;
  height: 62px;
  padding-inline: 18px;
  border-radius: 999px;
  background: var(--surface-elev);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.f-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Alexandria", "Syne", sans-serif;
  font-weight: 800;
  font-size: 1.02rem;
  white-space: nowrap;
}

.f-brand-gem {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--emerald), var(--gold));
  color: #ffffff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 8px 18px -6px color-mix(in srgb, var(--emerald) 60%, transparent);
}

.f-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.f-nav a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  transition: color 0.18s ease;
  white-space: nowrap;
}
.f-nav a:hover { color: var(--emerald); }

.f-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.f-pill-btn {
  height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}
.f-pill-btn:hover {
  border-color: var(--emerald);
  transform: translateY(-1px);
}

.f-btn {
  height: 46px;
  padding: 0 24px;
  border-radius: 999px;
  border: none;
  background: var(--emerald);
  color: var(--emerald-ink);
  font-family: "Alexandria", "Syne", sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 14px 30px -10px color-mix(in srgb, var(--emerald) 58%, transparent);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), filter 0.2s ease, box-shadow 0.22s ease;
}
.f-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}
.f-btn.sm { height: 38px; padding: 0 18px; font-size: 0.8rem; }
.f-btn.lg { height: 52px; padding: 0 28px; font-size: 0.92rem; }

.f-btn-ghost {
  height: 52px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-elev);
  color: var(--ink);
  font-family: "Alexandria", "Syne", sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.f-btn-ghost:hover {
  border-color: var(--emerald);
  transform: translateY(-2px);
}

.f-mobile-trigger { display: none; }

/* ==========================================================================
   CONTAINER & SECTION RHYTHM
   ========================================================================== */
.f-wrap {
  max-width: 1260px;
  margin-inline: auto;
  padding-inline: 24px;
}

.f-section {
  padding-block: 104px;
  position: relative;
}

.f-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--emerald-tint);
  color: var(--emerald);
  border: 1px solid color-mix(in srgb, var(--emerald) 22%, transparent);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.f-kicker.gold {
  background: var(--gold-tint);
  color: var(--gold);
  border-color: color-mix(in srgb, var(--gold) 26%, transparent);
}

.f-dot {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
  flex-shrink: 0;
}

.f-sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 52px;
}

.f-h2 {
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  font-weight: 800;
  line-height: 1.32;
  margin-top: 14px;
}
html[dir="ltr"] .f-h2 { line-height: 1.15; }

.f-lead {
  color: var(--ink-soft);
  font-size: 0.98rem;
  max-width: 440px;
  margin: 0;
  line-height: 1.8;
}

.f-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  background: var(--emerald-tint);
  color: var(--emerald);
}
.f-badge.gold { background: var(--gold-tint); color: var(--gold); }
.f-badge.neutral {
  background: var(--bg-soft);
  color: var(--ink-soft);
  border: 1px solid var(--line);
}

/* ==========================================================================
   CHAPTER 0: LIVING SILK CANVAS HERO + 3D MORPHING KINETIC STAGE
   ========================================================================== */
.f-hero {
  position: relative;
  min-height: 100svh;
  padding-top: 112px;
  padding-bottom: 72px;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.f-hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.f-hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}

.f-h1 {
  font-size: clamp(2.45rem, 4.9vw, 4.3rem);
  font-weight: 800;
  line-height: 1.34;
  margin: 20px 0 20px;
}
html[dir="ltr"] .f-h1 { line-height: 1.12; }

.f-h1-accent {
  background: linear-gradient(125deg, var(--emerald), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

.f-hero-p {
  font-size: clamp(1rem, 1.25vw, 1.12rem);
  color: var(--ink-soft);
  max-width: 540px;
  margin: 0 0 30px;
  line-height: 1.85;
}

.f-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 34px;
}

.f-scene-switcher {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  border-radius: 16px;
  background: var(--surface-elev);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.f-scene-btn {
  padding: 9px 15px;
  border-radius: 11px;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-family: "Alexandria", "Syne", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.f-scene-btn:hover { color: var(--ink); }
.f-scene-btn.active {
  background: var(--emerald);
  color: var(--emerald-ink);
  box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--emerald) 65%, transparent);
}

/* 3D Perspective Floating Kinetic Stage */
.f-stage-wrap {
  perspective: 1200px;
}

.f-stage-card {
  position: relative;
  border-radius: 30px;
  padding: 28px;
  background: var(--surface-elev);
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  transform-style: preserve-3d;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease;
}
.f-stage-card:hover {
  border-color: color-mix(in srgb, var(--emerald) 38%, var(--line));
}

.f-stage-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

/* Scene 1: Live Animated Jeddah Map & Phone Order Bezel */
.jeddah-map-box {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 16px;
  margin-bottom: 16px;
}

@media (prefers-reduced-motion: no-preference) {
  .map-route-pulse {
    stroke-dasharray: 8 8;
    animation: routeDash 2.2s linear infinite;
  }
  .map-courier-dot {
    animation: courierPulse 2s ease-in-out infinite;
  }
}
@keyframes routeDash { to { stroke-dashoffset: -32; } }
@keyframes courierPulse {
  0%, 100% { r: 7; opacity: 1; }
  50% { r: 10; opacity: 0.72; }
}

/* Scene 2: ZATCA Laser Scanner Box */
.zatca-scan-frame {
  position: relative;
  width: 112px;
  height: 112px;
  padding: 9px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}
.zatca-laser {
  position: absolute;
  left: 6px;
  right: 6px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #10b981, transparent);
  box-shadow: 0 0 10px #10b981;
  top: 10%;
}
@media (prefers-reduced-motion: no-preference) {
  .zatca-laser {
    animation: laserSweep 2.6s ease-in-out infinite alternate;
  }
}
@keyframes laserSweep {
  from { top: 10%; }
  to { top: 88%; }
}

/* ==========================================================================
   CHAPTER 1: SCULPTURAL METRICS STRIP + WCAG PAUSABLE PARTNER RIBBON
   ========================================================================== */
.f-metrics-band {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}

.f-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.f-metric-cell {
  padding: 40px 26px;
  border-inline-end: 1px solid var(--line);
}
.f-metric-cell:last-child { border-inline-end: none; }

.f-metric-num {
  font-family: "Alexandria", "Syne", sans-serif;
  font-size: clamp(2rem, 3.4vw, 3rem);
  font-weight: 800;
  line-height: 1.12;
  color: var(--ink);
  margin: 8px 0 6px;
}

.f-partner-ribbon {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding-block: 18px;
}
.f-partner-inner {
  display: flex;
  align-items: center;
  gap: 18px;
}
.f-marquee-mask {
  flex: 1;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.f-marquee-track {
  display: flex;
  gap: 44px;
  width: max-content;
  @media (prefers-reduced-motion: no-preference) {
    animation: fMarqueeRtl 34s linear infinite;
  }
}
html[dir="ltr"] .f-marquee-track { animation-name: fMarqueeLtr; }
.f-marquee-mask.paused .f-marquee-track,
.f-marquee-mask:hover .f-marquee-track { animation-play-state: paused; }
@keyframes fMarqueeRtl { 0% { transform: translateX(0); } 100% { transform: translateX(50%); } }
@keyframes fMarqueeLtr { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

.f-partner-chip {
  font-family: "Alexandria", "Syne", sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink-muted);
  white-space: nowrap;
}

/* ==========================================================================
   CHAPTER 2: INTERACTIVE 4-STAGE KINETIC PRODUCT PIPELINE
   ========================================================================== */
.f-pipeline-shell {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 32px;
  align-items: stretch;
}

.f-pipe-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.f-pipe-step {
  width: 100%;
  padding: 20px 22px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: start;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.f-pipe-step:hover {
  border-color: var(--emerald);
  transform: translateY(-2px);
}
.f-pipe-step.active {
  border-color: var(--emerald);
  background: var(--emerald-tint);
  box-shadow: var(--shadow-sm);
}

.f-pipe-num {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--emerald);
  font-family: "Syne", "Alexandria", sans-serif;
  font-weight: 800;
  font-size: 0.88rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.f-pipe-step.active .f-pipe-num {
  background: var(--emerald);
  color: var(--emerald-ink);
  border-color: transparent;
}

.f-pipe-stage {
  border-radius: 28px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.f-blueprint-canvas {
  border-radius: 20px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 24px;
  min-height: 240px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

/* ==========================================================================
   CHAPTER 3: INTERACTIVE 6-TRACK ENGINEERING SPOTLIGHT
   ========================================================================== */
.f-spotlight-grid {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 28px;
  align-items: start;
}

.f-track-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.f-track-btn {
  width: 100%;
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: start;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.f-track-btn:hover { border-color: var(--emerald); }
.f-track-btn.active {
  background: var(--emerald);
  color: var(--emerald-ink);
  border-color: transparent;
  box-shadow: 0 14px 32px -12px color-mix(in srgb, var(--emerald) 60%, transparent);
}
.f-track-sub {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 2px;
}
.f-track-btn.active .f-track-sub {
  color: var(--emerald-ink);
  opacity: 0.86;
}

.f-track-stage {
  border-radius: 28px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}

.f-track-hero-media {
  height: 240px;
  position: relative;
  overflow: hidden;
  background: #071210;
}
.f-track-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.f-track-stage:hover .f-track-hero-media img { transform: scale(1.04); }

/* ==========================================================================
   CHAPTER 4: 10-SECTOR SHARIA 3-INSTALLMENT CONFIGURATOR
   ========================================================================== */
.f-calc-card {
  border-radius: 30px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
}

.f-calc-left {
  padding: 36px;
  border-inline-end: 1px solid var(--line);
}
.f-calc-right {
  padding: 36px;
  background: var(--bg-soft);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}

.f-sector-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 18px;
}

.f-sector-pill {
  padding: 11px 14px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: start;
  transition: all 0.18s ease;
}
.f-sector-pill:hover { border-color: var(--emerald); }
.f-sector-pill.active {
  background: var(--emerald);
  color: var(--emerald-ink);
  border-color: transparent;
}

.f-addon-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 15px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--bg);
  margin-bottom: 9px;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  transition: border-color 0.18s ease;
}
.f-addon-item:hover { border-color: var(--emerald); }
.f-addon-item input {
  accent-color: var(--emerald);
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  cursor: pointer;
}

.f-sharia-bar {
  height: 10px;
  border-radius: 99px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 4fr 3fr 3fr;
  gap: 3px;
  margin: 12px 0 14px;
}
.f-sharia-bar span:nth-child(1) { background: var(--emerald); border-radius: 99px; }
.f-sharia-bar span:nth-child(2) { background: var(--gold); border-radius: 99px; }
.f-sharia-bar span:nth-child(3) { background: var(--ink-muted); border-radius: 99px; }

.f-sharia-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}
.f-sharia-tile {
  padding: 12px 8px;
  border-radius: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: center;
}

/* ==========================================================================
   CHAPTER 5: SAUDI NETWORK PULSE SVG + CLIENT VOICES + CASE STUDIES
   ========================================================================== */
.f-cases-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.f-case-card {
  border-radius: 26px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.22s ease;
}
.f-case-card:hover {
  transform: translateY(-4px);
  border-color: var(--emerald);
}

.f-case-media {
  height: 210px;
  position: relative;
  overflow: hidden;
  background: #071311;
}
.f-case-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.f-network-box {
  border-radius: 28px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}

.f-api-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.f-api-node {
  padding: 18px;
  border-radius: 18px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: border-color 0.25s ease, transform 0.22s ease;
}
.f-api-node.live {
  border-color: var(--emerald);
  transform: translateY(-2px);
}

.f-api-meter {
  height: 5px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}
.f-api-meter-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--emerald), var(--gold));
  transition: width 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.f-voice-card {
  padding: 24px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

.f-wave-btn {
  width: 40px;
  height: 40px;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.18s ease;
}
.f-wave-btn:hover,
.f-wave-btn.active {
  background: var(--emerald);
  color: var(--emerald-ink);
  border-color: transparent;
}

/* ==========================================================================
   CHAPTER 6: LUXURY CONSULTATION CTA + FOOTER
   ========================================================================== */
.f-cta-card {
  border-radius: 32px;
  padding: 52px 46px;
  background: linear-gradient(135deg, var(--emerald-tint), var(--gold-tint)), var(--surface);
  border: 1px solid color-mix(in srgb, var(--emerald) 26%, var(--line));
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 32px;
  align-items: center;
}

.f-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 64px 0 34px;
}

.f-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
  gap: 32px;
}
.f-footer h4 {
  font-size: 0.88rem;
  font-weight: 800;
  margin-bottom: 14px;
}
.f-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.f-footer li a {
  font-size: 0.85rem;
  color: var(--ink-soft);
  transition: color 0.16s ease;
}
.f-footer li a:hover { color: var(--emerald); }

.f-footer-bottom {
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

/* ==========================================================================
   NATIVE TOP-LAYER <dialog closedby="any"> DRAWERS (MWG COMPLIANT)
   ========================================================================== */
dialog.f-dialog {
  margin: 0;
  margin-inline-start: auto;
  height: 100dvh;
  max-height: 100dvh;
  width: min(460px, 94vw);
  max-width: 94vw;
  padding: 30px;
  border: none;
  border-inline-start: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  overflow-y: auto;
  opacity: 0;
  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.28s;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  transition-behavior: allow-discrete;
}

@media (prefers-reduced-motion: no-preference) {
  dialog.f-dialog { transform: translateX(-24px); }
  html[dir="ltr"] dialog.f-dialog { transform: translateX(24px); }
}

dialog.f-dialog[open]:where(:not([data-closing])) {
  opacity: 1;
  @starting-style { opacity: 0; }
  @media (prefers-reduced-motion: no-preference) {
    transform: translateX(0);
    @starting-style { transform: translateX(-24px); }
  }
}
@media (prefers-reduced-motion: no-preference) {
  html[dir="ltr"] dialog.f-dialog[open]:where(:not([data-closing])) {
    transform: translateX(0);
    @starting-style { transform: translateX(24px); }
  }
}

dialog.f-dialog::backdrop {
  background: rgba(6, 10, 12, 0);
  backdrop-filter: blur(0px);
  transition-property: background-color, backdrop-filter, display, overlay;
  transition-duration: 0.26s;
  transition-behavior: allow-discrete;
}
dialog.f-dialog[open]:where(:not([data-closing]))::backdrop {
  background: rgba(6, 10, 12, 0.6);
  backdrop-filter: blur(8px);
  @starting-style {
    background: rgba(6, 10, 12, 0);
    backdrop-filter: blur(0px);
  }
}

.f-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.f-field label { font-size: 0.8rem; font-weight: 700; color: var(--ink-soft); }
.f-field input,
.f-field select,
.f-field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 0.9rem;
  outline: none;
}
.f-field input:focus,
.f-field select:focus,
.f-field textarea:focus { border-color: var(--emerald); }

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (ZERO OVERFLOW AT 390px)
   ========================================================================== */
@media (max-width: 1060px) {
  .f-nav { display: none; }
  .f-mobile-trigger { display: inline-flex; }
  .f-hero-grid,
  .f-pipeline-shell,
  .f-spotlight-grid,
  .f-calc-card,
  .f-cta-card {
    grid-template-columns: 1fr;
  }
  .f-calc-left { border-inline-end: none; border-bottom: 1px solid var(--line); }
  .f-metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .f-metric-cell:nth-child(2) { border-inline-end: none; }
  .f-metric-cell:nth-child(1),
  .f-metric-cell:nth-child(2) { border-bottom: 1px solid var(--line); }
  .f-api-grid,
  .f-voices-grid,
  .f-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .f-header { top: 8px; padding-inline: 10px; }
  .f-header-pill { height: 54px; padding-inline: 12px; gap: 8px; }
  .f-brand-sub { display: none; }
  .desktop-only { display: none !important; }
  .f-pill-btn { height: 32px; padding: 0 9px; font-size: 0.72rem; }
  .f-wrap { padding-inline: 16px; }
  .f-section { padding-block: 64px; }
  .f-hero { padding-top: 86px; padding-bottom: 48px; }
  .f-stage-card { padding: 18px; border-radius: 22px; }
  .f-metrics-grid,
  .f-cases-grid,
  .f-api-grid,
  .f-voices-grid,
  .f-footer-grid,
  .f-sharia-cols { grid-template-columns: 1fr; }
  .f-metric-cell { border-inline-end: none; border-bottom: 1px solid var(--line); padding: 26px 18px; }
  .f-metric-cell:last-child { border-bottom: none; }
  .f-calc-left, .f-calc-right { padding: 22px 16px; }
  .f-sector-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .f-sector-pill { padding: 9px 10px; font-size: 0.76rem; }
  .f-network-box, .f-pipe-stage { padding: 20px 16px; }
  .f-cta-card { padding: 28px 18px; border-radius: 22px; }
  .f-partner-inner { flex-wrap: wrap; }
}
