:root {
  color-scheme: light dark;
  --page: #f3f3f0;
  --card: #131313;
  --ink: #f7f7f4;
  --muted: #b9b9b3;
  --line: #2d2d2a;
  --field: #1a1a18;
  --accent: #ffffff;
  --focus: #7aa2ff;
  --shadow: none;
  --glass-bg: rgb(18 18 17 / 0.88);
  --glass-ring: rgb(255 255 255 / 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0d0d0d;
    --card: #151515;
    --ink: #f5f5f2;
    --muted: #a9a9a3;
    --line: #2a2a28;
    --field: #111111;
    --accent: #ffffff;
    --focus: #8fb0ff;
    --shadow: none;
    --glass-bg: rgb(22 22 21 / 0.78);
    --glass-ring: rgb(255 255 255 / 0.11);
  }
}

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

html {
  min-height: 100%;
  background: var(--page);
}

body {
  min-height: 100%;
  margin: 0;
  position: relative;
  overflow-x: hidden;
  background: var(--page);
  color: var(--ink);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

.background-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.things-page-root,
.things-page {
  --things-soft: #746e68;
  width: 100%;
  min-height: 100%;
  overflow: hidden;
  background: #fafaf7;
  color: #141414;
  color-scheme: light;
}

.things-canvas-page {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.things-pill,
.things-origin-button {
  position: fixed;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgb(20 20 20 / 0.1);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.76);
  box-shadow: 0 8px 24px rgb(20 20 20 / 0.08);
  color: var(--things-soft);
  padding: 0 15px;
  font-size: 0.95rem;
  line-height: 1;
  transform: translateX(-50%);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
}

.things-pill {
  top: 16px;
  left: 50%;
  gap: 8px;
  min-height: 38px;
  transform: translateX(-50%);
}

.things-origin-button {
  top: 16px;
  right: 16px;
  justify-content: center;
  width: 38px;
  height: 38px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  padding: 0;
  transform: scale(0.96);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.things-origin-button[hidden] {
  display: none;
}

.things-origin-button:hover {
  background: rgb(255 255 255 / 0.86);
}

.things-origin-button.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.things-origin-button.is-visible:active {
  transform: scale(0.965);
}

.things-origin-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--things-soft);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.things-origin-button svg circle:last-child {
  fill: var(--things-soft);
  stroke: none;
}

.heart-button {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.heart-button:focus,
.heart-button:focus-visible {
  outline: none;
}

.things-heart {
  width: 16px;
  height: 16px;
  transform-origin: center;
  image-rendering: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.heart-button.is-popping .things-heart {
  animation: heart-pop 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

.things-canvas {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1;
  display: block;
  width: 100vw;
  height: 100vh;
  cursor: grab;
  touch-action: none;
}

.things-canvas.is-dragging {
  cursor: grabbing;
}

.things-item-layer {
  position: fixed;
  inset: 0;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.things-canvas-page.is-layout-ready .things-item-layer {
  opacity: 1;
}

.things-item {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--item-render-width, var(--item-width, 172px));
  margin: 0;
  cursor: grab;
  pointer-events: auto;
  z-index: var(--item-z, 0);
  transform:
    translate3d(var(--item-screen-x, 0), var(--item-screen-y, 0), 0)
    rotate(var(--item-active-rotation, var(--item-rotation, 0deg)))
    scale(var(--view-scale, 1));
  transform-origin: center;
  touch-action: none;
  user-select: none;
  transition:
    filter 180ms ease,
    opacity 180ms ease;
  will-change: transform;
}

.things-canvas-page.has-selection .things-item:not(.is-selected) {
  opacity: 1;
  filter: blur(2.8px) saturate(0.38) brightness(1.16) contrast(0.82);
}

.things-item.is-selected {
  --item-active-rotation: 0deg;

  z-index: var(--selected-z, 20);
}

.things-item.is-selected::before {
  position: absolute;
  right: 10%;
  bottom: -7%;
  left: 10%;
  z-index: 0;
  height: 20%;
  border-radius: 999px;
  background: rgb(20 20 20 / 0.16);
  content: "";
  filter: blur(14px);
  opacity: 0.72;
  pointer-events: none;
  transform: translate3d(0, 7px, 0) scaleX(0.94);
}

.things-item.is-unwritten::after {
  position: absolute;
  inset: -7px;
  z-index: 4;
  border: 2px solid rgb(255 59 48 / 0.72);
  border-radius: 18px;
  content: "";
  pointer-events: none;
}

.things-item.is-unwritten .disc-item-image {
  box-shadow:
    0 0 0 7px #fff,
    0 0 0 10px rgb(255 59 48 / 0.72),
    0 10px 16px rgb(20 20 20 / 0.08);
}

.things-item.is-unwritten:has(.disc-item-image)::after {
  display: none;
}

.things-item.is-moving {
  animation: sticker-pickup-wobble 520ms ease-in-out infinite alternate;
  cursor: grabbing;
  filter: drop-shadow(0 16px 20px rgb(20 20 20 / 0.12));
  z-index: var(--drag-z, 10);
}

.things-item.is-read-spinning .disc-item-image {
  animation:
    disc-read-spin 2100ms linear both,
    disc-read-optical-blur 2100ms linear both;
  transform-origin: center;
}

.sticker-backing {
  position: absolute;
  z-index: 1;
  display: block;
  pointer-events: none;
  filter: drop-shadow(0 12px 18px rgb(20 20 20 / 0.08));
}

.canvas-item-image,
.sticker-image {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.plain-item-image {
  filter: drop-shadow(0 10px 16px rgb(20 20 20 / 0.08));
}

.disc-item-image {
  border-radius: 50%;
  box-shadow:
    0 0 0 7px #fff,
    0 10px 16px rgb(20 20 20 / 0.08);
}

.things-detail-sheet {
  position: fixed;
  right: 14px;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 14px;
  z-index: 4;
  max-width: 760px;
  margin: 0 auto;
  border: 1px solid rgb(20 20 20 / 0.1);
  border-radius: 22px;
  background: rgb(255 255 255 / 0.82);
  box-shadow: 0 18px 54px rgb(20 20 20 / 0.14);
  opacity: 0;
  padding: 20px;
  transform: translateY(calc(100% + 28px)) scale(0.985);
  transition:
    opacity 190ms ease,
    transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}

.things-detail-sheet.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.things-detail-sheet[hidden] {
  display: none;
}

.things-detail-content {
  display: grid;
  gap: 14px;
  min-height: 164px;
}

.things-detail-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 16px;
  align-items: center;
}

.things-detail-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(184px, 240px);
  gap: 22px;
  align-items: start;
}

.things-detail-media {
  display: grid;
  place-items: start end;
  justify-self: end;
  width: min(240px, 100%);
}

.things-detail-image {
  display: block;
  max-width: 100%;
  max-height: 156px;
  border-radius: 14px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgb(20 20 20 / 0.12));
  user-select: none;
  -webkit-user-drag: none;
}

.things-detail-sheet[data-media-shape="portrait"] .things-detail-main {
  grid-template-columns: minmax(0, 1fr) minmax(116px, 148px);
  gap: 18px;
}

.things-detail-sheet[data-media-shape="portrait"] .things-detail-media {
  width: min(148px, 100%);
}

.things-detail-sheet[data-media-shape="portrait"] .things-detail-image {
  max-height: 190px;
}

.things-detail-notes {
  min-width: 0;
}

.things-detail-title {
  margin: 0;
  color: #171716;
  font-size: 1.18rem;
  font-weight: 520;
  letter-spacing: 0;
  line-height: 1.2;
}

.things-detail-description {
  max-width: 52ch;
  margin: 0;
  color: var(--things-soft);
  font-size: 0.96rem;
  line-height: 1.5;
}

.things-detail-description a {
  color: #171716;
  text-decoration-color: rgb(20 20 20 / 0.28);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

.things-detail-description a:hover {
  color: #171716;
  text-decoration-color: rgb(20 20 20 / 0.58);
}

.things-detail-close {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgb(20 20 20 / 0.08);
  border-radius: 999px;
  background: rgb(250 250 247 / 0.72);
  color: var(--things-soft);
  cursor: pointer;
  padding: 0;
}

.things-detail-close:active {
  transform: scale(0.965);
}

.things-detail-close svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

@media (max-width: 700px) {
  .things-page-root,
  .things-page {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .things-canvas-page {
    position: relative;
    min-height: var(--mobile-board-height, 1800px);
    overflow: visible;
  }

  .things-canvas {
    position: absolute;
    width: 100%;
    height: var(--mobile-board-height, 1800px);
    cursor: default;
    touch-action: pan-y;
  }

  .things-item-layer {
    position: absolute;
    height: var(--mobile-board-height, 1800px);
    min-height: 100%;
  }

  .things-item {
    cursor: pointer;
    touch-action: none;
  }

  .things-origin-button {
    display: none;
  }

  .things-detail-sheet {
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
    padding: 14px;
  }

  .things-detail-content {
    gap: 12px;
    min-height: 0;
  }

  .things-detail-main {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .things-detail-sheet[data-media-shape="portrait"] .things-detail-main {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .things-detail-media {
    place-items: start;
    justify-self: stretch;
    width: 100%;
  }

  .things-detail-sheet[data-media-shape="portrait"] .things-detail-media {
    width: 100%;
  }

  .things-detail-title {
    font-size: 1.02rem;
  }

  .things-detail-description {
    font-size: 0.9rem;
    line-height: 1.42;
  }

  .things-detail-image {
    width: 100%;
    max-width: none;
    max-height: none;
    height: auto;
  }
}

@keyframes heart-pop {
  0% {
    transform: scale(1);
  }

  42% {
    transform: scale(var(--heart-pop-scale, 1.34)) rotate(var(--heart-pop-rotation, -7deg));
  }

  72% {
    transform: scale(var(--heart-settle-scale, 0.92)) rotate(var(--heart-settle-rotation, 3deg));
  }

  100% {
    transform: scale(1);
  }
}

@keyframes sticker-pickup-wobble {
  0% {
    transform:
      translate3d(var(--item-screen-x, 0), var(--item-screen-y, 0), 0)
      rotate(calc(var(--item-rotation, 0deg) - 0.8deg))
      scale(1.034);
  }

  100% {
    transform:
      translate3d(var(--item-screen-x, 0), var(--item-screen-y, 0), 0)
      rotate(calc(var(--item-rotation, 0deg) + 0.8deg))
      scale(1.044);
  }
}

@keyframes disc-read-spin {
  0% {
    transform: rotate(0deg);
  }

  14% {
    transform: rotate(7deg);
  }

  30% {
    transform: rotate(24deg);
  }

  46% {
    transform: rotate(68deg);
  }

  60% {
    transform: rotate(190deg);
  }

  72% {
    transform: rotate(720deg);
  }

  84% {
    transform: rotate(2340deg);
  }

  100% {
    transform: rotate(5220deg);
  }
}

@keyframes disc-read-optical-blur {
  0%,
  50% {
    filter: blur(0) saturate(1);
  }

  72% {
    filter: blur(0.2px) saturate(1.08);
  }

  84% {
    filter: blur(0.72px) saturate(1.18);
  }

  100% {
    filter: blur(0.28px) saturate(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .heart-button.is-popping .things-heart {
    animation-duration: 1ms;
  }

  .things-item.is-moving {
    animation: none;
    transform:
      translate3d(var(--item-screen-x, 0), var(--item-screen-y, 0), 0)
      rotate(var(--item-active-rotation, var(--item-rotation, 0deg)))
      scale(1.034);
  }

  .things-item.is-read-spinning {
    animation: none;
  }

  .things-item.is-read-spinning .disc-item-image {
    animation: none;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--accent);
}

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

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-size: 3.65rem;
  line-height: 0.95;
}

h2 {
  margin-bottom: 4px;
  font-size: 1rem;
  line-height: 1.3;
}

p {
  color: var(--muted);
}

.page {
  display: grid;
  position: relative;
  z-index: 1;
  min-height: 100svh;
  place-items: center;
  padding: 28px;
}

.card {
  width: min(100%, 720px);
  border: 0;
  border-radius: 8px;
  background: var(--glass-bg);
  box-shadow:
    0 0 0 1px var(--glass-ring),
    inset 0 1px 0 rgb(255 255 255 / 0.035);
}

.home-card {
  width: min(100%, 440px);
  padding: clamp(22px, 5vw, 42px);
}

.kicker {
  margin-bottom: 18px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.home-layout {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: stretch;
}

.home-left {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.home-brand {
  color: #ffffff;
  font-weight: 400;
  text-decoration: none;
}

.home-socials {
  display: flex;
  gap: 8px;
}

.home-socials a {
  display: grid;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid color-mix(in srgb, var(--glass-ring) 84%, transparent);
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
}

.home-socials a:hover {
  border-color: color-mix(in srgb, var(--muted) 38%, transparent);
  color: var(--ink);
}

.home-socials svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  pointer-events: none;
}

.home-links {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  text-align: right;
}

.home-links a {
  color: var(--muted);
  font-weight: 400;
  text-decoration: none;
}

.home-links a:hover {
  color: var(--ink);
}

.blog-empty-card {
  display: grid;
  gap: 44px;
}

.blog-empty-topline {
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.blog-empty-topline span:last-child {
  color: var(--ink);
}

.blog-empty-content p {
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .page {
    padding: 16px;
  }

  h1 {
    font-size: 2.8rem;
  }
}
