:root {
  color-scheme: dark;
  --green: #8dffad;
  --green-soft: rgba(141, 255, 173, 0.22);
  --amber: #ffc900;
  --ink: #030308;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  min-height: 240vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 48%, rgba(79, 45, 105, 0.28), transparent 34%),
    radial-gradient(circle at 50% 50%, rgba(255, 201, 0, 0.1), transparent 19%),
    #010105;
  color: white;
  font-family:
    "Courier New",
    "D2Coding",
    "Nanum Gothic Coding",
    monospace;
}

.starfield {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  background: var(--ink);
}

.scroll-aura {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: var(--aura-opacity, 0.32);
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 201, 0, 0.08), transparent 18%),
    radial-gradient(circle at 50% 50%, rgba(199, 38, 108, 0.09), transparent 30%),
    radial-gradient(circle at 50% 55%, rgba(141, 255, 173, 0.035), transparent 36%);
  filter: blur(var(--aura-blur, 14px)) saturate(1.04);
  transform: scale(var(--aura-scale, 1));
  transform-origin: 50% 50%;
  transition: opacity 180ms linear;
}

.launch-screen {
  position: relative;
  z-index: 1;
  min-height: 240vh;
  padding: 0;
}

.brand-stage {
  position: fixed;
  top: 0;
  left: 50%;
  width: min(92vw, 980px);
  height: 100vh;
  height: 100svh;
  margin: 0;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: clamp(22px, 4.5vh, 42px);
  padding: clamp(24px, 5vw, 72px);
  opacity: 1;
  transform: translateX(-50%) translateY(clamp(-18px, -3vh, -4px));
  transform-origin: 50% 52%;
}

.brand-stage::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(92vw, 820px);
  aspect-ratio: 1;
  pointer-events: none;
  opacity: var(--lens-opacity, 0.12);
  background:
    radial-gradient(circle, rgba(255, 201, 0, 0.1), transparent 34%),
    radial-gradient(circle, rgba(141, 255, 173, 0.035), transparent 58%);
  filter: blur(30px);
  transform: translate(-50%, -50%) scale(var(--lens-scale, 1));
  transform-origin: 50% 50%;
}

.logo-picture,
.diecl-logo {
  width: min(86vw, 760px);
  max-width: 100%;
  height: auto;
  display: block;
}

.diecl-logo {
  filter:
    drop-shadow(0 0 calc(12px + var(--logo-glow, 0px)) rgba(255, 201, 0, 0.18))
    drop-shadow(0 0 calc(28px + var(--logo-glow, 0px)) rgba(199, 38, 108, 0.12));
  animation: logoIdle 8.8s ease-in-out infinite;
}

.logo-picture {
  position: relative;
  opacity: 0;
  transform: scale(var(--logo-scale, 1));
  transform-origin: 50% 50%;
  will-change: opacity, transform;
  transition:
    opacity 1200ms ease,
    filter 1200ms ease,
    transform 1200ms ease;
}

.brand-stage.is-revealing .logo-picture {
  animation: logoDissolve 1.45s ease-out 0.18s forwards;
}

.logo-picture::after {
  content: none;
}

.status-wrap {
  width: min(92vw, 760px);
  min-height: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2vh, 18px);
  color: var(--green);
  text-shadow:
    0 0 3px rgba(141, 255, 173, 0.55),
    0 0 12px var(--green-soft),
    0 0 24px rgba(141, 255, 173, 0.12);
  filter: saturate(calc(1.02 + var(--text-saturate, 0)));
  opacity: 0;
  transform: scale(var(--status-scale, 1));
  transform-origin: 50% 50%;
  transition:
    opacity 1200ms ease,
    filter 1200ms ease,
    transform 1200ms ease;
  will-change: opacity, transform;
}

.status-type {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
}

.brand-stage.is-terminal .status-wrap {
  opacity: 1;
  animation: terminalBoot 0.78s steps(8) forwards;
}

.brand-stage.is-away .logo-picture,
.brand-stage.is-away .status-wrap {
  animation: none;
  opacity: 0;
  filter: blur(12px);
  transition:
    opacity 1900ms ease,
    filter 1900ms ease,
    transform 1900ms ease;
}

.brand-stage.is-away .logo-picture::after {
  content: none;
}

.status-line {
  margin: 0;
  display: inline-block;
  grid-column: 2;
  min-width: 0;
  max-width: calc(100% - 22px);
  text-align: center;
  font-size: clamp(18px, 3.6vw, 34px);
  line-height: 1.18;
  letter-spacing: 0;
  white-space: nowrap;
}

.cursor {
  grid-column: 3;
  justify-self: start;
  flex: 0 0 auto;
  width: 0.58em;
  height: 1.1em;
  background: var(--green);
  box-shadow:
    0 0 5px rgba(141, 255, 173, 0.56),
    0 0 18px var(--green-soft);
  animation: blink 0.88s steps(1) infinite;
}

.energy-meter {
  position: relative;
  width: min(86vw, 560px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 420px) minmax(58px, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 12px;
  row-gap: 7px;
  opacity: 0;
  transform: translateY(6px);
  filter: blur(4px);
  transition:
    opacity 900ms ease,
    transform 900ms ease,
    filter 900ms ease;
}

.energy-meter.is-live {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.energy-track {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(141, 255, 173, 0.55);
  background:
    linear-gradient(90deg, rgba(141, 255, 173, 0.08), rgba(141, 255, 173, 0.02)),
    rgba(2, 15, 8, 0.58);
  box-shadow:
    inset 0 0 12px rgba(141, 255, 173, 0.12),
    0 0 16px rgba(141, 255, 173, 0.1);
}

.energy-track::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 30%;
  opacity: 0;
  background: linear-gradient(
    90deg,
    rgba(141, 255, 173, 0.24),
    rgba(141, 255, 173, 0.58),
    rgba(141, 255, 173, 0.28)
  );
  box-shadow:
    inset 0 0 22px rgba(141, 255, 173, 0.36),
    0 0 20px rgba(141, 255, 173, 0.2);
  pointer-events: none;
}

.energy-meter.is-charged .energy-track::before {
  animation: remainingBlink 0.72s steps(1) 3 forwards;
}

.energy-track::after {
  content: "";
  position: absolute;
  inset: 2px;
  opacity: 0.28;
  background: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent 13px,
    rgba(141, 255, 173, 0.45) 13px,
    rgba(141, 255, 173, 0.45) 14px
  );
  pointer-events: none;
}

.energy-fill {
  position: relative;
  z-index: 1;
  width: 0%;
  height: 100%;
  background:
    linear-gradient(90deg, rgba(55, 255, 116, 0.62), rgba(180, 255, 201, 0.9)),
    var(--green);
  box-shadow:
    0 0 12px rgba(141, 255, 173, 0.62),
    0 0 28px rgba(141, 255, 173, 0.24);
  transition: width 90ms linear;
}

.energy-value {
  grid-column: 3;
  grid-row: 1;
  justify-self: start;
  min-width: 58px;
  color: var(--green);
  font-size: clamp(14px, 2vw, 18px);
  line-height: 1;
  text-align: left;
  text-shadow:
    0 0 4px rgba(141, 255, 173, 0.62),
    0 0 16px rgba(141, 255, 173, 0.18);
}

.energy-left {
  grid-column: 2;
  grid-row: 2;
  justify-self: start;
  min-width: 64px;
  color: rgba(141, 255, 173, 0.62);
  font-size: clamp(10px, 1.5vw, 12px);
  line-height: 1;
  text-align: left;
  letter-spacing: 0;
  opacity: 1;
  text-shadow: 0 0 10px rgba(141, 255, 173, 0.16);
  transition: none;
}

.manifesto {
  position: absolute;
  left: 50%;
  top: 30vh;
  width: min(86vw, 720px);
  display: grid;
  justify-items: center;
  gap: clamp(8px, 1.5vh, 14px);
  color: rgba(247, 247, 242, 0.9);
  font-family:
    "Courier New",
    "D2Coding",
    "Nanum Gothic Coding",
    monospace;
  text-align: center;
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.1),
    0 0 24px rgba(255, 255, 255, 0.045);
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 1500ms ease,
    filter 1500ms ease;
}

.manifesto.is-live {
  opacity: 1;
  filter: blur(0);
}

.manifesto.is-dissolving .manifesto-line {
  opacity: 0;
  transform: translateY(-8px);
  filter: blur(9px);
  transition:
    opacity 1800ms ease,
    transform 1800ms ease,
    filter 1800ms ease;
}

.manifesto-line {
  opacity: 0;
  transform: translateY(10px);
  filter: blur(6px);
  font-size: clamp(18px, 2.7vw, 32px);
  line-height: 1.36;
  letter-spacing: 0;
  transition:
    opacity 1500ms ease,
    transform 1500ms ease,
    filter 1500ms ease;
}

.manifesto-line.is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.manifesto-line.is-accent {
  color: rgba(247, 247, 242, 0.9);
  font-size: clamp(18px, 2.7vw, 32px);
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.1),
    0 0 24px rgba(255, 255, 255, 0.045);
}

.manifesto-line.is-credit {
  margin-top: clamp(10px, 2vh, 18px);
  color: rgba(247, 247, 242, 0.9);
  font-size: clamp(18px, 2.7vw, 32px);
  opacity: 1;
  transform: none;
  filter: none;
  transition: none;
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.1),
    0 0 24px rgba(255, 255, 255, 0.045);
}

.manifesto.is-dissolving .manifesto-line.is-credit {
  filter: none;
  transform: none;
}

@keyframes logoIdle {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(0, -8px, 0) scale(1.012);
  }
}

@keyframes blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

@keyframes logoDissolve {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes remainingBlink {
  0%,
  50% {
    opacity: 0;
  }
  51%,
  100% {
    opacity: 0.82;
  }
}

@keyframes terminalBoot {
  0% {
    opacity: 0;
    transform: scaleY(0.08) scaleX(1.18);
    filter: saturate(1.5) brightness(1.36);
  }
  34% {
    opacity: 1;
    transform: scaleY(0.16) scaleX(1.08);
  }
  52% {
    opacity: 0.38;
    transform: scaleY(1.16) scaleX(0.98);
  }
  72% {
    opacity: 1;
    transform: scaleY(0.92) scaleX(1.02);
  }
  100% {
    opacity: 1;
    transform: scale(var(--status-scale, 1));
    filter: saturate(calc(1.18 + var(--text-saturate, 0)));
  }
}

@media (max-width: 640px) {
  .brand-stage {
    width: 96vw;
    gap: 24px;
  }

  .diecl-logo {
    width: min(62vw, 260px);
  }

  .logo-picture {
    width: min(62vw, 260px);
  }

  .status-wrap {
    width: 91vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  .diecl-logo,
  .logo-picture,
  .status-wrap,
  .cursor {
    animation: none;
  }

  body,
  .launch-screen {
    min-height: 100vh;
  }

  .brand-stage {
    position: fixed;
  }
}
