:root {
  color-scheme: light;
  --paper: oklch(92.5% 0.105 94);
  --paper-warm: oklch(89.5% 0.12 91);
  --graphite: oklch(28% 0.018 75);
  --shadow: oklch(46% 0.07 77 / 0.2);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background: var(--paper);
}

button,
textarea,
input {
  font: inherit;
}

#paper {
  position: fixed;
  inset: 0;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 18% 28%, oklch(100% 0 0 / 0.2) 0 0.7px, transparent 1.15px),
    radial-gradient(circle at 72% 64%, oklch(77% 0.085 85 / 0.13) 0 0.65px, transparent 1.1px),
    radial-gradient(circle at 44% 79%, oklch(100% 0 0 / 0.12) 0 0.85px, transparent 1.35px),
    linear-gradient(105deg, transparent 0 48%, oklch(80% 0.08 85 / 0.035) 49%, transparent 51%);
  background-size: 23px 27px, 31px 29px, 37px 41px, 157px 173px;
}

#paper.is-dragging {
  cursor: grabbing;
}

#paper::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.38;
  background:
    linear-gradient(90deg, oklch(100% 0 0 / 0.06), transparent 22%, transparent 78%, oklch(73% 0.08 85 / 0.04)),
    linear-gradient(oklch(100% 0 0 / 0.04), transparent 24%, transparent 76%, oklch(75% 0.08 85 / 0.03));
}

.sticker-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#world {
  position: absolute;
  inset: 0 auto auto 0;
  width: 1px;
  height: 1px;
  transform: translate3d(0, 0, 0);
  transform-origin: 0 0;
  will-change: transform;
}

.cursor {
  position: absolute;
  width: 13px;
  height: 13px;
  border: 2px solid var(--graphite);
  border-radius: 50%;
  opacity: 0.3;
  transform: translate3d(-50%, -50%, 0) rotate(-8deg);
  animation: cursor-blink 920ms steps(1, end) infinite;
  will-change: transform, opacity;
}

.empty-hint {
  position: absolute;
  z-index: 2;
  top: 134px;
  left: 151px;
  margin: 0;
  color: oklch(28% 0.018 75 / 0.25);
  font: 600 12px/1 ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  letter-spacing: 0.035em;
  pointer-events: none;
  transform: translate3d(0, -50%, 0) rotate(-1deg);
  transition: opacity 120ms cubic-bezier(0.215, 0.61, 0.355, 1), transform 120ms cubic-bezier(0.215, 0.61, 0.355, 1);
}

.empty-hint.is-hidden {
  opacity: 0;
  transform: translate3d(3px, -50%, 0) rotate(-1deg);
}

#keyboard-sink {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
  resize: none;
}

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

@keyframes cursor-blink {
  0%,
  46% {
    opacity: 0.34;
  }

  47%,
  100% {
    opacity: 0.08;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor {
    animation: none;
    opacity: 0.28;
  }

  #world {
    will-change: auto;
  }

  .empty-hint {
    transition: none;
  }
}

html.debug-mode,
html.debug-mode body {
  height: auto;
  min-height: 100%;
  overflow: auto;
  overscroll-behavior: auto;
  scroll-behavior: smooth;
}

.debug-mode body {
  color: var(--graphite);
  font-family: ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 18% 28%, oklch(100% 0 0 / 0.2) 0 0.7px, transparent 1.15px),
    radial-gradient(circle at 72% 64%, oklch(77% 0.085 85 / 0.13) 0 0.65px, transparent 1.1px);
  background-size: 23px 27px, 31px 29px;
}

.debug-catalog {
  width: min(100%, 1600px);
  padding: 24px clamp(16px, 3vw, 48px) 80px;
  margin: 0 auto;
}

.debug-header {
  display: grid;
  grid-template-columns: minmax(max-content, 1fr) auto auto;
  gap: 16px 32px;
  align-items: end;
  padding: 12px 0 24px;
  border-bottom: 1px solid oklch(42% 0.04 80 / 0.16);
}

.debug-heading h1,
.debug-family h2,
.debug-sheet h3,
.debug-heading p,
.debug-sticker figcaption {
  margin: 0;
}

.debug-heading h1 {
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1;
  letter-spacing: -0.03em;
}

.debug-heading p {
  margin-top: 7px;
  color: oklch(38% 0.025 75 / 0.64);
  font-size: 13px;
}

.debug-nav {
  display: flex;
  gap: 6px 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.debug-nav a,
.debug-normal-link {
  color: inherit;
  font-size: 12px;
  font-weight: 650;
  text-underline-offset: 3px;
}

.debug-nav a {
  color: oklch(38% 0.025 75 / 0.7);
  text-decoration: none;
}

.debug-nav a:hover,
.debug-nav a:focus-visible,
.debug-normal-link:hover,
.debug-normal-link:focus-visible {
  color: var(--graphite);
  text-decoration: underline;
}

.debug-family {
  padding-top: 48px;
  scroll-margin-top: 16px;
}

.debug-family h2 {
  font-size: 22px;
  letter-spacing: -0.02em;
}

.debug-sheet {
  padding-top: 28px;
}

.debug-sheet h3 {
  padding-bottom: 10px;
  color: oklch(38% 0.025 75 / 0.68);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.debug-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: 22px 12px;
}

.debug-sticker {
  min-width: 0;
  margin: 0;
}

.debug-sticker-stage {
  position: relative;
  display: grid;
  height: 120px;
  padding: 10px;
  overflow: hidden;
  place-items: center;
  border-radius: 14px;
  background: oklch(98% 0.025 94 / 0.38);
}

.debug-sticker img {
  position: absolute;
  inset: 10px;
  display: block;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  object-fit: contain;
}

.debug-sticker figcaption {
  padding: 7px 2px 0;
  color: oklch(32% 0.02 75 / 0.62);
  font: 9px/1.35 ui-monospace, "SFMono-Regular", Consolas, monospace;
  overflow-wrap: anywhere;
  text-align: center;
}

@media (max-width: 720px) {
  .debug-header {
    grid-template-columns: 1fr auto;
    align-items: start;
  }

  .debug-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
  }

  .debug-grid {
    grid-template-columns: repeat(auto-fill, minmax(98px, 1fr));
  }

  .debug-sticker-stage {
    height: 108px;
  }
}
