.gp-tap {
  display: grid;
  grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr);
  align-items: center;
  gap: clamp(22px, 5vw, 70px);
  margin-block: clamp(32px, 6vw, 78px) 12px;
  padding: clamp(20px, 4vw, 55px);
  border: 1px solid var(--gp-line);
  border-radius: 22px;
  background: #efebe4;
  color: var(--gp-ink);
  clear: both;
}

.gp-tap h2 {
  margin: 10px 0 24px;
  font: 400 clamp(34px, 5vw, 64px)/1.02 Georgia, serif;
  letter-spacing: -.055em;
}

.gp-tap__steps {
  display: grid;
  gap: 10px;
  padding-inline-start: 23px;
  margin: 0 0 23px;
  color: #4c453f;
  line-height: 1.55;
}

.gp-tap__steps li { padding-inline-start: 4px; }
.gp-tap__steps li::marker { font-weight: 700; color: #745935; }
.gp-tap [hidden] { display: none; }
.gp-tap--hero {
  display: block;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: #201c19;
}
.gp-tap__visual { min-width: 0; }
.gp-tap__controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 0 0 12px 12px;
  background: #201c19;
}
.gp-tap__platforms { display: flex; gap: 4px; }
.gp-tap__controls button {
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #fff8eb;
  font: 650 .8125rem/1.25 system-ui, sans-serif;
  cursor: pointer;
}
.gp-tap__platforms button[aria-pressed="true"] { background: #40362d; border-color: #6e5c49; }
.gp-tap__controls .gp-tap__replay { background: #f1e6d5; color: #2e241a; }
.gp-tap__controls .gp-tap__replay:hover { background: #fff8eb; }
.gp-tap__controls button:focus-visible { outline: 2px solid #e0c6a3; outline-offset: 2px; }

.gp-tap__stage {
  --phone-x: 72%;
  --phone-y: 51%;
  --tap-x: 75%;
  --tap-y: 13%;
  --card-x: 54%;
  --card-y: 43%;
  --tap-time: 3.4s;
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  overflow: hidden;
  aspect-ratio: 1.64;
  border-radius: 12px 12px 0 0;
  background: radial-gradient(ellipse at 44% 4%, #796b5b 0%, #473d35 36%, #292320 67%, #191615 100%);
}
.gp-tap__stage[data-platform="android"] {
  --tap-x: var(--phone-x);
  --tap-y: var(--phone-y);
}
.gp-tap__phone {
  position: absolute;
  top: var(--phone-y);
  left: var(--phone-x);
  height: 77%;
  aspect-ratio: 70.6 / 146.6;
  border: 1px solid #c3b6a5;
  border-radius: 16% / 8%;
  background: linear-gradient(145deg, #b3a99a, #393330 65%, #9d8e7d);
  box-shadow: 7px 12px 21px #170f0e88;
  transform: translate(-50%, -50%) rotate(9deg);
}
.gp-tap__front { position: absolute; inset: 1.65% 3.25%; }
.gp-tap__rear { display: none; }

.gp-tap__front::before,
.gp-tap__front::after,
.gp-tap__rear::before,
.gp-tap__rear::after {
  content: "";
  position: absolute;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
}
.gp-tap__front::before,
.gp-tap__rear::before {
  inset: -2px;
  border: 1px solid #fff9ee;
  border-radius: 13% / 6.5%;
  box-shadow: 0 0 6px 1px #fff8ebae, 0 0 16px 3px #f8e0b779, inset 0 0 7px #fff9edac;
}
.gp-tap__front::after,
.gp-tap__rear::after {
  top: 15%;
  right: -2px;
  width: clamp(2px, .5cqw, 4px);
  height: 15%;
  border-radius: 999px;
  background: #fffdfa;
  box-shadow: 0 -3px 9px 2px #edf9ffd9, 0 5px 13px 3px #ffedc3a8;
}

.gp-tap__screen {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
  border-radius: 13% / 6.5%;
  background: #f8f4ee;
  color: #251f1b;
  font: 500 clamp(7px, 2cqw, 14px)/1.2 system-ui, sans-serif;
}

.gp-tap__island {
  position: absolute;
  top: 2.6%;
  left: 35%;
  width: 30%;
  height: 4%;
  border-radius: 999px;
  background: #1c1716;
}

.gp-tap__wallpaper {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 6%;
  padding: 27% 6% 0;
  color: #fff4e9;
  background: linear-gradient(154deg, #303134, #17181a 77%);
}

.gp-tap__time { font-size: clamp(18px, 7cqw, 52px); font-weight: 620; letter-spacing: -.06em; }

.gp-tap__notice {
  display: flex;
  align-items: center;
  gap: 7%;
  width: 100%;
  padding: 7%;
  border-radius: 8px;
  background: #fff5eb;
  color: #322722;
  font-size: .9em;
  opacity: 0;
}

.gp-tap__notice small { display: block; margin-top: 2px; }
.gp-tap__notice-icon { display: grid; place-items: center; flex: 0 0 20%; aspect-ratio: 1; border-radius: 5px; color: #fff2e3; background: #504032; font-weight: 700; }

.gp-tap__contact {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 5%;
  padding: 24% 8% 0;
  text-align: center;
  background: linear-gradient(165deg, #fcfaf6, #ece2d8);
  opacity: 0;
}

.gp-tap__contact-label { color: #604d40; font-family: Georgia, serif; font-size: 1.15em; }
.gp-tap__avatar { display: grid; place-items: center; width: 34%; aspect-ratio: 1; border-radius: 50%; background: #dcccba; font-family: Georgia, serif; }
.gp-tap__contact strong { font: 600 clamp(10px, 3.25cqw, 23px)/1.02 Georgia, serif; }
.gp-tap__contact small { color: #604d40; }
.gp-tap__address { padding-block: 5%; border-top: 1px solid #d6c7b9; font-size: .76em; }
.gp-tap__save { padding: 7% 10%; border-radius: 999px; background: #342b24; color: #fff8ee; font-size: .81em; }

/* The card's NFC mark is its transform origin. The pulse uses the same target. */
.gp-tap__card {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.gp-tap__card img {
  position: absolute;
  top: var(--card-y);
  left: var(--card-x);
  width: 47%;
  height: auto;
  margin: 0;
  border-radius: 6%;
  transform: translate(-93%, -15%) rotate(-11deg);
  transform-origin: 93% 15%;
  box-shadow: 1px 2px 0 #101723, 4px 12px 21px #100d09a6;
}
.gp-tap__pulse {
  position: absolute;
  z-index: 3;
  top: var(--tap-y);
  left: var(--tap-x);
  width: 8%;
  aspect-ratio: 1;
  border: 1px solid #fff8e8;
  border-radius: 50%;
  box-shadow: 0 0 8px #fff5dca6;
  opacity: 0;
  transform: translate(-50%, -50%);
}
.gp-tap__stage.is-playing .gp-tap__card { animation: gp-tap-travel var(--tap-time) both; }
.gp-tap__stage.is-playing .gp-tap__card img { animation: gp-tap-card var(--tap-time) both; }
.gp-tap__stage.is-playing .gp-tap__pulse { animation: gp-tap-pulse var(--tap-time) both; }
.gp-tap__stage.is-playing .gp-tap__notice { animation: gp-tap-notice var(--tap-time) both; }
.gp-tap__stage.is-playing .gp-tap__contact { animation: gp-tap-contact var(--tap-time) both; }
.gp-tap__stage.is-complete .gp-tap__contact { opacity: 1; }
.gp-tap__stage.is-complete .gp-tap__card { transform: translate(-7%, 3%); }
.gp-tap__stage.is-complete .gp-tap__card img { transform: translate(-93%, -15%) rotate(-11deg) scale(.88); }
.gp-tap__stage.is-playing:not([data-platform="android"]) .gp-tap__front::before,
.gp-tap__stage.is-playing[data-platform="android"] .gp-tap__rear::before { animation: gp-tap-rim-light var(--tap-time) both; }

.gp-tap__stage[data-platform="android"] .gp-tap__phone {
  aspect-ratio: 70.8 / 150.5;
  border-color: #a8a89d;
  background: linear-gradient(150deg, #767b72, #222723 72%, #71776c);
  transform-style: preserve-3d;
}
.gp-tap__stage[data-platform="android"] .gp-tap__front {
  backface-visibility: hidden;
  transform: translateZ(.7px);
}
.gp-tap__stage[data-platform="android"] .gp-tap__rear {
  position: absolute;
  inset: 1% 1.5%;
  display: block;
  border-radius: 13% / 6.5%;
  background: linear-gradient(155deg, #777e72, #394139 70%, #282f2a);
  backface-visibility: hidden;
  transform: rotateY(180deg) translateZ(.7px);
}
.gp-tap__cameras {
  position: absolute;
  inset: 7.8% 0 auto;
  height: 11.5%;
  border-block: 1px solid #a4a59b;
  border-radius: 2px;
  background: linear-gradient(180deg, #b1b5aa, #82877c 21%, #656d63 81%, #9da098 93%);
  box-shadow: 0 2px 3px #15191499, inset 0 1px #ebeae6a6;
}
.gp-tap__cameras::before,
.gp-tap__cameras::after { content: ""; position: absolute; top: 50%; transform: translateY(-50%); border-radius: 999px; }
.gp-tap__cameras::before {
  left: 11%;
  width: 54%;
  height: 74%;
  background: radial-gradient(circle closest-side at 25% 50%, #4e6582 11%, #273242 34%, #11151d 63%, transparent 72%),
    radial-gradient(circle closest-side at 75% 50%, #536b84 11%, #273242 34%, #11151d 63%, transparent 72%), #171b20;
  box-shadow: 0 0 0 1px #dddcd45e;
}
.gp-tap__cameras::after {
  right: 14%;
  width: 7%;
  aspect-ratio: 1;
  background: radial-gradient(circle, #fff1d6, #c4bca5 65%, #7e8078);
}
.gp-tap__stage[data-platform="android"] .gp-tap__island {
  left: 47.5%;
  width: 5%;
  height: auto;
  aspect-ratio: 1;
}
.gp-tap__stage[data-platform="android"] .gp-tap__wallpaper {
  background: radial-gradient(ellipse at 102% 104%, #414245 0%, #262729 46%, #18191b 74%);
}
.gp-tap__stage[data-platform="android"].is-playing .gp-tap__phone { animation: gp-tap-android-phone var(--tap-time) both; }
.gp-tap__stage[data-platform="android"].is-playing .gp-tap__notice { animation-name: gp-tap-android-notice; }

@keyframes gp-tap-travel {
  0%, 15% { transform: translate(0, 0); }
  41%, 57% { transform: translate(calc(var(--tap-x) - var(--card-x)), calc(var(--tap-y) - var(--card-y))); }
  80%, 100% { transform: translate(-7%, 3%); }
}
@keyframes gp-tap-card {
  0%, 15% { transform: translate(-93%, -15%) rotate(-11deg); }
  41%, 57% { transform: translate(-93%, -15%) rotate(-2deg) scale(.52); }
  80%, 100% { transform: translate(-93%, -15%) rotate(-11deg) scale(.88); }
}
@keyframes gp-tap-android-phone {
  0%, 68%, 100% { transform: translate(-50%, -50%) rotate(9deg) rotateY(0deg); }
  20%, 56% { transform: translate(-50%, -50%) rotate(9deg) rotateY(180deg); }
}
@keyframes gp-tap-pulse {
  0%, 40% { opacity: 0; transform: translate(-50%, -50%) scale(.4); }
  47% { opacity: .95; }
  63%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.6); }
}
@keyframes gp-tap-rim-light {
  0%, 40%, 70%, 100% { opacity: 0; }
  49% { opacity: .95; }
  57% { opacity: .52; }
}
@keyframes gp-tap-notice {
  0%, 47%, 85%, 100% { opacity: 0; }
  56%, 74% { opacity: 1; }
}
@keyframes gp-tap-android-notice {
  0%, 67%, 85%, 100% { opacity: 0; }
  73%, 78% { opacity: 1; }
}
@keyframes gp-tap-contact {
  0%, 80% { opacity: 0; transform: translateY(5%); }
  94%, 100% { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
  .gp-tap { grid-template-columns: minmax(0, 1fr); }
  .gp-tap__controls { padding-inline: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .gp-tap__stage.is-playing * { animation: none !important; }
}
