:root {
  color-scheme: dark;
  --bg: #0f172a;
  --surface: rgba(15, 23, 42, 0.72);
  --border: #334155;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #818cf8;
  --cta: #6366f1;
  --placeholder: #64748b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(99, 102, 241, 0.18), transparent 32%),
    linear-gradient(180deg, #0f172a 0%, #111827 100%);
  font: 16px/1.6 'Inter', system-ui, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

h1,
h2,
h3,
p,
pre {
  margin: 0;
}

.page {
  position: relative;
  overflow-x: hidden;
}

.page::before {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 32rem;
  pointer-events: none;
  background: radial-gradient(circle at top, rgba(99, 102, 241, 0.24), transparent 55%);
}

.page::after {
  content: '';
  position: absolute;
  top: 12rem;
  right: -8rem;
  width: 20rem;
  height: 20rem;
  border-radius: 9999px;
  pointer-events: none;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.18), transparent 65%);
  filter: blur(64px);
}

.container {
  position: relative;
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  padding: 2.5rem 0 3.5rem;
}

.hero {
  width: min(680px, 100%);
  margin: 0 auto;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  border: 1px solid rgba(129, 140, 248, 0.25);
  background: rgba(129, 140, 248, 0.08);
  color: var(--accent);
  font-size: 0.875rem;
}

h1 {
  max-width: 12ch;
  margin: 1.25rem auto 0;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

h2 {
  margin-top: 0.75rem;
  font-size: clamp(1.75rem, 4vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h3 {
  margin-top: 0.75rem;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.lead,
.subcopy,
.panel-copy,
.footer p,
pre,
.panel-footer {
  color: var(--text-muted);
}

.lead {
  margin-top: 1.25rem;
}

.subcopy {
  margin-top: 1rem;
  font-size: 0.875rem;
}

.studio {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  margin-top: 3rem;
}

.panel,
.output {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22);
}

.panel {
  padding: 1.5rem;
}

.panel-top,
.panel-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.mono {
  font: 0.875rem 'JetBrains Mono', monospace;
  color: var(--accent);
}

.chip {
  height: fit-content;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid rgba(129, 140, 248, 0.22);
  background: rgba(129, 140, 248, 0.1);
  color: var(--accent);
  font-size: 0.75rem;
}

.panel-copy {
  margin-top: 1rem;
  max-width: 52ch;
}

input,
textarea {
  width: 100%;
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.42);
  color: var(--text);
  outline: none;
}

textarea {
  min-height: 18rem;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--placeholder);
}

input:focus,
textarea:focus {
  border-color: var(--cta);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18);
}

.panel-footer {
  align-items: center;
  margin-top: 1rem;
  font-size: 0.875rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 1.25rem;
  border: 0;
  border-radius: 14px;
  background: var(--cta);
  color: white;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.24);
}

.button:hover {
  background: #7376f7;
}

.button:disabled {
  cursor: wait;
  opacity: 0.75;
}

.error {
  margin-top: 1rem;
  color: #fca5a5;
  font-size: 0.875rem;
}

.outputs {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.output {
  padding: 1.25rem;
}

.output-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.copy-button {
  height: 36px;
  padding: 0 0.875rem;
  border: 1px solid rgba(129, 140, 248, 0.22);
  border-radius: 9999px;
  background: rgba(129, 140, 248, 0.08);
  color: var(--accent);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
}

.copy-button:hover {
  background: rgba(129, 140, 248, 0.16);
}

pre {
  margin-top: 1rem;
  white-space: pre-wrap;
  font: inherit;
}

.footer {
  width: min(680px, 100%);
  margin: 4rem auto 0;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.copyright {
  margin-top: 1rem;
  font-size: 0.875rem;
}

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

@media (max-width: 720px) {
  .container {
    width: min(1200px, calc(100% - 32px));
    padding-top: 2rem;
    padding-bottom: 3rem;
  }

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

  .panel,
  .output {
    padding: 1rem;
  }

  .panel-top,
  .panel-footer,
  .output-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .button {
    width: 100%;
  }
}
