:root {
  color-scheme: light;
  --paper: #f3f1ec;
  --ink: #111;
  --muted: #6b6862;
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: "Be Vietnam Pro", system-ui, -apple-system, sans-serif;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}

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

.overlay {
  position: fixed;
  z-index: 2;
}

.title {
  top: max(20px, env(safe-area-inset-top));
  left: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.logo {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.title h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.title p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.ig {
  right: 20px;
  bottom: max(20px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
}

.ig svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.ig:hover span,
.ig:focus-visible span {
  text-decoration: underline;
}

/* Cursor: a "+" that turns into "×" while dragging */
.has-cursor #gl {
  cursor: none;
}

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 4;
  width: 0;
  height: 0;
  pointer-events: none;
  mix-blend-mode: difference;
}

.cursor::before,
.cursor::after {
  content: "";
  position: absolute;
  left: -9px;
  top: -0.75px;
  width: 18px;
  height: 1.5px;
  background: #fff;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.25s, left 0.25s;
}

.cursor::after {
  transform: rotate(90deg);
}

.is-over-photo .cursor::before,
.is-over-photo .cursor::after {
  left: -14px;
  width: 28px;
}

.is-dragging .cursor::before {
  transform: rotate(45deg);
}

.is-dragging .cursor::after {
  transform: rotate(135deg);
}

.cursor.is-hidden,
.lightbox:not([hidden]) ~ .cursor {
  opacity: 0;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 3;
  background: rgb(243 241 236 / 0);
  transition: background 0.3s;
  touch-action: none;
}

.lightbox.is-open {
  background: rgb(243 241 236 / 0.96);
}

.lb-img {
  position: absolute;
  transform-origin: 0 0;
  object-fit: cover;
  background: #e0dbd1;
  box-shadow: 0 20px 60px rgb(0 0 0 / 0.12);
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.16s;
  user-select: none;
}

.lightbox:not(.is-open) .lb-img {
  opacity: 0;
}

.lb-img.is-swapping {
  opacity: 0;
}

.lb-btn {
  position: absolute;
  padding: 8px 4px;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s 0.15s;
}

.is-open .lb-btn {
  opacity: 1;
}

.lb-btn:hover,
.lb-btn:focus-visible {
  text-decoration: underline;
}

.lb-close {
  top: max(12px, env(safe-area-inset-top));
  right: 16px;
}

.lb-next {
  bottom: max(12px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
}

/* Fallback grid (no WebGL / reduced motion) */
.is-fallback {
  overflow: auto;
}

.title,
.ig {
  padding: 6px 12px 6px 6px;
  margin: -6px;
  border-radius: 999px;
  background: rgb(243 241 236 / 0.88);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.ig {
  padding-left: 10px;
}

.grid {
  columns: 130px;
  column-gap: 20px;
  padding: 88px 20px 72px;
}

.grid-item {
  display: block;
  width: 100%;
  margin: 0 0 24px;
  padding: 0;
  border: 0;
  background: #e0dbd1;
  cursor: zoom-in;
  break-inside: avoid;
  transform: rotate(var(--tilt));
  transition: transform 0.2s;
}

.grid-item:hover,
.grid-item:focus-visible {
  transform: rotate(0deg) scale(1.03);
}

.grid-item img {
  display: block;
  width: 100%;
  height: auto;
}

@media (prefers-reduced-motion: reduce) {
  .lb-img,
  .lb-btn,
  .lightbox,
  .grid-item {
    transition: none;
  }
}

.noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 16px;
  text-align: center;
}

.noscript a {
  color: inherit;
}
