/* Creat de Emilian Cristian · © 2026 Emilian Cristian. Toate drepturile rezervate. */
/* smooth cross-fade when moving between WALDEVAR pages (e.g. Power Grid -> home) */
@view-transition { navigation: auto; }

:root {
  --bg: #01040b;
  --ink: #e8f1fb;
  --ink-dim: rgba(190, 214, 245, 0.55);
  --glow: #6cc6ff;
  --font: 'Montserrat', system-ui, sans-serif;
  --logo-w: clamp(125px, 9.36vw, 190px); /* +20 % */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; }

#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
}
.no-webgl body {
  background:
    radial-gradient(ellipse 60% 30% at 50% 26%, rgba(63, 155, 255, 0.3), transparent 70%),
    linear-gradient(#01040e 0%, #0d2c5c 30%, #01050d 31%, #020a18 100%);
}

/* soft darkening behind the text so it always reads */
.scrim {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 42% 24% at 50% 53%, rgba(1, 5, 14, 0.6), rgba(1, 5, 14, 0.22) 60%, transparent 82%);
  opacity: 0;
  transition: opacity 2.4s ease 1.6s;
}
.is-loaded .scrim { opacity: 1; }

/* ------------------------------------------------------------------ HERO */
.hero {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6vh 32px 0;
  pointer-events: none;
}
.hero__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
/* a soft dark-blue halo behind the headline and the logos, so everything white reads clearly
   (a blurred gradient, not backdrop-filter: blur over the live 3D canvas flickers) */
.hero__inner::before {
  content: '';
  position: absolute;
  left: -14%;
  right: -14%;
  top: -34%;
  bottom: -30%;
  z-index: -1;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(2, 9, 30, 0.7) 0%, rgba(3, 12, 38, 0.5) 42%, rgba(3, 12, 38, 0.18) 66%, transparent 80%);
  filter: blur(28px);
  opacity: 0;
  transition: opacity 1.6s ease;
}
body:has(.headline.is-in) .hero__inner::before, .no-webgl .hero__inner::before { opacity: 1; }

.headline {
  position: relative;
  margin: 0 0 clamp(26px, 4.4vh, 48px);
  font-weight: 700;
  font-size: clamp(26px, 2.82vw, 55px);
  line-height: 1.05;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  font-kerning: none;
  color: #eef4fc;
  text-shadow: 0 2px 24px rgba(1, 6, 18, 0.65);
}
.headline__text { display: block; }
.headline .word { display: inline-block; white-space: nowrap; }
.headline .char {
  display: inline-block;
  opacity: 0;
  transform: translate3d(0, 0.55em, 0) rotateX(-70deg);
  transform-origin: 50% 100%;
  filter: blur(10px);
  transition:
    opacity 0.9s ease,
    transform 1.2s var(--ease-out),
    filter 1s ease;
  transition-delay: calc(var(--i) * 32ms);
}
.headline .char.is-accent { text-shadow: 0 0 26px rgba(62, 168, 255, 0.45); }
.headline.is-in .char { opacity: 1; transform: none; filter: none; }
.headline__glint {
  position: absolute;
  inset: 0;
  color: transparent;
  pointer-events: none;
  text-shadow: none;
  background: linear-gradient(100deg, transparent 0 42%, rgba(255, 255, 255, 0.85) 50%, transparent 58% 100%);
  background-size: 260% 100%;
  background-position: 160% 0;
  -webkit-background-clip: text;
  background-clip: text;
  /* no filter here: a blur redrawn on every frame of the sweep made the page stutter when the wave arrived */
}

/* ------------------------------------------------------------------ DIVISIONS */
.divisions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, auto);
  justify-content: center;
  gap: 24px clamp(12px, 1.2vw, 24px);
}
@media (max-width: 1100px) {
  .divisions { grid-template-columns: repeat(3, auto); --logo-w: clamp(132px, 20vw, 204px); }
}
@media (max-width: 560px) {
  .divisions { grid-template-columns: repeat(2, auto); --logo-w: 42vw; }
}
.division { position: relative; }
.division__link {
  position: relative;
  display: block;
  padding: 12px 6px;
  pointer-events: auto;
  outline: none;
  cursor: pointer;
  transition: transform 0.7s var(--ease-out);
}
.division__logo {
  position: relative;
  display: block;
  width: var(--logo-w);
  aspect-ratio: 2436 / 713;
  filter: drop-shadow(0 0 0 transparent);
  transition: filter 0.7s ease;
}
.division__logo img, .division__logo canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
/* the logos appear like the headline's letters: they rise, unfold and come out of a blur, one after another */
.division__logo { perspective: 600px; }
.division__logo canvas { display: none; }
.division__logo img {
  opacity: 0;
  transform: translate3d(0, 45%, 0) rotateX(-70deg);
  transform-origin: 50% 100%;
  filter: blur(10px);
  transition: opacity 0.9s ease, transform 1.2s var(--ease-out), filter 1s ease;
  transition-delay: calc(var(--i, 0) * 140ms);
}
.division.is-built .division__logo img { opacity: 1; transform: none; filter: none; }
.no-webgl .division__logo img { opacity: 1; transition: opacity 1s ease; }

/* the sun ray: a warm band of light clipped to the logo's own shape */
.division__shine {
  position: absolute;
  inset: 0;
  overflow: hidden;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  pointer-events: none;
}
.division__shine i {
  position: absolute;
  top: -30%;
  bottom: -30%;
  left: 0;
  width: 38%;
  transform: translateX(-200%) skewX(-20deg);
  background: linear-gradient(90deg,
    rgba(255, 196, 110, 0) 0%,
    rgba(255, 208, 140, 0.4) 24%,
    rgba(255, 228, 180, 0.95) 44%,
    #fffaf0 50%,
    rgba(255, 228, 180, 0.95) 56%,
    rgba(255, 208, 140, 0.4) 76%,
    rgba(255, 196, 110, 0) 100%);
}
/* small star-shaped glint riding the top edge of the ray */
.division__spark {
  position: absolute;
  top: 6%;
  left: 0;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(circle, #fff 0 7%, rgba(255, 228, 175, 0.9) 13%, rgba(255, 200, 120, 0.22) 34%, transparent 60%);
}
.division__spark::before, .division__spark::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46px;
  height: 1.5px;
  transform: translate(-50%, -50%);
  background: linear-gradient(90deg, transparent, rgba(255, 250, 240, 0.95), transparent);
}
.division__spark::after { transform: translate(-50%, -50%) rotate(90deg); width: 30px; }

/* accent line under the logo, on hover only */
.division__link::after {
  content: '';
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: -4px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 12px var(--accent);
  opacity: 0;
  transform: scaleX(0.2);
  transition: opacity 0.6s ease, transform 0.8s var(--ease-out);
}

/* hover / keyboard focus */
.division.is-hover .division__link,
.division__link:focus-visible { transform: translateY(-5px); }
.division.is-hover .division__logo,
.division__link:focus-visible .division__logo {
  filter: drop-shadow(0 0 16px color-mix(in srgb, var(--accent) 60%, transparent));
}
.division.is-hover .division__link::after,
.division__link:focus-visible::after { opacity: 1; transform: scaleX(1); left: 8%; right: 8%; }

/* invitation under the logos */
.divisions-hint {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: clamp(24px, 4vh, 40px) 0 0;
  font-size: clamp(18px, 2.1vw, 38px); /* twice the size it was */
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  white-space: nowrap;
  color: rgba(200, 222, 255, 0.78);
  text-shadow: 0 1px 12px rgba(1, 6, 18, 0.8);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 1.2s ease 0.4s, transform 1.4s var(--ease-out) 0.4s;
  pointer-events: none;
}
.divisions-hint span {
  margin-right: -0.24em;            /* letter-spacing adds space after the last letter */
  transition: opacity 0.35s ease;
}
.divisions-hint span.is-swapping { opacity: 0; }
.divisions-hint i {
  width: 62px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(140, 200, 255, 0.7));
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 1.2s var(--ease-out) 0.7s;
}
.divisions-hint i:last-child {
  background: linear-gradient(270deg, transparent, rgba(140, 200, 255, 0.7));
  transform-origin: left;
}
.divisions-hint.is-in { opacity: 1; transform: none; animation: hintBreath 4.5s ease-in-out 2s infinite; }
.divisions-hint.is-in i { transform: scaleX(1); }
.divisions-hint.is-active { color: #ffffff; }
@keyframes hintBreath {
  0%, 100% { color: rgba(200, 222, 255, 0.78); }
  50% { color: rgba(235, 244, 255, 1); }
}
.divisions-hint.is-active { animation: none; }

/* ------------------------------------------------------------------ LOADER */
.loader {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity 1.2s ease 0.45s, visibility 0s linear 1.7s;
}
.loader__inner {
  width: min(320px, 70vw);
  display: grid;
  gap: 18px;
  transition: opacity 0.4s ease, transform 0.8s var(--ease-out);
}
.loader__mark { width: 100%; height: auto; opacity: 0.9; }
.loader__bar {
  position: relative;
  height: 2px;
  border-radius: 2px;
  background: rgba(140, 200, 255, 0.2);
  overflow: hidden;
}
.loader__bar i {
  position: absolute;
  inset: 0;
  transform-origin: left;
  transform: scaleX(0);
  background: linear-gradient(90deg, rgba(108, 198, 255, 0.55), #fff);
  box-shadow: 0 0 10px var(--glow);
}
.loader__meta {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.34em;
  color: var(--ink-dim);
}
.loader__pct { color: var(--ink); font-variant-numeric: tabular-nums; }
.loader__flash {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: linear-gradient(90deg, transparent, #fff 50%, transparent);
  box-shadow: 0 0 30px 6px rgba(108, 198, 255, 0.6);
  transform: scaleX(0);
  opacity: 0;
}
.loader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader.is-done .loader__inner { opacity: 0; transform: scale(0.96); }
.loader.is-done .loader__flash { animation: flash 1.1s var(--ease-out) forwards; }
@keyframes flash {
  0% { transform: scaleX(0); opacity: 1; }
  45% { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(1) scaleY(60); opacity: 0; }
}

@media (max-width: 900px) {
  .headline { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  .headline .char { transition-duration: 0.01s; transition-delay: 0s; }
}

/* ------------------------------------------------------------------ DIVISIONS (opened over the page, no reload) */
.shell-veil {
  position: fixed;
  inset: 0;
  z-index: 15;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.55s ease;
}
.shell-veil.is-on { opacity: 1; }
.division-frame {
  position: fixed;
  inset: 0;
  z-index: 20;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--bg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.6s ease 0.2s, visibility 0s linear 0.8s;
}
.division-frame.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.6s ease 0.2s, visibility 0s;
}
@media (max-width: 560px) { .divisions-hint { font-size: 3.6vw; letter-spacing: 0.14em; gap: 10px; } .divisions-hint i { width: 24px; } }
@media (prefers-reduced-motion: reduce) { .division__logo img { transition-duration: 0.01s; transition-delay: 0s; } }

/* the address at the foot of the page, as big as the headline; it fades in with the hint */
.site-url {
  position: fixed;
  left: 50%;
  bottom: clamp(22px, 5vh, 56px);
  z-index: 2;
  margin: 0;
  translate: -50% 12px;
  font-weight: 700;
  font-size: clamp(26px, 2.82vw, 55px);
  line-height: 1;
  letter-spacing: 0.045em;
  white-space: nowrap;
  color: #eef4fc;
  text-shadow: 0 2px 24px rgba(1, 6, 18, 0.75);
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s ease 0.6s, translate 1.4s var(--ease-out) 0.6s;
}
body:has(.divisions-hint.is-in) .site-url { opacity: 1; translate: -50% 0; }
.no-webgl .site-url { opacity: 1; translate: -50% 0; }
@media (max-width: 560px) { .site-url { font-size: 6.4vw; } }

