@font-face { font-family: Cinzel; font-weight: 600; font-display: swap; src: url(fonts/cinzel-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-display: swap; src: url(fonts/cormorant-garamond-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 700; font-display: swap; src: url(fonts/cormorant-garamond-latin-700-normal.woff2) format("woff2"); }

:root {
  /* one unit = 1/100 of a 16:9 frame that fits the viewport; every overlay is sized in it */
  --u: min(1vw, 1.777vh);
  --cream: #ecdcb9;
  --cream-dim: #d9c8a6;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: #0d0414;
  color: var(--cream);
  font-family: "Cormorant Garamond", Georgia, serif;
  overflow-x: clip;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

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

.stage {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url(images/bg.webp) center / cover;
}

/* vignette for readability */
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 75% 70% at 50% 45%, transparent 55%, rgb(5 0 10 / .55)),
    linear-gradient(transparent 70%, rgb(5 0 10 / .4));
  pointer-events: none;
}

/* lightning seam flash, toggled by script.js */
.seam {
  position: absolute;
  z-index: 1;
  top: 0; bottom: 0;
  left: calc(50% - 6 * var(--u));
  width: calc(12 * var(--u));
  background:
    linear-gradient(90deg, transparent 30%, rgb(240 190 255 / .9) 50%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 50% 45%, rgb(190 90 255 / .6), transparent);
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
}
.flash .seam { animation: flash .7s ease-out; }
@keyframes flash {
  0%, 100% { opacity: 0; }
  8% { opacity: .85; }
  20% { opacity: .15; }
  32% { opacity: .65; }
}

.embers {
  position: fixed;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ---------- desktop: overlays placed like the mockup ---------- */

.side {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.side > * {
  position: absolute;
  margin: 0;
  pointer-events: auto;
  animation: rise .9s cubic-bezier(.2, .7, .2, 1) both;
  animation-delay: var(--in, 0s);
}
.side > :nth-child(2) { --in: .15s; }
.side > :nth-child(3) { --in: .3s; }
@keyframes rise { from { opacity: 0; translate: 0 calc(2 * var(--u)); } }

.logo { width: calc(25 * var(--u)); left: calc(18% - 12.5 * var(--u)); top: 15%; }
.neuri .logo { width: calc(21 * var(--u)); left: calc(79.5% - 10.5 * var(--u)); top: 16%; }

.stats { left: 4%; top: 37.5%; }
.neuri .stats { left: 78%; top: 38%; }

.btn { left: calc(14.6% - 10.6 * var(--u)); top: 71%; }
.neuri .btn { left: calc(85.4% - 10.6 * var(--u)); }

/* ---------- logos ---------- */

.logo img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 calc(1.2 * var(--u)) var(--glow));
  animation: float 7s ease-in-out infinite;
  transition: filter .4s, scale .4s;
}
.neuri .logo img { animation-delay: -3.5s; }
@keyframes float { 50% { transform: translateY(calc(-.5 * var(--u))); } }

/* twinkle on the gem */
.logo::after {
  content: "";
  position: absolute;
  left: 50%; top: var(--gem);
  width: calc(4 * var(--u));
  aspect-ratio: 1;
  translate: -50% -50%;
  background:
    radial-gradient(closest-side, #fff 10%, transparent 45%),
    linear-gradient(90deg, transparent 48%, #fff 50%, transparent 52%),
    linear-gradient(transparent 48%, #fff 50%, transparent 52%);
  -webkit-mask: radial-gradient(closest-side, #000 25%, transparent);
  mask: radial-gradient(closest-side, #000 25%, transparent);
  mix-blend-mode: screen;
  opacity: 0;
  animation: twinkle 6s 2s ease-in-out infinite;
  pointer-events: none;
}
.alturi .logo::after { --gem: 22%; }
.neuri .logo::after { --gem: 17%; animation-delay: 5s; }
@keyframes twinkle {
  0%, 75%, 100% { opacity: 0; scale: .3; rotate: 0deg; }
  85% { opacity: 1; scale: 1; rotate: 45deg; }
}

/* ---------- stats ---------- */

.stats {
  list-style: none;
  padding: 0;
  display: grid;
  gap: calc(1.8 * var(--u));
}
.stats li {
  display: flex;
  align-items: center;
  gap: calc(1.1 * var(--u));
}
.badge {
  flex: none;
  width: calc(5.6 * var(--u));
  height: calc(5.6 * var(--u));
  filter: drop-shadow(0 0 calc(.5 * var(--u)) rgb(255 200 120 / .35));
  transition: scale .5s cubic-bezier(.3, 1.6, .5, 1), filter .4s;
}
span.badge {
  display: grid;
  place-items: center;
  padding-bottom: calc(.2 * var(--u)); /* interior circle sits slightly above center */
  background: url(images/alturi_badge.webp) center / contain no-repeat;
}
.badge svg {
  width: 46%;
  fill: #f3d995;
  filter: drop-shadow(0 0 2px rgb(255 190 110 / .8));
}

.stats p {
  margin: 0;
  display: grid;
  line-height: 1.1;
  font-variant-numeric: lining-nums;
  filter: drop-shadow(0 2px 3px rgb(0 0 0 / .85));
}
.stats p strong { font-weight: 700; font-size: calc(1.9 * var(--u)); --c: var(--cream); }
.stats p span { font-weight: 500; font-size: calc(1.45 * var(--u)); --c: var(--cream-dim); }
.neuri li:first-child strong { font-size: calc(2.3 * var(--u)); letter-spacing: .02em; }
.neuri li:last-child strong { font-size: calc(2.1 * var(--u)); }
.neuri li:first-child span { font-size: calc(1.3 * var(--u)); }
.countdown {
  font-size: calc(1 * var(--u));
  font-weight: 500;
  letter-spacing: .06em;
  color: #9fd0ff;
  font-variant-numeric: lining-nums tabular-nums;
}
.countdown:empty { display: none; }

/* wandering shimmer: one light crosses all four texts, Alturi to Neuri, about every 18s */
.stats p strong, .stats p span {
  background: linear-gradient(110deg, var(--c) 38%, #fff6dc 45%, #fff 50%, #fff6dc 55%, var(--c) 62%) 100% 0 / 300% 100% no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 18s var(--d) linear infinite;
}
.alturi li:first-child { --d: 4s; }
.alturi li:last-child { --d: 4.45s; }
.neuri li:first-child { --d: 4.9s; }
.neuri li:last-child { --d: 5.35s; }
@keyframes shimmer {
  0% { background-position: 100% 0; }
  7%, 100% { background-position: 0 0; }
}

/* ---------- buttons ---------- */

.alturi { --btn: url(images/alturi_button.webp); --glow: rgb(255 40 140 / .55); }
.neuri { --btn: url(images/neuri_button.webp); --glow: rgb(60 150 255 / .55); }

.btn {
  display: grid;
  place-items: center;
  width: calc(21.2 * var(--u));
  aspect-ratio: 2033 / 773;
  padding-bottom: calc(.6 * var(--u)); /* text on the frame's visual center */
  background: var(--btn) center / contain no-repeat;
  color: var(--cream);
  font: 600 calc(1.25 * var(--u)) / 1 Cinzel, Georgia, serif;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-decoration: none;
  text-shadow: 0 1px 3px rgb(0 0 0 / .8);
  transition: scale .35s cubic-bezier(.3, 1.5, .5, 1), filter .35s;
}
/* light sweep, clipped to the button artwork */
/* neuri's panel sits ~2.4% lower in its artwork than alturi's */
.neuri .btn { padding-bottom: calc(.2 * var(--u)); }
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgb(255 255 255 / .6) 50%, transparent 60%) 100% 0 / 300% 100% no-repeat;
  -webkit-mask: var(--btn) center / contain no-repeat;
  mask: var(--btn) center / contain no-repeat;
  pointer-events: none;
}
.btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
  border-radius: 999px;
  scale: 1.05;
  filter: brightness(1.12) drop-shadow(0 0 calc(1.2 * var(--u)) var(--glow));
}
.btn:active { scale: .97; }

@media (hover: hover) {
  .btn:hover {
    scale: 1.06;
    color: #fff;
    filter: brightness(1.12) drop-shadow(0 0 calc(1.2 * var(--u)) var(--glow));
  }
  .btn:hover::after {
    background-position: 0 0;
    transition: background-position .9s ease;
  }
  .btn:active { scale: .97; }

  .stats li:hover .badge {
    scale: 1.12;
    filter: drop-shadow(0 0 calc(1 * var(--u)) var(--glow)) brightness(1.15);
  }
}

/* ---------- desktop: spotlight the hovered side, dim the other ---------- */

@media (hover: hover) and (min-width: 901px) and (min-height: 541px) and (min-aspect-ratio: 121/100) {
  /* ::before = the side's half as hover zone + colored glow, ::after = dim layer */
  .side::before, .side::after {
    content: "";
    position: absolute;
    top: 0; bottom: 0;
    opacity: 0;
    transition: opacity .6s ease;
  }
  .alturi::before, .alturi::after { left: 0; right: 50%; }
  .neuri::before, .neuri::after { left: 50%; right: 0; }
  .side::before { pointer-events: auto; }
  .side::after { pointer-events: none; }
  .alturi::before { background: radial-gradient(ellipse 80% 70% at 35% 55%, rgb(255 50 140 / .2), transparent 70%); }
  .neuri::before { background: radial-gradient(ellipse 80% 70% at 65% 55%, rgb(60 140 255 / .2), transparent 70%); }
  .alturi::after { background: linear-gradient(90deg, rgb(6 0 12 / .55) 55%, transparent); }
  .neuri::after { background: linear-gradient(270deg, rgb(6 0 12 / .55) 55%, transparent); }

  .side:hover::before,
  .stage:has(.neuri:hover) .alturi::after,
  .stage:has(.alturi:hover) .neuri::after { opacity: 1; }

  .side:hover .logo img {
    scale: 1.03;
    filter: brightness(1.15) drop-shadow(0 0 calc(2.2 * var(--u)) var(--glow));
  }
}

/* ---------- mobile / narrow: stacked (Neuri on top), never side by side ---------- */

@media (max-width: 900px), (max-height: 540px), (max-aspect-ratio: 6/5) {
  :root { --u: clamp(11px, min(3.3vw, 2.2svh), 18px); }

  .stage { height: auto; overflow: visible; display: flex; flex-direction: column; }
  .neuri { order: -1; }
  .stage::before, .stage::after, .seam { display: none; }

  .side {
    position: relative;
    inset: auto;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(2 * var(--u));
    padding: max(5svh, env(safe-area-inset-top)) max(6vw, env(safe-area-inset-right)) max(5svh, env(safe-area-inset-bottom)) max(6vw, env(safe-area-inset-left));
    overflow: hidden;
    isolation: isolate;
  }
  .stage .side > * { position: relative; left: auto; top: auto; }

  /* background twice the panel width: each panel shows its own half */
  .side::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: 0; bottom: 0; left: 0;
    width: 200%;
    background:
      linear-gradient(rgb(8 2 12 / .35), transparent 30%, transparent 45%, rgb(8 2 12 / .8) 85%),
      url(images/bg.webp) 48% 35% / cover;
  }
  .neuri::before { left: -100%; background-position: 0 0, 60% 35%; }

  /* glowing lightning divider between the panels */
  .alturi::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #ff3fa4 20%, #c27bff 50%, #3fa4ff 80%, transparent);
    box-shadow: 0 0 12px 2px rgb(190 100 255 / .7);
  }
  .flash .alturi::after { animation: flash-line .7s ease-out; }
  @keyframes flash-line { 8%, 32% { box-shadow: 0 0 40px 10px rgb(220 160 255 / .95); } 20% { box-shadow: 0 0 12px 2px rgb(190 100 255 / .7); } }

  .logo, .neuri .logo { width: min(24 * var(--u), 86vw); }
  .stats { margin-top: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation: none !important; transition: none !important; }
}
