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

:root {
  --bg: #0f1115;
  --bg-grid: #151821;
  --panel: #1a1d24;
  --panel-2: #20242d;
  --input: #090b0f;
  --terminal: #050607;
  --terminal-soft: #0b1010;
  --border: #2d3747;
  --border-soft: rgba(45, 212, 191, 0.16);
  --text: #e5edf7;
  --text-muted: #94a3b8;
  --text-dim: #667085;
  --green: #10b981;
  --green-hover: #0ea371;
  --green-dark: #065f46;
  --amber: #f59e0b;
  --blue: #60a5fa;
  --red: #ef4444;
  --code: #a7f3d0;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
  --font-ui: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-code: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
}

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

html {
  background: var(--bg);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-ui);
  color: var(--text);
  line-height: 1.5;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 22px 22px;
}

a {
  color: inherit;
  text-decoration: none;
}

header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(15, 17, 21, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

nav {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  min-height: 64px;
  padding: 0.7rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
}

.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  color: var(--text);
  font-family: var(--font-code);
  font-weight: 800;
  white-space: nowrap;
}

.logo-mark {
  color: var(--green);
  font-weight: 800;
}

.logo small {
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 0.74rem;
  font-weight: 600;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.3rem;
}

.nav-links a {
  color: var(--text-muted);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.5rem;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.nav-links a:hover {
  color: var(--text);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.04);
}

main {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  flex: 1;
}

footer {
  color: var(--text-muted);
  background: #0b0d11;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  padding: 1.25rem;
  text-align: center;
}

.hero {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 1rem;
  row-gap: 0.25rem;
  margin: 0 0 1.4rem;
}

.hero-mark {
  grid-row: 1 / span 3;
  width: 58px;
  height: 58px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 5px;
  background: #101510;
  border: 2px solid #313b32;
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 8px 22px rgba(0, 0, 0, 0.28);
}

.hero-mark span {
  display: block;
  border-radius: 3px;
}

.hero-mark span:nth-child(1) { background: #5fa83a; }
.hero-mark span:nth-child(2) { background: #b7791f; }
.hero-mark span:nth-child(3) { background: #8b9384; }
.hero-mark span:nth-child(4) { background: #326f46; }

.eyebrow {
  color: var(--green);
  font-family: var(--font-code);
  font-size: 0.78rem;
  font-weight: 700;
}

.hero h1 {
  font-size: 2.2rem;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 0;
}

.hero > p:last-child {
  color: var(--text-muted);
  max-width: 680px;
  font-size: 1rem;
}

.generator {
  margin-bottom: 3.5rem;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 1.4rem;
  align-items: stretch;
}

.workbench-panel,
.terminal-panel {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.workbench-panel {
  padding: 1.35rem;
}

.panel-title,
.terminal-header {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-code);
  font-size: 0.76rem;
  font-weight: 700;
}

.panel-title {
  margin-bottom: 1.15rem;
  padding-bottom: 0.65rem;
}

.module-name {
  color: var(--green);
  text-align: right;
}

.command-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

label {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

select,
textarea {
  width: 100%;
  color: var(--text);
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

select {
  min-height: 46px;
  padding: 0.65rem 2.3rem 0.65rem 0.8rem;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 19px, calc(100% - 12px) 19px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

textarea {
  min-height: 132px;
  padding: 0.85rem;
  resize: vertical;
  line-height: 1.55;
}

textarea::placeholder {
  color: #647084;
}

select:focus,
textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14);
}

button[type="submit"] {
  min-height: 48px;
  align-self: flex-start;
  color: #06130d;
  background: var(--green);
  border: 0;
  border-bottom: 4px solid var(--green-dark);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  padding: 0.72rem 1.2rem;
  transition: background 0.15s, transform 0.12s, border-bottom-width 0.12s;
}

button[type="submit"]:hover {
  background: var(--green-hover);
  transform: translateY(-1px);
}

button[type="submit"]:active {
  border-bottom-width: 2px;
  transform: translateY(2px);
}

.examples {
  margin-top: 1.15rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.examples p {
  color: var(--text-muted);
  font-family: var(--font-code);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
}

.examples ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
}

.examples a {
  display: inline-flex;
  max-width: 100%;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.35rem 0.52rem;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.examples a::before {
  content: '>';
  color: var(--green);
  font-family: var(--font-code);
  margin-right: 0.4rem;
}

.examples a:hover {
  color: var(--text);
  border-color: rgba(16, 185, 129, 0.55);
  background: rgba(16, 185, 129, 0.08);
}

.terminal-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--terminal);
}

.terminal-header {
  padding: 0 1rem;
  background: #12151c;
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.terminal-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  opacity: 0.75;
}

.terminal-dots span:nth-child(1) { background: var(--red); }
.terminal-dots span:nth-child(2) { background: var(--amber); }
.terminal-dots span:nth-child(3) { background: var(--green); }

.terminal-title {
  color: var(--text-muted);
}

.terminal-body {
  position: relative;
  min-height: 100%;
  flex: 1;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
}

#result {
  min-height: 278px;
  flex: 1;
}

.terminal-placeholder {
  min-height: 278px;
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.6rem;
  color: var(--text-dim);
  border: 1px dashed #283241;
  background:
    linear-gradient(rgba(16, 185, 129, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 185, 129, 0.04) 1px, transparent 1px),
    var(--terminal-soft);
  background-size: 18px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-code);
  text-align: center;
  padding: 1.25rem;
}

.prompt-symbol {
  color: var(--green);
  font-size: 1.2rem;
  font-weight: 800;
}

.htmx-indicator {
  display: none;
  color: var(--amber);
  font-family: var(--font-code);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
}

.htmx-request .htmx-indicator,
.htmx-indicator.htmx-request,
.htmx-request ~ .htmx-indicator {
  display: block;
}

.result-card {
  animation: slideUp 0.22s ease-out;
  min-height: 278px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #283241;
  border-radius: var(--radius-sm);
  background: var(--terminal-soft);
}

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

.result-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.55rem 0.75rem;
  color: var(--text-muted);
  background: #12151c;
  border-bottom: 1px solid #283241;
  font-size: 0.78rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  color: #06130d;
  background: var(--green);
  border-radius: var(--radius-sm);
  font-family: var(--font-code);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  text-transform: uppercase;
}

.placement strong {
  color: var(--text);
}

.code-panel {
  border-bottom: 1px solid #283241;
}

.code-toolbar {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.45rem 0.65rem;
  color: var(--text-muted);
  background: #0c0f14;
  border-bottom: 1px solid #1e2633;
}

.code-toolbar span {
  font-family: var(--font-code);
  font-size: 0.76rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.copy-btn {
  min-height: 32px;
  color: #06130d;
  background: var(--green);
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.32rem 0.68rem;
  transition: background 0.15s, transform 0.12s;
}

.copy-btn:hover {
  background: var(--green-hover);
  transform: translateY(-1px);
}

.copy-btn.copied {
  background: var(--amber);
}

pre {
  max-width: 100%;
  overflow-x: auto;
  background: #020303;
  color: var(--code);
  font-size: 0.85rem;
  line-height: 1.7;
  padding: 1rem;
}

code {
  color: var(--code);
  font-family: var(--font-code);
}

.warnings,
.explanation {
  padding: 0.85rem 1rem;
}

.warnings {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.08);
  border-bottom: 1px solid #283241;
}

.warnings h3,
.explanation h3 {
  color: var(--text);
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.warnings ul {
  display: grid;
  gap: 0.35rem;
  padding-left: 1.1rem;
}

.explanation {
  color: var(--text-muted);
}

.explanation p {
  white-space: pre-wrap;
  font-size: 0.9rem;
}

.result-error {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.45);
  border-radius: var(--radius-sm);
  font-weight: 700;
  padding: 0.9rem 1rem;
}

.categories-grid,
.how-it-works,
.faq {
  margin-bottom: 3rem;
}

.categories-grid h2,
.how-it-works h2,
.faq h2 {
  font-size: 1.35rem;
  margin-bottom: 1rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.85rem;
}

.card {
  min-height: 150px;
  display: block;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-top: 4px solid var(--green);
  border-radius: var(--radius);
  padding: 1rem;
  transition: transform 0.16s, border-color 0.16s, background 0.16s;
}

.card:nth-child(2) { border-top-color: var(--blue); }
.card:nth-child(3) { border-top-color: var(--amber); }
.card:nth-child(4) { border-top-color: var(--red); }
.card:nth-child(5) { border-top-color: #a3a3a3; }
.card:nth-child(6) { border-top-color: #818cf8; }
.card:nth-child(7) { border-top-color: #2dd4bf; }
.card:nth-child(8) { border-top-color: #fb923c; }

.card:hover {
  color: var(--text);
  background: var(--panel-2);
  border-color: rgba(16, 185, 129, 0.45);
  transform: translateY(-2px);
}

.card h3 {
  font-size: 1rem;
  margin-bottom: 0.45rem;
}

.card p {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.how-it-works ol {
  counter-reset: steps;
  display: grid;
  gap: 0.75rem;
  list-style: none;
}

.how-it-works li {
  position: relative;
  min-height: 62px;
  color: var(--text-muted);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  counter-increment: steps;
  padding: 0.85rem 1rem 0.85rem 3.4rem;
}

.how-it-works li::before {
  content: counter(steps);
  position: absolute;
  left: 0.85rem;
  top: 0.85rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #06130d;
  background: var(--amber);
  border-radius: var(--radius-sm);
  font-family: var(--font-code);
  font-weight: 800;
}

.how-it-works strong {
  color: var(--text);
}

details {
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.65rem;
}

summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  padding: 0.85rem 1rem;
}

summary::-webkit-details-marker {
  display: none;
}

summary::before {
  content: '+';
  display: inline-block;
  width: 1.2rem;
  color: var(--green);
  font-family: var(--font-code);
}

details[open] summary {
  border-bottom: 1px solid var(--border);
}

details[open] summary::before {
  content: '-';
}

details p {
  color: var(--text-muted);
  padding: 0.9rem 1rem;
}

.back-link {
  margin-top: 1.5rem;
  font-weight: 700;
}

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

  .terminal-panel {
    min-height: 340px;
  }
}

@media (max-width: 760px) {
  nav {
    min-height: 56px;
  }

  .logo small,
  .nav-links {
    display: none;
  }

  main {
    padding: 1.15rem 1rem 3rem;
  }

  .hero {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 0.45rem;
  }

  .hero-mark {
    grid-row: auto;
    width: 48px;
    height: 48px;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .workbench-panel,
  .terminal-body {
    padding: 1rem;
  }

  .panel-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .module-name {
    text-align: left;
  }

  button[type="submit"] {
    width: 100%;
  }

  .result-meta {
    align-items: flex-start;
    flex-direction: column;
  }
}
