/* Tawafy Web Design System — Sacred Quietude 2.0: Cahaya Haramain (Light & True Dark OLED) */

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/assets/fonts/PlusJakartaSans.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('/assets/fonts/cormorant-garamond-latin-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('/assets/fonts/cormorant-garamond-latin-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('/assets/fonts/cormorant-garamond-latin-600-italic.woff2') format('woff2');
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('/assets/fonts/cormorant-garamond-latin-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'LPMQ Isep Misbah';
  src: url('/assets/fonts/LPMQIsepMisbah.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Scheherazade New';
  src: url('/assets/fonts/ScheherazadeNew-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Scheherazade New';
  src: url('/assets/fonts/ScheherazadeNew-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root,
[data-theme="light"] {
  color-scheme: light;
  --bg-canvas: #F5F3EE;
  --bg-band-ivory: #FAF9F5;
  --bg-band-sand: #F2EFE7;
  --bg-band-porcelain: #FBFBF8;
  --bg-band-stone: #EFECE3;
  --surface: #FFFFFF;
  --surface-elevated: #F1EFEA;
  --surface-subtle: #ECE9E3;
  --ink-primary: #0B2257;
  --ink-secondary: #3E4C63;
  --ink-muted: #526075;
  --border-subtle: #E2DEC8;
  --hairline: rgba(11, 34, 87, 0.09);
  --gold-decor: #C59B27;
  --gold-ink: #7D6112;
  --gold-subtle: #F6EFE0;
  --on-gold: #0B2257;
  --nav-pill: #F3EAD3;
  --orange-accent: #FF4D1C;
  --emerald: #0F766E;
  --emerald-subtle: #E6F4F1;
  --danger: #B91C1C;
  --danger-subtle: #FEE2E2;
  --hero-bg: #0B2257;
  --hero-fg: #F8FAFC;
  --hero-muted: #CBD5E1;
  --hero-accent: #E5C158;
  --topbar-bg: rgba(245, 243, 238, 0.9);
  --shadow-card: 0 4px 16px -2px rgba(11, 34, 87, 0.06), 0 2px 6px -1px rgba(11, 34, 87, 0.03);
  --shadow-floating: 0 24px 48px -12px rgba(11, 34, 87, 0.14), 0 4px 12px -2px rgba(11, 34, 87, 0.05);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Sacred Quietude 2.0 — Nocturnal Sanctuary & Typography Scale Tokens */
  --night-bg: #060D1E;
  --night-surface: #091328;
  --night-elevated: #0E1B36;
  --night-ink: #F8FAFC;
  --night-muted: #CBD5E1;
  --night-subtle: #94A3B8;
  --night-gold: #E5C158;
  --night-line: rgba(229, 193, 88, 0.24);
  --night-hairline: rgba(248, 250, 252, 0.10);

  /* Adaptive Hero Tokens (Day / Dhuha mode) */
  --hero-surface: #F5F1E9;
  --hero-ink: #0B2257;
  --hero-ink-muted: #2B3B56;
  --hero-accent-ink: #8A6412;
  --hero-rule: rgba(11, 34, 87, 0.18);
  --hero-veil-rgb: 245, 241, 233;
  --hero-ghost-bg: rgba(245, 241, 233, 0.72);
  --hero-ghost-border: rgba(11, 34, 87, 0.34);

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-ui: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-arabic-id: 'LPMQ Isep Misbah', 'Scheherazade New', serif;
  --font-arabic-global: 'Scheherazade New', 'LPMQ Isep Misbah', serif;

  --step--1: clamp(0.75rem, 0.72rem + 0.15vw, 0.84rem);
  --step-0: clamp(0.95rem, 0.92rem + 0.18vw, 1.0625rem);
  --step-1: clamp(1.125rem, 1.06rem + 0.32vw, 1.3125rem);
  --step-2: clamp(1.375rem, 1.24rem + 0.65vw, 1.75rem);
  --step-3: clamp(1.75rem, 1.5rem + 1.2vw, 2.375rem);
  --step-4: clamp(2.25rem, 1.85rem + 2vw, 3.375rem);
  --step-5: clamp(2.75rem, 2.15rem + 3vw, 4.5rem);

  --space-section: clamp(4.5rem, 7vw, 7.5rem);
  --ease-sacred: cubic-bezier(0.22, 1, 0.36, 1);

  /* Realistic Device Frame & Hero Vignette Tokens */
  --device-frame-hi: #4a4d55;
  --device-frame-lo: #15161a;
  --device-edge: #6b6e76;
  --device-screen: #0b1736;
  --device-screen-glow: #16306b;
  --device-screen-app-top: #f4f3ee;
  --device-screen-app-bottom: #ffffff;
  --device-glare: rgba(255, 255, 255, 0.10);
  --device-shadow-1: rgba(0, 0, 0, 0.40);
  --device-shadow-2: rgba(0, 0, 0, 0.65);
  --device-shadow-3: rgba(0, 0, 0, 0.55);
  --device-gesture: rgba(0, 0, 0, 0.18);
  --hero-vignette: 6, 13, 30;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg-canvas: #060D1E;
  --bg-band-ivory: #091328;
  --bg-band-sand: #0C1832;
  --bg-band-porcelain: #071024;
  --bg-band-stone: #0B162E;
  --surface: #0C1832;
  --surface-elevated: #122142;
  --surface-subtle: #182B54;
  --ink-primary: #F8FAFC;
  --ink-secondary: #CBD5E1;
  --ink-muted: #94A3B8;
  --border-subtle: rgba(248, 250, 252, 0.13);
  --hairline: rgba(248, 250, 252, 0.09);
  --gold-decor: #E5C158;
  --gold-ink: #E5C158;
  --gold-subtle: #1E1A0F;
  --on-gold: #060D1E;
  --nav-pill: #211C10;
  --orange-accent: #FF4D1C;
  --emerald: #34D399;
  --emerald-subtle: #0D2821;
  --danger: #F87171;
  --danger-subtle: #2B1214;
  --hero-bg: #060D1E;
  --hero-fg: #F8FAFC;
  --hero-muted: #CBD5E1;
  --hero-accent: #E5C158;
  --hero-surface: #060D1E;
  --hero-ink: #F8FAFC;
  --hero-ink-muted: #CBD5E1;
  --hero-accent-ink: #E5C158;
  --hero-rule: rgba(248, 250, 252, 0.22);
  --hero-veil-rgb: 6, 13, 30;
  --hero-ghost-bg: rgba(6, 13, 30, 0.42);
  --hero-ghost-border: rgba(229, 193, 88, 0.72);
  --topbar-bg: rgba(6, 13, 30, 0.90);
  --shadow-card: 0 8px 24px -4px rgba(3, 8, 20, 0.62);
  --shadow-floating: 0 28px 56px -12px rgba(2, 6, 16, 0.80);
  --device-frame-hi: #4a4d55;
  --device-frame-lo: #15161a;
  --device-edge: #6b6e76;
  --device-screen: #0b1736;
  --device-screen-glow: #16306b;
  --device-screen-app-top: #f4f3ee;
  --device-screen-app-bottom: #ffffff;
  --device-glare: rgba(255, 255, 255, 0.10);
  --device-shadow-1: rgba(0, 0, 0, 0.40);
  --device-shadow-2: rgba(0, 0, 0, 0.65);
  --device-shadow-3: rgba(0, 0, 0, 0.55);
  --device-gesture: rgba(0, 0, 0, 0.18);
  --hero-vignette: 6, 13, 30;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  background-color: var(--bg-canvas);
  color: var(--ink-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.25s var(--ease-sacred), color 0.25s var(--ease-sacred);
}

/* Browser Surface Craft */
::selection {
  background: var(--gold-subtle);
  color: var(--ink-primary);
}

input,
textarea,
select {
  caret-color: var(--gold-decor);
}

:focus-visible {
  outline: 2px solid var(--gold-decor);
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: var(--bg-canvas);
}

::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 999px;
  border: 2px solid var(--bg-canvas);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--ink-muted);
}

a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 3px;
}

img,
svg {
  display: block;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.arabic-script {
  font-family: var(--font-arabic-id);
  direction: rtl;
  font-feature-settings: "kern" 1, "liga" 1, "mark" 1, "mkmk" 1;
}

html[lang="en"] .arabic-script {
  font-family: var(--font-arabic-global);
}

.font-display-qalam {
  font-family: var(--font-display);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Layout Container */
.wrap {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

@media (min-width: 768px) {
  .wrap {
    padding: 0 32px;
  }
}

/* Sticky Architectural Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--topbar-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hairline);
  color: var(--ink-primary);
}

.topbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: 6px 12px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-logo {
  height: 28px;
  width: auto;
}

[data-theme="dark"] .logo-for-light {
  display: none;
}

[data-theme="light"] .logo-for-dark,
:root:not([data-theme="dark"]) .logo-for-dark {
  display: none;
}

.nav-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  order: 3;
  flex: 1 0 100%;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 6px 0 0;
  border-top: 1px solid var(--hairline);
  margin-right: 0;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  min-height: 36px;
  font-size: 13.5px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 999px;
  white-space: nowrap;
  color: var(--ink-secondary);
  transition: color 0.18s ease, background-color 0.18s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--ink-primary);
  background: var(--surface-elevated);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

@media (min-width: 900px) {
  .topbar-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    min-height: 76px;
    padding-top: 0;
    padding-bottom: 0;
  }

  .brand {
    justify-self: start;
  }

  .nav-links {
    display: flex;
    order: 0;
    flex: 0 1 auto;
    width: auto;
    overflow-x: visible;
    padding: 0;
    border-top: 0;
    justify-self: center;
    margin-right: 0;
  }

  .nav-link {
    min-height: 40px;
    padding: 8px 14px;
  }

  .topbar-actions {
    grid-column: 3;
    justify-self: end;
  }
}

/* Mode Masjid (OLED) & Lang Controls */
.theme-toggle:not(.icon-btn) {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--surface);
  color: var(--ink-primary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.theme-toggle:not(.icon-btn):hover {
  border-color: var(--gold-decor);
}

.theme-toggle:not(.icon-btn):active {
  transform: scale(0.97);
}

.theme-toggle .toggle-label {
  display: none;
}

@media (min-width: 640px) {
  .theme-toggle .toggle-label {
    display: inline;
  }
}

.icon-btn {
  appearance: none;
  border: none;
  background: transparent;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: inherit;
  transition: color 0.18s ease, background-color 0.18s ease, transform 0.18s var(--ease-sacred);
}

.icon-btn:hover {
  background: color-mix(in srgb, currentColor 8%, transparent);
}

.icon-btn:active {
  transform: scale(0.95);
}

.lang-text {
  appearance: none;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 8px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: inherit;
  cursor: pointer;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.lang-text:hover {
  background: color-mix(in srgb, currentColor 8%, transparent);
}

.lang-opt {
  opacity: 0.56;
  transition: opacity 0.18s ease, color 0.18s ease;
}

.lang-opt.is-active {
  opacity: 1;
  font-weight: 800;
  color: var(--gold-ink);
}

.lang-sep {
  opacity: 0.45;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-subtle);
  background: var(--surface);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.lang-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.lang-btn.active {
  background: var(--ink-primary);
  color: var(--bg-canvas);
}

/* Buttons */
.btn-primary {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  background: var(--ink-primary);
  color: var(--bg-canvas);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease, box-shadow 0.18s ease;
}

[data-theme="dark"] .btn-primary {
  background: var(--gold-decor);
  color: var(--on-gold);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink-primary);
  border: 1px solid var(--border-subtle);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.btn-secondary:hover {
  border-color: var(--gold-decor);
  background: var(--surface-elevated);
}

.btn-gold {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  background: var(--hero-accent);
  color: var(--on-gold);
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.btn-gold:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.btn-ghost-light {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  background: rgba(248, 250, 252, 0.08);
  color: #F8FAFC;
  border: 1px solid rgba(229, 193, 88, 0.32);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.btn-ghost-light:hover {
  border-color: #E5C158;
  background: rgba(229, 193, 88, 0.14);
  transform: translateY(-1px);
}

/* Mobile Quick-Jump Strip (< 900px) */
.mobile-jump-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 20px 10px;
  border-top: 1px solid var(--hairline);
  scrollbar-width: none;
}

.mobile-jump-bar::-webkit-scrollbar {
  display: none;
}

@media (min-width: 900px) {
  .mobile-jump-bar {
    display: none;
  }
}

.mobile-jump-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-secondary);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.16s ease, color 0.16s ease;
}

.mobile-jump-pill:hover,
.mobile-jump-pill:focus-visible {
  color: var(--ink-primary);
  border-color: var(--gold-decor);
}

/* Editorial Eyebrow */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-ink);
  margin: 0 0 10px;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: 0.72;
}

.eyebrow--gold {
  color: var(--night-gold);
}

/* Unified Studio Footer */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 36px 0 48px;
  font-size: 13px;
  color: var(--ink-muted);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

@media (min-width: 768px) {
  .footer-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.footer-brand-note {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  font-weight: 600;
  color: var(--ink-primary);
}

.footer-links a:hover {
  color: var(--gold-ink);
  text-decoration: underline;
}

/* 3-Column Adaptive Luxury Footer (Light / Nocturnal, Hairline Divider) */
.luxury-footer {
  background: var(--bg-canvas);
  color: var(--ink-secondary);
  padding: 32px 0 28px;
  border-top: 1px solid var(--hairline);
  transition: background-color 0.35s var(--ease-sacred), color 0.35s var(--ease-sacred), border-color 0.35s var(--ease-sacred);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 16px;
  align-items: start;
}

.footer-brand-block {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.footer-brand-block .brand-logo {
  height: 28px;
  width: auto;
}

.footer-tagline {
  margin: 0;
  max-width: 36ch;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ink-secondary);
}

.footer-copy {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

.footer-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.footer-col-title {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-ink);
}

.footer-col a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-primary);
  transition: color 0.18s ease;
}

.footer-col a:hover {
  color: var(--gold-ink);
}

@media (min-width: 820px) {
  .luxury-footer {
    padding: 40px 0 32px;
  }

  .footer-grid {
    grid-template-columns: 1fr auto auto;
    gap: 40px 64px;
  }

  .footer-brand-block {
    grid-column: auto;
  }

  .footer-tagline {
    max-width: none;
  }

  .footer-col {
    gap: 6px;
  }

  .footer-col-title {
    margin: 0 0 6px;
  }

  .footer-col a {
    min-height: auto;
    padding: 3px 0;
    line-height: 1.45;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
