:root {
  --bg: #0f0f0f;
  --panel: #161616;
  --line: #262626;
  --text: #e8e8e8;
  --muted: #8a8a8a;
  --red: #B5151B;
  --red-hover: #961217;
  font-family: 'Barlow', -apple-system, BlinkMacSystemFont, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); }
main { max-width: 1320px; margin: 0 auto; padding: 32px 20px 64px; }

header { display: flex; align-items: center; gap: 24px; margin-bottom: 28px; }
.logo { width: 84px; flex-shrink: 0; }
.eyebrow { font-family: 'Barlow Condensed', sans-serif; font-weight: 500; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--red); margin: 0 0 6px; }
h1 { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 38px; line-height: 1; letter-spacing: 0.02em; text-transform: uppercase; color: #fff; margin: 0 0 6px; }
.sub { color: var(--muted); margin: 0; font-size: 14px; }

.layout { display: grid; grid-template-columns: 320px 1fr; gap: 28px; align-items: start; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } }

#controls { display: flex; flex-direction: column; gap: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 20px; }
label, legend { display: flex; flex-direction: column; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
legend { margin-bottom: 8px; padding: 0; }
.hint { font-weight: 400; text-transform: none; letter-spacing: 0; color: #5c5c5c; }
fieldset { border: 0; margin: 0; padding: 0; }

input[type='text'], input[type='password'] {
  font: inherit; font-size: 16px; color: var(--text); background: #1c1c1c;
  border: 1px solid #2a2a2a; border-radius: 6px; padding: 12px 14px; outline: none;
  text-transform: none; letter-spacing: 0; font-weight: 400;
}
input[type='text']:focus, input[type='password']:focus { border-color: var(--red); }
input[type='range'] { accent-color: var(--red); }

.seg { display: grid; grid-template-columns: 1fr 1fr; background: #1c1c1c; border: 1px solid #2a2a2a; border-radius: 6px; padding: 3px; gap: 3px; }
.seg button { background: transparent; color: var(--muted); padding: 9px 10px; font-size: 14px; }
.seg button[aria-pressed='true'] { background: #2c2c2c; color: #fff; }
.seg button:hover { background: #262626; }

.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.swatch { aspect-ratio: 1; border-radius: 6px; border: 2px solid transparent; padding: 0; box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), inset 0 -2px 0 rgba(0,0,0,0.35); }
.swatch[aria-pressed='true'] { border-color: #fff; }
label.custom { flex-direction: row; align-items: center; gap: 10px; font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--text); margin-top: 10px; cursor: pointer; }
label.custom input { width: 34px; height: 28px; padding: 0; border: 1px solid #2a2a2a; border-radius: 4px; background: none; cursor: pointer; }

button { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 16px; letter-spacing: 0.06em; text-transform: uppercase; color: #fff; background: var(--red); border: 0; border-radius: 6px; padding: 13px 16px; cursor: pointer; transition: background 0.2s; }
button:hover { background: var(--red-hover); }
button:disabled { opacity: 0.35; cursor: not-allowed; background: var(--red); }
#status { min-height: 1.2em; margin: -8px 0 0; font-size: 13px; color: var(--muted); }
#status.error { color: #e05a5a; }

figure { margin: 0; }
canvas { width: 100%; height: auto; display: block; border-radius: 14px; border: 1px solid var(--line); background: #000; }
figcaption { margin-top: 8px; font-size: 12px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }

#gate { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
#gate-form { display: flex; flex-direction: column; gap: 12px; width: min(340px, 100%); }
.gate-logo { width: 90px; margin-bottom: 12px; }
#gate-error { color: #e05a5a; margin: 0; font-size: 13px; }
