:root {
  --beyond-navy: #071538;
  --beyond-navy-deep: #030b20;
  --beyond-gold: #d7ac42;
  --beyond-gold-light: #f4d37d;
  --beyond-ivory: #fbfaf6;
  --beyond-line: rgba(215, 172, 66, 0.24);
  --beyond-shadow: 0 28px 70px rgba(5, 16, 47, 0.13);
}

html { scroll-behavior: smooth; }

body {
  background: var(--beyond-ivory);
  color: var(--beyond-navy);
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  background: var(--beyond-navy-deep);
  opacity: 0;
  transition: opacity 280ms ease;
}

body.route-leaving::before { opacity: 0.94; }

#beyond-scroll-progress {
  position: fixed;
  inset-block-start: 0;
  inset-inline-start: 0;
  z-index: 10000;
  width: var(--scroll-progress, 0%);
  height: 3px;
  background: linear-gradient(90deg, #a97916, var(--beyond-gold-light));
  box-shadow: 0 0 14px rgba(244, 211, 125, 0.55);
  transition: width 80ms linear;
}

header {
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  transition: background-color 300ms ease, box-shadow 300ms ease, border-color 300ms ease;
}

header.beyond-scrolled {
  background: rgba(3, 11, 32, 0.92) !important;
  border-color: var(--beyond-line) !important;
  box-shadow: 0 16px 50px rgba(3, 11, 32, 0.22);
}

header img[src*="beyond-b"] {
  width: 3.5rem !important;
  height: 3.5rem !important;
  border: 0 !important;
  border-radius: 0 !important;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.22));
}

header nav a {
  position: relative;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}

header nav a::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -0.55rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--beyond-gold), transparent);
  transform: scaleX(0);
  transition: transform 260ms ease;
}

header nav a:hover::after,
header nav a[aria-current="page"]::after { transform: scaleX(1); }

main { animation: beyond-page-in 520ms cubic-bezier(.22,.8,.24,1) both; }

main > section:first-child {
  min-height: 96svh !important;
  isolation: isolate;
}

main > section:first-child::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 74% 38%, rgba(215, 172, 66, 0.12), transparent 26%),
    linear-gradient(180deg, transparent 62%, rgba(3, 11, 32, 0.38));
}

main > section:first-child > div:not(.hero-monogram) { z-index: 2; }

main > section:first-child > div:first-child img {
  transform: translate3d(0, var(--hero-shift, 0), 0) scale(1.075);
  transition: transform 120ms linear;
  filter: saturate(0.9) contrast(1.05);
}

main > section:first-child h1 {
  max-width: 48rem;
  font-size: clamp(3.1rem, 5.65vw, 5.85rem) !important;
  line-height: 1.08 !important;
  letter-spacing: -0.025em;
  text-wrap: balance;
  text-shadow: 0 16px 42px rgba(0, 0, 0, 0.22);
}

[dir="rtl"] main > section:first-child h1 {
  font-family: "IBM Plex Sans Arabic", "Cairo", sans-serif;
  letter-spacing: 0;
  line-height: 1.3 !important;
}

main > section:first-child p {
  max-width: 43rem !important;
  font-size: 1.08rem;
  line-height: 1.95;
  text-wrap: pretty;
}

.hero-monogram {
  position: absolute;
  inset-inline-end: clamp(2rem, 7vw, 8rem);
  top: 50%;
  z-index: 2;
  width: clamp(11rem, 22vw, 22rem);
  transform: translateY(-43%);
  pointer-events: none;
  opacity: 0.86;
  animation: monogram-arrive 1.15s cubic-bezier(.16,.9,.3,1) 160ms both;
}

.hero-monogram img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 35px 55px rgba(0, 0, 0, 0.35));
}

main > section:first-child a {
  position: relative;
  overflow: hidden;
  min-height: 3.35rem;
  border-radius: 2px;
  transition: transform 240ms ease, box-shadow 240ms ease, color 240ms ease, border-color 240ms ease;
}

main > section:first-child a::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255,255,255,.32) 50%, transparent 75%);
  transform: translateX(-130%);
  transition: transform 600ms ease;
}

main > section:first-child a:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(3, 11, 32, 0.22);
}

main > section:first-child a:hover::before { transform: translateX(130%); }

main > section:not(:first-child) { position: relative; }

main > section:not(:first-child)::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline-start: 50%;
  width: min(86%, 82rem);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--beyond-line), transparent);
}

main h2 { text-wrap: balance; letter-spacing: -0.02em; }
[dir="rtl"] main h2 { letter-spacing: 0; }
main p { text-wrap: pretty; }
main img { transition: transform 650ms cubic-bezier(.2,.72,.24,1), filter 450ms ease; }

main a.group,
main .bg-white.border {
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(5, 16, 47, 0.055);
  transition: transform 320ms cubic-bezier(.2,.8,.2,1), box-shadow 320ms ease, border-color 320ms ease;
}

main a.group::after,
main .bg-white.border::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--beyond-gold), transparent);
  transform: scaleX(0);
  transition: transform 360ms ease;
}

main a.group:hover,
main .bg-white.border:hover {
  transform: translateY(-8px);
  border-color: rgba(215, 172, 66, 0.5) !important;
  box-shadow: var(--beyond-shadow);
}

main a.group:hover::after,
main .bg-white.border:hover::after { transform: scaleX(1); }
main a.group:hover img { transform: scale(1.055); }

.reveal-ready {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 720ms ease, transform 720ms cubic-bezier(.18,.82,.24,1);
}

.reveal-ready.reveal-visible { opacity: 1; transform: translateY(0); }
.reveal-ready:nth-child(2) { transition-delay: 70ms; }
.reveal-ready:nth-child(3) { transition-delay: 140ms; }
.reveal-ready:nth-child(4) { transition-delay: 210ms; }

footer {
  position: relative;
  background:
    radial-gradient(circle at 85% 5%, rgba(215, 172, 66, 0.11), transparent 24%),
    var(--beyond-navy-deep) !important;
}

footer img[src*="beyond-b"] {
  width: 4rem !important;
  height: 4rem !important;
  border: 0 !important;
  border-radius: 0 !important;
}

img[loading="lazy"] { background-color: #f1ede3; }

@keyframes beyond-page-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes monogram-arrive {
  from { opacity: 0; transform: translate(55px, -43%) scale(.88); }
  to { opacity: .86; transform: translate(0, -43%) scale(1); }
}

@media (max-width: 1100px) {
  .hero-monogram { opacity: 0.22; width: min(44vw, 20rem); }
}

@media (max-width: 767px) {
  header img[src*="beyond-b"] { width: 3rem !important; height: 3rem !important; }
  main > section:first-child { min-height: 88svh !important; }
  main > section:first-child h1 {
    font-size: clamp(2.4rem, 11vw, 3.5rem) !important;
    line-height: 1.18 !important;
  }
  [dir="rtl"] main > section:first-child h1 { line-height: 1.35 !important; }
  main > section:first-child p { font-size: 1rem; line-height: 1.85; }
  .hero-monogram {
    inset-inline-end: -3rem;
    top: 43%;
    width: 15rem;
    opacity: 0.16;
  }
  main > section:not(:first-child) { padding-block: 4.75rem !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal-ready { opacity: 1; transform: none; }
}

