:root {
  --ink: #141414;
  --paper: #fbf4e8;
  --cream: #f3e7d4;
  --accent: #e63e2b;
  --accent-2: #f0b32e;
  --deep: #223126;
  --shadow: rgba(20, 20, 20, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #fff3da 0%, #f1e5cf 35%, #e8ddc6 100%);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.bg-wash::before,
.bg-wash::after {
  content: "";
  position: fixed;
  inset: -20%;
  background:
    repeating-linear-gradient(120deg, rgba(20, 20, 20, 0.04) 0 1px, transparent 1px 30px),
    radial-gradient(circle at 20% 20%, rgba(230, 62, 43, 0.15) 0, transparent 55%),
    radial-gradient(circle at 80% 10%, rgba(34, 49, 38, 0.18) 0, transparent 60%),
    radial-gradient(circle at 70% 80%, rgba(240, 179, 46, 0.12) 0, transparent 60%);
  z-index: -2;
}

.bg-wash::after {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cpath d='M0 10h120M0 40h120M0 70h120M0 100h120' stroke='%23141414' stroke-opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.4;
  z-index: -1;
}

section,
header,
footer {
  width: min(1100px, 92vw);
  margin: 0 auto;
  padding: 4rem 0;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 3rem;
  align-items: center;
  padding-top: 5rem;
}

.hero-copy h1 {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(3.5rem, 10vw, 7rem);
  letter-spacing: 0.04em;
  margin: 0 0 1rem;
}

.stamp {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: var(--paper);
  box-shadow: 6px 6px 0 var(--ink);
}

.tagline {
  font-size: 1.1rem;
  max-width: 34ch;
  margin-bottom: 2rem;
}

.cta-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-art {
  position: relative;
  display: grid;
  place-items: center;
  background: var(--paper);
  padding: 2rem;
  border-radius: 20px;
  box-shadow: 0 20px 40px var(--shadow);
  transform: rotate(-1.5deg);
}

.hero-art img {
  width: min(360px, 80vw);
  height: auto;
  display: block;
}

.caption {
  margin-top: 1rem;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.contract {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: var(--deep);
  color: var(--paper);
  padding: 2rem;
  border-radius: 18px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.contract h2 {
  margin: 0 0 0.5rem;
}

.contract-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(0, 0, 0, 0.4);
  padding: 1rem 1.2rem;
  border-radius: 14px;
  max-width: 100%;
}

.contract-box code {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.95rem;
  word-break: break-all;
}

.section-head h2 {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin: 0 0 0.5rem;
}

.section-head p {
  max-width: 50ch;
  margin: 0;
}

.generator-grid {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 2rem;
}

.chart-card {
  margin-top: 2rem;
  background: var(--paper);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 20px 40px var(--shadow);
  display: grid;
  gap: 1rem;
  position: relative;
}

.chart-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.5rem;
  color: var(--ink);
  opacity: 0.5;
  z-index: 0;
}

.chart-card iframe {
  width: 100%;
  height: 520px;
  border: none;
  border-radius: 14px;
  background: transparent;
  position: relative;
  z-index: 1;
}

.chart-link {
  justify-self: flex-end;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
}

.btn.success {
  background: #22c55e;
  color: white;
  border-color: #22c55e;
}


.panel {
  background: var(--paper);
  border-radius: 18px;
  padding: 2rem;
  box-shadow: 0 20px 40px var(--shadow);
}

.controls label {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
  font-size: 0.95rem;
}

.controls input[type="text"],
.controls input[type="file"] {
  padding: 0.6rem 0.8rem;
  border: 1px solid #d8cbb5;
  border-radius: 10px;
  font-family: inherit;
  background: #fffdf8;
}

.controls select {
  padding: 0.6rem 0.8rem;
  border: 1px solid #d8cbb5;
  border-radius: 10px;
  font-family: inherit;
  background: #fffdf8;
}

.controls input[type="range"] {
  width: 100%;
}

.range-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #6f6458;
}

.button-row {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.btn {
  border: none;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 8px 18px rgba(20, 20, 20, 0.15);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(20, 20, 20, 0.18);
}

.btn.primary {
  background: var(--accent);
  color: #fff;
}

.btn.ghost {
  background: transparent;
  border: 2px solid var(--ink);
}

.btn.tiny {
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
  background: var(--accent-2);
}

.preview .canvas-shell {
  background: #111;
  border-radius: 14px;
  padding: 1rem;
  display: grid;
  place-items: center;
}

.preview canvas {
  width: 100%;
  height: auto;
  max-height: 260px;
  background: #111;
}

.hint {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: #6f6458;
}

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

.preview-card {
  display: grid;
  gap: 0.75rem;
}

.lore-grid,
.link-grid {
  margin-top: 2rem;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.lore-card {
  padding: 1.6rem;
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 18px 30px var(--shadow);
}

.lore-card h3 {
  margin-top: 0;
}

.link-card {
  padding: 1.6rem;
  border-radius: 16px;
  background: var(--paper);
  text-decoration: none;
  color: inherit;
  box-shadow: 0 18px 30px var(--shadow);
  display: grid;
  gap: 0.5rem;
}

.link-card .label {
  font-weight: 600;
}

.how-grid {
  margin-top: 2rem;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.how-card {
  background: var(--paper);
  padding: 1.6rem;
  border-radius: 16px;
  box-shadow: 0 18px 30px var(--shadow);
}

.how-card .step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  font-weight: 700;
  background: var(--accent-2);
  margin-bottom: 0.8rem;
}

.footer {
  padding-bottom: 5rem;
  text-align: center;
  color: #6f6458;
}

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

  .hero {
    padding-top: 3rem;
  }

  section,
  header,
  footer {
    padding: 3rem 0;
  }

  .chart-card iframe {
    height: 380px;
  }

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

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