:root {
  color-scheme: dark;
  --bg: #06070b;
  --panel: rgba(16, 20, 31, 0.82);
  --panel-strong: rgba(21, 27, 41, 0.95);
  --line: rgba(255, 255, 255, 0.09);
  --text: #eef2ff;
  --muted: #9ea8c6;
  --accent: #7bf7d4;
  --accent-2: #9c7bff;
  --accent-3: #ffcf5a;
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.42);
  --radius: 22px;
  --radius-sm: 14px;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: "Segoe UI Variable", "Aptos", "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  background:
    radial-gradient(circle at 15% 20%, rgba(124, 247, 212, 0.16), transparent 28%),
    radial-gradient(circle at 80% 12%, rgba(156, 123, 255, 0.18), transparent 30%),
    radial-gradient(circle at 70% 82%, rgba(255, 207, 90, 0.12), transparent 30%),
    linear-gradient(180deg, #05060a 0%, #0a0e17 100%);
  color: var(--text);
}

.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.02), transparent 32%),
    linear-gradient(60deg, rgba(255, 255, 255, 0.02), transparent 35%);
  mix-blend-mode: screen;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.09;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 5px 5px;
  mask-image: radial-gradient(circle at center, black 55%, transparent 100%);
}

.shell {
  width: min(1440px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 20px 0 28px;
  position: relative;
  z-index: 1;
}

.hero {
  padding: 26px 28px;
  margin-bottom: 18px;
  background:
    linear-gradient(180deg, rgba(24, 32, 49, 0.9), rgba(13, 17, 27, 0.82)),
    rgba(15, 18, 28, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -30% 55%;
  height: 260px;
  background: radial-gradient(circle, rgba(123, 247, 212, 0.32), transparent 60%);
  filter: blur(12px);
  pointer-events: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 14px 0 10px;
  font-size: clamp(34px, 6vw, 62px);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.lede {
  max-width: 68ch;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(123, 247, 212, 0.12);
  border: 1px solid rgba(123, 247, 212, 0.22);
  color: #d9fff6;
  font-size: 12px;
}

.badge-muted {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.workspace,
.outputs {
  display: grid;
  gap: 18px;
}

.workspace {
  grid-template-columns: minmax(330px, 460px) minmax(0, 1fr);
  align-items: stretch;
}

.outputs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.controls,
.preview-panel,
.code-panel {
  padding: 18px;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.small-note {
  color: var(--muted);
  font-size: 12px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
}

select,
textarea,
button {
  font: inherit;
}

select,
textarea {
  width: 100%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

select:focus,
textarea:focus {
  border-color: rgba(123, 247, 212, 0.5);
  background: rgba(255, 255, 255, 0.06);
}

select {
  min-height: 46px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  min-height: 52px;
  padding: 12px 14px;
  line-height: 1.6;
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 14px;
  padding: 11px 14px;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

button:hover {
  transform: translateY(-1px);
  border-color: rgba(123, 247, 212, 0.35);
  background: rgba(255, 255, 255, 0.08);
}

button:active {
  transform: translateY(0);
}

button.primary {
  background: linear-gradient(135deg, rgba(123, 247, 212, 0.2), rgba(156, 123, 255, 0.22));
  border-color: rgba(123, 247, 212, 0.35);
  box-shadow: 0 10px 32px rgba(123, 247, 212, 0.12);
}

.secondary-row {
  margin-top: 10px;
}

.status-block {
  margin-top: 16px;
  padding: 14px;
  border-radius: 18px;
  background: var(--panel-strong);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

progress {
  width: 100%;
  height: 12px;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

progress::-webkit-progress-bar {
  background: rgba(255, 255, 255, 0.08);
}

progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

progress::-moz-progress-bar {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.log {
  margin: 12px 0 0;
  min-height: 116px;
  max-height: 180px;
  overflow: auto;
  padding: 0;
  color: #d8e2ff;
  background: transparent;
  border: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
}

.preview-panel {
  display: flex;
  flex-direction: column;
  min-height: 560px;
}

iframe {
  width: 100%;
  flex: 1;
  border: 0;
  border-radius: 18px;
  background: #0a0d14;
  min-height: 500px;
}

.code-panel {
  display: flex;
  flex-direction: column;
  min-height: 310px;
}

.mini {
  padding: 7px 10px;
  border-radius: 11px;
  font-size: 12px;
}

.code-panel textarea {
  flex: 1;
  min-height: 220px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre;
}

@media (max-width: 1180px) {
  .workspace,
  .outputs {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100vw - 18px, 1440px);
    padding-top: 10px;
  }

  .hero,
  .controls,
  .preview-panel,
  .code-panel {
    padding: 16px;
  }

  h1 {
    font-size: clamp(28px, 10vw, 44px);
  }

  .button-row {
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}
