:root {
  --bg: #f6f1ea;
  --bg-soft: #fffaf5;
  --bg-mid: #f0e8df;
  --bg-deep: #ebe3d8;
  --ink: #2a241f;
  --card-w: clamp(12em, 20vw, 26em);
  --radius: 1.15em;
}

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

html,
body {
  width: 100%;
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: none;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}

.demo-section {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, var(--bg-soft) 0%, transparent 70%),
    linear-gradient(165deg, var(--bg-soft) 0%, var(--bg-mid) 48%, var(--bg-deep) 100%);
}

.perspective-tiles {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100dvh;
  overflow: clip;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.perspective-tiles.is-dragging {
  cursor: grabbing;
}

.perspective-tiles__collection {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.perspective-tiles__list {
  display: grid;
  place-items: center;
}

.perspective-tiles__item {
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  height: max-content;
  will-change: transform, opacity;
}

.demo-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--card-w);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55) inset,
    0 18px 40px rgba(42, 36, 31, 0.12),
    0 4px 12px rgba(42, 36, 31, 0.06);
}

.demo-card__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  will-change: filter;
}

.demo-card__scrim {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(ellipse 70% 55% at 50% 52%, rgba(20, 16, 12, 0.42) 0%, rgba(20, 16, 12, 0.08) 55%, transparent 72%),
    linear-gradient(180deg, rgba(20, 16, 12, 0.12) 0%, transparent 35%, transparent 65%, rgba(20, 16, 12, 0.18) 100%);
  pointer-events: none;
  will-change: filter;
}

.demo-card__title {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-size: calc(var(--card-w) / 5.5);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  text-transform: uppercase;
  color: #fff;
  opacity: 0;
  visibility: hidden;
  perspective: 700px;
  transform-style: preserve-3d;
  text-shadow:
    0 1px 1px rgba(0, 0, 0, 0.35),
    0 2px 10px rgba(0, 0, 0, 0.35),
    0 0 24px rgba(0, 0, 0, 0.2);
  will-change: transform, opacity, filter;
  pointer-events: none;
}

.demo-card__char {
  display: inline-block;
  will-change: transform, opacity, filter;
}

.demo-card__title--beige {
  color: #fff4ea;
}

.demo-card__title--sky {
  color: #eef6fc;
}

.demo-card__title--sage {
  color: #f3f6e8;
}
