@font-face {
  font-family: 'Geist Pixel';
  src: url('GeistPixel-Regular-VariableFont_ELSH.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #1c0f0f;
  --hairline: #d9d3d3;
  --muted: #716969;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 18px;
  background: #fff;
  color: var(--ink);
  font-family: 'Geist Pixel', monospace;
}
.frame {
  display: grid;
  grid-template-columns: minmax(0, 350px) minmax(0, 1fr);
  width: min(100%, 1360px);
  min-height: min(690px, calc(100vh - 36px));
  border: 1px solid var(--ink);
}
.controls-panel {
  min-width: 0;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  padding: 32px 30px 26px;
  border-right: 1px solid var(--ink);
}
.panel-header { margin-bottom: 24px; }
.mode-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.mode-options label { display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 32px; border: 1px solid var(--hairline); border-radius: 4px; font-size: 11px; cursor: pointer; }
.mode-options label:has(input:checked) { border-color: var(--ink); background: #f3f0f5; }
.mode-options input { margin: 0; accent-color: var(--ink); }
.eyebrow {
  margin: 0 0 8px;
  font-size: 10px;
  line-height: 1.2;
}
h1, h2 { font-weight: 400; }
h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}
.actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  margin-bottom: 23px;
}
.actions > * { min-width: 0; }
button {
  min-width: 0;
  min-height: 36px;
  padding: 5px 6px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: #000;
  color: #fff;
  font: 400 12px/1.1 'Geist Pixel', monospace;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s ease, transform .15s ease;
}
button:hover { background: #292929; }
button:active { transform: translateY(1px); }
button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
button:disabled { cursor: wait; opacity: .6; }
.secondary-action,
.download-menu > summary {
  display: grid;
  place-items: center;
  min-height: 36px;
  padding: 5px 6px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font: 400 12px/1.1 'Geist Pixel', monospace;
  list-style: none;
  cursor: pointer;
}
.secondary-action:hover,
.download-menu > summary:hover { background: #f3f0f5; }
.download-menu { position: relative; }
.download-menu > summary::-webkit-details-marker { display: none; }
.download-menu > summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.download-options {
  position: absolute;
  z-index: 20;
  top: calc(100% + 5px);
  right: 0;
  display: grid;
  gap: 5px;
  width: 150px;
  padding: 6px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 7px 20px rgb(28 15 15 / 12%);
}
.download-options button { width: 100%; text-align: left; }
.download-menu[aria-disabled="true"] { pointer-events: none; opacity: .6; }
input:disabled, select:disabled { cursor: wait; opacity: .55; }

.control-section {
  width: 100%;
  padding: 0;
  border-top: 1px solid var(--hairline);
}
.control-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  list-style: none;
  cursor: pointer;
}
.control-section summary::-webkit-details-marker { display: none; }
.control-section summary::after {
  content: '+';
  flex: 0 0 auto;
  margin-left: 16px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}
.control-section[open] summary::after { content: '−'; }
.control-section summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.control-section-body { padding: 0 0 20px; }
.control-section h2 {
  margin: 0;
  font-size: 13px;
  line-height: 1.2;
}
.range-control {
  display: grid;
  grid-template-columns: 83px minmax(0, 1fr) 64px;
  align-items: center;
  gap: 10px;
  width: 100%;
  font-size: 12px;
  line-height: 1.2;
}
.range-control + .range-control { margin-top: 13px; }
.range-control label { white-space: nowrap; }
.range-control input {
  width: 100%;
  min-width: 0;
  margin: 0;
  accent-color: var(--ink);
  cursor: pointer;
}
.range-control input:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.range-control output {
  display: block;
  min-width: 64px;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.roundness-mode {
  display: grid;
  grid-template-columns: 83px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 19px;
  font-size: 12px;
}
.roundness-mode label { white-space: nowrap; }
.roundness-mode select {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: 4px 6px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: #fff;
  color: inherit;
  font: inherit;
}
.roundness-mode select:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.all-corners-control { margin-bottom: 16px; }
.all-corners-control output { overflow: visible; }
.select-control {
  display: grid;
  grid-template-columns: 83px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  font-size: 12px;
}
.select-control + .select-control { margin-top: 12px; }
.select-control select {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: 4px 6px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: #fff;
  color: inherit;
  font: inherit;
}
.select-control select:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.control-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}
.animation-easing { margin-top: 16px; }
.trim-controls {
  display: grid;
  gap: 13px;
  width: 100%;
  margin: 18px 0 0;
  padding: 16px 0 0;
  border: 0;
  border-top: 1px solid var(--hairline);
}
.trim-controls legend { padding: 0; font-size: 12px; }
.trim-controls .range-control { grid-template-columns: 83px minmax(0, 1fr) 64px; }
.toggle-control,
.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  font-size: 12px;
  cursor: pointer;
}
.toggle-control input,
.sound-toggle input { margin: 0; accent-color: var(--ink); }
.toggle-control input:focus-visible,
.sound-toggle input:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.corner-controls {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
}
.motion-controls {
  display: grid;
  gap: 12px;
  width: 100%;
  margin-top: 18px;
  font-size: 12px;
}
.motion-controls label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.motion-controls input { margin: 0; accent-color: var(--ink); }
.motion-controls input:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.wave-control {
  display: grid;
  grid-template-columns: 83px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 12px 0 0;
  padding: 0;
  border: 0;
  font-size: 12px;
}
.wave-control legend {
  grid-column: 1;
  width: 83px;
  margin: 0;
  padding: 0;
}
.wave-options {
  display: flex;
  grid-column: 2;
  gap: 6px;
}
.wave-options label { position: relative; cursor: pointer; }
.wave-options input,
.wave-random input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.wave-dot {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font: 400 14px/1 'Geist Pixel', monospace;
}
.wave-options input:checked + .wave-dot { border-color: var(--ink); background: var(--ink); color: #fff; }
.wave-options input:focus-visible + .wave-dot,
.wave-random input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }
.wave-options input:disabled + .wave-dot,
.wave-random input:disabled + span { cursor: not-allowed; opacity: .45; }
.wave-random {
  position: relative;
  display: block;
  grid-column: 2;
  cursor: pointer;
}
.wave-random span {
  display: grid;
  place-items: center;
  min-height: 32px;
  border: 1px solid var(--hairline);
  border-radius: 4px;
}
.wave-random input:checked + span { border-color: var(--ink); background: #f3f0f5; }
.sound-range { margin-top: 13px; }
.sound-toggle { margin-top: 18px; }
.test-sound { width: 100%; margin-top: 18px; }

.preview-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-self: stretch;
  min-width: 0;
  min-height: min(690px, calc(100vh - 36px));
  padding: 32px 58px 25px;
}
.preview-panel h2 {
  margin: 0;
  font-size: 12px;
  line-height: 1.2;
}
.preview-canvas {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 360px;
  padding: 36px 12px;
}
.grid-toggle {
  position: absolute;
  z-index: 3;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
}
.grid-toggle:hover { background: #f3f0f5; }
.grid-toggle[aria-pressed="false"] { color: var(--muted); }
.grid-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.35; }
.preview-canvas.grid-hidden .preview-grid { display: none; }
.logo-slot {
  position: relative;
  max-width: 100%;
  aspect-ratio: 264.03 / 147;
}
.logo-slot svg { position: relative; z-index: 1; display: block; width: 100%; height: 100%; overflow: visible; }
.preview-grid {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: visible;
  background-image:
    linear-gradient(to right, rgb(28 15 15 / 7%) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(28 15 15 / 7%) 1px, transparent 1px);
  background-size: var(--grid-unit, 37px) var(--grid-unit, 37px);
  pointer-events: none;
}
.grid-target {
  position: absolute;
  border: 1px dashed rgb(28 15 15 / 25%);
  border-radius: 3px;
  opacity: 0;
  transition: opacity .15s ease, background-color .15s ease;
}
.logo-slot.is-dragging .grid-target { opacity: 1; }
.grid-target.is-nearest { background: rgb(28 15 15 / 7%); border-color: rgb(28 15 15 / 55%); }
.preview-hint {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

#logo [data-part] { cursor: pointer; }
#logo [data-part^="icon"] { cursor: grab; touch-action: none; }
#logo [data-part^="icon"].is-dragging { cursor: grabbing; }
#logo [data-part]:focus-visible { outline: none; }
#logo [data-locked="true"] .lock-outline,
#logo [data-part]:hover .lock-outline,
#logo [data-part]:focus-visible .lock-outline { opacity: 1; }
#logo [data-part]:focus-visible .lock-outline { stroke-width: 2; }
#logo .lock-outline {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1;
  stroke-dasharray: 2 2;
  opacity: 0;
  pointer-events: none;
}
body.idle-motion #logo [data-part^="icon"]:not(.is-drawing) .icon-stroke {
  animation: icon-breathe 5s ease-in-out infinite;
}
body.idle-motion #logo [data-part="icon-b"]:not(.is-drawing) .icon-stroke {
  animation-delay: -2.5s;
}
@keyframes icon-breathe {
  0%, 100% { opacity: 1; transform: translateY(0); }
  50% { opacity: .88; transform: translateY(.45px); }
}
.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;
}
@media (max-width: 760px) {
  body { padding: 12px; }
  .frame { grid-template-columns: minmax(0, 1fr); }
  .controls-panel { max-height: none; overflow-y: visible; border-right: 0; border-bottom: 1px solid var(--ink); }
  .preview-panel { min-height: 360px; padding: 24px 30px; }
  .preview-canvas { min-height: 240px; }
  button, .download-menu > summary { min-height: 44px; }
}
@media (max-width: 420px) {
  .controls-panel { padding: 26px 20px 20px; }
  .preview-panel { padding: 22px 20px; }
  .range-control { grid-template-columns: 74px minmax(0, 1fr) 64px; gap: 8px; }
  .roundness-mode { grid-template-columns: 74px minmax(0, 1fr); gap: 8px; }
  .select-control { grid-template-columns: 74px minmax(0, 1fr); gap: 8px; }
  .wave-control { grid-template-columns: 74px minmax(0, 1fr); gap: 8px; }
  .wave-control legend { width: 74px; }
  .wave-dot { width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  button { transition: none; }
  .grid-target { transition: none; }
  body.idle-motion #logo .icon-stroke { animation: none; }
}
