:root {
  color-scheme: light;
  --ink: #1b1c1f;
  --ink-soft: #39404a;
  --paper: #f5f1ea;
  --card: #ffffff;
  --stroke: #e2d8c9;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --accent-warm: #f97316;
  --shadow: 0 20px 60px rgba(22, 30, 32, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
}

.bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: -1;
  background: radial-gradient(circle at top, #fdfaf5 0%, #f5f1ea 45%, #efe7dc 100%);
}

.orb {
  position: absolute;
  border-radius: 999px;
  opacity: 0.55;
  filter: blur(0);
  mix-blend-mode: multiply;
}

.orb-1 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.35), transparent 70%);
  top: -120px;
  right: -80px;
}

.orb-2 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.28), transparent 70%);
  bottom: -120px;
  left: -120px;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.2), transparent 70%);
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(30, 30, 30, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 30, 30, 0.05) 1px, transparent 1px);
  background-size: 120px 120px;
  opacity: 0.35;
  mask-image: radial-gradient(circle at top, black 40%, transparent 70%);
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.hero {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hero h1 {
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  font-weight: 700;
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  margin: 12px 0 8px;
}

.hero p {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 720px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent-strong);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.68rem;
}

.hero-actions {
  margin-top: 12px;
}

.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 22px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.intro {
  padding: 28px 32px;
}

.router-form label {
  font-weight: 600;
  display: block;
  margin-bottom: 12px;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.input-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.input-group {
  display: grid;
  gap: 8px;
}

.input-group label {
  margin: 0;
}

input,
select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: #fbfaf7;
  font-size: 0.98rem;
  font-family: inherit;
  color: var(--ink);
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: rgba(15, 118, 110, 0.6);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.help {
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.hidden {
  display: none;
}

body.connected .intro {
  display: none;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.card-head h2 {
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  margin: 0 0 6px;
}

.card-head p {
  margin: 0;
  color: var(--ink-soft);
}

.field {
  margin: 18px 0;
  display: grid;
  gap: 8px;
}

.label {
  font-weight: 600;
}

.radio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.radio-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: #fbfaf7;
  font-size: 0.95rem;
  cursor: pointer;
}

.radio-card input {
  margin: 0;
}

.radio-card span {
  text-align: left;
}

.stats {
  display: grid;
  gap: 16px;
  margin-top: 20px;
  margin-bottom: 16px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #fbfaf7;
  border: 1px solid var(--stroke);
}

.stat-label {
  color: var(--ink-soft);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-value {
  font-weight: 600;
  font-size: 1.05rem;
  display: block;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}

.mono {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
    monospace;
  font-size: 0.98rem;
}

.primary,
.ghost {
  border-radius: 14px;
  padding: 12px 18px;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.ghost.small {
  padding: 8px 14px;
  font-size: 0.85rem;
}
.primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 12px 30px rgba(15, 118, 110, 0.24);
}

.primary:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.primary.full,
.ghost.full {
  width: 100%;
}

.ghost {
  background: transparent;
  color: var(--accent-strong);
  border: 1px solid rgba(15, 118, 110, 0.4);
}

.ghost:hover {
  background: rgba(15, 118, 110, 0.1);
}

.status {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--accent-strong);
  font-size: 0.9rem;
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--ink-soft);
  padding-bottom: 8px;
}

.muted {
  color: #6d6f75;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #111827;
  color: white;
  font-size: 0.92rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: 280px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  background: #0f766e;
}

.toast.error {
  background: #b45309;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  animation: rise 0.7s ease forwards;
}

.delay-1 {
  animation-delay: 0.05s;
}

.delay-2 {
  animation-delay: 0.15s;
}

.delay-3 {
  animation-delay: 0.25s;
}

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

@media (max-width: 860px) {
  .page {
    padding: 36px 18px 28px;
  }

  .input-row,
  .input-grid {
    grid-template-columns: 1fr;
  }

  .input-grid button {
    width: 100%;
  }

  .card-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .radio-grid {
    grid-template-columns: 1fr;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .primary,
  .ghost {
    transition: none;
  }
}
