:root {
  color-scheme: light;
  --ink: #21151d;
  --paper: #f1eadc;
  --acid: #ff6b35;
  --lime: #d4f766;
  --plum: #402538;
  --line: rgba(33, 21, 29, .2);
  font-family: "Arial Narrow", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--acid); outline-offset: 2px; }

.topbar { min-height: 68px; padding: 0 4vw; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; color: inherit; font-size: 17px; font-weight: 900; text-decoration: none; letter-spacing: .08em; }
.brand-mark { position: relative; width: 30px; height: 24px; display: inline-block; }
.brand-mark i { position: absolute; width: 18px; height: 18px; border: 2px solid var(--ink); background: var(--paper); }
.brand-mark i:nth-child(1) { left: 0; top: 0; }
.brand-mark i:nth-child(2) { left: 6px; top: 3px; }
.brand-mark i:nth-child(3) { left: 12px; top: 6px; background: var(--acid); }
.topbar > p { margin: 0; font: 700 11px/1 monospace; letter-spacing: .18em; }
.quiet-button { justify-self: end; border: 0; border-bottom: 1px solid currentColor; padding: 5px 0; background: transparent; cursor: pointer; font-size: 13px; }

main { width: min(1480px, 100%); margin: 0 auto; padding: 58px 4vw 80px; }
.intro { display: grid; grid-template-columns: 1.5fr .75fr; gap: 8vw; align-items: end; padding-bottom: 56px; }
.eyebrow, .section-label { margin: 0 0 14px; font: 800 11px/1 monospace; letter-spacing: .15em; text-transform: uppercase; }
.eyebrow::before { content: ""; display: inline-block; width: 34px; height: 4px; margin: 0 10px 2px 0; background: var(--acid); }
h1 { margin: 0; font: 900 clamp(58px, 9vw, 130px)/.82 Arial, "PingFang SC", sans-serif; letter-spacing: -.075em; }
h1 em { color: var(--acid); font-style: normal; }
.lede { max-width: 460px; margin: 0 0 8px; font-size: clamp(17px, 1.7vw, 23px); line-height: 1.65; }
.section-label span { display: inline-grid; width: 25px; height: 25px; margin-right: 9px; place-items: center; border-radius: 50%; background: var(--ink); color: var(--paper); }
.section-label.light span { background: var(--lime); color: var(--ink); }

.preset-strip { padding: 25px 0; border-top: 1px solid var(--line); }
.preset-list { display: flex; flex-wrap: wrap; gap: 9px; }
.preset { border: 1px solid var(--ink); border-radius: 0; padding: 11px 16px; background: transparent; cursor: pointer; font-weight: 800; transition: .18s ease; }
.preset:hover { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--ink); background: var(--lime); }

.workspace { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(390px, .8fr); border: 1px solid var(--ink); }
.mixer-panel { min-width: 0; padding: clamp(22px, 3vw, 42px); background: #faf5e9; }
.panel-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 24px; }
h2 { margin: 0; font-size: 31px; letter-spacing: -.04em; }
h2 b { display: inline-grid; width: 32px; height: 32px; margin-left: 4px; place-items: center; border-radius: 50%; background: var(--acid); color: #fff; font-size: 14px; vertical-align: 5px; }
.add-button { border: 0; padding: 12px 15px; background: var(--ink); color: #fff; cursor: pointer; font-weight: 800; }
.add-button span { color: var(--lime); font-size: 19px; }
.layers { display: grid; gap: 13px; }
.layer-card { border: 1px solid var(--ink); background: var(--paper); }
.layer-top { display: flex; justify-content: space-between; padding: 12px 15px; border-bottom: 1px solid var(--line); }
.layer-identity { display: flex; align-items: center; gap: 9px; }
.grip { font-size: 20px; opacity: .45; }
.layer-actions { display: flex; gap: 5px; }
.layer-actions button { border: 1px solid var(--line); padding: 4px 8px; background: transparent; cursor: pointer; font-size: 12px; }
.layer-actions button:hover { background: var(--ink); color: #fff; }
.controls { display: grid; grid-template-columns: repeat(2, 1fr); gap: 17px 22px; padding: 18px 15px; }
.control > span { display: flex; justify-content: space-between; margin-bottom: 9px; font-size: 12px; font-weight: 700; }
.control output { color: #8b3820; font: 700 11px monospace; }
input[type="range"] { width: 100%; height: 4px; appearance: none; border-radius: 0; background: #cabdaf; accent-color: var(--acid); }
input[type="range"]::-webkit-slider-thumb { width: 15px; height: 21px; appearance: none; border: 1px solid var(--ink); border-radius: 0; background: var(--acid); cursor: ew-resize; }
.layer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 15px; border-top: 1px solid var(--line); }
.color-control { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; }
.color-control input[type="color"] { width: 27px; height: 27px; padding: 0; border: 1px solid var(--ink); background: transparent; }
.color-control input[type="text"] { width: 82px; border: 0; border-bottom: 1px solid var(--ink); padding: 5px; background: transparent; font: 12px monospace; text-transform: uppercase; }
.mode-control { position: relative; cursor: pointer; }
.mode-control input { position: absolute; opacity: 0; }
.mode-control span { display: block; border: 1px solid var(--ink); padding: 7px 11px; font-size: 12px; font-weight: 800; }
.mode-control input:checked + span { background: var(--plum); color: #fff; }

.preview-panel { position: sticky; top: 0; align-self: start; min-width: 0; padding: clamp(22px, 3vw, 42px); background: var(--plum); color: #fff; }
.preview-heading { display: flex; justify-content: space-between; align-items: start; }
.stage-toggle { border: 1px solid rgba(255,255,255,.45); padding: 7px 10px; background: transparent; color: #fff; cursor: pointer; font-size: 12px; }
.preview-panel h2 { margin-bottom: 21px; font-size: 38px; }
.stage { min-height: 400px; display: grid; place-items: center; overflow: hidden; background-color: #eee3d0; background-image: linear-gradient(45deg, rgba(64,37,56,.055) 25%, transparent 25%), linear-gradient(-45deg, rgba(64,37,56,.055) 25%, transparent 25%); background-size: 28px 28px; transition: .25s; }
.stage.dark { background-color: #191217; background-image: linear-gradient(45deg, rgba(255,255,255,.035) 25%, transparent 25%), linear-gradient(-45deg, rgba(255,255,255,.035) 25%, transparent 25%); }
.preview-box { width: clamp(150px, 18vw, 230px); aspect-ratio: 1; display: grid; place-items: center; background: var(--acid); color: var(--ink); transition: box-shadow .12s ease; }
.preview-box span { font: 900 clamp(20px, 2.4vw, 34px)/.83 Arial, sans-serif; letter-spacing: -.06em; }
.code-block { margin-top: 18px; border: 1px solid rgba(255,255,255,.25); background: #1b1119; }
.code-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,.15); color: #bca9b5; font: 11px monospace; }
.code-head button { border: 0; padding: 5px 8px; background: var(--lime); color: var(--ink); cursor: pointer; font-weight: 800; }
pre { min-height: 77px; margin: 0; padding: 15px; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; color: #f7b79e; font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.status { min-height: 19px; margin: 12px 0 0; color: #cfbdc8; font-size: 12px; }
.empty { padding: 42px 20px; border: 1px dashed var(--line); text-align: center; color: #75656f; }
.empty strong { display: block; margin-bottom: 6px; color: var(--ink); font-size: 18px; }

@media (max-width: 900px) {
  .intro { grid-template-columns: 1fr; gap: 30px; }
  .workspace { grid-template-columns: 1fr; }
  .preview-panel { position: static; }
  .stage { min-height: 330px; }
}
@media (max-width: 560px) {
  .topbar { grid-template-columns: 1fr auto; padding: 0 18px; }
  .topbar > p { display: none; }
  main { padding: 40px 18px 60px; }
  h1 { font-size: clamp(52px, 17vw, 78px); }
  .panel-heading { align-items: start; }
  .add-button { padding: 10px; font-size: 12px; }
  .controls { grid-template-columns: 1fr; }
  .layer-bottom { align-items: flex-start; flex-direction: column; }
  .layer-actions button { min-width: 34px; min-height: 30px; }
  .preview-panel { padding: 24px 18px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
