/* ==========================================================================
   NAKALITE — Coming soon (dark only)
   Key art fills the screen, logo, title and countdown sit on the floor below the squad
   ========================================================================== */

.cs {
  /* wide.webp is 2400×1357; the art box keeps that ratio and covers the screen */
  --ar: 1.7686;
  --fill: 1;
  --pad-x: max(16px, env(safe-area-inset-left), env(safe-area-inset-right));
  --mono: "Share Tech Mono", ui-monospace, "SF Mono", Menlo, monospace;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--bg);
}
/* tall screens get the portrait art; it fills the width and the floor fades into the page */
@media (max-aspect-ratio: 4/5) {
  .cs { --ar: .5654; --fill: .82; }
}

/* ---------- scene ---------- */
.cs-scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  animation: cs-fade 1.4s var(--ease-out) both;
}
.cs-art {
  /* a little bigger than the screen so the pointer drift never shows an edge */
  --w: max(100vw + 32px, (100dvh + 24px) * var(--ar) * var(--fill));
  position: absolute;
  left: 50%;
  /* when the art is taller than the screen, crop more from the top so the squad rides high */
  top: min(-12px, (100dvh - var(--w) / var(--ar)) * .6);
  width: var(--w);
  height: calc(var(--w) / var(--ar));
  translate: -50% 0;
  transform-origin: 50% 62%;
  animation: cs-push 2.6s var(--ease-out) both, cs-drift 24s ease-in-out 2.6s infinite alternate;
  will-change: transform;
}
.cs-art img {
  width: 100%;
  height: 100%;
  -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent);
  mask-image: linear-gradient(to bottom, #000 78%, transparent);
}

/* light spots placed on the art (percent of the art box) */
.cs-glow {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  mix-blend-mode: screen;
  animation: cs-breathe var(--t, 4.8s) ease-in-out infinite alternate;
}
.cs-glow--gate {
  --x: 50%; --y: 29%; --s: 36%;
  background: radial-gradient(closest-side, rgb(232 255 170 / .5), rgb(200 255 61 / .2) 42%, rgb(139 92 246 / .12) 66%, transparent);
}
.cs-glow--orb {
  --x: 74.1%; --y: 27%; --s: 9%; --t: 2.4s;
  background: radial-gradient(closest-side, rgb(255 255 255 / .9), rgb(196 170 255 / .55) 30%, rgb(139 92 246 / .2) 60%, transparent);
}
.cs-glow--drone {
  --x: 39.1%; --y: 20.2%; --s: 4.2%; --t: 1.7s;
  background: radial-gradient(closest-side, rgb(240 255 190 / .95), rgb(200 255 61 / .45) 40%, transparent);
}
@media (max-aspect-ratio: 4/5) {
  .cs-glow--gate { --x: 50.4%; --y: 33%; --s: 64%; }
  .cs-glow--orb { --x: 90.3%; --y: 38.5%; --s: 15%; }
  .cs-glow--drone { --x: 31%; --y: 33.2%; --s: 7%; }
}

/* shards: cut from the art at their exact spots; JS tilts them toward the pointer, CSS keeps them bobbing */
.cs-shards { position: absolute; inset: 0; perspective: 900px; }
.cs-shard {
  position: absolute;
  left: var(--l);
  top: var(--t);
  width: var(--w);
  will-change: transform;
}
.cs-shard img {
  width: 100%;
  height: auto;
  -webkit-mask-image: none;
  mask-image: none;
  animation: cs-bob var(--bob, 7s) ease-in-out var(--delay, 0s) infinite alternate;
}

/* slow smoke: two tiling noise layers drifting in opposite directions along the floor */
.cs-fog { position: absolute; inset: 0 -40px; will-change: transform; }
.cs-smoke {
  position: absolute;
  left: 0;
  width: calc(var(--tile) * 2 + 100vw);
  background-repeat: repeat-x;
  background-size: var(--tile) 100%;
  mix-blend-mode: screen;
  -webkit-mask-image: linear-gradient(to top, transparent, #000 25%, #000 55%, transparent);
  mask-image: linear-gradient(to top, transparent, #000 25%, #000 55%, transparent);
  animation: cs-smoke var(--dur) linear infinite;
}
.cs-smoke--far {
  --tile: 1600px; --dur: 110s;
  bottom: 12%;
  height: 46%;
  opacity: .62;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1600' height='480' preserveAspectRatio='none'%3E%3Cfilter id='f' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.0025 .007' numOctaves='4' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .62 0 0 0 0 .46 0 0 0 0 1 1.9 0 0 0 -.8'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
}
.cs-smoke--near {
  --tile: 1300px; --dur: 70s;
  bottom: -4%;
  height: 40%;
  opacity: .52;
  animation-direction: reverse;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1300' height='420' preserveAspectRatio='none'%3E%3Cfilter id='f' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.0035 .01' numOctaves='4' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .7 0 0 0 0 .55 0 0 0 0 1 2.1 0 0 0 -.92'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
}

.cs-sparks {
  position: absolute;
  inset: -40px;
  width: calc(100% + 80px);
  height: calc(100% + 80px);
}
/* darken the floor under the text and the sky under the button */
.cs-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, var(--bg) 0%, rgb(8 7 12 / .84) 18%, rgb(8 7 12 / .38) 38%, transparent 56%),
    linear-gradient(to bottom, rgb(8 7 12 / .55), transparent 16%),
    radial-gradient(120% 90% at 50% 42%, transparent 55%, rgb(8 7 12 / .7));
}

/* ---------- header (only the temporary Home link now) ---------- */
.cs-top {
  position: relative;
  display: flex;
  justify-content: flex-end;
  padding: max(20px, env(safe-area-inset-top)) max(var(--pad-x), 28px) 0;
  animation: cs-drop .9s var(--ease-out) .35s both;
}
.cs-enter svg { transition: translate .25s var(--ease-out); }
.cs-enter:hover svg, .cs-enter:focus-visible svg { translate: 3px 0; }

/* ---------- title block ---------- */
.cs-main {
  position: relative;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px var(--pad-x) max(32px, calc(env(safe-area-inset-bottom) + 18px));
  text-align: center;
}
.cs-in { animation: cs-rise 1s var(--ease-out) both; animation-delay: calc(.6s + var(--i) * .11s); }

.cs-logo {
  width: auto;
  height: clamp(30px, 3.1vw, 44px);
  margin-bottom: 14px;
  filter: drop-shadow(0 4px 18px rgb(0 0 0 / .6));
}

.cs-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(12px, 1.05vw, 15px);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text);
  text-shadow: 0 2px 12px rgb(0 0 0 / .6);
}
.cs-kicker svg { width: 15px; height: 15px; color: var(--lime); filter: drop-shadow(0 0 6px var(--lime-glow)); }

.cs-title {
  margin: 4px 0 14px;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: clamp(56px, min(9vw, 15dvh), 140px);
  line-height: .9;
  letter-spacing: .01em;
  text-transform: uppercase;
  /* lime face with a light sweep that crosses it every few seconds */
  background:
    linear-gradient(100deg, transparent 38%, rgb(255 255 255 / .85) 48%, transparent 58%) no-repeat,
    linear-gradient(180deg, #f4ffd6 4%, #c8ff3d 52%, #86bd0c 100%);
  background-size: 260% 100%, 100% 100%;
  background-position: 160% 0, 0 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 5px 0 rgb(59 22 128 / .95)) drop-shadow(0 0 34px rgb(200 255 61 / .32));
  animation: cs-rise 1s var(--ease-out) calc(.6s + var(--i) * .11s) both, cs-shine 7s ease-in-out 2.6s infinite;
}
.cs-title span { display: inline-block; padding-inline: .06em; }

/* ---------- HUD: launch plate and countdown ---------- */
/* chamfered frames: the element paints the 1px edge, ::before paints the glass inside it */
.cs-date, .cs-unit {
  --cut: 10px;
  position: relative;
  isolation: isolate;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  background: linear-gradient(135deg, rgb(var(--lime-rgb) / .85), rgb(var(--lime-rgb) / .22) 45%, rgb(139 92 246 / .5));
}
.cs-date::before, .cs-unit::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  clip-path: inherit;
  background:
    repeating-linear-gradient(to bottom, rgb(255 255 255 / .035) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, rgb(24 19 38 / .9), rgb(9 8 15 / .94));
}

.cs-date {
  --cut: 9px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 36px;
  padding: 0 20px 0 16px;
  font-family: var(--mono);
  font-size: clamp(13px, 1.05vw, 15px);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-2);
  white-space: nowrap;
}
/* a scan line sweeps across the plate now and then */
.cs-date::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 40%, rgb(var(--lime-rgb) / .22) 50%, transparent 60%) no-repeat;
  background-size: 250% 100%;
  background-position: 180% 0;
  animation: cs-scan 6s ease-in-out 3.4s infinite;
}
.cs-date__dot {
  width: 7px;
  height: 7px;
  background: var(--lime);
  box-shadow: 0 0 8px 1px var(--lime-glow);
  animation: cs-blink 1.2s steps(2, jump-none) infinite;
}
.cs-date__k { color: var(--text-3); }
.cs-date time { color: var(--lime); text-shadow: 0 0 10px rgb(var(--lime-rgb) / .45); }
.cs-date__t { color: var(--text-2); }
.cs-date__t::before { content: "/"; margin-right: 12px; color: var(--text-3); }
.cs-main.is-live .cs-date { color: var(--lime); }

.cs-count {
  display: flex;
  align-items: center;
  gap: clamp(6px, .8vw, 10px);
  margin-top: 20px;
}
.cs-unit {
  --dh: clamp(34px, 3.3vw, 48px);
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: clamp(84px, 8vw, 116px);
  padding: 14px 14px 12px;
}
.cs-digits { display: flex; gap: calc(var(--dh) * .14); }
/* 7-segment digits drawn by js/coming-soon.js; unlit segments stay as faint ghosts */
.cs-digits svg {
  width: calc(var(--dh) * .6);
  height: var(--dh);
  overflow: visible;
  transform: skewX(-8deg);
  filter: drop-shadow(0 0 6px rgb(var(--lime-rgb) / .55));
}
.cs-digits polygon { fill: rgb(var(--lime-rgb) / .07); transition: fill .12s linear; }
.cs-digits polygon.on { fill: #d6ff66; }
.cs-unit__k {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text-3);
}
/* how much of this unit is left: a thin lime bar along the bottom edge */
.cs-unit__bar {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 5px;
  height: 2px;
  background: rgb(var(--lime-rgb) / .12);
}
.cs-unit__bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--lime);
  box-shadow: 0 0 6px var(--lime-glow);
  transform-origin: left;
  transform: scaleX(var(--p, 1));
  transition: transform var(--pt, .9s) linear;
}
.cs-colon {
  display: grid;
  gap: 8px;
  animation: cs-blink 1s steps(2, jump-none) infinite;
}
.cs-colon::before, .cs-colon::after {
  content: "";
  width: 5px;
  height: 5px;
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime-glow);
  transform: skewX(-8deg);
}

/* ---------- small screens ---------- */
@media (max-width: 600px) {
  .cs-top { padding-inline: var(--pad-x); padding-top: max(16px, env(safe-area-inset-top)); }
  .cs-logo { height: 28px; margin-bottom: 12px; }
  .cs-kicker { gap: 8px; letter-spacing: .14em; }
  .cs-title { font-size: min(21vw, 13dvh); line-height: .86; margin: 8px 0 16px; }
  .cs-title span { display: block; }
  .cs-date { gap: 9px; padding: 0 14px 0 12px; letter-spacing: .1em; }
  .cs-date__t::before { margin-right: 9px; }
  .cs-count { gap: 4px; margin-top: 16px; }
  .cs-unit { --dh: 30px; --cut: 8px; min-width: 0; width: min(76px, 20vw); padding: 11px 0 10px; gap: 7px; }
  .cs-unit__k { font-size: 9px; letter-spacing: .12em; }
  .cs-unit__bar { left: 10px; right: 10px; bottom: 4px; }
  .cs-colon { gap: 6px; }
  .cs-colon::before, .cs-colon::after { width: 4px; height: 4px; }
}
@media (max-width: 360px) {
  .cs-colon { display: none; }
  .cs-count { gap: 6px; }
}
/* short landscape screens: the text has to sit on the squad, so the floor shade climbs higher */
@media (max-height: 520px) and (min-aspect-ratio: 4/5) {
  .cs-shade {
    background:
      linear-gradient(to top, var(--bg) 0%, rgb(8 7 12 / .86) 30%, rgb(8 7 12 / .4) 55%, transparent 72%),
      linear-gradient(to bottom, rgb(8 7 12 / .6), transparent 24%),
      radial-gradient(120% 90% at 50% 42%, transparent 55%, rgb(8 7 12 / .7));
  }
  .cs-main { padding-top: 12px; padding-bottom: 14px; }
  .cs-logo { height: 24px; margin-bottom: 8px; }
  .cs-title { margin: 2px 0 10px; }
  .cs-count { margin-top: 10px; }
  .cs-unit { --dh: 26px; padding: 9px 12px 9px; gap: 5px; }
}

/* ---------- motion ---------- */
@keyframes cs-fade { from { opacity: 0; } }
@keyframes cs-push { from { scale: 1.08; } to { scale: 1; } }
@keyframes cs-drift { from { scale: 1; } to { scale: 1.04; } }
@keyframes cs-breathe { from { opacity: .35; scale: .94; } to { opacity: .85; scale: 1.05; } }
@keyframes cs-rise { from { opacity: 0; translate: 0 22px; } }
@keyframes cs-drop { from { opacity: 0; translate: 0 -14px; } }
@keyframes cs-shine {
  0%, 55% { background-position: 160% 0, 0 0; }
  85%, 100% { background-position: -60% 0, 0 0; }
}
@keyframes cs-scan {
  0%, 60% { background-position: 180% 0; }
  90%, 100% { background-position: -80% 0; }
}
@keyframes cs-blink { 50% { opacity: .25; } }
@keyframes cs-bob {
  from { translate: 0 calc(var(--amp, 6px) * -1); rotate: calc(var(--spin, 2deg) * -1); }
  to { translate: 0 var(--amp, 6px); rotate: var(--spin, 2deg); }
}
@keyframes cs-smoke { to { transform: translateX(calc(var(--tile) * -1)); } }

@media (prefers-reduced-motion: reduce) {
  .cs-art, .cs-title, .cs-shard img, .cs-smoke, .cs-colon, .cs-date__dot, .cs-date::after { animation: none; }
  .cs-glow { animation: none; opacity: .6; }
}
