:root {
  --bg: #000;
  --fg: #f3ece1;
  --muted: rgba(243, 236, 225, 0.66);
  --faint: rgba(243, 236, 225, 0.14);
  --gold: #c9a04a;
  --gold-hi: #e9c87a;
  --gold-deep: #8a6424;
  --gold-metal: linear-gradient(115deg, #7a5520 0%, #b88a35 22%, #f3dc94 46%, #c9a04a 62%, #8a6424 82%, #d9b569 100%);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(16px, 5vw, 80px);
  --font: 'Inter Tight', system-ui, -apple-system, sans-serif;
  --font-display: 'Inter Tight', system-ui, sans-serif;
}

[dir='rtl'] {
  --font: 'Noto Naskh Arabic', 'Inter Tight', system-ui, serif;
  --font-display: 'Noto Naskh Arabic', serif;
}

@font-face {
  font-family: 'Libre Baskerville';
  src: url('../assets/fonts/LibreBaskerville.ttf') format('truetype');
  font-weight: 400 700;
  font-display: swap;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { background: var(--bg); }

body {
  min-height: 100vh;
  min-height: 100svh;
  color: var(--fg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.ar { font-family: 'Noto Naskh Arabic', serif; }

/* Oro metálico en texto */
em, .brand__ziqa, .brand__intl, .brand__ar-main, .brand__ar-sub, .gate__mark {
  background: var(--gold-metal);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: shine 6s ease-in-out infinite;
}
@keyframes shine {
  0%, 100% { background-position: 0% 0; }
  50% { background-position: 100% 0; }
}

em {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  padding-right: 0.06em;
}
[dir='rtl'] em { font-family: 'Noto Naskh Arabic', serif; font-style: normal; font-weight: 700; padding: 0; }

/* ---------- Fondo ---------- */
.bg-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 0;
  transform: translate(14%, 12%) scale(1.026);
  transition: opacity 2.2s var(--ease);
  pointer-events: none; /* decorativo: sin botones de vídeo flotante del navegador */
}
[dir='rtl'] .bg-video { transform: translate(-14%, 12%) scale(1.026) scaleX(-1); }
.stage-site .bg-video { opacity: 0.92; }

#webgl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 2s ease;
}
.stage-site #webgl, .stage-gate #webgl { opacity: 1; }

.light {
  position: fixed;
  left: 0;
  top: 0;
  width: 70vmax;
  height: 70vmax;
  margin: -35vmax 0 0 -35vmax;
  z-index: 1;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(201, 160, 74, 0.18), rgba(138, 100, 36, 0.06) 50%, transparent 72%);
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 1.5s ease;
  will-change: transform;
}
.stage-site .light { opacity: 1; }

.shade {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.45) 38%, transparent 62%),
    radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.75) 100%);
  opacity: 0;
  transition: opacity 2s ease;
}
[dir='rtl'] .shade {
  background:
    linear-gradient(270deg, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.45) 38%, transparent 62%),
    radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.75) 100%);
}
.stage-site .shade { opacity: 1; }

.grain {
  position: fixed;
  inset: -100%;
  z-index: 3;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-6%, 4%); }
  40% { transform: translate(5%, -7%); }
  60% { transform: translate(-3%, 8%); }
  80% { transform: translate(7%, 2%); }
  100% { transform: translate(0, 0); }
}

/* ---------- Puerta de entrada ---------- */
.gate {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 28px;
  padding: 24px;
  text-align: center;
  transition: opacity 0.6s ease, visibility 0.6s;
}
.gate__mark {
  font-family: 'Noto Naskh Arabic', serif;
  font-weight: 700;
  font-size: clamp(56px, 10vw, 104px);
  line-height: 1;
  animation: shine 6s ease-in-out infinite, breathe 3s ease-in-out infinite;
}
@keyframes breathe { 50% { opacity: 0.55; } }
.gate__hint { font-size: 12px; letter-spacing: 0.18em; color: var(--muted); }
.gate__langs { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.gate__langs button {
  min-width: 132px;
  padding: 14px 22px;
  border: 1px solid var(--faint);
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: 0.04em;
  transition: border-color 0.4s, background 0.4s, transform 0.5s var(--ease);
}
.gate__langs button.ar { font-size: 16px; }
.gate__langs button:hover, .gate__langs button:focus-visible {
  border-color: var(--gold);
  background: rgba(201, 160, 74, 0.08);
  transform: translateY(-2px);
  outline: none;
}
body:not(.stage-gate) .gate { opacity: 0; visibility: hidden; pointer-events: none; }

/* ---------- Intro ---------- */
.intro {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: #000;
  opacity: 0;
  visibility: hidden;
}
.intro video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.stage-intro .intro { opacity: 1; visibility: visible; }
.intro video { transform-origin: 50% 0%; }
.intro.is-passing video { animation: pass 0.5s cubic-bezier(0.4, 0, 1, 1) forwards; }
@keyframes pass { to { transform: scale(1.12) translateY(-2%); filter: brightness(1.35); } }

.flash {
  position: fixed;
  inset: 0;
  z-index: 35;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 50%, #fffaf0 0%, #f3dc94 30%, #c9a04a 60%, #2a1c08 100%);
}
.flash.is-on { animation: flash 1.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
@keyframes flash {
  0% { opacity: 0; }
  6% { opacity: 1; }
  100% { opacity: 0; }
}

.skip {
  position: fixed;
  bottom: 24px;
  inset-inline-end: var(--gutter);
  z-index: 45;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s, color 0.3s;
}
.skip:hover { color: var(--fg); }
.stage-intro .skip { opacity: 1; visibility: visible; }

/* ---------- Cabecera ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 38;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px var(--gutter);
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
.brand {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: calc(var(--z) * 0.3);
  transform-origin: center;
  opacity: 0;
  direction: ltr;
  --z: 62px; /* tamaño de ZIQA en la cabecera */
}
.brand { transition: opacity 0.8s ease; }
/* Logo bilingüe fijo: el mismo en los tres idiomas */
.brand__latin { display: flex; flex-direction: column; align-items: center; }
.brand__sep { width: 1px; align-self: stretch; margin: calc(var(--z) * 0.12) 0; background: linear-gradient(transparent, var(--gold), transparent); }
/* Árabe con el mismo esquema que el latino: palabra grande arriba, pequeña debajo */
.brand__ar { display: flex; flex-direction: column; align-items: center; justify-content: space-between; align-self: stretch; font-family: 'Noto Naskh Arabic', serif; white-space: nowrap; }
.brand__ar-main { font-weight: 700; font-size: calc(var(--z) * 1.08); line-height: 1; margin-top: calc(var(--z) * -0.04); }
.brand__ar-sub { font-weight: 500; font-size: calc(var(--z) * 0.42); line-height: 1.1; }
.stage-site .brand { opacity: 1; }

/* Logo grande del centro (50 % más grande que antes) */
.intro-logo {
  position: fixed;
  inset: 0;
  z-index: 36;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  --z: min(125px, 22vw, 13vh);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.6s ease, visibility 0.6s;
}
.intro-logo img { width: calc(var(--z) * 5.3); max-width: 92vw; height: auto; margin-bottom: calc(var(--z) * 0.2); }
.stage-logo .intro-logo { opacity: 1; visibility: visible; }
/* Identidad tipográfica: Baskerville en mayúsculas */
.brand__ziqa {
  font-family: 'Libre Baskerville', Baskerville, serif;
  font-size: var(--z);
  letter-spacing: 0.107em;
  padding: 0 0 0.1em 0.107em;
  line-height: 1.15;
}
.brand__intl {
  font-family: 'Libre Baskerville', Baskerville, serif;
  font-size: calc(var(--z) * 0.2526); /* mismo ancho que ZIQA, borde a borde */
  letter-spacing: 0.24em;
  padding-left: 0.24em;
  line-height: 1.2;
}

.nav__right { display: flex; align-items: center; gap: 22px; }
.nav__right, .hero, .foot { opacity: 0; transition: opacity 1.2s var(--ease) 0.3s, transform 1.2s var(--ease) 0.3s; }
.stage-site .nav__right, .stage-site .foot { opacity: 1; }
body:not(.stage-site) .nav__right, body:not(.stage-site) .hero { pointer-events: none; }

.langs { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--faint); border-radius: 999px; }
.langs button {
  min-width: 36px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
  transition: color 0.3s, background 0.3s;
}
.langs button.ar { font-size: 14px; line-height: 1; }
.langs button:hover { color: var(--fg); }
.langs button.is-active { background: var(--gold-metal); background-size: 200% 100%; color: #1a1206; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 26px;
  border-radius: 999px;
  background: var(--gold-metal);
  background-size: 200% 100%;
  color: #1a1206;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  box-shadow: inset 0 1px 0 rgba(255, 240, 200, 0.45);
  transition: transform 0.5s var(--ease), background-position 0.8s var(--ease), box-shadow 0.5s;
}
.btn:hover {
  background-position: 100% 0;
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 240, 200, 0.45), 0 10px 40px -8px rgba(201, 160, 74, 0.6);
}
.btn i { font-style: normal; transition: transform 0.5s var(--ease); }
.btn:hover i { transform: translateX(4px); }
[dir='rtl'] .btn i { transform: scaleX(-1); }
[dir='rtl'] .btn:hover i { transform: scaleX(-1) translateX(4px); }
.btn--ghost {
  padding: 11px 20px;
  background: rgba(243, 236, 225, 0.04);
  color: var(--fg);
  border: 1px solid var(--faint);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 13px;
  box-shadow: none;
}
.btn--ghost:hover { background: rgba(243, 236, 225, 0.1); box-shadow: none; }

/* ---------- Contenido ---------- */
.hero {
  position: fixed;
  top: 0;
  bottom: 0;
  inset-inline-start: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(20px, 4.2vh, 40px); /* aire entre título, texto, Desk y botón */
  width: min(860px, 100vw);
  padding: clamp(76px, 13vh, 110px) var(--gutter) clamp(48px, 9vh, 90px);
  transform: translateY(24px);
}
.stage-site .hero { opacity: 1; transform: none; }

.eyebrow {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
}
[dir='rtl'] .eyebrow { letter-spacing: 0; font-size: 20px; text-transform: none; }

.title {
  font-family: var(--font-display);
  font-size: clamp(28px, min(3.42vw, 5.85vh), 54px);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -0.035em;
}
.title em { font-size: 1.06em; }
[dir='rtl'] .title { letter-spacing: 0; line-height: 1.22; }

.lead {
  max-width: 470px;
  font-size: clamp(14px, min(1.15vw, 2.4vh), 17px);
  font-weight: 400;
  line-height: 1.7;
  color: rgba(243, 236, 225, 0.85);
}
[dir='rtl'] .lead { font-size: clamp(16px, 1.25vw, 18px); line-height: 1.7; }

.team { display: flex; flex-direction: column; gap: 12px; }
.team__label { font-size: 12.5px; color: var(--muted); letter-spacing: 0.02em; }
[dir='rtl'] .team__label { font-size: 14px; }
.pillars { list-style: none; display: flex; flex-wrap: wrap; }
.pillars li {
  padding: 0 18px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-inline-start: 1px solid var(--gold-deep);
}
.pillars li:first-child { padding-inline-start: 0; border: 0; }

.desk {
  max-width: 470px;
  margin-top: clamp(4px, 3vh, 36px); /* el Desk y el botón, un poco más abajo */
  padding-top: 20px;
  border-top: 1px solid var(--faint);
  font-size: 15.5px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--muted);
}
.desk b { font-weight: 500; color: var(--gold); letter-spacing: 0.04em; }
[dir='rtl'] .desk { font-size: 18px; font-weight: 400; }
[dir='rtl'] .desk b { letter-spacing: 0; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; margin-top: 6px; }
.where { font-size: 12px; letter-spacing: 0.16em; color: var(--muted); }
[dir='rtl'] .where { letter-spacing: 0; font-size: 14px; }

.foot {
  position: fixed;
  bottom: 22px;
  inset-inline-start: var(--gutter);
  z-index: 10;
  font-size: 11.5px;
  color: var(--muted);
}

/* ---------- Panel de contacto ---------- */
.contact {
  position: fixed;
  top: 0;
  bottom: 0;
  inset-inline-end: 0;
  z-index: 50;
  width: min(460px, 100vw);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  padding: 80px 44px;
  background: rgba(10, 8, 6, 0.86);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border-inline-start: 1px solid rgba(201, 160, 74, 0.25);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.8s var(--ease), visibility 0s linear 0.8s;
}
[dir='rtl'] .contact { transform: translateX(-100%); }
.contact.is-open { transform: none; visibility: visible; transition: transform 0.8s var(--ease), visibility 0s; }
.contact__title:focus { outline: none; }
.contact__close {
  position: absolute;
  top: 22px;
  inset-inline-end: 26px;
  font-size: 28px;
  line-height: 1;
  color: var(--muted);
}
.contact__close:hover { color: var(--fg); }
.contact__title { font-family: var(--font-display); font-size: clamp(40px, 5vw, 60px); font-weight: 500; letter-spacing: -0.03em; }
[dir='rtl'] .contact__title { letter-spacing: 0; }
.channels { list-style: none; display: flex; flex-direction: column; border-top: 1px solid var(--faint); }
.channels a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--faint);
  transition: color 0.3s, padding 0.5s var(--ease);
}
.channels span { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
[dir='rtl'] .channels span { letter-spacing: 0; font-size: 14px; }
.channels b { font-weight: 400; font-size: 15px; }
.channels a:hover { padding-inline-start: 8px; color: var(--gold-hi); }
.scrim {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s, visibility 0.6s;
}
.contact.is-open + .scrim { opacity: 1; visibility: visible; }

/* ---------- Móvil ---------- */
@media (max-width: 768px) {
  .nav { padding: 16px var(--gutter); }
  .nav__right { gap: 10px; }
  .nav__right .btn--ghost { display: none; }
  .brand { --z: 36px; } /* en móvil el logo bilingüe y los idiomas deben caber en una línea */
  .bg-video { transform: translateY(-2%) scale(1.064); }
  [dir='rtl'] .bg-video { transform: translateY(-2%) scale(1.064) scaleX(-1); }
  .shade, [dir='rtl'] .shade {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.78) 45%, rgba(0, 0, 0, 0.9));
  }
  body.stage-site { overflow-y: auto; }
  .hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    width: 100vw;
    justify-content: center;
    gap: clamp(16px, 2.6vh, 26px);
    padding: 96px var(--gutter) 40px;
    transform: none; /* en móvil el texto aparece sin desplazarse: así la página no salta */
  }
  .title { font-size: clamp(34px, 10vw, 50px); }
  .lead { font-size: 14.5px; line-height: 1.6; }
  .desk { margin-top: clamp(2px, 4vh - 20px, 30px); padding-top: clamp(14px, 2.4vh, 22px); } /* más aire en móviles altos */
  [dir='rtl'] .desk { font-size: 17px; line-height: 1.55; }
  [dir='rtl'] .eyebrow { font-size: 18px; }
  .pillars li { padding: 0 12px; font-size: 14px; }
  .foot { display: none; }
  .contact { padding: 72px 24px; }
}

@media (max-width: 360px) {
  .brand { --z: 28px; }
  .langs { gap: 2px; padding: 3px; }
  .langs button { min-width: 30px; padding: 6px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .grain, .gate__mark { animation: none; }
  * { transition-duration: 0.01s !important; }
}
