/* ─── Loader ─── */
#loader {
  position: fixed;
  inset: 0;
  background: var(--bg-deepest);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  will-change: clip-path;
}

.loader-logo-wrap {
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: inset(100% 0 0 0);
  will-change: clip-path;
}

#loader-logo {
  width: 100%;
  height: auto;
  display: block;
}

.loader-tagline-ar {
  font-family: var(--font-ar);
  font-weight: 500;
  font-size: 20px;
  color: var(--ink-100);
  letter-spacing: 0.04em;
  min-height: 1.2em;
  opacity: 0;
}

.loader-tagline-ar .caret {
  display: inline-block;
  width: 2px;
  height: 0.9em;
  background: var(--teal-signature);
  vertical-align: -2px;
  margin-inline-start: 4px;
  animation: caret-blink 0.6s steps(1) infinite;
}

@keyframes caret-blink {
  50% { opacity: 0; }
}

.loader-tagline-en {
  font-family: var(--font-en);
  font-weight: 300;
  font-size: 11px;
  color: var(--ink-40);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: 0;
}

.loader-progress {
  width: 240px;
  height: 2px;
  display: flex;
  gap: 2px;
  margin-top: 4px;
}

.loader-progress__seg {
  flex: 1;
  height: 100%;
  background: var(--ink-12);
  position: relative;
  overflow: hidden;
}

.loader-progress__seg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: currentColor;
  transform: scaleX(var(--seg-fill, 0));
  transform-origin: left center;
  will-change: transform;
}

.loader-progress__seg:nth-child(1) { color: var(--brand-amber); }
.loader-progress__seg:nth-child(2) { color: var(--brand-pink); }
.loader-progress__seg:nth-child(3) { color: var(--brand-cyan); }
.loader-progress__seg:nth-child(4) { color: var(--brand-purple); }

/* ─── Navigation (Phase 5.7) ─── */
.nav {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  opacity: 0;
  transition:
    opacity 0.6s ease,
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    top 0.4s ease,
    background 0.4s ease;
  will-change: opacity, transform;
}

.nav.is-visible {
  opacity: 1;
}

/* Auto-hide on scroll-down (preserves base centering transform) */
.nav.nav--hidden {
  transform: translate(-50%, -160%);
  opacity: 0;
  pointer-events: none;
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: 0;
  background: linear-gradient(
    155deg,
    rgba(11, 13, 16, 0.85) 0%,
    rgba(20, 24, 31, 0.78) 100%
  );
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 8px 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3),
    0 4px 16px rgba(0, 0, 0, 0.3),
    0 12px 40px rgba(0, 0, 0, 0.4),
    0 0 24px rgba(13, 91, 90, 0.06);
  height: 56px;
  transition:
    background 0.4s ease,
    border-color 0.4s ease,
    box-shadow 0.4s ease;
}

.nav__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  width: 40px;
  padding: 6px;
  border-radius: 50%;
  transition: background 0.3s;
  flex-shrink: 0;
}
.nav__logo img {
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
}
.nav__logo:hover {
  background: rgba(255, 255, 255, 0.05);
}

.nav__divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 8px;
  flex-shrink: 0;
}

.nav__links {
  display: flex;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 2px;
}

.nav__link {
  position: relative;
  display: flex;
  align-items: center;
  font: 500 13px var(--font-ar);
  color: var(--ink-60);
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 8px;
  transition: color 0.3s ease, background 0.3s ease;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.nav__link:hover {
  color: var(--ink-100);
  background: rgba(255, 255, 255, 0.06);
}

.nav__link.is-active {
  color: var(--teal-signature);
  background: rgba(13, 91, 90, 0.12);
}

.nav__link.is-active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--teal-signature);
  box-shadow: 0 0 6px rgba(13, 91, 90, 0.6);
}

.nav__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--terracotta) 0%, #B0501C 100%);
  color: #0E1117;
  font: 600 13px var(--font-ar);
  padding: 10px 20px;
  border-radius: 100px;
  text-decoration: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  flex-shrink: 0;
}

.nav__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(196, 106, 54, 0.4);
}

.nav__cta::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
}
.nav__cta:hover::after { left: 150%; }

.nav__cta-arrow {
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  transition: transform 0.3s ease;
}
.nav__cta:hover .nav__cta-arrow {
  transform: translateX(-4px);
}

.nav.is-scrolled .nav__inner {
  background: linear-gradient(
    155deg,
    rgba(11, 13, 16, 0.92) 0%,
    rgba(20, 24, 31, 0.88) 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3),
    0 4px 16px rgba(0, 0, 0, 0.4),
    0 16px 50px rgba(0, 0, 0, 0.5),
    0 0 24px rgba(13, 91, 90, 0.08);
}

/* ─── Adaptive light variant — when nav is over the cream Spaces band ─── */
.nav.nav--on-light .nav__inner {
  background: linear-gradient(
    155deg,
    rgba(247, 245, 241, 0.85) 0%,
    rgba(217, 205, 184, 0.7) 100%
  );
  border-color: rgba(11, 13, 16, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -1px 0 rgba(11, 13, 16, 0.06),
    0 4px 16px rgba(11, 13, 16, 0.1),
    0 12px 40px rgba(11, 13, 16, 0.15),
    0 0 24px rgba(196, 106, 54, 0.08);
}
.nav.nav--on-light .nav__link {
  color: var(--bg-deepest);
}
.nav.nav--on-light .nav__link:hover {
  background: rgba(11, 13, 16, 0.06);
  color: var(--bg-deepest);
}
.nav.nav--on-light .nav__link.is-active {
  background: rgba(13, 91, 90, 0.15);
  color: var(--teal-signature);
}
.nav.nav--on-light .nav__divider {
  background: rgba(11, 13, 16, 0.1);
}

/* Hamburger (mobile) */
.nav__hamburger {
  display: none;
  position: fixed;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: rgba(20, 24, 31, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  z-index: 600;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.nav__hamburger span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--ink-80);
  transition: all 0.3s ease;
}
.nav__hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.nav__hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav__hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* Mobile menu overlay */
.nav__mobile {
  position: fixed;
  inset: 0;
  background: rgba(14, 17, 23, 0.98);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  z-index: 550;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.nav__mobile.is-open {
  opacity: 1;
  pointer-events: auto;
}
.nav__mobile-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: right;
}
.nav__mobile-links a {
  display: block;
  font: 600 28px var(--font-ar);
  color: var(--ink-80);
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 4px;
  transition: all 0.3s;
}
.nav__mobile-links a:hover {
  color: var(--teal-signature);
  background: rgba(13, 91, 90, 0.05);
}

@media (max-width: 900px) {
  .nav { display: none; }
  .nav__hamburger { display: flex; }
}

/* ─── Buttons ─── */
.btn-primary {
  position: relative;
  display: inline-block;
  font-family: var(--font-ar);
  font-weight: 600;
  font-size: 14px;
  color: var(--bg-deepest);
  background: linear-gradient(135deg, var(--terracotta) 0%, #B0501C 100%);
  padding: 16px 36px;
  border-radius: 2px;
  overflow: hidden;
  letter-spacing: 0.02em;
  transition: filter 0.25s ease;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.28) 50%, transparent 80%);
  transition: left 0.7s ease;
  pointer-events: none;
}

.btn-primary:hover::after {
  left: 130%;
}

.btn-secondary {
  display: inline-block;
  font-family: var(--font-ar);
  font-weight: 500;
  font-size: 14px;
  color: var(--ink-80);
  background: transparent;
  border: 0.5px solid var(--ink-25);
  padding: 16px 36px;
  border-radius: 2px;
  letter-spacing: 0.02em;
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.btn-secondary:hover {
  color: var(--teal-signature);
  border-color: var(--teal-signature);
  background: rgba(13, 91, 90, 0.05);
}

/* ─── Eyebrow (section label) ─── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.eyebrow__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--teal-signature);
  box-shadow: 0 0 8px var(--teal-glow);
  flex-shrink: 0;
}

.eyebrow__line {
  width: 18px;
  height: 1px;
  background: linear-gradient(90deg, var(--teal-signature), transparent);
  flex-shrink: 0;
}

.eyebrow__text {
  font-family: var(--font-ar);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--teal-signature);
  line-height: 1;
}

/* ─── Eyebrow — large modifier (prominent section labels) ─── */
.eyebrow--large {
  gap: 12px;
}
.eyebrow--large .eyebrow__dot {
  width: 8px;
  height: 8px;
  background: var(--teal-signature);
  box-shadow:
    0 0 0 4px rgba(13, 91, 90, 0.15),
    0 0 16px rgba(13, 91, 90, 0.6);
}
.eyebrow--large .eyebrow__line {
  width: 32px;
  height: 1.5px;
  background: linear-gradient(90deg, var(--teal-signature), transparent);
}
.eyebrow--large .eyebrow__text {
  font: 600 14px var(--font-ar);
  letter-spacing: 0.22em;
  color: var(--teal-signature);
  text-transform: none;
}

/* ─── Primary Button Arrow (Phase 2) ─── */
.btn-primary__arrow {
  display: inline-block;
  font-size: 14px;
  margin-inline-start: 8px;
  opacity: 0.7;
  transition: transform 0.3s ease, opacity 0.3s ease;
  will-change: transform;
}

.btn-primary:hover .btn-primary__arrow {
  transform: translateX(-4px);
  opacity: 1;
}

/* ─── Multi-color Particles (Phase 2) ─── */
.particle {
  position: absolute;
  border-radius: 50%;
  animation: particleFloat linear infinite;
  will-change: transform, opacity;
  filter: blur(0.3px);
  pointer-events: none;
}

.particle::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: inherit;
  filter: blur(4px);
  opacity: 0.4;
}

@keyframes particleFloat {
  0%   { transform: translateY(0) scale(1);   opacity: var(--p-op); }
  50%  { opacity: calc(var(--p-op) * 0.7); }
  100% { transform: translateY(-120px) scale(0.3); opacity: 0; }
}

/* ─── Section Divider ─── */
.section-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--teal-signature) 50%, transparent 100%);
  box-shadow: 0 0 12px var(--teal-glow);
  border: none;
}
