:root {
  --ink: #f6efe6;
  --muted: rgb(246, 239, 230, 0.62);
  --glass: rgb(255, 244, 230, 0.09);
  --glass-line: rgb(255, 244, 230, 0.2);
  --accent: #f3c64e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #1a1210;
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60vmax 50vmax at 12% 8%, #c2410c 0%, transparent 60%),
    radial-gradient(55vmax 45vmax at 92% 20%, #7c3aed 0%, transparent 58%),
    radial-gradient(60vmax 50vmax at 70% 100%, #b45309 0%, transparent 60%),
    #1a1210;
}

.nav {
  position: sticky;
  top: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1120px;
  width: calc(100% - 32px);
  margin: 12px auto 0;
  padding: 8px 8px 8px 20px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  backdrop-filter: blur(18px) saturate(1.3);
}

.brand { font-weight: 700; letter-spacing: 0.02em; }
.nav nav { display: flex; gap: 4px; }

.nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 999px;
}

.nav a:hover,
.nav a:focus-visible { background: rgb(255, 255, 255, 0.14); outline: none; }

main { max-width: 1120px; margin: 0 auto; padding: 0 16px 40px; }
.hero { padding: 48px 0 24px; text-align: center; }
.hero h1 { margin: 0 0 8px; font-size: clamp(2rem, 6vw, 3.4rem); line-height: 1.1; }
.hero p { margin: 0 auto; max-width: 36rem; color: var(--muted); font-size: 1.1rem; }

.panel {
  border-radius: 24px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  backdrop-filter: blur(22px) saturate(1.3);
  padding: 20px;
}

.panel h2 {
  margin: 20px 0 10px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.panel h2:first-child { margin-top: 0; }

.studio { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }

.stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  border-radius: 16px;
  overflow: hidden;
  background: #0c0d12;
  transition: background 0.2s;
}

.stage[data-bg="light"] { background: #f4f1ec; }

.stage[data-bg="clear"] {
  background: repeating-conic-gradient(#2a2a2e 0% 25%, #3a3a40 0% 50%) 0 0 / 24px 24px;
}

.stage canvas { max-width: 640px; width: 100%; height: auto; touch-action: none; cursor: crosshair; }

.drop,
.notice {
  position: absolute;
  margin: 0;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgb(0, 0, 0, 0.7);
  color: #fff;
  font-size: 0.9rem;
}

.drop { inset: 12px; display: grid; place-items: center; border: 2px dashed var(--accent); font-size: 1.1rem; }
.drop[hidden],
.notice[hidden] { display: none; }
.notice { left: 12px; right: 12px; bottom: 12px; text-align: center; }

.stage-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.samples { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.file input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.file span,
.pill {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--glass-line);
  background: rgb(255, 255, 255, 0.08);
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
}

.file:focus-within span,
.pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.file span:hover,
.pill:hover { background: rgb(255, 255, 255, 0.18); }
.pill.on { background: var(--accent); color: #1a1210; border-color: var(--accent); }
.pill.solid { background: var(--ink); color: #1a1210; border-color: var(--ink); font-weight: 600; }
.pill:disabled { opacity: 0.6; cursor: progress; }

.presets { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row { display: grid; grid-template-columns: 110px 1fr 44px; align-items: center; gap: 10px; margin: 8px 0; font-size: 0.95rem; }
.row input[type="range"] { width: 100%; accent-color: var(--accent); }
.row output { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.tint-row { grid-template-columns: 110px auto; margin-top: 12px; }
.tint-row[hidden] { display: none; }
.tint-row input { width: 56px; height: 34px; border: 0; padding: 0; background: none; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.embed { margin-top: 20px; }
.embed p { max-width: 46rem; }

pre {
  margin: 12px 0;
  padding: 14px;
  border-radius: 14px;
  background: rgb(0, 0, 0, 0.45);
  overflow-x: auto;
  font: 0.85rem/1.5 ui-monospace, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-all;
}

code { font: 0.9em ui-monospace, Consolas, monospace; }
footer { max-width: 1120px; margin: 0 auto; padding: 0 16px 40px; color: var(--muted); font-size: 0.85rem; text-align: center; }

@media (width <= 860px) {
  .studio { grid-template-columns: 1fr; }
  .row { grid-template-columns: 96px 1fr 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .stage { transition: none; }
}
