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

:root {
  --bg: #f4efe6;
  --bg-deep: #efe3d1;
  --ink: #201a14;
  --muted: #5e5348;
  --accent: #e48a4d;
  --accent-dark: #c56b2e;
  --cream: #fff7ee;
  --shadow: rgba(32, 26, 20, 0.2);
}

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

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 10%, #fff5ea 0%, transparent 40%),
    radial-gradient(circle at 90% 20%, #ffe7d4 0%, transparent 42%),
    linear-gradient(120deg, var(--bg) 0%, var(--bg-deep) 100%);
  color: var(--ink);
  font-family: "Space Grotesk", sans-serif;
  image-rendering: pixelated;
}

img {
  image-rendering: pixelated;
  display: block;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.page {
  position: relative;
  padding: 32px 20px 56px;
}

.hero {
  max-width: 960px;
  margin: 0 auto 28px;
  text-align: left;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--cream);
  border: 1px solid #ead6c5;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  font-family: "Fraunces", serif;
  font-size: clamp(40px, 6vw, 64px);
  margin: 18px 0 6px;
}

.hero__lead {
  font-size: clamp(16px, 2.4vw, 22px);
  color: var(--muted);
  margin: 0 0 8px;
}

.hero__meta {
  margin: 0;
  color: var(--muted);
}

.shell {
  max-width: 1040px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 20px;
  align-items: start;
}

.builder,
.preview {
  background: var(--cream);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 20px 40px var(--shadow);
  border: 1px solid #ead6c5;
}

.preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.builder__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.builder__header h2 {
  font-size: 20px;
  margin: 0;
}

.builder__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border-radius: 16px;
  border: 1px dashed #e0c6b1;
  background: #fffdf9;
  font-size: 14px;
}

.builder__base {
  color: var(--muted);
}

.builder__row select,
.builder__row input,
.builder__arg select,
.builder__arg input {
  font-family: "Space Grotesk", sans-serif;
  border-radius: 10px;
  border: 1px solid #e0c6b1;
  padding: 6px 10px;
  background: #fff;
  color: var(--ink);
}

.builder__row input {
  min-width: 160px;
}

.builder__actions {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.builder__arg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  background: #fffaf3;
  border-radius: 12px;
  border: 1px solid #ead6c5;
  margin-right: 8px;
  flex-wrap: wrap;
}

.arg-remove {
  border: none;
  background: #f2e3d2;
  color: var(--muted);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.btn--disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.builder__error {
  color: #b1441f;
  margin: 8px 0 0;
  min-height: 20px;
}

.preview__frame {
  background: #1d1611;
  border-radius: 20px;
  padding: 22px;
  display: grid;
  place-items: center;
  min-height: 280px;
}

.preview__actions {
  display: flex;
  justify-content: center;
  margin-top: 6px;
}

.preview img {
  width: min(320px, 80vw);
  height: auto;
}

.preview__hint {
  margin-top: 4px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.btn {
  cursor: pointer;
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 600;
  font-family: "Space Grotesk", sans-serif;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn--ghost {
  background: transparent;
  border: 1px solid #e0c6b1;
  color: var(--muted);
}

.btn--accent {
  background: var(--accent);
  color: #1a0e06;
  box-shadow: 0 10px 18px rgba(228, 138, 77, 0.3);
}

.btn:hover {
  transform: translateY(-1px);
}

.footer {
  margin-top: 32px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.footer p {
  margin: 6px 0;
}

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

@media (max-width: 600px) {
  .builder__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .builder__row {
    padding: 10px;
  }
}
