:root {
  --bg: #0b1220;
  --bg2: #121a2b;
  --panel: rgba(18, 28, 48, 0.72);
  --ink: #e6edf8;
  --muted: #8b9bb8;
  --accent: #3b82f6;
  --accent-bright: #60a5fa;
  --accent-ink: #061018;
  --line: rgba(148, 163, 184, 0.18);
  --ok: #34d399;
  --err: #fb7185;
  --font: "IBM Plex Sans", system-ui, sans-serif;
  --display: "Space Grotesk", "IBM Plex Sans", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 45% at 85% 0%, rgba(59, 130, 246, 0.28), transparent 55%),
    radial-gradient(ellipse 45% 35% at 0% 100%, rgba(30, 64, 120, 0.4), transparent 50%),
    linear-gradient(160deg, #071018 0%, var(--bg) 45%, var(--bg2) 100%);
}
.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 20%, transparent 75%);
  pointer-events: none;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.brand {
  font-family: var(--display);
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.03em;
}
.top nav { display: flex; gap: 0.75rem; align-items: center; }
.top nav a:not(.btn) { color: var(--muted); text-decoration: none; font-size: 0.95rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font: inherit;
  font-weight: 600;
  padding: 0.65rem 1.1rem;
  border-radius: 2px;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn.buy { background: var(--accent); color: #fff; }
.btn.buy:hover { background: var(--accent-bright); }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.ghost:hover { border-color: var(--accent-bright); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: translateY(1px); }

.hero {
  min-height: calc(100vh - 4rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 1.5rem 4rem;
  max-width: 42rem;
  animation: rise 0.7s ease both;
}
.brand-hero {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.6rem, 9vw, 4.4rem);
  letter-spacing: -0.05em;
  margin: 0 0 1rem;
  line-height: 0.95;
  background: linear-gradient(120deg, #f8fbff 20%, var(--accent-bright) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero h1 {
  font-family: var(--display);
  font-size: clamp(1.2rem, 2.8vw, 1.55rem);
  font-weight: 500;
  margin: 0 0 0.75rem;
  max-width: 26ch;
  letter-spacing: -0.02em;
}
.lede { color: var(--muted); margin: 0 0 1.75rem; max-width: 38ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.strip {
  padding: 2.5rem 1.5rem 3rem;
  border-top: 1px solid var(--line);
  max-width: 42rem;
}
.strip h2 {
  font-family: var(--display);
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}
.strip ul { margin: 0; padding-left: 1.1rem; color: var(--muted); }
.strip li { margin-bottom: 0.4rem; }

.foot {
  padding: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}
.foot a { color: var(--accent-bright); }

.app-body .workspace {
  max-width: 52rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: rise 0.45s ease both;
}
.status {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
  font-family: var(--display);
  letter-spacing: -0.01em;
}
.status.unlocked { color: var(--ok); }

.panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.1rem 1.15rem;
}
.panel h2 {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}
.field-grid .span-2 { grid-column: 1 / -1; }

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
}
input, textarea, select {
  font: inherit;
  color: var(--ink);
  background: rgba(7, 12, 22, 0.65);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.7rem 0.8rem;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}
.mode-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}
.mode-toggle button {
  flex: 1;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 0.7rem;
  border-radius: 2px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.mode-toggle button.active {
  color: var(--ink);
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.15);
}

.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.metric {
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(7, 12, 22, 0.4);
}
.metric .label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}
.metric .value {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.metric.accent .value { color: var(--accent-bright); }

.quote-box {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.quote-box h3 {
  font-family: var(--display);
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
}
.quote-box p {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.quote-box strong { color: var(--ink); }

dialog {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg2);
  color: var(--ink);
  padding: 1.25rem;
  max-width: 22rem;
  width: calc(100% - 2rem);
}
dialog::backdrop { background: rgba(4, 8, 16, 0.7); }
dialog h2 {
  font-family: var(--display);
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
dialog p { color: var(--muted); font-size: 0.9rem; }
.err { color: var(--err); font-size: 0.85rem; }
.hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

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

@media (max-width: 760px) {
  .panel-grid,
  .field-grid,
  .metrics { grid-template-columns: 1fr; }
  .field-grid .span-2 { grid-column: auto; }
}
@media (max-width: 560px) {
  .top { flex-wrap: wrap; gap: 0.75rem; }
}
