/* Card page intro: "the tap", built in HTML/CSS so it fits any screen shape. Flat brand colours.
   Everything is sized from --W (the card's width), which adapts to the viewport,
   so nothing is ever cropped. Animations are driven by card-intro.js. */

html.ci-open,
html.ci-open body {
  overflow: hidden;
}

.ci {
  --W: min(64vw, 27vh, 420px);
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: min(7vh, 3.5rem);
  padding: max(1.5rem, env(safe-area-inset-top)) 1.25rem max(1.5rem, env(safe-area-inset-bottom));
  background: #ed1aa8; /* flat brand magenta, like the new site */
  font-family: 'Space Grotesk', sans-serif;
  color: #0a0a0a;
  overflow: hidden;
  transition: opacity 0.5s ease;
}

.ci[hidden] {
  display: none;
}

.ci.is-leaving {
  opacity: 0;
  pointer-events: none;
}

.ci:focus {
  outline: none;
}

/* wide screens: greeting on the left, card on the right */
@media (min-aspect-ratio: 1/1) {
  .ci {
    --W: min(34vw, 40vh, 520px);
    flex-direction: row;
    gap: min(8vw, 6rem);
  }
}

.ci__greeting {
  margin: 0;
  max-width: min(90vw, 9ch);
  font-size: clamp(2.6rem, min(15vw, 8.5vh), 6.5rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.035em;
  text-align: center;
  opacity: 0;
}

@media (min-aspect-ratio: 1/1) {
  .ci__greeting {
    max-width: 9ch;
    text-align: left;
    font-size: clamp(2.6rem, min(6.5vw, 12vh), 7.5rem);
  }
}

/* the stage holds the card and leaves room below it for the phone */
.ci__stage {
  position: relative;
  width: calc(var(--W) * 1.3);
  height: calc(var(--W) * 1.75);
  flex: none;
}

.ci__card {
  position: absolute;
  left: 50%;
  top: 0;
  width: var(--W);
  aspect-ratio: 85.6 / 54;
  margin-left: calc(var(--W) / -2);
  border-radius: calc(var(--W) * 0.035);
  background: #f4f1ec; /* white PLA */
  opacity: 0;
}

.ci__chip-ring {
  position: absolute;
  left: 50%;
  top: 58%;
  width: 40%;
  aspect-ratio: 1;
  border-radius: 50%;
  translate: -50% -50%;
  background: rgba(0, 0, 0, 0.018);
  border: 1px solid rgba(0, 0, 0, 0.05); /* the faint NFC chip circle on the real card */
}

.ci__logo {
  position: absolute;
  left: 50%;
  top: 20%;
  height: 17%;
  translate: -50% 0;
  filter: brightness(0); /* black filament inlay */
}

.ci__tap {
  position: absolute;
  left: 50%;
  top: 58%;
  translate: -50% -50%;
  margin: 0;
  font-family: "Courier New", Courier, monospace; /* taste-skill-ignore: the typeface printed on Ray's real card */
  font-weight: 700;
  font-size: calc(var(--W) * 0.14);
  line-height: 1;
  color: #000;
}

/* ripples spread from the chip */
.ci__ripple {
  position: absolute;
  left: 50%;
  top: calc(var(--W) * 0.631 * 0.58);
  width: calc(var(--W) * 0.3);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid rgba(10, 10, 10, 0.8);
  translate: -50% -50%;
  opacity: 0;
  pointer-events: none;
}

/* the phone: anchored by its top edge, which lands on the chip */
.ci__phone {
  --P: calc(var(--W) * 0.6);
  position: absolute;
  left: calc(50% - var(--P) / 2);
  top: calc(var(--W) * 0.631 * 0.58 - var(--P) * 0.08);
  width: var(--P);
  aspect-ratio: 1 / 2.05;
  border-radius: calc(var(--P) * 0.16);
  padding: calc(var(--P) * 0.035);
  background: #2b2d32;
  transform-origin: 50% 4%;
  opacity: 0;
}

.ci__screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: calc(var(--P) * 0.13);
  overflow: hidden;
  background: #050507;
}

.ci__screen-on {
  position: absolute;
  inset: 0;
  padding: calc(var(--P) * 0.3) calc(var(--P) * 0.09) 0;
  background: #0a0a0a; /* the new page's ground */
  color: #f5f5f5;
  font-size: calc(var(--P) * 0.135);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.02em;
  opacity: 0;
}


.ci__island {
  position: absolute;
  top: calc(var(--P) * 0.04);
  left: 50%;
  width: 30%;
  height: calc(var(--P) * 0.075);
  translate: -50% 0;
  border-radius: 999px;
  background: #000;
}

/* the page's black sweeping out from the chip, so the hand-off to the page is seamless */
.ci__wave {
  position: fixed;
  inset: 0;
  background: #0a0a0a;
  clip-path: circle(0 at 50% 50%);
  pointer-events: none;
}

.ci__skip {
  position: absolute;
  top: max(1rem, env(safe-area-inset-top));
  right: max(1rem, env(safe-area-inset-right));
  z-index: 2;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #f5f5f5;
  background: #0a0a0a;
  border: 0;
  border-radius: 0;
  min-height: 44px;
  padding: 0.7rem 1.3rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ci.show-skip .ci__skip,
.ci__skip:focus-visible {
  opacity: 1;
}

.ci__skip:focus-visible {
  outline: 3px solid #0a0a0a;
  outline-offset: 4px;
}

@media (pointer: coarse) {
  .ci__skip {
    opacity: 1;
  }
}

@media (forced-colors: active) {
  .ci__skip {
    opacity: 1;
    border: 2px solid ButtonText;
  }
}
