.hero {
  position: relative;
  isolation: isolate;
  overflow: clip;
  color: var(--ink);
  background: radial-gradient(ellipse at 80% 34%, #fffaf0, #ede4d6 73%);
}

.hero::before {
  position: absolute;
  z-index: -1;
  inset: 0 auto 0 0;
  width: 64%;
  content: '';
  background: #123529 url('/media/poker-table.webp') center 64% / cover no-repeat;
  mask-image: linear-gradient(to right, #000 60%, #000d 74%, transparent);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, .83fr) minmax(0, 1.17fr);
  align-items: center;
  gap: 28px;
  min-height: clamp(420px, 38vw, 535px);
  padding-block: 24px 48px;
}

.hero-copy { padding-block: 18px; }
.hero .hero-copy h1 {
  margin: 0;
  font-size: clamp(36px, 4.2vw, 66px);
  font-weight: 900;
  line-height: 1.22;
  letter-spacing: -.065em;
}
.hero-subtitle { margin-top: 14px; color: #895623; font-size: clamp(16px, 2.05vw, 30px); font-weight: 780; }
.hero-description { margin-top: 9px; color: var(--muted); font-size: clamp(14px, 1.3vw, 18px); line-height: 1.9; }
.hero .hero-actions { margin-top: 23px; gap: 10px; }
.hero .button { border-radius: 100px; padding-inline: 17px; }
.hero .primary {
  min-height: 47px;
  background: linear-gradient(165deg, #225641, #0a3024);
  box-shadow: 0 6px 16px #133c2b2c;
}
.hero .primary:hover { background: #214c37; }
.hero .outline { border-color: #b99064; color: #764b29; }

.card-table {
  min-width: 0;
  display: grid;
  justify-items: center;
  align-self: end;
  margin-inline-start: 18px;
}

.card-stage {
  --card-width: clamp(135px, 15.5vw, 222px);
  position: relative;
  isolation: isolate;
  width: 100%;
  height: calc(var(--card-width) * 1.61);
  overflow: clip;
  touch-action: pan-y;
  user-select: none;
  cursor: grab;
}

.table-card {
  --x: -50%;
  --y: -50%;
  --angle: 0deg;
  --scale: 1;
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--card-width);
  aspect-ratio: .735;
  padding: 0;
  border-radius: 11px;
  perspective: 950px;
  transform: translate(calc(var(--x) + var(--drag-x, 0px)), var(--y)) rotate(var(--angle)) scale(var(--scale));
  transition: transform .46s cubic-bezier(.22,.65,.23,1), opacity .25s;
  -webkit-tap-highlight-color: transparent;
}

.deck-track {
  display: flex;
  direction: ltr;
  height: 100%;
  transform: translateX(calc(var(--drag-x, 0px) - var(--page, 0) * 100%));
  transition: transform .38s cubic-bezier(.22,.65,.23,1);
}
.deck-page { position: relative; flex: 0 0 100%; }
.deck-page .table-card:nth-child(2) { --angle: -5deg; z-index: 3; }
.deck-page .table-card:first-child { --x: -112%; --y: -44%; --angle: -18deg; --scale: .84; }
.deck-page .table-card:nth-child(3) { --x: 12%; --y: -45%; --angle: 16deg; --scale: .87; }
.deck-pair .table-card:first-child { --x: -99%; --angle: -12deg; --scale: .94; }
.deck-pair .table-card:nth-child(2) { --x: -2%; --y: -44%; --angle: 11deg; --scale: .94; }
.deck-page .table-card:hover,.deck-page .table-card:focus-visible { z-index: 4; }
.card-stage.is-dragging,.card-stage.is-dragging .table-card { cursor: grabbing; }
.card-stage.is-dragging .deck-track { transition: none; }

.card-turn,.card-face { position: absolute; inset: 0; border-radius: inherit; }
.card-turn {
  pointer-events: none;
  transform-style: preserve-3d;
  transition: transform .62s cubic-bezier(.25,.66,.25,1);
}

.table-card.is-flipped .card-turn { transform: rotateY(180deg); }
.card-face { backface-visibility: hidden; filter: drop-shadow(0 9px 12px #04140f80); }
.card-reverse { transform: rotateY(180deg); }

/* Clip each product photo along the edges of the box, single card and four-card fan. */
[data-deck="bicycle-black-ghost"] {
  --box-outline: polygon(23.8% 11.5%, 30.6% 9.5%, 75.7% 11.9%, 75.5% 85.2%, 29.4% 90.2%, 24% 89%);
  --sample-outline: polygon(18.23% 46.96%, 18.23% 46.32%, 19.05% 45.89%, 39.23% 42.16%, 40.05% 42.27%, 40.59% 42.91%, 48.85% 71.59%, 48.72% 72.55%, 47.90% 73.19%, 25.82% 79.37%, 25.01% 79.16%, 24.33% 78.52%);
  --sample-center: -33.5%, -60.8%;
  --fan-outline: polygon(5.2% 29.5%, 6.4% 28.2%, 33.9% 25.2%, 35.5% 25.7%, 57.8% 25.2%, 58.9% 26%, 94.4% 28.6%, 95.2% 29.8%, 92.7% 72.7%, 91.8% 73.5%, 50.1% 71.1%, 29.6% 71.5%, 10% 73.5%, 8.7% 72.6%);
}
[data-deck="bicycle-standard-red"] {
  --box-outline: polygon(29.1% 17.1%, 35.1% 16.1%, 71.5% 19%, 71.6% 79.3%, 34.9% 85.9%, 29.2% 84.7%);
  --sample-outline: polygon(16.18% 48.96%, 16.30% 48.21%, 17.11% 47.78%, 37.66% 43.63%, 38.59% 43.84%, 39.06% 44.48%, 47.77% 75.40%, 47.88% 76.04%, 47.19% 76.58%, 24.19% 82.76%, 23.38% 82.65%, 22.92% 82.01%);
  --sample-center: -32.0%, -63.2%;
  --fan-outline: polygon(4.6% 35.4%, 5.5% 34.3%, 27.4% 27.3%, 34.4% 26.7%, 54.9% 24.1%, 61.7% 25.2%, 69.7% 25.8%, 72% 26.8%, 95.8% 32.9%, 95.8% 34.1%, 87.2% 75%, 86.3% 75.8%, 56.6% 70.1%, 32.6% 71.3%, 11.4% 76.2%, 10.4% 75.6%);
}
[data-deck="gaslamp"] {
  --box-outline: polygon(30.8% 15.9%, 35.9% 15.1%, 73.4% 16.8%, 73.1% 81.2%, 36.1% 88%, 30.7% 86.8%);
  --sample-outline: polygon(15.75% 46.01%, 15.98% 45.45%, 16.70% 45.18%, 36.27% 42.03%, 37.23% 42.13%, 37.71% 42.68%, 47.73% 73.27%, 47.73% 73.82%, 46.90% 74.29%, 22.67% 80.66%, 21.95% 80.39%, 21.47% 79.74%);
  --sample-center: -31.7%, -61.3%;
  --fan-outline: polygon(4.2% 34.7%, 5.1% 33.6%, 32.8% 23.6%, 33.7% 25.3%, 55.3% 22.8%, 57% 24%, 78% 27%, 79.2% 28.4%, 96.8% 36.8%, 97.2% 38%, 83.9% 78%, 82.8% 79%, 54% 69.8%, 33% 70.7%, 20.6% 76.7%, 19.6% 75.9%);
}
[data-deck="bicycle-botanica"] {
  --box-outline: polygon(28.5% 19.4%, 33.8% 18.1%, 70.5% 19.9%, 70.3% 80.2%, 33.5% 83.6%, 28.5% 81.9%);
  --sample-outline: polygon(18.16% 42.97%, 18.27% 42.29%, 19.06% 41.90%, 38.37% 39.08%, 39.27% 39.18%, 39.73% 39.76%, 46.39% 67.64%, 46.27% 68.42%, 45.48% 69.00%, 23.24% 73.67%, 22.56% 73.47%, 22.23% 72.89%);
  --sample-center: -32.3%, -56.4%;
  --fan-outline: polygon(4.5% 35.2%, 5.4% 34.3%, 27.3% 29.5%, 29% 28.7%, 52.3% 27.4%, 70% 30.6%, 72.6% 31.3%, 95.9% 36.6%, 96.7% 37.6%, 88.5% 73.8%, 87.4% 74.7%, 59.8% 69.6%, 30.5% 69.1%, 15.1% 74.2%, 14.1% 73.6%);
}
[data-deck="bicycle-cyberpunk-hardwired"] {
  --box-outline: polygon(30% 19.9%, 36% 17.8%, 70.9% 21.8%, 70.2% 78.1%, 36.3% 85.7%, 31% 84%);
  --sample-outline: polygon(14.55% 45.28%, 14.68% 44.55%, 15.56% 44.13%, 35.19% 41.53%, 36.19% 41.63%, 36.70% 42.26%, 42.61% 70.72%, 42.61% 71.66%, 41.73% 72.18%, 18.71% 77.18%, 17.95% 77.08%, 17.45% 76.45%);
  --sample-center: -28.6%, -59.4%;
}
[data-deck="bicycle-stargazer-nebula"] {
  --box-outline: polygon(28.3% 15.9%, 35.5% 14.8%, 72.9% 17.4%, 72.5% 82.3%, 35.9% 86.9%, 28.5% 85.2%);
  --sample-outline: polygon(12.54% 45.74%, 12.54% 45.09%, 13.27% 44.54%, 33.37% 41.16%, 34.23% 41.27%, 34.85% 41.92%, 42.20% 71.25%, 42.32% 72.12%, 41.59% 72.66%, 18.79% 78.55%, 17.93% 78.44%, 17.44% 77.79%);
  --sample-center: -27.4%, -59.9%;
}
[data-deck="wqroyal-sun-god"] {
  --box-outline: polygon(29.3% 15.2%, 37.2% 13.4%, 71.4% 14.4%, 71.3% 74.1%, 37% 80.6%, 30.5% 79.5%);
  --sample-outline: polygon(16.05% 41.47%, 16.16% 40.91%, 16.95% 40.55%, 33.44% 38.33%, 34.00% 38.51%, 34.56% 39.07%, 39.87% 67.53%, 39.76% 68.36%, 38.97% 68.92%, 20.45% 72.61%, 19.55% 72.52%, 18.98% 71.97%);
  --sample-center: -28.0%, -55.5%;
}
[data-deck="qaisar-grand"] {
  --box-outline: polygon(27.3% 21.3%, 34.3% 18.4%, 72.5% 17.5%, 72% 82.3%, 34.8% 89.8%, 28% 87.7%);
  --sample-outline: polygon(15.27% 45.73%, 15.36% 45.09%, 16.00% 44.73%, 37.00% 41.00%, 37.64% 41.18%, 38.09% 41.82%, 46.27% 71.36%, 46.27% 72.27%, 45.64% 72.82%, 22.27% 78.91%, 21.45% 78.82%, 20.91% 78.18%);
  --sample-center: -30.8%, -60.0%;
}
.card-face img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--photo-width, 162%);
  height: auto;
  max-width: none;
  aspect-ratio: 1;
  object-fit: contain;
  transform: translate(var(--photo-center, -50%, -50%));
}
.card-front img { clip-path: var(--box-outline); }
.card-stage .card-reverse img {
  --photo-width: 225%;
  --photo-center: var(--sample-center);
  clip-path: var(--sample-outline);
}
.card-stage button:focus-visible { outline-color: #f3d29a; }

.card-gallery {
  padding-block: clamp(28px, 4vw, 55px);
  background: radial-gradient(ellipse at 28% 50%, #255843, #0c2c22 78%);
  color: #fff7e7;
}
.card-gallery-layout {
  display: grid;
  grid-template-columns: minmax(0, .68fr) minmax(0, 1.32fr);
  align-items: center;
  gap: 25px;
}
.card-gallery h2 { font-size: clamp(26px, 3vw, 42px); font-weight: 800; letter-spacing: -.045em; }
.card-gallery p { margin-top: 7px; color: #f0ddbb; }
.gallery-hand { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(9px, 1.5vw, 22px); padding: 10px 6px; }
.gallery-hand .table-card { position: relative; inset: auto; width: 100%; aspect-ratio: .95; border-radius: 9px; transform: translateY(-3%) rotate(5deg); }
.gallery-hand .table-card:nth-child(even) { transform: translateY(3%) rotate(-4deg); }
.gallery-hand .table-card:hover,.gallery-hand .table-card:focus-visible { transform: translateY(-6%) rotate(0); z-index: 1; }
.gallery-hand .table-card:focus-visible { outline-color: var(--brass); }
.gallery-hand .card-front img { --photo-width: 122%; }
.gallery-hand .card-reverse img { --photo-width: 105%; clip-path: var(--fan-outline); }

@media (max-width: 790px) {
  .hero-grid { grid-template-columns: 1fr; min-height: 0; gap: 11px; padding-block: 20px 13px; }
  .hero-copy { padding-block: 5px 0; text-align: center; }
  .hero .hero-copy h1 { font-size: clamp(32px, 8vw, 53px); }
  .hero-subtitle { margin-top: 6px; }
  .hero-description { margin-top: 3px; }
  .hero .hero-actions { margin-top: 13px; justify-content: center; }
  .hero .button { min-height: 40px; }
  .hero::before {
    inset: auto 0 0;
    width: 100%;
    height: 58%;
    background-position: center 66%;
    mask-image: linear-gradient(to top, #000 70%, transparent);
  }
  .card-table { margin-inline: 0; }
  .card-stage { --card-width: clamp(103px, 32vw, 175px); }
  .card-gallery-layout { grid-template-columns: 1fr; gap: 15px; }
  .card-gallery p { font-size: 13px; }
}

@media (max-width: 650px) {
  .gallery-hand {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 16px;
    max-width: 390px;
    width: 100%;
    margin-inline: auto;
  }
  .gallery-hand .table-card { aspect-ratio: 1.35; }
  .gallery-hand .card-front img { --photo-width: 101%; }
}

@media (prefers-reduced-motion: reduce) {
  .deck-track,.table-card,.card-turn { transition: none; }
}
