:root {
  --fg: #f4f1ea;
  --muted: #b7b2a8;
  --subtle: #8d887e;
  --surface: #141516;
  --line: rgb(244 241 234 / 0.14);
  --bg: #07080c;
  --accent: #f4f1ea;
  --accent-fg: #141311;
  --track: rgb(244 241 234 / 0.18);
  --fill: #f4f1ea;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "WenQuanYi Zen Hei", "Microsoft YaHei",
    system-ui, sans-serif;
  --font-display: "Songti SC", "Noto Serif SC", "STSong", "Noto Serif CJK SC", "PMingLiU", serif;
  --text-display: clamp(2rem, 1.15rem + 2.8vw, 4.25rem);
  --shadow-panel: 0 16px 40px rgb(0 0 0 / 0.28);
  color-scheme: dark;
}

.tone-light {
  --fg: #171614;
  --muted: #5c5852;
  --subtle: #6f6b64;
  --surface: #f6f3ec;
  --line: rgb(23 22 20 / 0.14);
  --accent: #171614;
  --accent-fg: #f6f3ec;
  --track: rgb(23 22 20 / 0.16);
  --fill: #171614;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.antialiased {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

button:not(:disabled),
[role="button"]:not(:disabled) {
  cursor: pointer;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
}

h1,
h2 {
  font-family: var(--font-display);
  text-wrap: balance;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

.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;
}

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  touch-action: none;
  cursor: none;
}

.stage [data-chrome] {
  cursor: auto;
  touch-action: auto;
}

.field-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 42%, rgb(0 0 0 / 0.38) 100%);
}

.tone-light .vignette {
  background: radial-gradient(ellipse at center, transparent 48%, rgb(20 18 14 / 0.16) 100%);
}

.tone-light .hero h1,
.tone-light .lede {
  text-shadow: 0 1px 12px rgb(246 243 236 / 0.8);
}

.pointer-glow {
  position: absolute;
  left: 0;
  top: 0;
  width: 240px;
  height: 240px;
  margin-left: -120px;
  margin-top: -120px;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle, rgb(255 246 238 / 0.2), rgb(255 246 238 / 0) 68%);
  mix-blend-mode: screen;
  will-change: transform;
}

.tone-light .pointer-glow {
  display: none;
}

.reticle {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border: 1px solid var(--fg);
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: difference;
  will-change: transform;
}

.reticle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 3px;
  margin: -1.5px 0 0 -1.5px;
  border-radius: 999px;
  background: var(--fg);
}

@media (pointer: coarse) {
  .stage {
    cursor: auto;
  }

  .reticle {
    display: none;
  }
}

.topbar,
.hero {
  position: absolute;
  z-index: 2;
  pointer-events: none;
}

.topbar {
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mark {
  width: 28px;
  height: 28px;
  flex: none;
}

.word {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.kicker,
.hint,
.notice,
.readout {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.readout {
  padding-top: 6px;
  text-align: right;
}

.hero {
  top: 92px;
  left: 20px;
  right: 20px;
  max-width: 34rem;
}

.hero h1 {
  margin: 0;
  font-size: var(--text-display);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.08;
  text-shadow: 0 1px 16px rgb(0 0 0 / 0.45);
}

.lede {
  display: none;
  max-width: 34ch;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.55;
  text-wrap: pretty;
  text-shadow: 0 1px 12px rgb(0 0 0 / 0.4);
}

.dock {
  position: absolute;
  z-index: 3;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-height: min(46dvh, 440px);
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-panel);
  color: var(--fg);
}

.dock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
}

.dock-toggle {
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
}

.dock-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.slider-field,
.field-block {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.slider-label,
.field-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  color: var(--fg);
  font-size: 0.875rem;
  font-weight: 500;
}

.slider-label span:last-child,
.field-label {
  color: var(--muted);
  font-weight: 500;
}

.slider-label span:first-child {
  color: var(--fg);
}

.slider {
  appearance: none;
  width: 100%;
  height: 44px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  --pct: 50%;
}

.slider::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(var(--fill), var(--fill)) 0 50% / var(--pct) 2px no-repeat,
    linear-gradient(var(--track), var(--track)) 0 50% / 100% 2px no-repeat;
}

.slider::-moz-range-track {
  height: 2px;
  border: 0;
  border-radius: 999px;
  background: var(--track);
}

.slider::-moz-range-progress {
  height: 2px;
  background: var(--fill);
}

.slider::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -8px;
  border: 0;
  border-radius: 999px;
  background: var(--fill);
}

.slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  background: var(--fill);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.choice,
.btn {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
}

.choice.is-on,
.btn-primary {
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-fg);
}

.btn:active,
.choice:active,
.return:active {
  transform: scale(0.98);
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.swatch {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  display: inline-grid;
  place-items: center;
}

.swatch.is-on {
  box-shadow: inset 0 0 0 2px var(--surface), inset 0 0 0 4px var(--fg);
}

.swatch.custom {
  position: relative;
  border-style: dashed;
  background: transparent;
}

.swatch.custom::after {
  content: "+";
  color: var(--fg);
  font-size: 1.05rem;
  line-height: 1;
}

.swatch.custom.is-on::after {
  content: none;
}

.swatch.custom input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.actions .btn:nth-child(n + 3) {
  grid-column: 1 / -1;
}

.notice {
  min-height: 1.1em;
  margin-top: 8px;
}

.return {
  position: absolute;
  z-index: 4;
  left: 16px;
  bottom: 16px;
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--fg);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-panel);
}

.return[hidden] {
  display: none;
}

.is-clean .topbar,
.is-clean .hero,
.is-clean .dock {
  display: none;
}

@media (min-width: 840px) {
  .topbar {
    padding: 28px 32px 0;
  }

  .hero {
    top: 128px;
    left: 32px;
  }

  .lede {
    display: block;
  }

  .dock {
    left: auto;
    right: 24px;
    bottom: 24px;
    width: 24rem;
    max-height: calc(100dvh - 48px);
  }

  .dock-head {
    margin-bottom: 12px;
  }

  .dock-toggle {
    display: none;
  }

  .hint {
    display: block;
  }
}

@media (max-width: 839px) {
  .hint,
  .dock-toggle {
    display: none;
  }

  .dock:not(.is-open) .dock-body {
    display: none;
  }

  .dock:not(.is-open) {
    max-height: none;
    overflow: visible;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .dock.is-open {
    max-height: min(62dvh, 560px);
  }

  .dock.is-open .dock-head {
    margin-bottom: 4px;
  }

  .dock:not(.is-open) .dock-toggle,
  .dock.is-open .dock-toggle {
    display: inline-flex;
    align-items: center;
  }
}

@media (max-height: 760px) and (min-width: 840px) {
  .lede {
    display: none;
  }

  .hero {
    top: 96px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn:active,
  .choice:active,
  .return:active {
    transform: none;
  }
}
