@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root { color-scheme: dark; --bg: #101311; --panel: #171b17; --line: #2c342b; --text: #e5e9df; --muted: #858e80; --accent: #b8f58b; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: 'DM Sans', system-ui, sans-serif; }
button, input, select { font: inherit; }
button, select, input[type="range"], input[type="checkbox"] { cursor: pointer; }
button, select { color: var(--text); }
button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
#viewport:focus { outline: none; }
.topbar { height: 83px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 5%; }
.brand { display: flex; align-items: center; gap: 12px; font-family: 'Space Grotesk', sans-serif; font-size: 21px; font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: 2px; }
.brand-mark { color: var(--accent); font-family: monospace; font-size: 26px; letter-spacing: -3px; margin-right: 9px; }
.brand-sub { font-family: monospace; font-size: 10px; font-weight: 400; color: var(--muted); letter-spacing: 1px; }
.local-badge, .eyebrow, .panel-bar, .viewport-footer, .viewport-corner, .section-label, .control-heading > span, .page-footer { font: 10px/1.6 Consolas, 'Courier New', monospace; letter-spacing: 1px; }
.local-badge { color: var(--muted); display: flex; align-items: center; gap: 9px; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px #b8f58b44; }
main { max-width: 1560px; margin: auto; padding: 0 5%; }
.intro { display: flex; justify-content: space-between; align-items: flex-end; padding: 44px 0 35px; }
.eyebrow { color: var(--accent); margin: 0 0 14px; }
h1 { font-family: 'Space Grotesk', system-ui, sans-serif; font-size: clamp(34px, 4.3vw, 62px); font-weight: 500; letter-spacing: -2.5px; line-height: 1.04; margin: 0; }
h1 span { color: var(--accent); }
.intro-copy { color: var(--muted); font-size: 13px; line-height: 1.9; margin: 0 4px 4px 30px; }
.studio { display: grid; grid-template-columns: minmax(0, 1fr) 292px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.viewport-panel { min-width: 0; display: flex; flex-direction: column; background: #0b0e0c; }
.panel-bar { display: flex; justify-content: space-between; padding: 16px 21px; border-bottom: 1px solid var(--line); color: #c5cbbb; background: #141813; }
.panel-bar .dot { margin-right: 9px; }
.muted, #fps { color: var(--muted); }
#viewport { position: relative; flex: 1; min-height: 510px; overflow: hidden; cursor: grab; touch-action: none; background: radial-gradient(ellipse at center, #17201655, transparent 65%); }
#viewport:active { cursor: grabbing; }
#screen { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; white-space: pre; font-family: 'Courier New', monospace; line-height: 1; font-weight: 400; color: var(--accent); text-shadow: 0 0 7px #b8f58b25; user-select: none; }
.viewport-corner { position: absolute; pointer-events: none; color: #62705e; font-size: 9px; line-height: 1.9; letter-spacing: .6px; }
.top-left { top: 23px; left: 23px; }
.bottom-left { bottom: 21px; left: 23px; }
.bottom-right { bottom: 21px; right: 23px; text-align: right; }
.axis { color: #a3b594; }
.viewport-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; padding: 13px 21px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.viewport-footer > span { margin-right: auto; }
.text-button { background: none; border: none; color: #a9b19e; font: inherit; padding: 3px 0; }
.text-button:hover { color: var(--accent); }
.text-button:disabled { opacity: .5; cursor: wait; }
.clipboard-selection { position: fixed; left: -9999px; top: 0; }
.controls { border-left: 1px solid var(--line); background: var(--panel); padding: 23px; }
.control-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
h2 { font-family: 'Space Grotesk', sans-serif; font-weight: 500; font-size: 18px; margin: 0; letter-spacing: -.4px; }
.control-heading > span { color: #66705e; font-size: 9px; }
.control-section { border-bottom: 1px solid var(--line); padding-bottom: 21px; margin-bottom: 20px; }
.section-label { display: block; color: var(--muted); margin: 0 0 13px; font-size: 9px; }
select { width: 100%; border: 1px solid #364030; border-radius: 4px; padding: 10px; background: #1d241c; font-size: 12px; }
.upload-button { width: 100%; border: 1px dashed #48513e; background: transparent; border-radius: 4px; padding: 13px 10px; margin-top: 10px; display: flex; justify-content: space-between; align-items: center; font-size: 11px; }
.upload-button:hover { background: #232d1f; border-color: var(--accent); }
.upload-button > span:first-child { color: var(--accent); font-size: 18px; }
.upload-button > span:last-child { font: 9px monospace; color: var(--muted); }
.helper { font-size: 10px; color: #7f8975; line-height: 1.7; margin: 10px 0 0; }
#message { font-size: 11px; line-height: 1.5; color: var(--accent); margin: 8px 0 0; overflow-wrap: anywhere; }
#message:empty { display: none; }
#message.error { color: #ffb4a2; }
.range-label { display: flex; justify-content: space-between; align-items: center; font-size: 12px; margin-bottom: 10px; }
output { color: var(--accent); font-family: monospace; font-size: 11px; }
input[type="range"] { width: 100%; height: 3px; accent-color: var(--accent); display: block; margin: 16px 0 25px; }
.field-label { display: block; font-size: 12px; margin: 17px 0 9px; }
.motion-section { padding-bottom: 9px; }
.motion-section .range-label { margin-bottom: 17px; }
.switch { appearance: none; width: 30px; height: 17px; border-radius: 20px; background: #414b3b; margin: 0; transition: background .2s; }
.switch::before { content: ''; display: block; width: 11px; height: 11px; margin: 3px; background: #d7e4cd; border-radius: 50%; transition: transform .2s; }
.switch:checked { background: #6c9c4d; }
.switch:checked::before { transform: translateX(13px); }
.swatches { display: flex; gap: 8px; }
.swatch { width: 15px; height: 15px; background: var(--swatch); border-radius: 50%; border: 2px solid var(--panel); padding: 0; }
.swatch.active { outline: 1px solid var(--swatch); outline-offset: 2px; }
.control-note { display: flex; gap: 12px; color: var(--muted); font: 10px/1.8 monospace; }
.control-note > span { color: var(--accent); }
.control-note p { margin: 0; }
.page-footer { display: flex; justify-content: space-between; gap: 20px; padding: 21px 0 30px; font-size: 9px; color: #75806c; }
.page-footer a { color: #aab69c; text-decoration: none; }
#drop-overlay { display: none; position: absolute; inset: 14px; background: #152210ee; border: 1px dashed var(--accent); align-items: center; justify-content: center; flex-direction: column; color: var(--accent); font: 22px monospace; pointer-events: none; }
#drop-overlay span { font: 12px monospace; color: var(--muted); margin-top: 14px; }
#viewport.dragging #drop-overlay { display: flex; }
@media (min-width: 1500px) { #viewport { min-height: 620px; } }
@media (max-width: 850px) { .studio { grid-template-columns: minmax(0, 1fr) 245px; } .controls { padding: 18px; } .brand-sub { display: none; } .intro-copy { font-size: 11px; } #viewport { min-height: 510px; } .viewport-footer { gap: 12px; padding: 13px; font-size: 8px; } }
@media (max-width: 620px) { .topbar { height: 65px; } .local-badge { font-size: 8px; } .intro { padding: 30px 0; } .intro-copy { display: none; } h1 { font-size: 43px; } .studio { grid-template-columns: 1fr; } #viewport { min-height: 400px; } .controls { border-left: 0; border-top: 1px solid var(--line); } .page-footer { flex-wrap: wrap; font-size: 8px; } .page-footer > span:nth-child(2) { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
