:root {
  /* Zerocoder brand palette from zerocoder.ru */
  --zc-green: #3ce473;
  --zc-green-bright: #5eff96;
  --zc-purple: #766bf6;
  --zc-purple-soft: #e6e4ff;
  --zc-coral: #ff8562;
  --zc-yellow: #eeff00;
  --zc-navy: #14133d;
  --zc-ink: #131313;
  --zc-gray: #8a8a99;
  --zc-mist: #f4f5f6;

  --bg: #0b0b1a;
  --bg-fade: rgba(11, 11, 26, 0.1);
  --accent: var(--zc-green);
  --accent-2: var(--zc-purple);
  --text: #f3f4ff;
  --muted: #9aa0c2;
  --warn: var(--zc-yellow);
  --danger: var(--zc-coral);

  --font-display: "Manrope", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 1.35rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  position: relative;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(118, 107, 246, 0.28), transparent 55%),
    radial-gradient(ellipse 50% 40% at 90% 80%, rgba(60, 228, 115, 0.12), transparent 50%),
    var(--bg);
}

#matrix {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.42;
  pointer-events: none;
}

.scanlines,
.vignette,
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.scanlines {
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    rgba(0, 0, 0, 0.16) 3px,
    transparent 4px
  );
  opacity: 0.35;
  animation: scan-drift 8s linear infinite;
}

.vignette {
  background:
    radial-gradient(ellipse at center, transparent 40%, rgba(8, 7, 24, 0.82) 100%),
    linear-gradient(180deg, rgba(20, 19, 61, 0.35), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.5));
}

.noise {
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: noise-flicker 0.35s steps(2) infinite;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 1rem clamp(1rem, 3vw, 2rem);
  pointer-events: none;
}

.topbar-chip {
  pointer-events: none;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  border: 1px solid rgba(118, 107, 246, 0.35);
  background: rgba(20, 19, 61, 0.55);
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  backdrop-filter: blur(8px);
}

.stage {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(4.5rem, 8vw, 6rem) clamp(1.25rem, 4vw, 3rem) 2rem;
  gap: 0.85rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: clamp(0.75rem, 1.6vw, 0.95rem);
  letter-spacing: 0.04em;
  opacity: 0;
  animation: fade-up 0.8s ease 0.2s forwards;
}

.prompt {
  color: var(--zc-green);
  margin-right: 0.45rem;
}

.cursor {
  color: var(--zc-green);
  animation: blink 1s step-end infinite;
}

.code {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(5.5rem, 22vw, 11.5rem);
  line-height: 0.9;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-shadow:
    0 0 12px rgba(60, 228, 115, 0.55),
    0 0 40px rgba(60, 228, 115, 0.28),
    0 0 80px rgba(118, 107, 246, 0.22);
  position: relative;
  opacity: 0;
  animation: fade-up 0.9s ease 0.35s forwards, code-pulse 3.5s ease-in-out 1.2s infinite;
}

.code-main {
  display: inline-block;
  position: relative;
  z-index: 1;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  font: inherit;
  letter-spacing: inherit;
  opacity: 0.85;
  pointer-events: none;
}

.glitch::before {
  color: var(--zc-purple);
  transform: translate(2px, -1px);
  clip-path: inset(0 0 55% 0);
  animation: glitch-top 2.4s infinite linear alternate-reverse;
}

.glitch::after {
  color: var(--zc-coral);
  transform: translate(-2px, 1px);
  clip-path: inset(45% 0 0 0);
  animation: glitch-bottom 1.8s infinite linear alternate-reverse;
}

.title {
  margin: 0.2rem 0 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.05rem, 3.2vw, 1.85rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  animation: fade-up 0.9s ease 0.55s forwards;
}

.title-glitch {
  position: relative;
  display: inline-block;
  color: var(--text);
  text-shadow: 0 0 18px rgba(243, 244, 255, 0.2);
}

.title-glitch::before,
.title-glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  overflow: hidden;
  opacity: 0;
}

.title-glitch::before {
  color: var(--zc-green-bright);
  animation: title-shift 4s infinite;
}

.title-glitch::after {
  color: var(--zc-coral);
  animation: title-shift-2 5s infinite;
}

.subtitle {
  margin: 0;
  max-width: 36rem;
  color: var(--muted);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(0.95rem, 2.1vw, 1.12rem);
  line-height: 1.55;
  opacity: 0;
  animation: fade-up 0.9s ease 0.7s forwards;
}

.status-panel {
  margin-top: 1.4rem;
  width: min(100%, 28rem);
  display: grid;
  gap: 0.55rem;
  padding: 1.05rem 1.2rem;
  border: 1px solid rgba(118, 107, 246, 0.35);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(60, 228, 115, 0.08), transparent 42%),
    linear-gradient(225deg, rgba(118, 107, 246, 0.12), transparent 50%),
    rgba(20, 19, 61, 0.55);
  backdrop-filter: blur(10px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 20px 50px rgba(0, 0, 0, 0.28);
  opacity: 0;
  animation: fade-up 0.9s ease 0.85s forwards, panel-breathe 4s ease-in-out 1.8s infinite;
}

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
}

.label {
  color: var(--muted);
  letter-spacing: 0.16em;
  font-size: 0.74rem;
}

.value.warn {
  color: var(--warn);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  letter-spacing: 0.08em;
}

.dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 10px rgba(238, 255, 0, 0.75);
  animation: blink 1.2s step-end infinite;
}

.actions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  opacity: 0;
  animation: fade-up 0.9s ease 1s forwards;
}

.btn {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(60, 228, 115, 0.55);
  background: linear-gradient(180deg, rgba(60, 228, 115, 0.22), rgba(60, 228, 115, 0.06));
  color: var(--zc-green-bright);
  font-family: var(--font-display);
  font-size: clamp(0.72rem, 1.8vw, 0.82rem);
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 0.95rem 1.35rem;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 0 24px rgba(60, 228, 115, 0.15);
}

.btn:hover,
.btn:focus-visible {
  outline: none;
  transform: translateY(-2px);
  background: linear-gradient(180deg, rgba(60, 228, 115, 0.34), rgba(60, 228, 115, 0.1));
  box-shadow: 0 0 36px rgba(60, 228, 115, 0.28);
}

.btn:active {
  transform: translateY(0);
}

.btn-ghost {
  border-color: rgba(118, 107, 246, 0.5);
  background: rgba(118, 107, 246, 0.12);
  color: #d8d4ff;
  box-shadow: none;
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  background: rgba(118, 107, 246, 0.22);
  box-shadow: 0 0 28px rgba(118, 107, 246, 0.25);
}

.btn-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 30%,
    rgba(255, 255, 255, 0.18) 48%,
    transparent 62%
  );
  transform: translateX(-120%);
  animation: shine 3.5s ease-in-out infinite;
}

.footer-log {
  margin: 1.4rem 0 0;
  max-width: 42rem;
  color: rgba(154, 160, 194, 0.9);
  font-size: clamp(0.7rem, 1.5vw, 0.8rem);
  letter-spacing: 0.03em;
  min-height: 1.2em;
  opacity: 0;
  animation: fade-up 0.9s ease 1.15s forwards;
  transition: opacity 0.2s ease;
}


.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(8, 7, 20, 0.72);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop.is-open[hidden] {
  display: grid;
}

.modal {
  width: min(100%, 24rem);
  padding: 1.45rem 1.35rem 1.3rem;
  border-radius: var(--radius);
  border: 1px solid rgba(60, 228, 115, 0.35);
  background:
    linear-gradient(160deg, rgba(60, 228, 115, 0.1), transparent 45%),
    rgba(20, 19, 61, 0.96);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 24px 60px rgba(0, 0, 0, 0.45);
  text-align: left;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.28s ease;
}

.modal-backdrop.is-open .modal {
  transform: translateY(0) scale(1);
}

.modal-kicker {
  margin: 0 0 0.55rem;
  color: var(--zc-green);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
}

.modal-title {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.modal-text {
  margin: 0 0 1.2rem;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.98rem;
  line-height: 1.5;
}

.modal-btn {
  width: 100%;
}

.btn:disabled,
.btn.is-loading {
  pointer-events: none;
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}


@keyframes blink {
  50% { opacity: 0; }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes code-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.12); }
}

@keyframes glitch-top {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3px, 1px); }
  40% { transform: translate(3px, -1px); clip-path: inset(10% 0 60% 0); }
  60% { transform: translate(-2px, 0); }
  80% { transform: translate(4px, 1px); clip-path: inset(0 0 40% 0); }
  100% { transform: translate(0, 0); }
}

@keyframes glitch-bottom {
  0% { transform: translate(0, 0); }
  25% { transform: translate(3px, -1px); }
  50% { transform: translate(-4px, 1px); clip-path: inset(55% 0 5% 0); }
  75% { transform: translate(2px, 0); }
  100% { transform: translate(-1px, 1px); }
}

@keyframes title-shift {
  0%, 90%, 100% { opacity: 0; transform: translate(0); }
  92% { opacity: 0.7; transform: translate(-3px, 0); clip-path: inset(20% 0 50% 0); }
  94% { opacity: 0.5; transform: translate(3px, 0); clip-path: inset(40% 0 20% 0); }
}

@keyframes title-shift-2 {
  0%, 86%, 100% { opacity: 0; transform: translate(0); }
  88% { opacity: 0.55; transform: translate(4px, 1px); }
  91% { opacity: 0.4; transform: translate(-3px, -1px); }
}

@keyframes panel-breathe {
  0%, 100% { border-color: rgba(118, 107, 246, 0.35); }
  50% { border-color: rgba(60, 228, 115, 0.45); }
}

@keyframes shine {
  0%, 60% { transform: translateX(-120%); }
  80%, 100% { transform: translateX(120%); }
}

@keyframes scan-drift {
  from { background-position: 0 0; }
  to { background-position: 0 100px; }
}

@keyframes noise-flicker {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-1%, 1%); }
}

  50% { filter: hue-rotate(25deg) brightness(1.15); }
}

@media (max-width: 640px) {
  .status-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }

  .title {
    letter-spacing: 0.04em;
  }

  .actions {
    width: 100%;
  }

  .btn {
    width: 100%;
  }
}

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

  .eyebrow,
  .code,
  .title,
  .subtitle,
  .status-panel,
  .actions,
  .footer-log {
    opacity: 1;
  }
}
