/* Brand colors arrive as --brand-* custom properties, injected per request by the
   server from tenant.config.json + TENANT_* env vars. Nothing here is hardcoded. */

:root {
  --ink: #f4f6fb;
  --ink-dim: rgba(244, 246, 251, 0.62);
  --backdrop: #070810;
  --surface: rgba(255, 255, 255, 0.04);
  --hairline: rgba(255, 255, 255, 0.12);
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: var(--gutter);
  gap: var(--gutter);
  background:
    radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--brand-primary) 22%, transparent), transparent 60%),
    var(--backdrop);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", "Helvetica Neue", sans-serif;
  overflow: hidden;
}

/* ---------- background ---------- */

.aurora {
  position: fixed;
  inset: -20vmax;
  z-index: 0;
  filter: blur(90px);
  opacity: 0.55;
  pointer-events: none;
}

.aurora__blob {
  position: absolute;
  width: 46vmax;
  height: 46vmax;
  border-radius: 50%;
  mix-blend-mode: screen;
  animation: drift 22s ease-in-out infinite alternate;
}

.aurora__blob--1 {
  top: 6%;
  inset-inline-start: 4%;
  background: var(--brand-primary);
}

.aurora__blob--2 {
  bottom: 2%;
  inset-inline-end: 6%;
  background: var(--brand-secondary);
  animation-duration: 28s;
  animation-delay: -6s;
}

.aurora__blob--3 {
  top: 34%;
  inset-inline-start: 42%;
  width: 32vmax;
  height: 32vmax;
  background: var(--brand-accent);
  animation-duration: 19s;
  animation-delay: -12s;
}

@keyframes drift {
  from {
    transform: translate3d(-6%, -4%, 0) scale(1);
  }
  to {
    transform: translate3d(8%, 6%, 0) scale(1.18);
  }
}

.grid-veil {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--hairline) 1px, transparent 1px),
    linear-gradient(90deg, var(--hairline) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 72%);
  mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 72%);
  opacity: 0.35;
}

/* ---------- chrome ---------- */

.brand,
.footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.footer {
  justify-content: space-between;
  flex-wrap: wrap;
  text-transform: none;
  letter-spacing: 0.02em;
}

.footer__link {
  color: var(--ink-dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.footer__link:hover {
  color: var(--ink);
  border-bottom-color: var(--brand-accent);
}

.brand__logo {
  height: 32px;
  width: auto;
  display: block;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  box-shadow: 0 6px 24px color-mix(in srgb, var(--brand-primary) 45%, transparent);
}

.brand__name {
  font-weight: 600;
  color: var(--ink);
}

/* ---------- centre stage ---------- */

.stage {
  position: relative;
  z-index: 1;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  gap: 1.5rem;
}

.halo,
.orbit {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

/* All rings/dots share grid cell 1/1 so they stack and centre on the name,
   overflowing the stage on purpose. */
.halo__ring {
  grid-area: 1 / 1;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 40%, transparent);
  animation: pulse 6s ease-out infinite;
}

.halo__ring--1 {
  width: min(30rem, 72vmin);
  height: min(30rem, 72vmin);
}

.halo__ring--2 {
  width: min(38rem, 88vmin);
  height: min(38rem, 88vmin);
  border-color: color-mix(in srgb, var(--brand-secondary) 34%, transparent);
  animation-delay: -2s;
}

.halo__ring--3 {
  width: min(46rem, 104vmin);
  height: min(46rem, 104vmin);
  border-color: color-mix(in srgb, var(--brand-accent) 26%, transparent);
  animation-delay: -4s;
}

@keyframes pulse {
  0% {
    transform: scale(0.82);
    opacity: 0;
  }
  25% {
    opacity: 1;
  }
  100% {
    transform: scale(1.12);
    opacity: 0;
  }
}

.orbit__dot {
  grid-area: 1 / 1;
  position: relative;
  width: min(34rem, 80vmin);
  height: min(34rem, 80vmin);
  animation: spin 18s linear infinite;
}

.orbit__dot::after {
  content: "";
  position: absolute;
  top: -5px;
  inset-inline-start: calc(50% - 5px);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand-accent);
  box-shadow: 0 0 18px 3px color-mix(in srgb, var(--brand-accent) 70%, transparent);
}

.orbit__dot--2 {
  animation-duration: 26s;
  animation-direction: reverse;
}

.orbit__dot--2::after {
  background: var(--brand-secondary);
  box-shadow: 0 0 18px 3px color-mix(in srgb, var(--brand-secondary) 70%, transparent);
}

.orbit__dot--3 {
  animation-duration: 34s;
  animation-delay: -9s;
}

.orbit__dot--3::after {
  background: var(--brand-primary);
  box-shadow: 0 0 18px 3px color-mix(in srgb, var(--brand-primary) 70%, transparent);
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

/* ---------- the animated name ---------- */

.hero {
  position: relative;
  margin: 0;
  font-size: clamp(2.4rem, 11vw, 7.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 0.28em;
}

/* Shown only until the script upgrades the heading into animated pieces. */
.hero__fallback {
  background: linear-gradient(100deg, var(--brand-primary), var(--brand-accent), var(--brand-secondary));
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.hero__word {
  display: inline-flex;
  white-space: nowrap;
}

.hero__piece {
  display: inline-block;
  background-image: linear-gradient(
    100deg,
    var(--brand-primary) 0%,
    var(--brand-accent) 35%,
    var(--brand-secondary) 70%,
    var(--brand-primary) 100%
  );
  background-size: 300% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  transform: translate3d(0, 0.5em, 0) rotate(6deg);
  opacity: 0;
  filter: drop-shadow(0 10px 30px color-mix(in srgb, var(--brand-primary) 45%, transparent));
  animation:
    reveal 0.85s cubic-bezier(0.22, 1.2, 0.36, 1) forwards,
    float 4.5s ease-in-out infinite,
    shimmer 7s linear infinite;
  /* --i is the piece index, set by app.js — it staggers all three animations. */
  animation-delay:
    calc(var(--i) * 70ms),
    calc(900ms + var(--i) * 70ms),
    calc(var(--i) * -260ms);
}

@keyframes reveal {
  to {
    transform: translate3d(0, 0, 0) rotate(0deg);
    opacity: 1;
  }
}

@keyframes float {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -0.12em, 0);
  }
}

@keyframes shimmer {
  to {
    background-position: -300% 0;
  }
}

.tagline {
  margin: 0;
  font-size: clamp(0.85rem, 2.2vw, 1.05rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
  opacity: 0;
  animation: fade-up 1s ease-out 1.1s forwards;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translate3d(0, 0.75rem, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- accessibility ---------- */

@media (prefers-reduced-motion: reduce) {
  .aurora__blob,
  .halo__ring,
  .orbit__dot {
    animation: none;
  }

  .hero__piece {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .tagline {
    animation: none;
    opacity: 1;
  }
}
