/* Cairo for Arabic, Araboto for the Latin brand name (self-hosted, subset) */
@font-face { font-family: "Cairo"; font-weight: 300; font-display: swap; src: url("fonts/cairo-Light.woff2") format("woff2"); }
@font-face { font-family: "Cairo"; font-weight: 400; font-display: swap; src: url("fonts/cairo-Regular.woff2") format("woff2"); }
@font-face { font-family: "Cairo"; font-weight: 500; font-display: swap; src: url("fonts/cairo-Medium.woff2") format("woff2"); }
@font-face { font-family: "Araboto"; font-weight: 400; font-display: swap; src: url("fonts/araboto-Normal.woff2") format("woff2"); }

:root {
  --ink: #000;
  --gold: #dbb778;
  --gold-light: #ecd09a;
  --paper: #f3f9ef;
  --muted: #a3a3a3;
  --rule: #2a2a2a;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --font: "Cairo", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.7;
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 100svh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
[lang="en"] { font-family: "Araboto", "Cairo", system-ui, sans-serif; }

/* background photography: crossfading architecture, slow zoom */
.bg { position: fixed; inset: 0; z-index: 0; background: var(--ink); overflow: hidden; }
.bg img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.02);
  transition: opacity 2.4s ease-in-out, transform 0s linear 2.4s; /* reset zoom only after fade-out */
}
.bg img.on { opacity: .75; transform: scale(1.1); transition: opacity 2.4s ease-in-out, transform 16s ease-out; }
.bg::after { content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 48%, rgba(0,0,0,.72), rgba(0,0,0,.25) 70%, transparent); }

/* background lattice echoing the facade pattern */
.lattice { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.lattice svg {
  position: absolute; inset: -6%;
  width: 112%; height: 112%;
  opacity: 0;
  transform: translate3d(var(--px, 0), var(--py, 0), 0);
  transition: transform 1.2s var(--ease);
  animation: lattice-in 2.4s .2s var(--ease) forwards;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 0%, transparent 78%);
          mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 0%, transparent 78%);
}
.lattice polygon { fill: none; stroke: var(--gold); stroke-width: .6; opacity: .16; vector-effect: non-scaling-stroke; }
.lattice polygon.lit { animation: twinkle 7s ease-in-out infinite; }
.vignette { position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 30%, #000 100%); }

@keyframes lattice-in { to { opacity: 1; } }
@keyframes twinkle { 0%, 100% { opacity: .1; } 50% { opacity: .55; } }

/* stage */
.stage {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 3rem 1.25rem 2rem;
}
.logo { margin: 0; }
.logo-svg { display: block; width: min(92vw, 400px); height: auto; overflow: visible;
  filter: drop-shadow(0 0 32px rgba(219, 183, 120, .18)); }
.logo-svg .st0 { fill: var(--paper); }
.logo-svg .st1 { fill: var(--gold); fill-rule: evenodd; }
/* intro: mark cells pop in top to bottom, Arabic then English letters rise in (delays set per shape in script.js) */
.js .logo-svg .st1, .js .logo-svg .st0 { opacity: 0; transform-box: fill-box; transform-origin: center; animation-fill-mode: both; }
.js .logo-svg .st1 { animation: cell-pop .8s var(--ease) both; }
.js .logo-svg .st0 { animation: glyph-in .8s var(--ease) both; }
.logo-svg .st1.tw { opacity: 1; animation: cell-glow 5s ease-in-out infinite; }
@keyframes cell-pop { from { opacity: 0; transform: scale(.2); } to { opacity: 1; transform: scale(1); } }
@keyframes glyph-in { from { opacity: 0; transform: translate3d(0, 14px, 0); } to { opacity: 1; transform: none; } }
@keyframes cell-glow { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.rule { width: min(260px, 52vw); height: 1px; margin-block: 2rem 1.75rem; background: var(--rule); position: relative; overflow: hidden;
  transform: scaleX(0); animation: grow 1.2s 1.9s var(--ease) forwards; }
.rule i { position: absolute; inset-block: 0; inset-inline-start: -40%; width: 40%;
  background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
  animation: sweep 3.8s 3.4s ease-in-out infinite; }

.soon { margin: 0; font-weight: 300; font-size: clamp(1.5rem, 4vw, 2.25rem);
  color: var(--gold); opacity: 0; transform: translate3d(0, 12px, 0); animation: rise 1s 2.2s var(--ease) forwards; }
.lead { margin: .35rem 0 0; color: var(--muted); max-width: 34ch; opacity: 0; transform: translate3d(0, 12px, 0);
  animation: rise 1s 2.4s var(--ease) forwards; }

/* countdown */
.count { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-block-start: 2.5rem;
  width: min(520px, 100%); opacity: 0; transform: translate3d(0, 12px, 0); animation: rise 1s 2.6s var(--ease) forwards; }
.count[hidden] { display: none; }
.count .cell { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding-block: .35rem;
  border-inline-start: 1px solid var(--rule); }
.count .cell:first-child { border-inline-start: 0; }
.count b { font-weight: 300; font-size: clamp(2rem, 7vw, 3.25rem); line-height: 1.1;
  color: var(--paper); font-variant-numeric: tabular-nums; }
.count span { font-size: .9rem; color: var(--muted); }

/* footer */
.foot { position: relative; z-index: 3; padding: 1.5rem 1.25rem; text-align: center; color: var(--muted); font-size: .9rem;
  opacity: 0; animation: fade 1s 2.8s var(--ease) forwards; }

@keyframes rise { to { opacity: 1; transform: translate3d(0, 0, 0); } }
@keyframes fade { to { opacity: 1; } }
@keyframes grow { to { transform: scaleX(1); } }
@keyframes sweep { 0% { inset-inline-start: -40%; } 60%, 100% { inset-inline-start: 100%; } }

/* logo scales up with the viewport: phone ≈ full width, tablet 62vw, desktop 34vw (max 500px) */
@media (min-width: 600px) { .logo-svg { width: min(62vw, 480px); } }
@media (min-width: 1000px) { .logo-svg { width: min(34vw, 500px); } }
@media (max-width: 599px) { .stage { padding-inline: .5rem; } .rule { margin-block: 1.5rem 1.25rem; } }

/* reduced motion: everything is simply present */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .bg img.on { transform: none !important; }
  .count, .lattice svg, .foot, .soon, .lead, .logo-svg .st0, .logo-svg .st1 { opacity: 1 !important; transform: none !important; }
  .rule { transform: none !important; }
  .rule i { display: none; }
  .lattice polygon.lit { opacity: .3; }
}
