/* ---------------------------------------------------------
   uae.com — coming soon
   Black & white world, UAE-flag accents, 3D network hero.
   Bilingual (EN/AR), fully self-contained.
--------------------------------------------------------- */

:root {
  --bg: #05070a;
  --surface: #0e1116;
  --text: #f4f6f8;
  --text-muted: #8f99a6;
  --border: rgba(255, 255, 255, 0.10);
  --flag-green: #00843d;
  --flag-red: #ef3340;
  --flag-white: #f4f6f8;
  --flag-black: #6b7684;   /* "black" stop, lifted to read on dark */
  --radius: 14px;
  --font-latin: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-arabic: "Noto Sans Arabic", system-ui, "Segoe UI", sans-serif;
  font-size: 16px;
}

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

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-latin);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

html[lang="ar"] body {
  font-family: var(--font-arabic);
}

/* --- intro: 1971 -> 2026 time-lapse ---------------------- */

#intro {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  /* matches the 900ms handoff timeout in intro.js */
  transition: opacity 0.9s cubic-bezier(0.4, 0, 0.2, 1),
              transform 1.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#intro.intro-hide {
  opacity: 0;
  transform: scale(1.045);   /* the scene pushes past the viewer on exit */
  pointer-events: none;
}

/* The hero now reveals UNDER this fade (a true cross-fade), so the intro's
   counter/caption must clear faster than the scene or the two text stacks
   briefly double-expose. */
#intro.intro-hide .intro-content {
  opacity: 0;
  transition: opacity 0.35s ease;
}

#intro-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Cinematic vignette over the 3D scene. Deliberately CSS rather than a
   canvas fill — see the note in intro.js's drawScene(). */
#intro::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 62% 58% at 50% 52%,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.34) 62%,
    rgba(0, 0, 0, 0.82) 100%
  );
}

.intro-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.35rem;
  padding: 2rem;
  text-align: center;
  animation: intro-content-in 1.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes intro-content-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.intro-mark {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  opacity: 0.9;
}

.intro-mark svg {
  width: 26px;
  height: 26px;
  color: var(--flag-white);
}

.intro-wordmark {
  font-family: var(--font-latin);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--text);
}

.intro-wordmark .dot {
  color: var(--flag-green);
}

/* Fine tracked label above the counter — the detail that reads as
   institutional rather than techy. */
.intro-label {
  font-family: var(--font-latin);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: -0.6rem;
  padding-inline-start: 0.42em;   /* optically centre the tracked text */
}

.intro-year {
  /* Latin font and LTR forced explicitly: the counter is western-arabic
     numerals in both languages, and without these the digits can reorder
     or pick up the Arabic face when html[dir=rtl] is active. */
  font-family: var(--font-latin) !important;
  direction: ltr;
  unicode-bidi: isolate;
  font-weight: 800;
  font-size: clamp(4rem, 13.5vw, 8.5rem);
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  line-height: 0.92;
  /* Brushed-platinum numerals so the counter feels milled, not printed. */
  background: linear-gradient(175deg, #ffffff 0%, #e8eef5 38%, #9fb2c4 62%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* NOTE: deliberately no filter/drop-shadow here. The digits are rewritten
     every frame by the scramble, so a blurred filter would be re-rasterised
     ~60x/second — it measured as one of the biggest costs on mobile. The
     glow is provided by the static .intro-glow layer behind instead. */
}

/* Static bloom behind the counter — painted once, never re-rasterised. */
.intro-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(38rem, 92vw);
  height: 20rem;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    ellipse 50% 46% at 50% 50%,
    rgba(150, 205, 255, 0.11) 0%,
    rgba(150, 205, 255, 0) 70%
  );
}

.intro-caption {
  font-size: 1.02rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.62);
  min-height: 1.55em;
  max-width: 28rem;
  letter-spacing: 0.005em;
}

.intro-caption[dir="rtl"] {
  font-family: var(--font-arabic);
  line-height: 1.85;
}

/* Each new caption line rises into place. */
.intro-caption.caption-in {
  animation: caption-in 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes caption-in {
  from { opacity: 0; transform: translateY(9px); filter: blur(3px); }
  to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.intro-bar {
  position: relative;
  width: min(22rem, 68vw);
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  overflow: hidden;
  margin-top: 0.5rem;
}

.intro-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(
    90deg,
    rgba(0, 132, 61, 0.9) 0%,
    rgba(255, 255, 255, 0.95) 55%,
    rgba(160, 230, 255, 1) 100%
  );
  border-radius: inherit;
  box-shadow: 0 0 12px rgba(160, 230, 255, 0.55);
}

/* Hero stays hidden and its reveal animations paused until the intro
   hands off — avoids a flash of content behind the overlay and lets
   the existing fade-up animations play fresh at the right moment. */
body.intro-active .wrap {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.wrap {
  transition: opacity 0.6s ease;
}

.eyebrow,
.wordmark,
.headline,
.hero-rule,
.subtitle,
.x-link {
  animation-play-state: paused;
}

.hero.revealed .eyebrow,
.hero.revealed .wordmark,
.hero.revealed .headline,
.hero.revealed .hero-rule,
.hero.revealed .subtitle,
.hero.revealed .x-link {
  animation-play-state: running;
}

/* --- background: 3D canvas + vignette ------------------ */

#uae-map {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  /* clearRect leaves the canvas transparent, so a vertical temperature
     ramp underneath is free — night sky settling toward the ground. */
  background: linear-gradient(180deg, #0a0e14 0%, #05070a 48%, #04060a 100%);
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.55) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, transparent 18%, transparent 82%, rgba(0, 0, 0, 0.35) 100%);
}

/* On desktop, keep the text column readable over the starfield. */
@media (min-width: 900px) {
  .vignette {
    background:
      linear-gradient(90deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.25) 34%, transparent 55%),
      radial-gradient(ellipse 120% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
  }
  html[dir="rtl"] .vignette {
    background:
      linear-gradient(270deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.25) 34%, transparent 55%),
      radial-gradient(ellipse 120% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
  }

  /* A faint sodium floor under the coast — the intro's palette carried
     through the cut. Scoped to the map page: the 404 shares .vignette but
     has no map to anchor the warmth. */
  body.has-map .vignette {
    background:
      linear-gradient(90deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.25) 34%, transparent 55%),
      radial-gradient(ellipse 46% 38% at 71% 60%, rgba(255, 168, 88, 0.05) 0%, transparent 72%),
      radial-gradient(ellipse 120% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
  }
  html[dir="rtl"] body.has-map .vignette {
    background:
      linear-gradient(270deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.25) 34%, transparent 55%),
      radial-gradient(ellipse 46% 38% at 29% 60%, rgba(255, 168, 88, 0.05) 0%, transparent 72%),
      radial-gradient(ellipse 120% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
  }
}

/* Fine film grain over the whole page — the texture that separates a
   considered surface from a flat CSS gradient. Generated in-document via
   an SVG turbulence data URI (no asset request; img-src allows data:). */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* The grain sits entirely behind the opaque intro overlay, but a
   full-viewport blend layer still costs compositing work every frame of
   the 3D sequence. Drop it until the intro has handed off. */
body.intro-active .grain {
  display: none;
}

/* --- layout --------------------------------------------- */

.wrap {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 78rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
}

.logo-mark {
  width: 34px;
  height: 34px;
}

.logo-text {
  font-family: var(--font-latin);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.logo-text .dot {
  color: var(--flag-green);
  animation: dot-pulse 2.6s ease-in-out infinite;
}

/* Animated emblem: the whole mark drifts round slowly, the core breathes,
   and a highlight travels node-to-node like a signal circling the net. */
.logo-mark {
  overflow: visible;
}

.logo-spin {
  transform-box: fill-box;
  transform-origin: center;
  animation: logo-spin 48s linear infinite;
}

.logo-core {
  transform-box: fill-box;
  transform-origin: center;
  animation: logo-core 2.6s ease-in-out infinite;
}

.logo-nodes circle {
  transform-box: fill-box;
  transform-origin: center;
  animation: logo-node 3.5s ease-in-out infinite;
}
.logo-nodes circle:nth-child(1) { animation-delay: 0s; }
.logo-nodes circle:nth-child(2) { animation-delay: 0.5s; }
.logo-nodes circle:nth-child(3) { animation-delay: 1s; }
.logo-nodes circle:nth-child(4) { animation-delay: 1.5s; }
.logo-nodes circle:nth-child(5) { animation-delay: 2s; }
.logo-nodes circle:nth-child(6) { animation-delay: 2.5s; }
.logo-nodes circle:nth-child(7) { animation-delay: 3s; }

@keyframes logo-spin {
  to { transform: rotate(360deg); }
}

@keyframes logo-core {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50%      { transform: scale(1.18); opacity: 1; }
}

@keyframes logo-node {
  0%, 100% { opacity: 0.45; transform: scale(0.85); }
  50%      { opacity: 1; transform: scale(1.25); }
}

@keyframes dot-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* --- language toggle ------------------------------------ */

.lang-toggle {
  font-family: var(--font-arabic);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(14, 17, 22, 0.72);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: border-color 0.2s ease, color 0.2s ease;
}

html[lang="ar"] .lang-toggle {
  font-family: var(--font-latin);
}

.lang-toggle:hover {
  border-color: rgba(255, 255, 255, 0.45);
}

.lang-toggle:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* --- hero ------------------------------------------------ */

.hero {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3.5rem 0;
  max-width: 36rem;
}

/* A soft spotlight lifts the text column off the map behind it. */
.hero::before {
  content: "";
  position: absolute;
  inset-inline-start: -22%;
  inset-block: 2%;
  width: 150%;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(
    ellipse 58% 52% at 32% 50%,
    rgba(120, 190, 255, 0.08) 0%,
    rgba(0, 0, 0, 0) 70%
  );
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  padding: 0.46rem 1.05rem 0.46rem 0.85rem;
  margin-bottom: 1.7rem;
  backdrop-filter: blur(8px);
  animation: hero-in 1.1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Live indicator — set on a pseudo-element so the bilingual i18n swap
   (which rewrites the eyebrow's innerHTML) can never wipe it out. */
.eyebrow::before {
  content: "";
  flex: none;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  margin-inline-end: 0.6rem;
  background: var(--flag-green);
  box-shadow: 0 0 0 0 rgba(0, 132, 61, 0.6);
  animation: eyebrow-ping 2.8s ease-out infinite;
}

@keyframes eyebrow-ping {
  0%   { box-shadow: 0 0 0 0 rgba(0, 168, 107, 0.55); opacity: 1; }
  70%  { box-shadow: 0 0 0 7px rgba(0, 168, 107, 0); opacity: 0.75; }
  100% { box-shadow: 0 0 0 0 rgba(0, 168, 107, 0); opacity: 1; }
}

html[lang="ar"] .eyebrow {
  letter-spacing: 0;
}

/* Hairline rule — a small institutional detail between claim and detail. */
.hero-rule {
  width: 5.5rem;
  height: 1px;
  margin: 0.35rem 0 1.5rem;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(160, 230, 255, 0.35) 55%,
    rgba(255, 255, 255, 0) 100%
  );
  transform-origin: left center;
  animation: rule-in 1.5s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
}

html[dir="rtl"] .hero-rule {
  transform-origin: right center;
  background: linear-gradient(
    270deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(160, 230, 255, 0.35) 55%,
    rgba(255, 255, 255, 0) 100%
  );
}

@keyframes rule-in {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: scaleX(1); opacity: 1; }
}

/* Shared entrance: rise out of a soft blur. Heavier and more filmic than
   a plain fade, and it reads as deliberate rather than bouncy. */
@keyframes hero-in {
  from { opacity: 0; transform: translateY(16px); filter: blur(6px); }
  to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* The wordmark — uae.com in animated UAE-flag colors. */
.wordmark {
  font-family: var(--font-latin);
  font-size: clamp(3.2rem, 9.5vw, 5.6rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.045em;
  margin-bottom: 1.1rem;
  background: linear-gradient(
    100deg,
    var(--flag-white) 0%,
    var(--flag-green) 18%,
    var(--flag-white) 38%,
    var(--flag-red) 56%,
    var(--flag-white) 74%,
    var(--flag-black) 88%,
    var(--flag-white) 100%
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: flag-flow 24s ease-in-out infinite, hero-in 1.2s cubic-bezier(0.16,1,0.3,1) 0.12s both;
}

/* .wordmark is forced dir="ltr" to keep "uae.com" glyph order, so its
   start edge resolves to LEFT inside the RTL column — re-anchor it to
   the stack's shared right edge. */
html[dir="rtl"] .wordmark {
  text-align: right;
}

/* Holds are 59% + n*150%: with background-size 300%, each +150% step shows
   the identical window, so the rests match and the 0%/100% wrap is seamless.
   59% centers the red stop in the visible window. Retune if background-size
   changes. */
@keyframes flag-flow {
  0%   { background-position: 59% 0; }
  12%  { background-position: 209% 0; }
  50%  { background-position: 209% 0; }
  62%  { background-position: 359% 0; }
  100% { background-position: 359% 0; }
}

.headline {
  font-size: clamp(1.75rem, 4.3vw, 2.5rem);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.025em;
  margin-bottom: 1.1rem;
  /* Static brushed metal. One living identity element on the page (the
     wordmark) is intent; two competing loops was noise — and a vertical
     gradient needs no RTL mirror. */
  background: linear-gradient(180deg, #ffffff 0%, #dbe4ee 60%, #b9c6d4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: hero-in 1.3s cubic-bezier(0.16,1,0.3,1) 0.28s both;
}

html[lang="ar"] .headline {
  letter-spacing: 0;
  line-height: 1.45;
}

.subtitle {
  font-size: 1.02rem;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 1.6rem;
  animation: hero-in 1.3s cubic-bezier(0.16,1,0.3,1) 0.66s both;
}

html[lang="ar"] .subtitle {
  line-height: 1.95;
}

/* --- X / social link --------------------------------------- */

.x-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  width: fit-content;
  /* Invisible hit-area inflation (~18px -> ~35px): no border, no
     background, so the optical position doesn't move. */
  padding-block: 0.55rem;
  margin-top: 0.85rem;
  margin-bottom: -0.55rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
  animation: hero-in 1.3s cubic-bezier(0.16,1,0.3,1) 0.88s both;
}

.x-icon {
  width: 1em;
  height: 1em;
  flex: none;
}

.x-link:hover {
  color: var(--text);
}

.x-link:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --- redirect countdown ------------------------------------- */

.redirect-note {
  /* display:none until JS unhides it at reveal, so this slots in as the
     next rung of the 0/0.12/0.28/0.5/0.66/0.88s delay ladder. */
  animation: hero-in 1.2s cubic-bezier(0.16, 1, 0.3, 1) 1.05s both;
  margin-top: 1.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.redirect-note[hidden] {
  display: none;
}

.redirect-cancel {
  position: relative;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

/* Transparent extender: ~44px effective target for the one control under
   a 30s deadline, zero visual delta. */
.redirect-cancel::before {
  content: "";
  position: absolute;
  inset: -9px -8px;
}

.redirect-cancel:hover {
  border-color: rgba(255, 255, 255, 0.45);
}

.redirect-cancel:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* The redirect leaves on a breath, not a hard cut. .grain deliberately
   excluded: at 0.045 opacity the fade is imperceptible. */
body.leaving .wrap,
body.leaving #uae-map,
body.leaving .vignette {
  opacity: 0;
  transition: opacity 0.35s ease;
}

body.leaving {
  pointer-events: none;
}

/* Visually hidden but present for assistive tech (the redirect's
   screen-reader announcements — separate from the visible per-second
   countdown text, so it can be throttled to a few key moments instead
   of re-announcing every single second). */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- footer ------------------------------------------------ */

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer a:hover {
  color: var(--text);
}

.sep {
  opacity: 0.5;
}

/* --- 404 page ---------------------------------------------- */

.brand-link {
  text-decoration: none;
  color: inherit;
}

.error-code {
  font-family: var(--font-latin);
  font-size: clamp(4rem, 18vw, 9rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  background: linear-gradient(
    100deg,
    var(--flag-green) 0%,
    var(--flag-white) 45%,
    var(--flag-red) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.error-title {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.9rem;
}

.home-link {
  display: inline-block;
  width: fit-content;
  margin-top: 1.75rem;
  font-weight: 600;
  color: #05070a;
  background: var(--flag-white);
  border-radius: var(--radius);
  padding: 0.8rem 1.5rem;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.2s ease;
}

.home-link:hover {
  background: #ffffff;
  transform: translateY(-1px);
}

.home-link:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* --- animation ---------------------------------------------- */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .eyebrow,
  .eyebrow::before,
  .wordmark,
  .headline,
  .hero-rule,
  .subtitle,
  .x-link,
  .logo-spin,
  .logo-core,
  .logo-nodes circle,
  .logo-text .dot,
  .intro-content,
  .intro-caption,
  .intro-caption.caption-in,
  .redirect-note {
    animation: none;
  }
  /* freeze the flag gradient on its red-centered rest pose — with the
     animation off, the default window shows only white -> green */
  .wordmark {
    background-position: 59% 0;
  }
  /* the rule is scaleX(0) at its keyframe start — make sure it's drawn */
  .hero-rule {
    transform: none;
    opacity: 1;
  }
  /* grain is static texture, but drop it further for visual calm */
  .grain {
    opacity: 0.02;
  }
  #intro,
  .wrap {
    transition: none;
  }
  * {
    transition-duration: 0.01ms !important;
  }
}

/* --- responsive --------------------------------------------- */

/* Short laptops (1366x768 class): the Arabic stack's taller line-heights
   (subtitle 1.95, headline 1.45) overflow by ~13px — trim the hero's
   vertical padding only when height is actually scarce. */
@media (min-width: 900px) and (max-height: 800px) {
  .hero {
    padding: 1.5rem 0;
  }
}

/* Mobile: the map floats above, content settles below it. The map band is
   whatever 100dvh leaves after the text stack's budget — 37rem (592px) MUST
   stay in sync with the 592 constant in map.js resize() — so the X link,
   the redirect countdown and its cancel land inside the first viewport
   instead of below the fold with a 30s timer running. */
@media (max-width: 899px) {
  body.has-map .hero {
    justify-content: flex-end;
    max-width: 100%;
    padding-top: clamp(8.5rem, calc(100vh - 37rem), 44vh);   /* Safari <15.4 */
    padding-top: clamp(8.5rem, calc(100dvh - 37rem), 44dvh);
    padding-bottom: 1rem;
  }
  .wrap { padding: 1.25rem 1.25rem 1rem; }
  .eyebrow { margin-bottom: 1.15rem; }
  .wordmark { margin-bottom: 0.85rem; }
  .headline { margin-bottom: 0.85rem; }
  .hero-rule { margin: 0.3rem 0 1.05rem; }
  .subtitle { font-size: 0.95rem; line-height: 1.62; margin-bottom: 1rem; }
  html[lang="ar"] .subtitle { font-size: 0.92rem; line-height: 1.8; }
  .x-link, .redirect-note { margin-top: 0.9rem; }
}
