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

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: #050816;
  color: #f8fafc;
  min-height: 100vh;
}

a { color: #c4b5fd; text-decoration: none; }
a:hover { color: #e9d5ff; }

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(5, 8, 22, 0.9);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-nav .brand {
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #f8fafc;
}

.site-nav .links {
  display: flex;
  gap: 1.25rem;
  font-size: 0.95rem;
}

.site-nav .links a.active {
  color: #f9a8d4;
}

.page {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.page-header {
  text-align: center;
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 0.5rem;
}

.page-header p {
  color: #94a3b8;
  max-width: 36rem;
  margin: 0 auto;
  line-height: 1.6;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  align-items: start;
}

.preview-panel {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 1rem;
}

.canvas-wrap {
  background: #111827;
  border-radius: 0.75rem;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
}

canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

.placeholder {
  color: #64748b;
  padding: 4rem 1rem;
  text-align: center;
}

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

.card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 1.25rem;
}

.card h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #94a3b8;
  margin-bottom: 1rem;
}

label {
  display: block;
  font-size: 0.9rem;
  color: #cbd5e1;
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="file"],
input[type="range"] {
  width: 100%;
}

input[type="text"] {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.5rem;
  color: #f8fafc;
  padding: 0.65rem 0.75rem;
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
}

input[type="text"]:focus {
  outline: 2px solid rgba(196, 181, 253, 0.5);
  border-color: transparent;
}

input[type="file"] {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 0.75rem;
}

.range-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.range-row output {
  min-width: 2.5rem;
  text-align: right;
  color: #c4b5fd;
  font-variant-numeric: tabular-nums;
}

.templates {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.template-btn {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.5rem;
  color: #e2e8f0;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.55rem 0.5rem;
  transition: border-color 0.15s, background 0.15s;
}

.template-btn:hover,
.template-btn.active {
  border-color: #c4b5fd;
  background: rgba(196, 181, 253, 0.12);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: none;
  border-radius: 0.6rem;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1rem;
  transition: transform 0.1s, opacity 0.15s;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, #f9a8d4, #c4b5fd);
  color: #0f172a;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f8fafc;
  margin-top: 0.5rem;
}

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