/* ===========================================================================
   Finyki UAE — interactive FX layer
   Loaded ONLY on /uae/* pages (linked from uae/_generate.py), scoped under the
   .uae-fx body class so it can never leak into the main site. GPU-composited
   transforms/opacity only — no layout shift (CLS-safe), cheap paints (INP-safe).
   All motion is disabled under prefers-reduced-motion.
   =========================================================================== */

.uae-fx { --fx-tango: 240, 78, 35; --fx-amber: 250, 176, 58; }

/* ---------- Hero: animated aurora glow ---------- */
.uae-fx .page-hero { position: relative; overflow: hidden; isolation: isolate; }
.uae-fx .page-hero__inner { position: relative; z-index: 2; }
.uae-fx .page-hero::before {
  content: "";
  position: absolute;
  inset: -25% -15%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(38% 48% at 18% 26%, rgba(var(--fx-tango), 0.16), transparent 70%),
    radial-gradient(34% 42% at 82% 16%, rgba(var(--fx-amber), 0.14), transparent 72%),
    radial-gradient(30% 40% at 72% 90%, rgba(var(--fx-tango), 0.08), transparent 70%);
  filter: blur(14px);
  animation: fxAurora 20s ease-in-out infinite alternate;
}

/* ---------- Hero: rotating geometric motif (injected by JS) ---------- */
.uae-fx .fx-motif {
  position: absolute;
  top: -90px;
  right: -90px;
  width: clamp(280px, 34vw, 520px);
  height: clamp(280px, 34vw, 520px);
  z-index: 1;
  pointer-events: none;
  color: rgba(var(--fx-tango), 0.45);
  opacity: 0.5;
  animation: fxSpin 80s linear infinite;
}
.uae-fx .fx-motif--2 {
  top: auto; right: auto; bottom: -130px; left: -120px;
  width: clamp(240px, 28vw, 440px); height: clamp(240px, 28vw, 440px);
  color: rgba(var(--fx-amber), 0.4);
  opacity: 0.38;
  animation: fxSpinRev 115s linear infinite;
}

/* ---------- Cards: 3D tilt + cursor-follow sheen ---------- */
/* The tilt transform itself is applied inline by JS on hover; here we only set
   up the positioning context and the radial sheen that tracks the cursor. */
.uae-fx .related-card,
.uae-fx .deliverable { position: relative; }
.uae-fx .related-card > *,
.uae-fx .deliverable > * { position: relative; z-index: 1; }
.uae-fx .related-card::after,
.uae-fx .deliverable::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%),
              rgba(var(--fx-tango), 0.13), transparent 60%);
}
.uae-fx .related-card.fx-on::after,
.uae-fx .deliverable.fx-on::after { opacity: 1; }

/* ---------- Magnetic buttons: smooth return on leave ---------- */
.uae-fx .btn--solid,
.uae-fx .btn--xl { transition: transform 0.35s cubic-bezier(.22,.61,.36,1), background-color .25s ease, color .25s ease, border-color .25s ease; }

/* ---------- Respect reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .uae-fx .page-hero::before,
  .uae-fx .fx-motif { animation: none; }
}

/* ---------- Icons on cards ---------- */
.uae-fx .fx-icon {
  display: block;
  width: 30px;
  height: 30px;
  color: rgb(var(--fx-tango));
  margin: 0 0 16px;
  transition: transform 0.4s cubic-bezier(.22,.61,.36,1);
}
.uae-fx .related-card .fx-icon { margin-bottom: 14px; }
.uae-fx .related-card:hover .fx-icon,
.uae-fx .deliverable:hover .fx-icon { transform: scale(1.14) rotate(-5deg); }

/* ---------- Feature strip (replaces the wordy intro) ---------- */
.uae-fx .fx-features { padding: 84px 0; background: var(--white); border-top: 1px solid var(--line); }
.uae-fx .fx-features__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; margin-top: 46px; }
.uae-fx .fx-feature__icon {
  display: inline-grid; place-items: center;
  width: 54px; height: 54px; border-radius: 15px;
  background: rgba(var(--fx-tango), 0.08);
  border: 1px solid rgba(var(--fx-tango), 0.16);
  margin-bottom: 18px;
}
.uae-fx .fx-feature__icon .fx-icon { margin: 0; width: 26px; height: 26px; }
.uae-fx .fx-feature h3 { font-family: var(--font-display); font-size: 20px; line-height: 1.2; margin: 0 0 8px; color: var(--black); }
.uae-fx .fx-feature p { font-size: 14.5px; line-height: 1.6; color: var(--charcoal); margin: 0; }
@media (max-width: 860px) { .uae-fx .fx-features__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .uae-fx .fx-features__grid { grid-template-columns: 1fr; gap: 24px; } }

/* ---------- Animated process steps (replaces the wordy engagement block) ---------- */
.uae-fx .fx-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; margin-top: 50px; position: relative; }
.uae-fx .fx-steps::before {
  content: ""; position: absolute; top: 27px; left: 11%; right: 11%; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.18) 18%, rgba(255,255,255,.18) 82%, transparent);
}
.uae-fx .fx-steps::after {
  content: ""; position: absolute; top: 23px; left: 11%;
  width: 10px; height: 10px; border-radius: 50%;
  background: rgb(var(--fx-tango));
  box-shadow: 0 0 14px 2px rgba(var(--fx-tango), 0.7);
  animation: fxFlow 4.5s cubic-bezier(.5,0,.5,1) infinite;
}
.uae-fx .fx-step { position: relative; }
.uae-fx .fx-step__icon {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  background: #141414; border: 1px solid rgba(255,255,255,.16);
  position: relative; z-index: 1;
  animation: fxBob 3.4s ease-in-out infinite;
}
.uae-fx .fx-step:nth-child(2) .fx-step__icon { animation-delay: .35s; }
.uae-fx .fx-step:nth-child(3) .fx-step__icon { animation-delay: .7s; }
.uae-fx .fx-step:nth-child(4) .fx-step__icon { animation-delay: 1.05s; }
.uae-fx .fx-step__icon .fx-icon { margin: 0; width: 26px; height: 26px; color: rgb(var(--fx-tango)); }
.uae-fx .fx-step__wk { display: block; font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #FAB03A; margin: 18px 0 6px; }
.uae-fx .fx-step h3 { font-family: var(--font-display); font-size: 19px; color: #fff; margin: 0 0 8px; }
.uae-fx .fx-step p { font-size: 14px; line-height: 1.55; color: rgba(250,250,250,.72); margin: 0; }
@media (max-width: 860px) {
  .uae-fx .fx-steps { grid-template-columns: 1fr 1fr; gap: 32px 24px; }
  .uae-fx .fx-steps::before, .uae-fx .fx-steps::after { display: none; }
}
@media (max-width: 480px) { .uae-fx .fx-steps { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  .uae-fx .fx-steps::after, .uae-fx .fx-step__icon { animation: none; }
  .uae-fx .fx-icon { transition: none; }
}

/* ---------- Hero typography: balance H1 wraps + bilingual tagline ---------- */
/* `text-wrap: balance` lets supporting browsers re-balance the two H1 lines
   so explicit <br/> + browser wrap don't strand a single word on its own line. */
.uae-fx .page-hero h1 { text-wrap: balance; }
.uae-fx .page-hero__bilingual {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(18px, 2vw, 26px);
  color: rgb(var(--fx-tango));
  margin: 22px 0 0;
  text-align: right;
  letter-spacing: -0.005em;
  opacity: 0.94;
  max-width: 28ch;
  margin-left: auto;
}
@media (max-width: 720px) {
  .uae-fx .page-hero__bilingual { text-align: left; margin-left: 0; font-size: 18px; }
}

/* ---------- RTL polish for Arabic UAE pages ---------- */
[dir="rtl"] .btn svg,
[dir="rtl"] .related-card__arrow svg,
[dir="rtl"] .nav__cta svg { transform: scaleX(-1); }
[dir="rtl"] .breadcrumb { direction: rtl; }
[dir="rtl"] .article-body { text-align: right; }
[dir="rtl"] .fx-step__wk { letter-spacing: 0; }

/* =========================================================================
   Home header — three design variants (D1 / D2 / D3). Each variant is fully
   isolated under .page-hero.design-N so the canonical /uae/ home is untouched.
   ========================================================================= */

/* ---------- Design 1 · Editorial asymmetric ---------- */
.uae-fx .page-hero.design-1 .design-1__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}
.uae-fx .design-1__lede { max-width: 56ch; margin-top: 28px; }
.uae-fx .design-1__aside {
  margin-top: 56px; padding: 32px 28px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  position: relative; z-index: 1;
}
.uae-fx .design-1__meta { display: grid; gap: 18px; margin: 0; }
.uae-fx .design-1__meta > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.uae-fx .design-1__meta > div + div { padding-top: 18px; border-top: 1px solid var(--line); }
.uae-fx .design-1__meta dt {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--charcoal-3); margin: 0;
}
.uae-fx .design-1__meta dd {
  font-family: var(--font-display); font-size: 16px; font-weight: 500;
  color: var(--black); margin: 0; text-align: right;
}
@media (max-width: 900px) {
  .uae-fx .page-hero.design-1 .design-1__grid { grid-template-columns: 1fr; gap: 32px; }
  .uae-fx .design-1__aside { margin-top: 8px; }
}

/* ---------- Design 2 · Split with animated flow diagram ---------- */
/* Top padding clears the sticky nav once the announcement banner is dismissed.
   The H1 is intentionally smaller than the canonical hero so a 3-word phrase
   like "AI Automation Agency" fits a single line in the narrower text column. */
.uae-fx .page-hero.design-2 {
  padding-top: clamp(72px, 9vh, 110px);
  padding-bottom: clamp(56px, 7vh, 90px);
}
.uae-fx .page-hero.design-2 h1 {
  font-size: clamp(38px, 4.4vw, 58px);
  line-height: 1.04;
  margin: 22px 0 0;
  max-width: none;          /* override styles.css default 15ch which forces per-word wrap */
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.uae-fx .page-hero.design-2 .design-2__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}
.uae-fx .page-hero.design-2 .design-2__text > p:not(.page-hero__bilingual) {
  max-width: 54ch;
  font-size: 16px;
  line-height: 1.7;
  margin-top: 22px;
}
.uae-fx .page-hero.design-2 .page-hero__bilingual { margin-top: 18px; max-width: none; }
.uae-fx .design-2__visual {
  display: grid; place-items: center;
  max-width: 420px; width: 100%;
  margin-left: auto;
}
.uae-fx .design-2__flow { width: 100%; height: auto; aspect-ratio: 1; }
.uae-fx .design-2__nodes circle { fill: #141414; stroke: rgba(240,78,35,0.55); stroke-width: 1.6; }
.uae-fx .design-2__nodes .design-2__hub { fill: rgb(240,78,35); stroke: none; filter: drop-shadow(0 8px 22px rgba(240,78,35,0.4)); }
.uae-fx .design-2__pulse { filter: drop-shadow(0 0 8px rgba(240,78,35,0.7)); }
@media (max-width: 1100px) {
  .uae-fx .page-hero.design-2 .design-2__grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 40px; }
  .uae-fx .design-2__visual { max-width: 360px; }
}
@media (max-width: 900px) {
  .uae-fx .page-hero.design-2 .design-2__grid { grid-template-columns: 1fr; gap: 28px; }
  .uae-fx .design-2__visual { max-width: 320px; margin: 0 auto; }
  .uae-fx .page-hero.design-2 h1 { font-size: clamp(36px, 8vw, 48px); }
}

/* ---------- Design 3 · Dark cinematic centered ---------- */
.uae-fx .page-hero.design-3 {
  background: #0A0A0A; color: var(--white); overflow: hidden; isolation: isolate;
  padding: clamp(80px, 12vh, 140px) 0;
}
.uae-fx .page-hero.design-3::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 80px 80px;
  animation: fxGridDrift 30s linear infinite;
  pointer-events: none;
  filter: none;
}
.uae-fx .page-hero.design-3::after {
  content: ""; position: absolute; inset: -20%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(40% 50% at 18% 22%, rgba(240,78,35, 0.20), transparent 70%),
    radial-gradient(35% 45% at 82% 18%, rgba(250,176,58, 0.14), transparent 72%);
  filter: blur(40px);
  animation: fxAurora 20s ease-in-out infinite alternate;
}
.uae-fx .design-3__container { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.uae-fx .design-3__inner { text-align: center; max-width: 980px; margin: 0 auto; }
.uae-fx .page-hero.design-3 .eyebrow--light { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.16); margin: 0 auto; }
.uae-fx .page-hero.design-3 h1 { color: var(--white); margin: 24px 0 0; }
.uae-fx .page-hero.design-3 h1 em { color: rgb(240,78,35); }
.uae-fx .design-3__lede {
  color: rgba(250,250,250,.78); font-size: clamp(16px, 1.5vw, 19px); line-height: 1.65;
  max-width: 680px; margin: 28px auto 0;
}
.uae-fx .design-3__tagline {
  font-family: var(--font-display); font-style: italic; font-weight: 500;
  font-size: clamp(20px, 2vw, 28px); color: rgb(240,78,35);
  text-align: center; margin: 20px 0 0; opacity: 0.92;
}
.uae-fx .design-3__cta { justify-content: center; margin-top: 36px; }
.uae-fx .design-3__stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px;
  margin: 64px 0 0; padding-top: 36px; border-top: 1px solid rgba(255,255,255,.14);
  max-width: 760px; margin-left: auto; margin-right: auto;
}
.uae-fx .design-3__stats > div { text-align: center; }
.uae-fx .design-3__stats dt {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: rgba(250,250,250,.6); margin: 0;
}
.uae-fx .design-3__stats dd {
  font-family: var(--font-display); font-size: clamp(28px, 3vw, 40px);
  font-weight: 500; color: var(--white); margin: 6px 0 0;
}
/* Suppress the generic .page-hero aurora on design-3 (it has its own warmer one). */
.uae-fx .page-hero.design-3 .fx-motif { color: rgba(255,255,255,0.06); opacity: 0.5; }
@media (max-width: 720px) {
  .uae-fx .design-3__stats { grid-template-columns: 1fr 1fr; }
}

@keyframes fxGridDrift { from { background-position: 0 0, 0 0; } to { background-position: 80px 80px, 80px 80px; } }

/* =========================================================================
   Design G · Gojiberry-inspired — centered product hero with corner-bracket
   framing, blur-in reveal, a faint hexagon field, and flowing edge streams.
   Borrows the design *language*; keeps Finyki's tango + Fraunces identity.
   ========================================================================= */
.uae-fx .page-hero.design-g {
  position: relative; isolation: isolate; overflow: hidden;
  padding-top: clamp(64px, 8vh, 104px);
  padding-bottom: clamp(56px, 8vh, 96px);
  text-align: center;
}
/* Warm wash + faint hexagon field, fading out behind the text. */
.uae-fx .design-g__bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.uae-fx .design-g__bg::before {
  content: ""; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cg fill='none' stroke='%23F04E23' stroke-opacity='0.07'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5z'/%3E%3Cpath d='M0 16.75l1 .58v15l-1 .58z'/%3E%3Cpath d='M27.99 16.75l-1 .58v15l1 .58z'/%3E%3C/g%3E%3C/svg%3E");
  -webkit-mask-image: radial-gradient(120% 90% at 50% 8%, #000 0%, rgba(0,0,0,.5) 38%, transparent 70%);
          mask-image: radial-gradient(120% 90% at 50% 8%, #000 0%, rgba(0,0,0,.5) 38%, transparent 70%);
}
.uae-fx .design-g__bg::after {
  content: ""; position: absolute; inset: -20%;
  background:
    radial-gradient(34% 42% at 50% 0%, rgba(240,78,35,.16), transparent 70%),
    radial-gradient(40% 50% at 12% 6%, rgba(250,176,58,.14), transparent 72%),
    radial-gradient(40% 50% at 88% 6%, rgba(240,78,35,.10), transparent 72%);
  filter: blur(8px);
  animation: fxAurora 22s ease-in-out infinite alternate;
}
.uae-fx .design-g__stream { position: absolute; top: 0; bottom: 0; width: clamp(120px, 16vw, 240px); height: 100%; }
.uae-fx .design-g__stream--l { left: 0; }
.uae-fx .design-g__stream--r { right: 0; }

.uae-fx .design-g__inner { position: relative; z-index: 1; max-width: 920px; margin: 0 auto; }

/* Corner-bracket framing (shared) */
.uae-fx .fx-bracket__c { position: absolute; width: 9px; height: 9px; pointer-events: none; }
.uae-fx .fx-bracket__c--tl { top: -1px; left: -1px; border-top: 1.5px solid rgb(240,78,35); border-left: 1.5px solid rgb(240,78,35); }
.uae-fx .fx-bracket__c--tr { top: -1px; right: -1px; border-top: 1.5px solid rgb(240,78,35); border-right: 1.5px solid rgb(240,78,35); }
.uae-fx .fx-bracket__c--bl { bottom: -1px; left: -1px; border-bottom: 1.5px solid rgb(240,78,35); border-left: 1.5px solid rgb(240,78,35); }
.uae-fx .fx-bracket__c--br { bottom: -1px; right: -1px; border-bottom: 1.5px solid rgb(240,78,35); border-right: 1.5px solid rgb(240,78,35); }

/* Trust badge (gojiberry "Backed by YC" style) */
.uae-fx .design-g__badge {
  position: relative; display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 16px; margin: 0 auto;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; color: var(--charcoal);
  background: rgba(255,255,255,.6); backdrop-filter: blur(4px);
}
.uae-fx .design-g__badge-mark {
  display: inline-grid; place-items: center; width: 20px; height: 20px;
  background: rgb(240,78,35); border-radius: 4px;
}
.uae-fx .design-g__badge-sep { opacity: .4; }
.uae-fx .design-g__badge-mono { color: rgb(240,78,35); }

.uae-fx .page-hero.design-g h1 {
  font-size: clamp(40px, 5.6vw, 84px); line-height: 1.0; letter-spacing: -0.035em;
  max-width: 16ch; margin: 26px auto 0; text-wrap: balance;
}
.uae-fx .design-g__lede {
  max-width: 60ch; margin: 24px auto 0;
  font-size: clamp(16px, 1.5vw, 19px); line-height: 1.65; color: var(--charcoal);
}
.uae-fx .design-g .design-g__tagline {
  text-align: center; margin: 18px auto 0; max-width: none;
}
.uae-fx .design-g__cta {
  position: relative; display: inline-flex; gap: 14px; flex-wrap: wrap;
  justify-content: center; margin: 34px auto 0; padding: 16px 18px;
}
.uae-fx .design-g__proof {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--charcoal-3); margin: 26px 0 0;
}

/* ---- Blur-in reveal (the gojiberry hallmark) — runs once on load ---- */
.uae-fx .design-g .fx-reveal { animation: fxBlurIn .9s cubic-bezier(.2,.7,.2,1) both; }
.uae-fx .design-g__inner > .fx-reveal:nth-child(1) { animation-delay: .05s; }
.uae-fx .design-g__inner > .fx-reveal:nth-child(2) { animation-delay: .16s; }
.uae-fx .design-g__inner > .fx-reveal:nth-child(3) { animation-delay: .28s; }
.uae-fx .design-g__inner > .fx-reveal:nth-child(4) { animation-delay: .40s; }
.uae-fx .design-g__inner > .fx-reveal:nth-child(5) { animation-delay: .52s; }
.uae-fx .design-g__inner > .fx-reveal:nth-child(6) { animation-delay: .62s; }

@media (max-width: 600px) {
  .uae-fx .page-hero.design-g h1 { font-size: clamp(34px, 9vw, 48px); }
  .uae-fx .design-g__cta { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .uae-fx .design-g .fx-reveal { animation: none; }
  .uae-fx .design-g__bg::after { animation: none; }
}

@keyframes fxBlurIn {
  from { opacity: 0; filter: blur(14px); transform: translateY(12px); }
  to   { opacity: 1; filter: blur(0);   transform: none; }
}

@keyframes fxAurora {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to   { transform: translate3d(3%, 2%, 0) scale(1.12); }
}
@keyframes fxSpin    { to { transform: rotate(360deg); } }
@keyframes fxSpinRev { to { transform: rotate(-360deg); } }
@keyframes fxBob     { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes fxFlow    { 0% { left: 11%; opacity: 0; } 8% { opacity: 1; } 92% { opacity: 1; } 100% { left: 89%; opacity: 0; } }
