:root {
  --bg: #030406;
  --bg-2: #07090d;
  --panel: #0a0d13;
  --panel-2: #0f131b;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #e8edf2;
  --muted: #8b95a4;
  --accent: #33ccff;
  --accent-2: #ff3df2;
  --pro: #ffcf5c;
  --radius: 16px;
  --font: 'Space Grotesk', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.05) 1px, transparent 0) 0 0 / 28px 28px,
    var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.05; }
canvas { display: block; }
.mono { font-family: var(--mono); font-size: 13px; color: var(--muted); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px;
  border: 1px solid var(--line-2); border-radius: 999px;
  background: rgba(255, 255, 255, 0.03); color: var(--text);
  font: 500 15px var(--font); cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.1s;
}
.btn:hover { border-color: var(--accent); background: rgba(51, 204, 255, 0.07); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: progress; }
.btn.primary {
  background: var(--accent); border-color: var(--accent); color: #001018;
  box-shadow: 0 0 0 0 rgba(51, 204, 255, 0.5), 0 8px 30px -8px rgba(51, 204, 255, 0.6);
}
.btn.primary:hover { background: #66dcff; box-shadow: 0 0 0 4px rgba(51, 204, 255, 0.18), 0 8px 30px -8px rgba(51, 204, 255, 0.8); }
.btn.sm { height: 34px; padding: 0 14px; font-size: 13px; }

.icon-btn {
  display: grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line-2); background: transparent; color: var(--text); cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn svg { width: 16px; height: 16px; }

.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

.tag-pro {
  display: inline-block; margin-left: 6px; padding: 1px 5px; border-radius: 4px;
  background: rgba(255, 207, 92, 0.14); color: var(--pro);
  font: 600 9px/1.4 var(--mono); letter-spacing: 0.06em; vertical-align: middle;
}
body.is-pro .tag-pro { display: none; }

.eyebrow {
  margin: 0 0 14px; color: var(--accent);
  font: 500 12px var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
}

/* ---------- nav ---------- */

.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  height: 64px; padding: 0 var(--gutter);
  background: rgba(3, 4, 6, 0.94);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font: 600 17px var(--font); letter-spacing: -0.01em; }
.brand svg { width: 26px; height: 26px; color: var(--accent); filter: drop-shadow(0 0 6px rgba(51, 204, 255, 0.6)); }
.brand b { color: var(--accent); font-weight: 600; }
.links { display: flex; gap: 28px; margin-left: auto; color: var(--muted); font-size: 15px; }
.links a:hover { color: var(--text); }
.pro-btn { height: 36px; padding: 0 16px; font-size: 14px; border-color: rgba(255, 207, 92, 0.4); color: var(--pro); }
.pro-btn:hover { border-color: var(--pro); background: rgba(255, 207, 92, 0.08); }
.pro-btn.active { background: rgba(255, 207, 92, 0.12); }

/* ---------- hero ---------- */

.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(24px, 5vw, 72px);
  min-height: min(calc(100vh - 64px), 940px); padding: 48px var(--gutter);
  max-width: 1360px; margin: 0 auto;
}
.hero h1 { font-size: clamp(44px, 6.4vw, 92px); font-weight: 700; letter-spacing: -0.04em; line-height: 0.98; }
.grad {
  background: linear-gradient(100deg, var(--accent) 10%, #a78bfa 55%, var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { max-width: 520px; margin: 28px 0 32px; color: var(--muted); font-size: 18px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-stage { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.hero-frame {
  position: relative; width: min(100%, 620px); aspect-ratio: 1;
  border-radius: 28px; overflow: hidden; border: 1px solid var(--line);
  box-shadow: 0 40px 120px -40px rgba(51, 204, 255, 0.35);
}
.hero-frame canvas { width: 100%; height: 100%; }
.hint { margin: 0; color: var(--muted); font-size: 13px; text-align: center; }
.hint em { color: var(--text); font-style: normal; }

/* segmented control */
.seg { display: inline-flex; flex-wrap: wrap; padding: 4px; gap: 2px; border: 1px solid var(--line-2); border-radius: 999px; background: rgba(255, 255, 255, 0.02); }
.seg button {
  height: 32px; padding: 0 14px; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted); font: 500 13px var(--font); cursor: pointer;
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed='true'] { background: var(--text); color: #05070a; }

/* ---------- principles ---------- */

.principles {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 1360px; margin: 0 auto; padding: 0 var(--gutter);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.principles > div { padding: 36px 32px 40px 0; }
.principles > div + div { padding-left: 32px; border-left: 1px solid var(--line); }
.principles .num { font: 500 11px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.principles h3 { margin: 14px 0 8px; font-size: 22px; }
.principles p { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- sections ---------- */

.section { max-width: 1360px; margin: 0 auto; padding: 112px var(--gutter) 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 20px; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(34px, 4.4vw, 56px); font-weight: 600; }
.sub { margin: 14px 0 0; color: var(--muted); }

/* ---------- gallery ---------- */

.rows { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.row { border-bottom: 1px solid var(--line); }
.row[hidden] { display: none; }
.row-head {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto 28px; align-items: center; gap: 24px;
  width: 100%; padding: 22px 4px; border: 0; background: none; color: var(--text);
  font: inherit; text-align: left; cursor: pointer;
}
.row-index { font: 500 12px var(--mono); color: var(--muted); letter-spacing: 0.1em; }
.row-title { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.row-name { font-size: clamp(22px, 2.4vw, 30px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; transition: color 0.2s; }
.row-blurb { color: var(--muted); font-size: 14px; }
.row-head:hover .row-name, .row.open .row-name { color: var(--accent); }
.row-thumbs { display: flex; transition: opacity 0.3s; }
.row-thumbs img { width: 48px; height: 48px; border-radius: 10px; border: 2px solid var(--bg); background: #000; }
.row-thumbs img + img { margin-left: -14px; }
.row.open .row-thumbs { opacity: 0; }
.row-meta { font: 12px var(--mono); color: var(--muted); white-space: nowrap; }
.chev { position: relative; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-2); transition: transform 0.35s, border-color 0.2s; }
.chev::before { content: ''; position: absolute; left: 50%; top: 45%; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translate(-50%, -50%) rotate(45deg); }
.row-head:hover .chev { border-color: var(--accent); }
.row.open .chev { transform: rotate(180deg); border-color: var(--accent); color: var(--accent); }
.row-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 8px; }
.row-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.45s cubic-bezier(0.2, 0.7, 0.2, 1); }
.row.open .row-body { grid-template-rows: 1fr; }
.row-inner { min-height: 0; overflow: hidden; }
.row-inner .grid { padding: 4px 0 32px; }
@media (prefers-reduced-motion: reduce) { .row-body, .chev, .row-thumbs { transition: none; } }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.card {
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--panel); transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.card:hover { border-color: var(--line-2); transform: translateY(-3px); box-shadow: 0 24px 60px -30px rgba(51, 204, 255, 0.4); }
.card-art { position: relative; aspect-ratio: 1; cursor: pointer; }
.card-art canvas { width: 100%; height: 100%; }
.badge {
  position: absolute; top: 12px; left: 12px; padding: 3px 8px; border-radius: 6px;
  font: 600 10px/1.4 var(--mono); letter-spacing: 0.1em;
}
.badge.free { background: rgba(20, 24, 32, 0.85); color: var(--text); }
.badge.pro { background: rgba(40, 32, 10, 0.85); color: var(--pro); border: 1px solid rgba(255, 207, 92, 0.3); }
.card-body { display: flex; flex-direction: column; justify-content: space-between; gap: 14px; flex: 1; padding: 16px 18px 18px; border-top: 1px solid var(--line); }
.card-body h3 { font-size: 18px; font-weight: 600; }
.card-body p { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.card-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-icons { display: flex; gap: 6px; }

/* ---------- studio ---------- */

.studio { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.stage-col { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 12px; }
.stage {
  --arw: 9; --arh: 16;
  width: min(100%, calc(72vh * var(--arw) / var(--arh)));
  aspect-ratio: var(--arw) / var(--arh);
  margin: 0 auto; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: #000;
}
.stage canvas { width: 100%; height: 100%; }
.playbar { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); }
.playbar input { flex: 1; }
.playbar .mono { width: 34px; text-align: right; }
.pro-note { margin: 0; padding: 10px 14px; border-radius: 12px; background: rgba(255, 207, 92, 0.07); border: 1px solid rgba(255, 207, 92, 0.2); color: #f3dfa8; font-size: 14px; }

.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.group { border-bottom: 1px solid var(--line); }
.group summary {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; cursor: pointer; list-style: none;
  font: 500 11px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.group summary::-webkit-details-marker { display: none; }
.group summary::after { content: '+'; font-size: 14px; }
.group[open] summary::after { content: '−'; }
.group-body { display: flex; flex-direction: column; gap: 16px; padding: 0 18px 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field[hidden] { display: none; }
.label { display: flex; align-items: center; font-size: 13px; color: var(--text); }
.label output { margin-left: auto; font: 12px var(--mono); color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 30px; padding: 0 11px; border-radius: 8px;
  border: 1px solid var(--line-2); background: transparent; color: var(--muted);
  font: 500 13px var(--font); cursor: pointer;
}
.chip:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.3); }
.chip[aria-pressed='true'] { color: #001018; background: var(--accent); border-color: var(--accent); }
.chip[aria-pressed='true'] .tag-pro { background: rgba(0, 0, 0, 0.18); color: #001018; }

.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.swatch {
  position: relative; aspect-ratio: 1; border-radius: 50%; cursor: pointer;
  border: 3px solid var(--sw-bg); background: var(--sw);
  box-shadow: 0 0 0 1px var(--line-2);
}
.swatch[aria-pressed='true'] { box-shadow: 0 0 0 2px var(--text); }
.swatch.is-pro::after {
  content: ''; position: absolute; right: -2px; top: -2px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--pro); box-shadow: 0 0 0 2px var(--panel);
}
body.is-pro .swatch.is-pro::after { display: none; }

input[type='range'] { -webkit-appearance: none; appearance: none; width: 100%; height: 20px; background: transparent; cursor: pointer; }
input[type='range']::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: var(--line-2); }
input[type='range']::-moz-range-track { height: 3px; border-radius: 3px; background: var(--line-2); }
input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5.5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(51, 204, 255, 0.7); }
input[type='range']::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(51, 204, 255, 0.7); }

.toggle { display: flex; align-items: center; gap: 10px; font-size: 13px; cursor: pointer; }
.toggle input { -webkit-appearance: none; appearance: none; position: relative; flex: none; width: 34px; height: 20px; margin: 0; border-radius: 999px; background: var(--line-2); cursor: pointer; transition: background 0.2s; }
.toggle input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--text); transition: transform 0.2s; }
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { transform: translateX(14px); background: #001018; }

.export { display: flex; flex-direction: column; gap: 16px; padding: 18px; background: var(--panel-2); }
.export h3 { font: 500 11px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.export-btns { display: grid; gap: 8px; }
.progress { display: flex; flex-direction: column; gap: 6px; }
.progress[hidden] { display: none; }
.bar { height: 4px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.15s; }
.fine { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

/* ---------- pricing ---------- */

.tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.tier { position: relative; display: flex; flex-direction: column; gap: 18px; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.tier h3 { font-size: 20px; font-weight: 600; }
.price { margin: 0; font-size: 48px; font-weight: 700; letter-spacing: -0.03em; }
.price small { font-size: 15px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.tier ul { flex: 1; margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; align-content: start; color: var(--muted); font-size: 15px; }
.tier li { display: flex; gap: 10px; }
.tier li::before { content: ''; flex: none; width: 10px; height: 10px; margin-top: 7px; border: 1.5px solid var(--accent); transform: rotate(45deg) scale(0.8); }
.tier.featured { border-color: rgba(51, 204, 255, 0.5); background: linear-gradient(180deg, rgba(51, 204, 255, 0.08), var(--panel) 60%); box-shadow: 0 30px 80px -40px rgba(51, 204, 255, 0.5); }
.ribbon { position: absolute; top: -11px; right: 24px; padding: 3px 10px; border-radius: 999px; background: var(--accent); color: #001018; font: 600 11px var(--mono); }

/* ---------- footer ---------- */

.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; max-width: 1360px; margin: 120px auto 0; padding: 28px var(--gutter) 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* ---------- modal & toast ---------- */

dialog { padding: 0; border: 0; background: transparent; color: var(--text); max-width: calc(100vw - 32px); }
dialog::backdrop { background: rgba(0, 0, 0, 0.78); }
.modal { position: relative; width: 460px; max-width: 100%; padding: 32px; border: 1px solid rgba(255, 207, 92, 0.3); border-radius: 22px; background: var(--panel); box-shadow: 0 40px 120px -30px rgba(255, 207, 92, 0.25); }
.modal h2 { font-size: 30px; }
.modal .eyebrow { color: var(--pro); }
.close { position: absolute; top: 14px; right: 16px; width: 32px; height: 32px; border: 0; background: none; color: var(--muted); font-size: 24px; cursor: pointer; }
.needs { margin: 16px 0 0; padding: 10px 12px; border-radius: 10px; background: rgba(255, 207, 92, 0.08); color: #f3dfa8; font-size: 14px; }
.needs b { color: var(--pro); font-weight: 600; }
.modal-list { margin: 18px 0 24px; padding-left: 18px; color: var(--muted); display: grid; gap: 6px; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.modal-actions .primary { background: var(--pro); border-color: var(--pro); color: #1a1200; box-shadow: none; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50;
  padding: 12px 18px; border-radius: 12px; border: 1px solid var(--line-2);
  background: rgba(15, 19, 27, 0.95); font-size: 14px;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: 0.25s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-top: 40px; }
  .studio { grid-template-columns: minmax(0, 1fr); }
  .stage-col { position: static; }
  .stage { width: min(100%, calc(60vh * var(--arw) / var(--arh))); }
  .tiers { grid-template-columns: minmax(0, 1fr); }
  .principles { grid-template-columns: minmax(0, 1fr); }
  .principles > div, .principles > div + div { padding: 28px 0; border-left: 0; }
  .principles > div + div { border-top: 1px solid var(--line); }
}
@media (max-width: 860px) {
  .row-head { grid-template-columns: auto minmax(0, 1fr) auto 28px; gap: 16px; }
  .row-thumbs { display: none; }
}
@media (max-width: 640px) {
  .links { display: none; }
  .row-head { grid-template-columns: minmax(0, 1fr) 28px; padding: 18px 0; }
  .row-index, .row-meta { display: none; }
  .playbar { flex-wrap: wrap; border-radius: 16px; }
  .playbar input { flex-basis: 100%; order: -1; }
  .pro-btn { margin-left: auto; }
  .section { padding-top: 80px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card-body { padding: 12px; }
  .card-body p { display: none; }
  .seg button { padding: 0 10px; }
}
@media (max-width: 420px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .card-body p { display: block; }
}
