@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@300;400;500&display=swap");

:root {
  --bg: #0b0f1a;
  --panel: rgba(15, 23, 42, 0.78);
  --panel-border: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #f97316;
  --accent-2: #38bdf8;
  --accent-3: #22c55e;
  --shadow: rgba(2, 6, 23, 0.5);
  --panel-glow: rgba(56, 189, 248, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Space Grotesk", sans-serif;
  background: radial-gradient(circle at top, rgba(56, 189, 248, 0.1), transparent 48%),
    radial-gradient(circle at 80% 20%, rgba(249, 115, 22, 0.1), transparent 45%),
    radial-gradient(circle at 20% 80%, rgba(34, 197, 94, 0.08), transparent 50%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html {
  scroll-behavior: smooth;
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
}

.blob {
  position: absolute;
  width: 420px;
  height: 420px;
  filter: blur(90px);
  opacity: 0.55;
}

.blob-a {
  background: radial-gradient(circle, rgba(56, 189, 248, 0.8), transparent 65%);
  top: -120px;
  left: -80px;
}

.blob-b {
  background: radial-gradient(circle, rgba(249, 115, 22, 0.8), transparent 65%);
  right: -120px;
  bottom: -160px;
}

.grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at top, black 40%, transparent 75%);
}

.hero {
  padding: 110px 8vw 70px;
}

.hero-intro {
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 46px 52px;
  border-radius: 30px;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.16), transparent 50%),
    radial-gradient(circle at 70% 30%, rgba(249, 115, 22, 0.14), transparent 55%),
    linear-gradient(140deg, rgba(15, 23, 42, 0.92), rgba(8, 10, 14, 0.96));
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 36px 90px rgba(2, 6, 23, 0.6), 0 0 0 1px rgba(56, 189, 248, 0.06);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(18px);
}

.hero-inner::before {
  content: "";
  position: absolute;
  inset: -110px -60px auto auto;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.45), transparent 70%);
  opacity: 0.75;
  pointer-events: none;
}

.hero-inner::after {
  content: "";
  position: absolute;
  inset: auto auto -140px -90px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.45), transparent 70%);
  opacity: 0.6;
  pointer-events: none;
}

.eyebrow {
  font-family: "IBM Plex Mono", monospace;
  color: var(--accent-2);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  font-size: 11px;
  margin-bottom: 14px;
}

h1 {
  font-size: clamp(3.1rem, 6.2vw, 5.2rem);
  margin-bottom: 16px;
  letter-spacing: -0.04em;
  line-height: 1.02;
  background: linear-gradient(120deg, #f8fafc, #f97316 45%, #38bdf8);
  -webkit-background-clip: text;
  color: transparent;
}

.subhead {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 700px;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.hero-actions:empty {
  display: none;
}

.hero-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.92rem;
}

.hero-meta span {
  padding: 6px 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  padding: 0 8vw 56px;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
}

.panel {
  background: linear-gradient(180deg, rgba(18, 24, 38, 0.88), rgba(9, 12, 18, 0.94));
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 20px;
  padding: 30px;
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.panel-header {
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  padding-bottom: 16px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.panel-header h2 {
  font-size: 1.4rem;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
  font-weight: 600;
}

.panel-header p {
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.93rem;
  color: rgba(226, 232, 240, 0.85);
  font-weight: 500;
}

label:focus-within {
  color: #e2e8f0;
}

label.full {
  grid-column: 1 / -1;
}

.full.faq-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.95rem;
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-item {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  padding: 12px;
  border-radius: 14px;
  background: rgba(10, 12, 18, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.8rem;
}

input,
textarea,
select {
  background: rgba(12, 16, 26, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.92rem;
  transition: border 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2), 0 12px 30px rgba(2, 6, 23, 0.35);
  background: rgba(15, 23, 42, 0.9);
}

input::placeholder,
textarea::placeholder {
  color: rgba(148, 163, 184, 0.7);
}

.hint {
  font-size: 0.8rem;
  color: var(--muted);
}

.toggle {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.4);
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.badge-select {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(10, 12, 18, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.badge-option {
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(15, 23, 42, 0.7);
  color: rgba(226, 232, 240, 0.7);
  padding: 6px 12px;
  border-radius: 999px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.badge-option:hover {
  border-color: rgba(56, 189, 248, 0.6);
  color: var(--text);
  transform: translateY(-1px);
}

.badge-option.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.9), rgba(249, 115, 22, 0.9));
  color: #0f172a;
  box-shadow: 0 10px 20px rgba(56, 189, 248, 0.25);
}

.wizard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
  align-items: center;
}

.autosave {
  font-size: 0.85rem;
  color: var(--muted);
  margin-right: auto;
}

.btn {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  padding: 10px 18px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, border 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.35);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #facc15);
  color: #111827;
  border: none;
}

.btn-ghost {
  background: rgba(15, 23, 42, 0.7);
  color: var(--text);
}

.btn-muted {
  background: transparent;
  color: var(--muted);
}

.btn-copy-markdown {
  display: none;
}

.preview.markdown-only .btn-copy-markdown {
  display: inline-flex;
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 28px;
  padding: 16px 34px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(120deg, #f97316, #fb7185, #38bdf8);
  color: #0b0d12;
  border: none;
  box-shadow: 0 22px 60px rgba(249, 115, 22, 0.4);
}

.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 26px 60px rgba(56, 189, 248, 0.35);
}

.preview {
  display: flex;
  flex-direction: column;
  gap: 16px;
  grid-column: 1 / -1;
  align-items: stretch;
}

.preview-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  position: sticky;
  top: 0;
  padding: 10px 0;
  background: linear-gradient(180deg, rgba(11, 13, 18, 0.96) 60%, rgba(11, 13, 18, 0));
  backdrop-filter: blur(6px);
  z-index: 5;
}

.preview-toolbar .btn {
  padding: 8px 14px;
  font-size: 0.88rem;
}

.pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.75);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  color: var(--muted);
  border: 1px solid var(--panel-border);
}

.preview-box {
  background: rgba(12, 16, 26, 0.8);
  border-radius: 16px;
  padding: 20px;
  height: auto;
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, 0.16);
  line-height: 1.6;
  font-size: 0.95rem;
}

.preview-box ul {
  padding-left: 18px;
}

.preview-box li {
  margin: 6px 0;
}

.preview-box h1 {
  font-size: 2rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding-bottom: 6px;
}

.preview-box h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-top: 1.6rem;
}

.preview-box h3 {
  font-size: 1.1rem;
}

.preview-box p {
  margin: 0.6rem 0;
}

.preview-box blockquote {
  border-left: 3px solid rgba(56, 189, 248, 0.6);
  padding-left: 12px;
  color: var(--muted);
  margin: 12px 0;
}

.preview-box hr {
  border: none;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  margin: 20px 0;
}

.preview-box table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.9rem;
}

.preview-box th,
.preview-box td {
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 8px 10px;
  text-align: left;
}

.preview-box th {
  background: rgba(15, 23, 42, 0.7);
}

.preview-box a {
  color: var(--accent-2);
}

.preview-box code {
  background: rgba(148, 163, 184, 0.12);
  padding: 2px 6px;
  border-radius: 6px;
  font-family: "IBM Plex Mono", monospace;
}

.preview-box pre {
  background: rgba(15, 23, 42, 0.9);
  padding: 12px;
  border-radius: 12px;
  overflow: auto;
  position: relative;
}

.preview-box pre code {
  background: transparent;
  padding: 0;
}

.preview-code {
  display: none;
  background: rgba(12, 16, 26, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 16px;
  padding: 18px;
  overflow: auto;
  color: var(--text);
}

.preview.markdown-only .preview-box,
.preview.markdown-only .preview-empty {
  display: none;
}

.preview.markdown-only .preview-code {
  display: block;
}

.copy-code-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.75);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-family: "IBM Plex Mono", monospace;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-code-btn:hover {
  border-color: rgba(56, 189, 248, 0.6);
  color: #e2e8f0;
}

.preview.is-collapsed {
  display: none;
}

.is-hidden {
  display: none !important;
}

body.preview-fullscreen .builder {
  display: none;
}

body.preview-fullscreen .preview {
  display: flex;
  min-height: 100vh;
  border-radius: 0;
  border: none;
  padding: 32px 8vw;
  box-shadow: none;
}

body.preview-fullscreen .hero,
body.preview-fullscreen .footer {
  display: none;
}

body.preview-fullscreen .layout {
  padding-top: 0;
  padding-bottom: 0;
}

body.preview-fullscreen .preview-box {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: transparent;
  border: none;
  padding: 0;
}

body.preview-fullscreen .preview-code {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.footer {
  padding: 24px 8vw 48px;
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
}

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

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .hero {
    padding-top: 48px;
  }
  .hero-inner {
    padding: 28px 22px;
  }
  .preview-box {
    height: 420px;
  }
}

@media (max-width: 600px) {
  .panel {
    padding: 18px;
  }
  .preview-box {
    height: 360px;
  }
}
