:root {
  --bg: oklch(0.972 0.002 100);
  --ink: oklch(0.26 0.01 260);
  --muted: oklch(0.62 0.015 260);
  --chip-ink: oklch(0.56 0.015 260);
  --chip-bg: oklch(0.93 0.003 100);
  --card-face: #fff;
  --cta-bg: oklch(0.27 0.012 260);
  --cta-bg-hover: oklch(0.32 0.012 260);
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    Roboto, "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, monospace;
}

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

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(2.5rem, 7vh, 4.5rem);
  padding: clamp(2rem, 6vh, 4rem) 1.5rem;
}

/* ---- Card stack ---- */

.stack {
  position: relative;
  width: min(88vw, 30rem);
  height: clamp(17rem, 42vw, 23.5rem);
  touch-action: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

/* Focus rings appear only after keyboard navigation (html.kb set in JS):
   pointer and touch users never see them. */
html.kb .stack:focus-visible::after {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 32px;
  outline: 2px solid oklch(0.55 0.18 255);
  outline-offset: 2px;
}

.card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(13rem, 33vw, 17.5rem);
  aspect-ratio: 5 / 6;
  padding: clamp(8px, 1vw, 11px);
  background: var(--card-face);
  border-radius: 24px;
  box-shadow:
    0 1px 2px oklch(0.2 0.01 260 / 0.06),
    0 12px 32px -12px oklch(0.25 0.02 260 / 0.28);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform;
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Deeper shadow while lifted, on a pseudo-element so only opacity animates */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 24px;
  box-shadow: 0 28px 56px -18px oklch(0.25 0.02 260 / 0.35);
  opacity: 0;
  transition: opacity 0.25s cubic-bezier(0.23, 1, 0.32, 1);
  pointer-events: none;
}

.card.dragging::after {
  opacity: 1;
}

.stack.ready .card {
  opacity: 1;
}

.card.dragging {
  cursor: grabbing;
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
  pointer-events: none;
  display: block;
}

.hint {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 50%;
  translate: -50% 0;
  white-space: nowrap;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.6s ease-out;
  pointer-events: none;
}

.stack.ready .hint {
  opacity: 1;
  transition-delay: 1.1s;
}

.stack.ready .hint.done {
  opacity: 0;
  transition-delay: 0.4s;
}

/* ---- Copy block ---- */

.copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  text-align: center;
}

.sku {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.09em;
  color: var(--chip-ink);
  background: var(--chip-bg);
  padding: 3px 9px;
  border-radius: 6px;
}

h1 {
  font-size: clamp(1.125rem, 1.1rem + 0.9vw, 1.375rem);
  line-height: 1.45;
  font-weight: 600;
  color: var(--ink);
}

.cta {
  margin-top: 0.9rem;
  display: inline-block;
  border: none;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  background: var(--cta-bg);
  color: #fff;
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.875rem 1.75rem;
  border-radius: 999px;
  transition:
    background 0.18s ease-out,
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (hover: hover) and (pointer: fine) {
  .cta:hover {
    background: var(--cta-bg-hover);
    transform: translateY(-1px);
  }
}

.cta:active {
  transform: translateY(0) scale(0.97);
  transition-duration: 0.06s;
}

.cta:focus {
  outline: none;
}

html.kb .cta:focus-visible {
  outline: 2px solid oklch(0.55 0.18 255);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  /* Springs snap instantly (handled in JS); keep the opacity fades —
     reduced motion means no movement, not no feedback. */
  .cta,
  .cta:hover,
  .cta:active {
    transition: none;
    transform: none;
  }
}
