/* ============================================================================
   COMING SOON — night-sky hold screen (the whole site is hidden)
   Rafael LP — rafaellp.com

   Self-contained: it does not change anything in the site — it simply covers
   the viewport with an animated sky. Loaded after site.css (whose color tokens
   it reuses, with fallbacks). Ambience (time-of-day tint, pointer parallax,
   floating particles) is driven by assets/js/coming-soon.js — without JS the
   screen still renders a beautiful static night sky.

   TO REACTIVATE THE SITE: run `powershell -File tools/reativar.ps1`
   (restores the full site from the `site-ativo` branch in one command).
   ========================================================================== */

/* Defensive: anything added to the page stays hidden behind the screen. */
body.coming-soon > *:not(.coming-soon-screen) {
  display: none !important;
}

body.coming-soon {
  min-height: 100svh;
  background: var(--bg, #0a0b0e);
}

/* ============================================================= the screen */
.coming-soon-screen {
  /* ambient palette — night is the default, JS rewrites it per time of day */
  --stars-opacity: 1;
  --aurora-a1: rgba(234, 166, 76, 0.22);
  --aurora-a2: rgba(96, 132, 220, 0.18);
  --aurora-a3: rgba(158, 110, 220, 0.15);
  --glow-warm: rgba(234, 166, 76, 0.16);
  --glow-cool: rgba(96, 132, 220, 0.13);

  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: var(--gutter, clamp(20px, 5vw, 44px));
  overflow: hidden;
  background:
    radial-gradient(120% 85% at 50% 118%, var(--glow-warm), transparent 58%),
    radial-gradient(90% 70% at 50% -12%, var(--glow-cool), transparent 62%),
    var(--bg, #0a0b0e);
}

/* Dawn: warm rose and amber. */
.coming-soon-screen[data-sky="dawn"] {
  --stars-opacity: 0.55;
  --aurora-a1: rgba(238, 142, 108, 0.26);
  --aurora-a2: rgba(234, 166, 76, 0.18);
  --aurora-a3: rgba(178, 108, 198, 0.14);
  --glow-warm: rgba(238, 142, 108, 0.2);
  --glow-cool: rgba(120, 130, 210, 0.12);
}

/* Day: cooler, brighter air, few stars. */
.coming-soon-screen[data-sky="day"] {
  --stars-opacity: 0.28;
  --aurora-a1: rgba(234, 176, 110, 0.16);
  --aurora-a2: rgba(120, 158, 226, 0.2);
  --aurora-a3: rgba(120, 150, 220, 0.12);
  --glow-warm: rgba(234, 166, 76, 0.1);
  --glow-cool: rgba(120, 158, 226, 0.18);
}

/* Dusk: rose, ember and violet. */
.coming-soon-screen[data-sky="dusk"] {
  --stars-opacity: 0.7;
  --aurora-a1: rgba(232, 128, 138, 0.22);
  --aurora-a2: rgba(234, 140, 90, 0.18);
  --aurora-a3: rgba(140, 100, 210, 0.16);
  --glow-warm: rgba(226, 120, 110, 0.18);
  --glow-cool: rgba(110, 110, 210, 0.12);
}

/* ------------------------------------------------------------- the sky */
.coming-soon-screen__sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Parallax layers: JS eases --px/--py (-1…1) and each depth moves less. */
.sky__layer {
  position: absolute;
  inset: 0;
  will-change: transform;
}

.sky__layer--aurora    { transform: translate3d(calc(var(--px, 0) * -34px), calc(var(--py, 0) * -24px), 0); }
.sky__layer--stars-far { transform: translate3d(calc(var(--px, 0) * -12px), calc(var(--py, 0) * -9px), 0); }
.sky__layer--stars-near { transform: translate3d(calc(var(--px, 0) * -24px), calc(var(--py, 0) * -17px), 0); }
.sky__layer--particles { transform: translate3d(calc(var(--px, 0) * -28px), calc(var(--py, 0) * -20px), 0); }
.sky__layer--meteors   { transform: translate3d(calc(var(--px, 0) * -18px), calc(var(--py, 0) * -13px), 0); }
.sky__layer--route     { transform: translate3d(calc(var(--px, 0) * -16px), calc(var(--py, 0) * -11px), 0); }
.sky__layer--horizon   { transform: translate3d(calc(var(--px, 0) * -8px), calc(var(--py, 0) * -6px), 0); }

/* ------------------------------------------------------------- auroras */
.sky__aurora {
  position: absolute;
  width: 62vmax;
  height: 62vmax;
  border-radius: 50%;
  mix-blend-mode: screen;
  will-change: transform;
}

.sky__aurora--1 {
  top: -20vmax;
  left: -14vmax;
  background: radial-gradient(closest-side,
    var(--aurora-a1), transparent 72%);
  animation: aurora-drift-a 26s ease-in-out infinite alternate;
}

.sky__aurora--2 {
  right: -18vmax;
  top: -10vmax;
  background: radial-gradient(closest-side,
    var(--aurora-a2), transparent 72%);
  animation: aurora-drift-b 32s ease-in-out infinite alternate;
}

.sky__aurora--3 {
  left: 22vmax;
  bottom: -26vmax;
  background: radial-gradient(closest-side,
    var(--aurora-a3), transparent 72%);
  animation: aurora-drift-c 38s ease-in-out infinite alternate;
}

@keyframes aurora-drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(7vmax, 5vmax, 0) scale(1.16) rotate(14deg); }
}

@keyframes aurora-drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.1); }
  to   { transform: translate3d(-8vmax, 7vmax, 0) scale(0.92) rotate(-12deg); }
}

@keyframes aurora-drift-c {
  from { transform: translate3d(0, 0, 0) scale(0.95); }
  to   { transform: translate3d(-6vmax, -6vmax, 0) scale(1.18) rotate(10deg); }
}

/* -------------------------------------------------------------- stars */
.sky__stars {
  position: absolute;
  inset: -12%;
  background-repeat: repeat;
}

.sky__layer--stars-far,
.sky__layer--stars-near {
  opacity: var(--stars-opacity, 1);
}

.sky__stars--far {
  background-image:
    radial-gradient(1.2px 1.2px at 38px 62px, rgba(237, 239, 242, 0.85), transparent 100%),
    radial-gradient(1px 1px at 142px 28px, rgba(237, 239, 242, 0.55), transparent 100%),
    radial-gradient(1.4px 1.4px at 218px 116px, rgba(234, 166, 76, 0.65), transparent 100%),
    radial-gradient(1px 1px at 302px 74px, rgba(237, 239, 242, 0.45), transparent 100%),
    radial-gradient(1.1px 1.1px at 86px 168px, rgba(237, 239, 242, 0.6), transparent 100%),
    radial-gradient(1px 1px at 262px 206px, rgba(190, 205, 235, 0.55), transparent 100%);
  background-size:
    340px 240px, 300px 280px, 380px 300px,
    260px 220px, 420px 320px, 360px 260px;
  animation: twinkle 7.5s ease-in-out infinite alternate;
}

.sky__stars--near {
  background-image:
    radial-gradient(1.8px 1.8px at 64px 128px, rgba(255, 255, 255, 0.9), transparent 100%),
    radial-gradient(1.6px 1.6px at 224px 52px, rgba(255, 255, 255, 0.75), transparent 100%),
    radial-gradient(2px 2px at 356px 178px, rgba(234, 166, 76, 0.8), transparent 100%),
    radial-gradient(1.5px 1.5px at 148px 232px, rgba(255, 255, 255, 0.65), transparent 100%);
  background-size: 480px 380px, 540px 420px, 620px 460px, 500px 400px;
  animation:
    twinkle 11s ease-in-out infinite alternate-reverse,
    stars-drift 160s linear infinite;
}

@keyframes twinkle {
  from { opacity: 0.5; }
  to   { opacity: 1; }
}

@keyframes stars-drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-48px, -22px, 0); }
}

/* --------------------------------------------------------- particles */
.sky__particle {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 10px rgba(234, 166, 76, 0.4), 0 0 22px rgba(234, 166, 76, 0.18);
  opacity: 0;
  will-change: transform, opacity;
  animation: particle-float var(--dur) ease-in-out var(--delay) infinite alternate;
}

@keyframes particle-float {
  from {
    opacity: 0;
    transform: translate3d(0, 0, 0);
  }
  30% {
    opacity: var(--o);
  }
  to {
    opacity: calc(var(--o) * 0.55);
    transform: translate3d(calc(var(--drift) * -0.38), calc(var(--drift) * -1), 0);
  }
}

/* ------------------------------------------------------------- meteors */
.sky__meteor {
  position: absolute;
  width: 190px;
  height: 1.5px;
  border-radius: 2px;
  background: linear-gradient(90deg,
    rgba(237, 239, 242, 0) 0%, rgba(237, 239, 242, 0.85) 55%, rgba(234, 166, 76, 0.95) 100%);
  opacity: 0;
  transform: rotate(38deg);
  will-change: transform, opacity;
}

.sky__meteor--1 { top: 7%;  left: 58%; animation: meteor-fall 7.5s linear 2.5s infinite; }
.sky__meteor--2 { top: 17%; left: 9%;  animation: meteor-fall 9s linear 8s infinite; }
.sky__meteor--3 { top: 3%;  left: 34%; animation: meteor-fall 8s linear 15.5s infinite; }

@keyframes meteor-fall {
  0%   { opacity: 0; transform: translate3d(0, 0, 0) rotate(38deg); }
  5%   { opacity: 0.95; }
  24%  { opacity: 0; transform: translate3d(46vw, 33vh, 0) rotate(38deg); }
  100% { opacity: 0; transform: translate3d(46vw, 33vh, 0) rotate(38deg); }
}

/* --------------------------------------------------------- the route */
.sky__route {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.sky__route-line {
  stroke: rgba(234, 166, 76, 0.16);
  stroke-width: 1.4;
}

.sky__route-flow {
  stroke: rgba(234, 166, 76, 0.65);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-dasharray: 3 26;
  filter: drop-shadow(0 0 5px rgba(234, 166, 76, 0.5));
  animation: route-flow 2.6s linear infinite;
}

@keyframes route-flow {
  to { stroke-dashoffset: -29; }
}

.sky__route-node {
  fill: #eaa64c;
  filter: drop-shadow(0 0 7px rgba(234, 166, 76, 0.8));
}

.sky__comet {
  fill: #fff;
  filter:
    drop-shadow(0 0 10px rgba(234, 166, 76, 0.95))
    drop-shadow(0 0 26px rgba(234, 166, 76, 0.5));
}

/* ------------------------------------------------- horizon grid + glow */
.sky__horizon {
  position: absolute;
  left: -25%;
  right: -25%;
  bottom: -14%;
  height: 52%;
  background:
    repeating-linear-gradient(90deg, rgba(234, 166, 76, 0.17) 0 1px, transparent 1px 92px),
    repeating-linear-gradient(0deg, rgba(234, 166, 76, 0.13) 0 1px, transparent 1px 64px);
  transform: perspective(560px) rotateX(64deg);
  transform-origin: bottom center;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.5) 42%, #000 100%);
  mask-image: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.5) 42%, #000 100%);
  opacity: 0.52;
  animation: grid-roll 14s linear infinite;
}

@keyframes grid-roll {
  to { background-position: 0 64px, 0 64px; }
}

/* ------------------------------------------------------ vignette + grain */
.sky__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(130% 110% at 50% 42%, transparent 52%, rgba(5, 6, 8, 0.74) 100%);
}

.sky__grain {
  position: absolute;
  inset: 0;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============================================================ the content */
.coming-soon-screen__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  /* gentle counter-parallax so the content floats above the sky */
  transform: translate3d(calc(var(--px, 0) * 9px), calc(var(--py, 0) * 7px), 0);
}

.coming-soon-screen__mark {
  width: clamp(40px, min(8vw, 9vh), 58px);
  height: auto;
  margin-bottom: clamp(14px, 3.5vh, 34px);
  filter: drop-shadow(0 10px 32px rgba(234, 166, 76, 0.28));
  opacity: 0;
  animation:
    rise-in 1.1s cubic-bezier(0.22, 0.61, 0.36, 1) 0.1s both,
    mark-float 7s ease-in-out 1.4s infinite;
}

@keyframes mark-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}

.coming-soon-screen__word {
  margin: 0;
  font-family: "Segoe UI Variable Display", "Segoe UI", ui-sans-serif, system-ui,
    -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(2.1rem, min(9vw, 12vh), 5.75rem);
  font-weight: 640;
  line-height: 1.04;
  letter-spacing: 0.14em;
  text-indent: 0.14em; /* optical centering for the tracking */
  text-transform: uppercase;
  background: linear-gradient(105deg,
    #b9c0ca 0%, #edeff2 34%, #ffffff 45%, #f2b25c 51%, #ffffff 58%, #edeff2 72%, #b9c0ca 100%);
  background-size: 230% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 16px 44px rgba(234, 166, 76, 0.18)) drop-shadow(0 2px 16px rgba(0, 0, 0, 0.5));
  opacity: 0;
  animation:
    rise-in 1.2s cubic-bezier(0.22, 0.61, 0.36, 1) 0.26s both,
    word-sheen 10s ease-in-out 1.8s infinite;
}

@keyframes word-sheen {
  0%   { background-position: 130% 0; }
  55%  { background-position: -30% 0; }
  100% { background-position: -30% 0; }
}

.coming-soon-screen__rule {
  position: relative;
  width: min(320px, 62vw);
  height: 1px;
  margin: clamp(26px, 4.5vh, 38px) 0 clamp(22px, 3.8vh, 30px);
  background: linear-gradient(90deg,
    transparent, rgba(255, 255, 255, 0.16) 30%, rgba(255, 255, 255, 0.16) 70%, transparent);
  opacity: 0;
  animation: rise-in 1.1s cubic-bezier(0.22, 0.61, 0.36, 1) 0.85s both;
}

.coming-soon-screen__rule::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #eaa64c;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 12px rgba(234, 166, 76, 0.9), 0 0 30px rgba(234, 166, 76, 0.45);
  animation: dot-breathe 4.5s ease-in-out infinite;
}

@keyframes dot-breathe {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  50%      { transform: translate(-50%, -50%) scale(1.35); opacity: 0.75; }
}

.coming-soon-screen__name {
  margin: 0;
  font-family: "Segoe UI Variable Display", "Segoe UI", ui-sans-serif, system-ui,
    -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(0.95rem, min(2.4vw, 3.2vh), 1.32rem);
  font-weight: 560;
  letter-spacing: 0.26em;
  text-indent: 0.26em;
  text-transform: uppercase;
  color: #d8dce2;
  opacity: 0;
  animation: rise-in 1.1s cubic-bezier(0.22, 0.61, 0.36, 1) 1s both;
}

.coming-soon-screen__role {
  margin: 13px 0 0;
  font-size: clamp(0.68rem, min(1.8vw, 2.4vh), 0.85rem);
  font-weight: 500;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  text-transform: uppercase;
  color: #979ea9;
  opacity: 0;
  animation: rise-in 1.1s cubic-bezier(0.22, 0.61, 0.36, 1) 1.15s both;
}

/* --------------------------------------------------------- teaser */
.coming-soon-screen__teaser {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: clamp(18px, 4.5vh, 52px);
  opacity: 0;
  animation: rise-in 1.1s cubic-bezier(0.22, 0.61, 0.36, 1) 1.35s both;
}

.coming-soon-screen__teaser-line {
  margin: 0;
  font-size: clamp(0.62rem, min(1.7vw, 2.2vh), 0.79rem);
  font-weight: 500;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  text-transform: uppercase;
  color: #8b929d;
}

.coming-soon-screen__teaser-game {
  margin: 7px 0 0;
  font-family: "Segoe UI Variable Display", "Segoe UI", ui-sans-serif, system-ui,
    -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(0.85rem, min(2.2vw, 3vh), 1.12rem);
  font-weight: 560;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  text-transform: uppercase;
  color: #eaa64c;
  text-shadow: 0 0 26px rgba(234, 166, 76, 0.35);
}

.coming-soon-screen__blur-name {
  display: block;
  width: min(430px, 74vw, 52vh);
  height: auto;
  margin-top: clamp(4px, 1vh, 10px);
  /* drawn already blurred in canvas — this is only a soft breath */
  animation: name-breathe 7s ease-in-out infinite;
}

@keyframes name-breathe {
  0%, 100% { transform: scale(1); opacity: 0.92; }
  50%      { transform: scale(1.035); opacity: 1; }
}

/* The name behaves like a scrambled transmission: a short glitch burst
   with a scanline sweep every few seconds. */
.coming-soon-screen__glitch {
  position: relative;
  animation: name-glitch 8.5s infinite;
}

.coming-soon-screen__glitch::after {
  content: "";
  position: absolute;
  left: -8%;
  right: -8%;
  top: -10%;
  height: 14%;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.16), transparent);
  opacity: 0;
  animation: glitch-scan 8.5s linear infinite;
}

@keyframes name-glitch {
  0%, 91%, 100%  { transform: translate3d(0, 0, 0); opacity: 1; }
  92%            { transform: translate3d(-4px, 0, 0) skewX(-1.6deg); opacity: 0.82; }
  93.5%          { transform: translate3d(3px, -1px, 0) skewX(1.1deg); opacity: 1; }
  95%            { transform: translate3d(-2px, 1px, 0); opacity: 0.78; }
  96.5%          { transform: translate3d(2px, 0, 0) skewX(-0.7deg); opacity: 0.95; }
  98%            { transform: translate3d(0, 0, 0); opacity: 1; }
}

@keyframes glitch-scan {
  0%, 91%  { opacity: 0; transform: translateY(0); }
  92%      { opacity: 1; transform: translateY(0); }
  97%      { opacity: 0; transform: translateY(760%); }
  100%     { opacity: 0; transform: translateY(760%); }
}

/* --------------------------------------------------------- contact */
.coming-soon-screen__contact {
  margin: clamp(16px, 3.2vh, 30px) 0 0;
  font-size: clamp(0.66rem, min(1.6vw, 2.1vh), 0.78rem);
  letter-spacing: 0.16em;
  opacity: 0;
  animation: rise-in 1.1s cubic-bezier(0.22, 0.61, 0.36, 1) 1.5s both;
}

.coming-soon-screen__contact a {
  color: #7d848f;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 2px;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.coming-soon-screen__contact a:hover,
.coming-soon-screen__contact a:focus-visible {
  color: #eaa64c;
  border-color: rgba(234, 166, 76, 0.55);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================================================== motion preferences */
@media (prefers-reduced-motion: reduce) {
  .coming-soon-screen__mark,
  .coming-soon-screen__word,
  .coming-soon-screen__rule,
  .coming-soon-screen__name,
  .coming-soon-screen__role,
  .coming-soon-screen__teaser,
  .coming-soon-screen__contact {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .coming-soon-screen__blur-name,
  .coming-soon-screen__glitch,
  .coming-soon-screen__glitch::after {
    animation: none;
  }

  .coming-soon-screen__blur-name {
    opacity: 1;
    transform: none;
  }

  .coming-soon-screen__inner,
  .sky__layer {
    transform: none;
  }

  .sky__aurora,
  .sky__stars,
  .sky__meteor,
  .sky__horizon,
  .sky__route-flow,
  .sky__route-node,
  .sky__comet,
  .coming-soon-screen__rule::after {
    animation: none;
  }

  .sky__meteor,
  .sky__comet,
  .sky__particle {
    display: none;
  }
}
