:root {
  --ink: #e8eef7;
  --muted: #9aa8bc;
  --paper: #0d1118;
  --panel: #151b26;
  --line: #2a3548;
  --accent: #3ddc97;
  --accent-ink: #06261a;
  --warn: #7eb6ff;
  --radius: 12px;
  --font-display: "Syne", "Avenir Next", "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 85% -5%, rgba(61, 220, 151, 0.16), transparent 55%),
    radial-gradient(700px 420px at 0% 20%, rgba(126, 182, 255, 0.12), transparent 50%),
    var(--paper);
  min-height: 100vh;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
  background-image:
    linear-gradient(to right, rgba(232, 238, 247, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(232, 238, 247, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, black 20%, transparent 90%);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  backdrop-filter: blur(12px);
  background: rgba(13, 17, 24, 0.84);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

nav {
  display: flex;
  gap: 1.25rem;
}
nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}
nav a:hover { color: var(--ink); }

main {
  width: min(980px, calc(100% - 2rem));
  margin: 0 auto;
  padding-bottom: 4rem;
}

.hero {
  padding: 4.5rem 0 3rem;
  animation: rise 0.7s ease both;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 1rem;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.7rem, 7vw, 4.6rem);
  line-height: 0.98;
  margin: 0 0 1rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.hero h1 span { color: var(--accent); }
.lede {
  max-width: 34rem;
  font-size: 1.12rem;
  color: var(--muted);
  line-height: 1.55;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.75rem 0 0.85rem;
}
.trust {
  color: var(--muted);
  font-size: 0.92rem;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.7rem 1.15rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn.tiny {
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  border-radius: 8px;
  background: #0f1520;
  border: 1px solid var(--line);
  color: var(--ink);
}

.panel, .how, .pricing {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
  margin: 1.25rem 0;
  animation: rise 0.8s ease both;
  animation-delay: 0.08s;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.panel h2, .how h2, .pricing h2 {
  font-family: var(--font-display);
  margin: 0 0 0.25rem;
  letter-spacing: -0.02em;
}
.muted { color: var(--muted); margin: 0; }

.tone-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.tone-row select,
#license {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  background: #0f1520;
  color: var(--ink);
}

.field-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  font: inherit;
  line-height: 1.5;
  resize: vertical;
  background: #0f1520;
  color: var(--ink);
  min-height: 180px;
}
textarea:focus, .tone-row select:focus, #license:focus {
  outline: 2px solid rgba(61, 220, 151, 0.35);
  border-color: var(--accent);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0;
}

.status {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: rgba(61, 220, 151, 0.1);
  border: 1px solid rgba(61, 220, 151, 0.35);
  color: var(--accent);
  margin-bottom: 1rem;
}
.status.error {
  background: rgba(126, 182, 255, 0.08);
  border-color: rgba(126, 182, 255, 0.35);
  color: var(--warn);
}

.outputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}
.out-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0f1520;
  overflow: hidden;
}
.out-card.wide { grid-column: 1 / -1; }
.out-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--line);
  background: #121927;
}
.out-card h3 {
  margin: 0;
  font-size: 0.95rem;
}
.out-card pre {
  margin: 0;
  padding: 0.9rem;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.45;
  max-height: 280px;
  overflow: auto;
  color: #c9d4e5;
}

.how ol {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
  line-height: 1.7;
}

.price-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.price-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.1rem;
  background: #0f1520;
}
.price-card.featured {
  border-color: rgba(61, 220, 151, 0.55);
}
.price-card h3 { margin: 0; font-family: var(--font-display); }
.price {
  font-size: 2rem;
  font-weight: 700;
  margin: 0.4rem 0 0.8rem;
}
.price span {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
}
.price-card ul {
  margin: 0 0 1rem;
  padding-left: 1.1rem;
  color: var(--muted);
  line-height: 1.6;
}
.fine {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0.75rem 0 0;
}

.site-footer {
  text-align: center;
  color: var(--muted);
  padding: 2rem 1rem 3rem;
  font-size: 0.9rem;
}

dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.25rem;
  width: min(420px, calc(100% - 2rem));
  background: var(--panel);
  color: var(--ink);
}
dialog::backdrop { background: rgba(4, 8, 14, 0.72); }
#pro-form h3 {
  margin-top: 0;
  font-family: var(--font-display);
}
#license { width: 100%; margin: 0.75rem 0; }
.dialog-actions {
  display: flex;
  gap: 0.5rem;
}
code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--accent);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 720px) {
  nav { display: none; }
  .outputs, .price-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
