@import url("./vendor/devices-css/iphone-14-pro.css") layer(buy-device);

.buy-chapter {
  min-height:0;
  padding:0;
  background:white;
  text-align:start;
  font-family:var(--display);
}
.buy-chapter:focus { outline:none; }
.buy-chapter [hidden] { display:none !important; }
.bc-wrap { width:min(1160px,88%); margin-inline:auto; }
.buy-concept .bc-lead {
  margin:22px 0 0;
  color:#50617c;
  font:500 clamp(1.04rem,1.55vw,1.27rem)/1.5 var(--display);
  letter-spacing:-.034em;
  text-wrap:pretty;
}
.buy-concept h2 {
  font-size:clamp(3.4rem,5.85vw,5.55rem);
  line-height:1.015;
  letter-spacing:-.065em;
}
.bc-link {
  display:inline-flex; align-items:center; justify-content:center;
  min-height:44px;
  gap:.6em;
  font:750 .96rem/1.2 var(--display);
  letter-spacing:-.025em;
}
.bc-link svg { width:1.15em; height:1.15em; }
.bc-link:hover { text-decoration:underline; text-underline-offset:.25em; }

/* All steps share one card, including during screen transitions. */
.bc-quote {
  overflow:clip;
  background:radial-gradient(ellipse at 50% 30%,#fff5dc,#ffe6af 75%,#ffdda0);
}
.bc-quote-layout {
  display:grid;
  width:min(1088px,88%);
  grid-template-columns:minmax(0,.82fr) minmax(0,1.18fr);
  gap:clamp(32px,5vw,72px);
  align-items:center;
  padding-block:clamp(54px,5.5vw,80px);
}
.bc-quote-copy h2 { font-size:clamp(2.25rem,4.7vw,3.95rem); }
.bc-quote-copy h2 span { color:var(--blue); }
.bc-quote-copy .bc-lead {
  max-width:20em;
  margin-top:20px;
}
.bc-quote-stage {
  position:relative;
  isolation:isolate;
  display:grid;
  place-items:center;
  --card-width:min(382px,calc(100% - 56px));
  --rosette-size:clamp(182px,19.5vw,280px);
  --rosette-inset:max(0px,calc((100% - var(--card-width)) / 2 - 98px));
  width:100%;
  padding-block:clamp(24px,2.5vw,36px);
}
.bc-quote-stage::before,.bc-quote-stage::after {
  content:"";
  position:absolute;
  z-index:-1;
  width:var(--rosette-size);
  aspect-ratio:1;
  background:#ac803d;
  opacity:.47;
  mask:url("./buy-guilloche.svg") center/contain no-repeat;
  pointer-events:none;
}
.bc-quote-stage::before {
  top:0;
  right:var(--rosette-inset);
}
.bc-quote-stage::after {
  bottom:0;
  left:var(--rosette-inset);
}
.bc-form {
  position:relative;
  container-type:inline-size;
  width:var(--card-width);
  margin:0;
  border:1px solid #f6e8cd;
  border-radius:23px;
  background:white;
  overflow:hidden;
  box-shadow:0 23px 48px -19px #815c2754,0 4px 14px #72532616;
}
.bc-scene { display:block; width:100%; height:auto; aspect-ratio:380 / 448; border:0; pointer-events:none; }
.bc-form:not([data-ready])::after {
  content:"";
  position:absolute;
  inset:0;
  background:white var(--poster,url("./purchase-poster.webp")) center / 100% 100% no-repeat;
}
@container (max-width:379px) {
  .bc-form::after { --poster:url("./purchase-poster-compact.webp"); }
}
@container (max-width:310px) {
  .bc-form::after { --poster:url("./purchase-poster-small.webp"); }
}
.bc-phone iframe { display:block; width:100%; border:0; background:white; }

/* The engraved paper and the card approach from different depths, then settle
   into the flat reading view before the first payment action. */
@media (prefers-reduced-motion: no-preference) {
  .bc-quote-stage {
    --entrance: perspective(1050px) translate3d(18px, 35px, -85px) rotateX(10deg) rotateY(-14deg) rotateZ(2.4deg);
    --far-print: translate(23px, -17px) rotate(6deg) scale(.94);
    --near-print: translate(-19px, 24px) rotate(-5deg) scale(1.05);
  }
  .bc-quote-stage[data-arrival="waiting"] .bc-form { transform:var(--entrance); }
  .bc-quote-stage[data-arrival="waiting"]::before { transform:var(--far-print); }
  .bc-quote-stage[data-arrival="waiting"]::after { transform:var(--near-print); }
  .bc-quote-stage[data-arrival="entering"] .bc-form {
    animation:purchase-arrival 1250ms cubic-bezier(.19,.82,.2,1) both;
  }
  .bc-quote-stage[data-arrival="entering"]::before {
    animation:purchase-far-print 1000ms cubic-bezier(.22,.7,.25,1) both;
  }
  .bc-quote-stage[data-arrival="entering"]::after {
    animation:purchase-near-print 1250ms cubic-bezier(.22,.7,.25,1) both;
  }
  @keyframes purchase-arrival { from { transform:var(--entrance); } to { transform:none; } }
  @keyframes purchase-far-print { from { transform:var(--far-print); } to { transform:none; } }
  @keyframes purchase-near-print { from { transform:var(--near-print); } to { transform:none; } }
}
@media (max-width:700px) and (prefers-reduced-motion:no-preference) {
  .bc-quote-stage {
    --entrance: perspective(900px) translate3d(5px, 22px, -48px) rotateX(7deg) rotateY(-9deg) rotateZ(1.5deg);
    --far-print: translate(9px, -12px) rotate(5deg);
    --near-print: translate(-8px, 13px) rotate(-3deg);
  }
}

/* The portrait uses the approved poster and the licensed iPhone frame at its native proportions. */
.bc-poster {
  overflow:hidden;
  padding-block:clamp(50px,5.2vw,77px) clamp(38px,4.2vw,64px);
  text-align:center;
  background:radial-gradient(ellipse at 50% 30%,#fff5dc,#ffe6af 75%,#ffdda0);
}
.bc-poster-copy h2 { font-size:clamp(3.4rem,5.3vw,5.15rem); }
.bc-poster-copy .bc-lead { margin:13px auto 7px; color:#5e5343; }
.bc-poster-copy .bc-link { color:#4f442f; }
.bc-phone {
  --phone-scale:.735;
  width:calc(428px * var(--phone-scale));
  height:calc(868px * var(--phone-scale));
  margin:28px auto 0;
  filter:drop-shadow(0 16px 24px #71511c29);
}
.bc-phone > .device { transform:scale(var(--phone-scale)); transform-origin:top left; }
.bc-phone .device-screen { overflow:hidden; padding-top:49px; background:#f7f8fc; }
.bc-phone iframe { height:100%; background:#f7f8fc; }
.bc-phone [aria-hidden] { pointer-events:none; }
@media(max-width:900px) {
  .bc-wrap { width:91%; }
  .bc-quote-layout { gap:26px; grid-template-columns:minmax(0,.72fr) minmax(0,1fr); }
}
@media(max-width:700px) {
  .bc-wrap { width:calc(100% - 38px); }
  .buy-concept h2 { font-size:clamp(2.43rem,8.2vw,3.3rem); }
  .buy-concept .bc-lead { font-size:1rem; line-height:1.47; }
  .bc-quote-layout {
    width:min(390px,calc(100% - clamp(36px,10vw,48px)));
    grid-template-columns:minmax(0,1fr);
    gap:22px;
    padding-block:clamp(34px,8vw,46px);
  }
  .bc-quote-copy { text-align:center; }
  .bc-quote-copy .bc-lead { margin:12px auto 0; max-width:22em; }
  .bc-quote-stage {
    --card-width:min(350px,100%);
    --rosette-size:clamp(120px,34vw,155px);
    --rosette-inset:calc((100% - var(--card-width)) / 2 - 10px);
    padding-block:24px;
  }
  .bc-form { border-radius:18px; }
  .bc-poster { padding-block:41px 38px; }
  .bc-poster-copy .bc-lead { max-width:24em; margin:12px auto 3px; }
  .bc-phone { margin-top:17px; --phone-scale:.74; }
}
@media(max-width:355px) {
  .bc-wrap { width:calc(100% - 28px); }
  .bc-quote-layout { width:calc(100% - 36px); }
  .bc-quote-copy h2 { font-size:clamp(2rem,10.6vw,2.34rem); }
  .bc-phone { --phone-scale:.665; }
}
