@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;800;900&family=Inter:wght@400;500;600;700&family=Cairo:wght@400;600;700;800;900&display=swap');

:root {
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  -webkit-font-smoothing: antialiased;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  color: #2C2C2C;
  background-color: #FBFAF8;
}

h1, h2, h3, h4, .font-display {
  font-family: 'Montserrat', sans-serif;
}

/* ---------- Grain texture overlay ---------- */
.grain {
  position: relative;
}
.grain::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n' x='0' y='0'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' fill='%23ffffff'/%3E%3C/svg%3E");
}

/* ---------- Hero gradient mesh ---------- */
.hero-gradient {
  background-color: #071D42;
  background-image:
    radial-gradient(ellipse 80% 60% at 15% 20%, rgba(201, 162, 39, 0.18), transparent 60%),
    radial-gradient(ellipse 70% 70% at 85% 85%, rgba(3, 10, 35, 0.55), transparent 60%),
    linear-gradient(180deg, rgba(7, 29, 66, 0.90) 0%, rgba(4, 14, 40, 0.97) 100%);
}

/* ---------- Diagonal line pattern (brand graphic lines) ---------- */
.pattern-lines {
  background-image: repeating-linear-gradient(
    135deg,
    rgba(201, 162, 39, 0.08) 0px,
    rgba(201, 162, 39, 0.08) 2px,
    transparent 2px,
    transparent 28px
  );
}

.pattern-lines-light {
  background-image: repeating-linear-gradient(
    135deg,
    rgba(13, 59, 102, 0.05) 0px,
    rgba(13, 59, 102, 0.05) 1px,
    transparent 1px,
    transparent 24px
  );
}

/* ---------- Image treatment: gradient + navy duotone ---------- */
.img-treatment {
  position: relative;
  overflow: hidden;
}
.img-treatment img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.img-treatment::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(7, 32, 58, 0.75) 0%, rgba(7, 32, 58, 0.15) 50%, rgba(13, 59, 102, 0.35) 100%);
  mix-blend-mode: multiply;
}
.img-treatment.no-tint::after {
  background: linear-gradient(to top, rgba(7, 32, 58, 0.65) 0%, transparent 55%);
  mix-blend-mode: normal;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.9rem 2rem;
  border-radius: 0.5rem;
  transition: transform 0.35s var(--ease-spring), opacity 0.25s var(--ease-out), box-shadow 0.35s var(--ease-out), background-color 0.25s var(--ease-out), color 0.25s var(--ease-out);
  will-change: transform;
}
.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background-color: #C9A227;
  color: #07203A;
  box-shadow: 0 8px 24px -6px rgba(201, 162, 39, 0.45);
}
.btn-primary:hover {
  background-color: #D4AC3D;
  transform: translateY(-2px);
  box-shadow: 0 14px 32px -8px rgba(201, 162, 39, 0.55);
}
.btn-primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(251, 250, 248, 1), 0 0 0 6px rgba(201, 162, 39, 0.6);
}

.btn-secondary {
  background-color: transparent;
  color: #FBFAF8;
  border: 1.5px solid rgba(251, 250, 248, 0.35);
}
.btn-secondary:hover {
  background-color: rgba(251, 250, 248, 0.1);
  border-color: rgba(251, 250, 248, 0.7);
  transform: translateY(-2px);
}
.btn-secondary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(7, 32, 58, 1), 0 0 0 6px rgba(251, 250, 248, 0.6);
}

.btn-dark {
  background-color: #0D3B66;
  color: #FBFAF8;
  box-shadow: 0 8px 24px -6px rgba(13, 59, 102, 0.45);
}
.btn-dark:hover {
  background-color: #0A2E50;
  transform: translateY(-2px);
  box-shadow: 0 14px 32px -8px rgba(13, 59, 102, 0.5);
}
.btn-dark:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px #FBFAF8, 0 0 0 6px rgba(13, 59, 102, 0.5);
}

/* ---------- Custom elevation shadows ---------- */
.shadow-elevated {
  box-shadow: 0 2px 8px -2px rgba(13, 59, 102, 0.18), 0 8px 24px -8px rgba(13, 59, 102, 0.12);
}
.shadow-floating {
  box-shadow: 0 12px 32px -8px rgba(13, 59, 102, 0.25), 0 24px 60px -16px rgba(13, 59, 102, 0.18);
}
.shadow-gold {
  box-shadow: 0 8px 24px -6px rgba(201, 162, 39, 0.35);
}

/* ---------- Cards ---------- */
.card {
  background-color: #FFFFFF;
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px -2px rgba(13, 59, 102, 0.1), 0 8px 24px -8px rgba(13, 59, 102, 0.08);
  transition: transform 0.4s var(--ease-spring), box-shadow 0.4s var(--ease-out);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px -12px rgba(13, 59, 102, 0.22), 0 8px 16px -8px rgba(13, 59, 102, 0.12);
}

/* ---------- Nav link underline ---------- */
.nav-link {
  position: relative;
  transition: color 0.25s var(--ease-out);
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  background-color: #C9A227;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease-spring);
}
.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

/* ---------- Mobile menu ---------- */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s var(--ease-out), opacity 0.3s var(--ease-out);
}
#mobile-menu.open {
  max-height: 28rem;
  opacity: 1;
}

.hamburger-line {
  transition: transform 0.35s var(--ease-spring), opacity 0.25s var(--ease-out);
}
#menu-toggle.open .line-1 {
  transform: translateY(7px) rotate(45deg);
}
#menu-toggle.open .line-2 {
  opacity: 0;
}
#menu-toggle.open .line-3 {
  transform: translateY(-7px) rotate(-45deg);
}

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

/* ---------- Stat divider ---------- */
.stat-divider:not(:last-child) {
  border-right: 1px solid rgba(251, 250, 248, 0.12);
}

/* ---------- Header scroll state ---------- */
#site-header {
  transition: background-color 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out), padding 0.4s var(--ease-out);
}
#site-header.scrolled {
  box-shadow: 0 4px 24px -8px rgba(13, 59, 102, 0.18);
}

/* ---------- Entrance / scroll-cue animations ---------- */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-up {
  animation: fade-in-up 0.9s var(--ease-out) both;
}
.delay-1 { animation-delay: 0.12s; }
.delay-2 { animation-delay: 0.26s; }
.delay-3 { animation-delay: 0.4s; }
.delay-4 { animation-delay: 0.54s; }

@keyframes bounce-subtle {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(8px); opacity: 1; }
}
.animate-bounce-subtle {
  animation: bounce-subtle 2.4s ease-in-out infinite;
}

/* ---------- Focus ring default ---------- */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid #C9A227;
  outline-offset: 2px;
}

/* ---------- Arabic / RTL language support ---------- */
html[dir="rtl"] body,
html[dir="rtl"] p,
html[dir="rtl"] li,
html[dir="rtl"] label,
html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select,
html[dir="rtl"] span:not(.lang-toggle),
html[dir="rtl"] a {
  font-family: 'Cairo', sans-serif;
}
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6,
html[dir="rtl"] .font-display {
  font-family: 'Cairo', sans-serif;
  letter-spacing: 0;
}
html[dir="rtl"] .tracking-\[-0\.03em\] {
  letter-spacing: 0;
}
html[dir="rtl"] .tracking-widest,
html[dir="rtl"] .tracking-wider,
html[dir="rtl"] .tracking-\[0\.3em\],
html[dir="rtl"] .tracking-\[0\.25em\] {
  letter-spacing: 0.02em;
}
html[dir="rtl"] .nav-link::after {
  right: 0;
  left: auto;
  transform-origin: right;
}
html[dir="rtl"] .nav-link:hover::after,
html[dir="rtl"] .nav-link.active::after {
  transform-origin: right;
}
html[dir="rtl"] .stat-divider:not(:last-child) {
  border-right: none;
  border-left: 1px solid rgba(251, 250, 248, 0.12);
}

/* Lang toggle button */
.lang-toggle {
  font-family: 'Cairo', sans-serif !important;
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  border: 1.5px solid rgba(255,255,255,0.25);
  border-radius: 9999px;
  padding: 0.3rem 0.85rem;
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
  background: transparent;
  white-space: nowrap;
  letter-spacing: 0;
}
.lang-toggle:hover {
  color: #C9A227;
  border-color: #C9A227;
}
