:root {
  color-scheme: light dark;
  --paper: #f7f7f2;
  --ink: #242330;
  --muted: #62616b;
  --violet: #514287;
  --line: #d1d0d3;
  --selected: #ece6f6;
  --checker: #e4e3e6;
  --canvas: #fff;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #19171f;
    --ink: #f2eef7;
    --muted: #bbb4c6;
    --violet: #c6adff;
    --line: #57515f;
    --selected: #332a43;
    --checker: #3b3741;
    --canvas: #28232f;
  }
  .signature-light {
    display: none;
  }
  .signature-dark {
    display: block !important;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  color: var(--violet);
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 4px;
}
.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;
}
.skip {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 10;
  padding: 12px;
  background: var(--ink);
  color: var(--paper);
}
.skip:focus {
  top: 12px;
}
.site-header,
main {
  width: calc(100% - 128px);
  max-width: 1312px;
  margin: auto;
}
.site-header {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.signature {
  display: block;
  width: 148px;
  height: auto;
  max-height: 52px;
  object-fit: contain;
}
.signature-dark {
  display: none;
}
.intro {
  margin: 23px 0 22px;
}
.intro h1 {
  margin: 0;
  font:
    700 clamp(58px, 7vw, 96px)/1 Georgia,
    "Times New Roman",
    serif;
  letter-spacing: -4px;
}
.intro p {
  margin: 8px 0 0;
  font:
    400 clamp(20px, 2.2vw, 30px)/1.35 Georgia,
    "Times New Roman",
    serif;
  color: var(--muted);
}
fieldset {
  min-width: 0;
  border: 0;
  padding: 0;
  margin: 0;
}
.characters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.character-choice {
  position: relative;
}
.character-choice input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.character-choice span {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font:
    700 24px/1.2 Georgia,
    "Times New Roman",
    serif;
  cursor: pointer;
}
.character-choice input:checked + span {
  background: var(--selected);
  color: var(--violet);
  border-color: var(--violet);
  box-shadow: inset 0 -3px var(--violet);
}
.character-choice input:focus-visible + span {
  outline: 3px solid var(--violet);
  outline-offset: 4px;
}
.studio {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(300px, 1fr);
  gap: 56px;
  align-items: start;
  padding-bottom: 36px;
}
.preview {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--canvas);
}
.checkerboard {
  background-image: conic-gradient(
    var(--checker) 25%,
    transparent 0 50%,
    var(--checker) 0 75%,
    transparent 0
  );
  background-size: 32px 32px;
}
.preview canvas,
.preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: center;
  transition: transform 0.15s ease;
}
.preview img {
  padding: 9%;
}
.preview [hidden] {
  display: none;
}
.preview.zoom-small canvas,
.preview.zoom-small img {
  transform: scale(0.75);
}
.preview.zoom-large canvas,
.preview.zoom-large img {
  transform: scale(1.25);
}
.preview-tools {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 16px;
  min-height: 48px;
  font-size: 14px;
}
.preview-tools select {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 16px;
  min-height: 44px;
  font-size: 14px;
}
.checker-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 12px;
  min-height: 44px;
  cursor: pointer;
}
.checker-label input {
  appearance: none;
  width: 38px;
  height: 24px;
  border: 1px solid var(--muted);
  border-radius: 20px;
  background: var(--line);
  position: relative;
  margin: 0;
  cursor: pointer;
}
.checker-label input:before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--paper);
  transition: transform 0.15s;
}
.checker-label input:checked {
  background: var(--violet);
  border-color: var(--violet);
}
.checker-label input:checked:before {
  transform: translateX(14px);
}
.controls h2 {
  font:
    700 54px/1.1 Georgia,
    "Times New Roman",
    serif;
  letter-spacing: -1px;
  margin: 0;
}
.character-description {
  font:
    400 23px/1.4 Georgia,
    "Times New Roman",
    serif;
  color: var(--muted);
  margin: 8px 0 22px;
}
.option-group {
  margin-bottom: 22px;
}
.option-group legend {
  font:
    400 21px/1.3 Georgia,
    "Times New Roman",
    serif;
  padding: 0;
  margin-bottom: 8px;
}
.option-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.option-choice {
  flex: 1;
  min-width: 120px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 13px 16px;
  min-height: 54px;
  font-size: 15px;
  cursor: pointer;
}
.option-choice:has(input:checked) {
  background: var(--selected);
  border-color: var(--violet);
  color: var(--violet);
}
.option-choice input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--violet);
  flex-shrink: 0;
}
.option-choice:has(input:disabled) {
  cursor: not-allowed;
}
.option-choice:has(input:disabled) span {
  opacity: 0.7;
}
.option-reason {
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0 0;
}
.reset {
  display: block;
  border: 0;
  background: none;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 4px 0;
  margin: 0 0 14px;
  min-height: 44px;
  font:
    16px/1.4 Georgia,
    "Times New Roman",
    serif;
}
.download {
  display: block;
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--violet);
  border-radius: 6px;
  background: var(--violet);
  color: var(--paper);
  font: 600 18px/1.3 var(--sans);
  padding: 15px;
}
.download:disabled {
  opacity: 0.55;
}
.export-meta,
.privacy {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 9px 0 0;
}
.status {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin: 24px 0 0;
  color: var(--muted);
  font:
    14px/1.5 Georgia,
    "Times New Roman",
    serif;
}
.status.error {
  color: var(--ink);
  font-weight: bold;
}
@media (min-width: 1500px) {
  .studio {
    grid-template-columns: 720px minmax(0, 1fr);
  }
}
@media (max-width: 900px) {
  .site-header,
  main {
    width: calc(100% - 48px);
  }
  .studio {
    gap: 28px;
    grid-template-columns: minmax(0, 1.1fr) minmax(270px, 1fr);
  }
  .controls h2 {
    font-size: 42px;
  }
  .character-description {
    font-size: 20px;
  }
  .option-choice {
    min-width: 100px;
    padding: 12px;
  }
  .preview-tools {
    gap: 10px;
  }
  .checker-label {
    margin-left: 0;
    gap: 7px;
  }
  .intro h1 {
    letter-spacing: -3px;
  }
}
@media (max-width: 680px) {
  .site-header,
  main {
    width: calc(100% - 32px);
  }
  .site-header {
    height: 66px;
    font-size: 13px;
  }
  .signature {
    width: 126px;
  }
  .intro {
    margin: 25px 0 23px;
  }
  .intro h1 {
    font-size: 64px;
  }
  .intro p {
    font-size: 21px;
    max-width: 330px;
    margin-top: 10px;
  }
  .characters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 20px;
  }
  .character-choice span {
    min-height: 48px;
    font-size: 21px;
  }
  .studio {
    display: flex;
    flex-direction: column;
    gap: 30px;
  }
  .preview-panel,
  .controls {
    width: 100%;
  }
  .controls h2 {
    font-size: 42px;
  }
  .preview-tools {
    justify-content: flex-start;
    font-size: 13px;
    gap: 12px;
  }
  .checker-label {
    margin-left: auto;
    flex-direction: row-reverse;
  }
  .option-list {
    gap: 10px;
  }
  .option-choice {
    min-height: 54px;
    font-size: 15px;
  }
  .download {
    min-height: 58px;
  }
  .privacy {
    font-size: 13px;
  }
  .status {
    margin-bottom: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before {
    transition: none !important;
  }
}
@media (prefers-color-scheme: dark) {
  .site-header .signature-light {
    display: none;
  }
}
.skip:not(:focus-visible) {
  top: -100px;
}
