:root {
  --bg: #120d0b;
  --bg-2: #1b1411;
  --surface: #221915;
  --line: #3a2c25;
  --text: #f6eee8;
  --muted: #b3a196;
  --fire-1: #ff3d00;
  --fire-2: #ff7a00;
  --fire-3: #ffb000;
  --radius: 14px;
  --font: "Archivo", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(255, 90, 0, 0.16), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Header */
.top { max-width: 1120px; margin: 0 auto; padding: 20px 16px; }
.wordmark {
  font-weight: 900; font-stretch: 112%; letter-spacing: 0.02em;
  color: var(--text); text-decoration: none; font-size: 18px;
}

main { max-width: 1120px; margin: 0 auto; padding: 0 16px 48px; }

/* Hero */
.hero { padding: 28px 0 36px; max-width: 760px; }
.hero h1 {
  font-size: clamp(36px, 7vw, 68px); line-height: 1; margin: 0 0 16px;
  font-weight: 900; font-stretch: 105%; letter-spacing: -0.01em;
}
.fire {
  background: linear-gradient(90deg, var(--fire-1), var(--fire-2) 55%, var(--fire-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { color: var(--muted); font-size: 18px; margin: 0; max-width: 560px; }
.lede strong { color: var(--text); }

/* Layout */
.studio {
  display: grid; gap: 32px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  align-items: start;
}
.preview { position: sticky; top: 24px; }

@media (max-width: 860px) {
  .studio { grid-template-columns: minmax(0, 1fr); }
  .preview { position: static; order: -1; }
}

/* Steps */
.step { margin-bottom: 32px; }
.step h2 {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 800; margin: 0 0 14px; color: var(--text);
}
.num {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--fire-2); color: #1a0f08; font-size: 13px; letter-spacing: 0;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px;
  font: inherit; font-weight: 700; font-size: 15px; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; fill: currentColor; }
.btn-x { background: var(--text); color: #000; }
.btn-x:hover { background: #fff; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { border-color: var(--muted); }
.btn-fire {
  background: linear-gradient(90deg, var(--fire-1), var(--fire-2));
  color: #fff; box-shadow: 0 6px 24px rgba(255, 80, 0, 0.3);
}
.btn-fire:hover:not(:disabled) { filter: brightness(1.08); }

:focus-visible { outline: 2px solid var(--fire-3); outline-offset: 3px; }

/* Sources */
.sources { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.gh {
  display: flex; align-items: center; flex: 1 1 260px; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 0 4px 0 16px; min-height: 44px;
}
.gh:focus-within { border-color: var(--muted); }
.gh-prefix { color: var(--muted); font-size: 15px; }
.gh input {
  flex: 1; min-width: 0; background: none; border: 0; color: var(--text);
  font: inherit; font-size: 15px; padding: 0 4px; outline: none;
}
.gh .btn { min-height: 36px; padding: 0 14px; }

.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 28px 16px; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--line); border-radius: var(--radius); background: var(--bg-2);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.drop span { color: var(--muted); font-size: 14px; }
.drop:hover, .drop.over { border-color: var(--fire-2); background: rgba(255, 122, 0, 0.06); }

.msg { min-height: 1.5em; margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.msg.error { color: #ff8a70; }

/* Tiers */
.tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

.tier {
  display: flex; flex-direction: column; gap: 8px; text-align: left;
  padding: 14px; border-radius: var(--radius); cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--line); color: var(--text); font: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.tier:hover { border-color: var(--muted); }
.tier[aria-checked="true"] { border-color: var(--fire-2); background: rgba(255, 122, 0, 0.08); }
.tier img {
  width: 64px; height: 64px; flex: none; border-radius: 50%;
  background: radial-gradient(circle, #3a2e28 0 62%, #2a201b 63%);
}
.tier-mrr { display: block; font-weight: 900; font-size: 18px; font-stretch: 105%; white-space: nowrap; }
.tier-tag { display: block; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; color: var(--fire-3); text-transform: uppercase; }

/* Three cards side by side only when the controls column has room; otherwise stack as rows */
.controls { container-type: inline-size; }
@container (max-width: 600px) {
  .tiers { grid-template-columns: minmax(0, 1fr); }
  .tier { flex-direction: row; align-items: center; gap: 14px; }
}
.tier-line { font-size: 13px; color: var(--muted); line-height: 1.35; }

/* Actions */
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.howto { margin-top: 18px; color: var(--muted); font-size: 14px; }
.howto summary { cursor: pointer; color: var(--text); font-weight: 600; }
.howto p { margin: 8px 0 0; }
.howto strong, .howto em { color: var(--text); }

/* Preview */
.stage {
  position: relative; aspect-ratio: 1; width: 100%; max-width: 440px; margin: 0 auto;
}
#canvas {
  width: 100%; height: 100%; display: block; border-radius: 50%;
  cursor: grab; touch-action: none; background: var(--bg-2);
  box-shadow: 0 0 0 1px var(--line), 0 30px 80px rgba(0, 0, 0, 0.5);
}
#canvas.dragging { cursor: grabbing; }

.zoom { display: flex; align-items: center; gap: 12px; max-width: 440px; margin: 18px auto 0; }
.zoom label { font-size: 13px; color: var(--muted); font-weight: 600; }
.zoom input { flex: 1; accent-color: var(--fire-2); }
.hint { text-align: center; color: var(--muted); font-size: 13px; margin: 8px 0 0; }

.minis { display: flex; justify-content: center; align-items: flex-end; gap: 24px; margin-top: 18px; }
.minis figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.minis canvas { border-radius: 50%; background: var(--bg-2); }
#mini-l { width: 64px; height: 64px; }
#mini-s { width: 40px; height: 40px; }
.minis figcaption { font-size: 12px; color: var(--muted); }

/* Quote */
.quote {
  margin: 56px 0 0; padding: 28px 0 0; border-top: 1px solid var(--line); max-width: 760px;
}
.quote p { font-size: 18px; line-height: 1.55; margin: 0 0 10px; color: var(--text); }
.quote cite { font-style: normal; color: var(--muted); font-size: 14px; }

.foot { max-width: 1120px; margin: 0 auto; padding: 24px 16px 40px; color: var(--muted); font-size: 13px; }
.foot p { margin: 0; }
.foot .credit { margin-top: 6px; font-size: 12px; }
.foot a { color: var(--text); text-decoration: none; }
.foot a:hover { color: var(--fire-3); }
