:root {
  color-scheme: dark;
  --bg: #050b14;
  --bg-soft: #0b1624;
  --panel: #0f1d2f;
  --panel-border: rgba(120, 180, 255, 0.12);
  --text: #e5f2ff;
  --muted: #8fb0cc;
  --accent: #26d6a0;
  --accent-2: #4ea1ff;
  --danger: #ff6b6b;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px clamp(16px, 3vw, 32px) 40px;
}

.hero {
  display: grid;
  gap: 18px;
  animation: rise 0.6s ease-out;
}

.brand {
  display: flex;
  gap: 18px;
  align-items: center;
}

.logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 700;
  color: #031014;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--muted);
  font-size: 12px;
}

h1 {
  margin: 6px 0 0;
  font-size: clamp(28px, 4vw, 40px);
}

.lede {
  color: var(--muted);
  margin: 0;
  max-width: 720px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

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

.workspace {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  width: 100%;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  min-height: 560px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fade 0.6s ease-out;
}

.editor-panel {
  height: 62vh;
  max-height: 70vh;
  overflow: hidden;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.panel h2 {
  margin: 0;
  font-size: 18px;
}

.editor {
  flex: 1;
  min-height: 0;
  height: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(140, 190, 255, 0.2);
  background: rgba(6, 12, 20, 0.9);
}

.cm-editor {
  height: 100%;
  font-family: "Spline Sans Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 1.6;
  background: transparent;
}

.cm-scroller {
  font-family: inherit;
}

.cm-editor.cm-focused {
  outline: 2px solid rgba(38, 214, 160, 0.6);
  outline-offset: 2px;
}

.toggles {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.toggle {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}

.select {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}

select,
.select input {
  background: rgba(5, 13, 25, 0.85);
  border: 1px solid rgba(140, 190, 255, 0.3);
  color: var(--text);
  border-radius: 10px;
  padding: 6px 10px;
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 12px;
}

.btn {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), #7fffd4);
  color: #041116;
  box-shadow: 0 16px 30px rgba(38, 214, 160, 0.3);
}

.btn.ghost {
  background: transparent;
  border-color: rgba(120, 180, 255, 0.3);
  color: var(--text);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
}

.log-panel {
  grid-column: 1 / -1;
  min-height: 220px;
}

.log {
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 12px;
  color: var(--muted);
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 6px;
}

.log-line {
  display: flex;
  gap: 8px;
  align-items: center;
}

.log-line strong {
  color: var(--accent-2);
  font-weight: 600;
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.link {
  color: var(--accent-2);
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

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

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


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

  .panel {
    min-height: 380px;
  }

  .editor-panel {
    height: 55vh;
  }
}
