:root {
  --ink: #eaf3ee;
  --muted: #9db0a6;
  --line: rgba(170, 210, 185, 0.16);
  --panel: rgba(18, 28, 24, 0.72);
  --accent: #35d19a;
  --accent-2: #d4f072;
  --warn: #ffb454;
  --danger: #ff8b80;
  --font: "Sora", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  width: 100%;
}
body {
  margin: 0;
  min-height: 100%;
  width: 100%;
  max-width: 100vw;
  font-family: var(--font);
  color: var(--ink);
  background-color: #0c1210;
  overflow-x: hidden;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 18% 12%, rgba(53, 209, 154, 0.22), transparent 60%),
    radial-gradient(760px 480px at 82% 18%, rgba(212, 240, 114, 0.14), transparent 62%),
    linear-gradient(160deg, #0b100e 0%, #121a17 45%, #0e1512 100%);
}
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 28%, black, transparent 75%);
}
.signal {
  position: absolute;
  left: 50%;
  top: 42%;
  width: min(920px, 88vw);
  height: 220px;
  transform: translate(-50%, -50%);
  background:
    linear-gradient(90deg, transparent, rgba(53, 209, 154, 0.18), transparent),
    repeating-linear-gradient(
      90deg,
      rgba(212, 240, 114, 0.08) 0 2px,
      transparent 2px 18px
    );
  filter: blur(0.2px);
  opacity: 0.55;
  mask-image: linear-gradient(90deg, transparent, black 15%, black 85%, transparent);
  animation: sweep 7s ease-in-out infinite;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.45;
  animation: drift 12s ease-in-out infinite alternate;
}
.orb-a { width: 280px; height: 280px; left: -40px; top: 18%; background: rgba(53, 209, 154, 0.35); }
.orb-b { width: 220px; height: 220px; right: 8%; top: 8%; background: rgba(212, 240, 114, 0.22); animation-delay: -4s; }

@keyframes drift {
  from { transform: translateY(0) translateX(0); }
  to { transform: translateY(28px) translateX(16px); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes sweep {
  0%, 100% { opacity: 0.25; transform: translate(-50%, -50%) scaleX(0.92); }
  50% { opacity: 0.6; transform: translate(-50%, -50%) scaleX(1); }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(53, 209, 154, 0.35); }
  50% { box-shadow: 0 0 0 12px rgba(53, 209, 154, 0); }
}

.shell {
  width: min(920px, 100%);
  max-width: 100%;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 48px 16px 40px;
  overflow-x: hidden;
}

.hero {
  flex: 1;
  display: grid;
  align-content: center;
  gap: 20px;
  padding-bottom: 8vh;
  min-width: 0;
  max-width: 100%;
  animation: rise 0.85s ease both 0.08s;
}
.brand {
  margin: 0;
  max-width: 100%;
  font-size: clamp(36px, 9vw, 78px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.05em;
  word-break: break-word;
  background: linear-gradient(120deg, #f3fff8 10%, var(--accent) 48%, var(--accent-2) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rise 0.9s ease both 0.05s;
}
.lead {
  margin: 0;
  max-width: 36ch;
  color: var(--muted);
  font-size: clamp(15px, 2.2vw, 18px);
  line-height: 1.65;
  word-break: break-word;
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 10px;
  padding: 10px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(14px);
  max-width: 100%;
  min-width: 0;
  animation: rise 0.9s ease both 0.16s;
}
.composer input {
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  padding: 14px 16px;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.composer input::placeholder { color: #6f8579; }
.composer button {
  border: 0;
  border-radius: 14px;
  padding: 0 22px;
  min-height: 48px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: #07110c;
  white-space: nowrap;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  transition: transform 0.2s ease, filter 0.2s ease;
}
.composer button:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.05); }
.composer button:disabled { opacity: 0.55; cursor: not-allowed; }

.panel {
  margin-top: 18px;
  border: 1px solid var(--line);
  background: rgba(14, 22, 19, 0.78);
  border-radius: 20px;
  padding: 16px;
  display: none;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  animation: rise 0.45s ease both;
}
.panel.show { display: block; }

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  min-width: 0;
}
.status-title {
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status-tag {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  border: 1px solid rgba(53, 209, 154, 0.35);
  padding: 5px 10px;
  border-radius: 999px;
}
.status-tag.warn { color: var(--warn); border-color: rgba(255, 180, 84, 0.4); }
.status-tag.err { color: var(--danger); border-color: rgba(255, 139, 128, 0.4); }

.bar {
  width: 100%;
  max-width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  width: 0;
  max-width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.25s ease;
}
.meta {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  font-family: var(--mono);
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.log {
  margin-top: 14px;
  max-height: min(240px, 40vh);
  overflow-x: hidden;
  overflow-y: auto;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  color: #b7c8be;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}
.result-ok {
  margin-top: 10px;
  color: var(--accent-2);
  font-weight: 600;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.foot {
  margin-top: auto;
  padding-top: 28px;
  color: #6f8178;
  font-size: 12px;
}
.gate-error {
  margin: 0;
  color: var(--danger);
  font-size: 14px;
}
.link-btn {
  border: 0;
  background: transparent;
  color: #7f9489;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}
.link-btn:hover { color: var(--ink); }

@media (max-width: 720px) {
  .shell { padding: 28px 14px 28px; }
  .hero { gap: 16px; padding-bottom: 4vh; }
  .composer {
    grid-template-columns: 1fr;
    border-radius: 16px;
  }
  .composer button {
    width: 100%;
    min-height: 52px;
    animation: pulse 2.4s infinite;
  }
  .panel {
    border-radius: 16px;
    padding: 14px;
  }
  .log {
    font-size: 11px;
    max-height: min(280px, 45vh);
  }
  .orb-a, .orb-b { opacity: 0.28; }
}
