/* The portal demo in the home hero. Lengths inside the phone screen are iOS
   points: the kit's Phone scales the whole screen (326 px wide: 1pt = 0.76px). */

.pd-stage {
  --pd-gutter: 32px;
  --pd-arrive: cubic-bezier(0.25, 0.8, 0.25, 1);
  --pd-touch: cubic-bezier(0.3, 0.75, 0.1, 1);
  position: relative;
  width: 480px;
  height: 540px;
  overflow: hidden;
  border-radius: 14px;
  background:
    linear-gradient(#E4E4DF 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, #E4E4DF 1px, transparent 1px) 0 0 / 32px 32px,
    var(--stage);
  font-family: var(--font);
  line-height: 1.3;
  color: var(--ink);
}

.pd-stage .pd-phone { position: absolute; top: var(--pd-gutter); right: var(--pd-gutter); }

.pd-stage .pd-app, .pd-stage .pd-cam { position: absolute; inset: 0; letter-spacing: 0; font-family: var(--font); }
.pd-stage .pd-app { background: var(--paper); color: var(--ink); }

/* Placeholder bar */
.pd-stage .pd-b { display: block; height: 8px; border-radius: 4px; background: #D9DBE0; }

/* App chrome: the portal's navy header and gold stripe */
.pd-stage .pd-bar { height: 118px; padding: 72px 20px 0; background: var(--ink); }
.pd-stage .pd-mark { width: 34px; height: 35px; mix-blend-mode: screen; }
.pd-stage .pd-stripe { height: 6px; }

/* The list and the opened plan share the space under the header */
.pd-stage .pd-body {
  position: absolute; inset: 124px 0 0;
  transition: opacity 0.2s ease, transform 0.3s var(--pd-touch);
  will-change: transform;
}
.pd-stage .pd-list { padding: 22px 20px 0; }
.pd-stage .pd-plan { opacity: 0; transform: translateY(8px); }
.pd-stage .pd-title { font-size: 30px; font-weight: 700; font-stretch: 75%; line-height: 36px; }
.pd-stage .pd-who { font-size: 16px; line-height: 24px; color: var(--muted); }

.pd-stage .pd-files { margin-top: 18px; border-bottom: 1px solid var(--line); }
.pd-stage .pd-row {
  position: relative; display: flex; align-items: center; gap: 12px;
  height: 58px; border-top: 1px solid var(--line);
  transition: opacity 0.5s ease, transform 0.8s var(--pd-arrive);
  will-change: transform;
}
.pd-stage .pd-row:nth-child(1) { transition-delay: 0.25s; }
.pd-stage .pd-row:nth-child(2) { transition-delay: 0.33s; }
.pd-stage .pd-row:nth-child(3) { transition-delay: 0.41s; }
.pd-stage .pd-row::before {
  content: ""; position: absolute; inset: 5px -8px; border-radius: 10px;
  background: rgba(3, 20, 47, 0.07); opacity: 0; transition: opacity 0.15s ease;
}
.pd-stage .pd-row[data-pressed]::before { opacity: 1; }
.pd-stage .pd-row svg { flex: none; }
.pd-stage .pd-row svg:last-child { margin-left: auto; color: var(--muted); }
.pd-stage .pd-name { font-size: 17px; font-weight: 600; line-height: 22px; white-space: nowrap; }

.pd-stage .pd-foot { display: grid; gap: 1px; margin-top: 24px; border: 1px solid var(--ink); background: var(--ink); }
.pd-stage .pd-foot span { display: grid; gap: 9px; padding: 13px 14px; background: var(--paper); }
.pd-stage .pd-foot .pd-b:first-child { width: 64px; height: 6px; }
.pd-stage .pd-foot span:first-child .pd-b:last-child { width: 132px; }
.pd-stage .pd-foot span:last-child .pd-b:last-child { width: 208px; }

.pd-stage .pd-planbar { display: flex; align-items: center; gap: 4px; height: 56px; padding: 0 12px; }
.pd-stage .pd-back {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%;
  transition: background-color 0.15s ease;
}
.pd-stage .pd-back[data-pressed] { background: rgba(3, 20, 47, 0.1); }
.pd-stage .pd-paper { margin: 0 20px; padding: 18px; height: 620px; border: 1px solid var(--line); background: #fff; }
.pd-stage .pd-paper svg { display: block; width: 100%; height: auto; }

/* Camera: the phone looks at the sheet's title block */
.pd-stage .pd-cam {
  z-index: 1; background: #C9C7C0; color: var(--ink);
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s 0.3s;
}
.pd-stage .pd-cam::before { content: ""; position: absolute; inset: 0 0 auto; height: 150px; background: linear-gradient(rgba(0, 0, 0, 0.6), transparent); }
.pd-stage .pd-shot { position: absolute; top: 262px; left: -40px; right: 62px; display: flex; border: 2px solid var(--ink); background: #E9E7E1; }
.pd-stage .pd-shot-cells { flex: 1; display: grid; }
.pd-stage .pd-shot-cells .pd-b { align-self: center; margin-left: 64px; height: 12px; border-radius: 6px; background: #B5B5B0; }
.pd-stage .pd-shot-cells .pd-b:nth-child(1) { width: 96px; }
.pd-stage .pd-shot-cells .pd-b:nth-child(2) { width: 132px; }
.pd-stage .pd-shot-cells .pd-b:nth-child(3) { width: 72px; }
.pd-stage .pd-shot-qr { position: relative; flex: none; width: 196px; padding: 20px; border-left: 2px solid var(--ink); }
.pd-stage .pd-shot-qr svg { display: block; }
.pd-stage .pd-find { position: absolute; inset: 8px; transform: scale(1.2); transition: transform 0.35s var(--pd-touch); }
.pd-stage .pd-find i { position: absolute; width: 26px; height: 26px; border: 0 solid #fff; transition: border-color 0.2s ease; }
.pd-stage .pd-find i:nth-child(1) { top: 0; left: 0; border-width: 4px 0 0 4px; border-top-left-radius: 8px; }
.pd-stage .pd-find i:nth-child(2) { top: 0; right: 0; border-width: 4px 4px 0 0; border-top-right-radius: 8px; }
.pd-stage .pd-find i:nth-child(3) { bottom: 0; left: 0; border-width: 0 0 4px 4px; border-bottom-left-radius: 8px; }
.pd-stage .pd-find i:nth-child(4) { bottom: 0; right: 0; border-width: 0 4px 4px 0; border-bottom-right-radius: 8px; }
.pd-stage .pd-link {
  position: absolute; top: 486px; left: 163px; display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: 19px; background: var(--gold-light);
  opacity: 0; transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.3s var(--pd-arrive), filter 0.1s ease;
}
.pd-stage .pd-link .pd-b { width: 96px; background: rgba(3, 20, 47, 0.45); }
.pd-stage .pd-link[data-pressed] { filter: brightness(0.9); }
.pd-stage .pd-camfoot {
  position: absolute; inset: 596px 0 0; display: flex; justify-content: center; gap: 22px;
  padding-top: 22px; background: rgba(0, 0, 0, 0.62);
}
.pd-stage .pd-camfoot .pd-b { width: 44px; background: rgba(255, 255, 255, 0.4); }
.pd-stage .pd-camfoot .pd-b:nth-child(2) { background: var(--gold); }

/* Satellite: the corner of a drawing sheet. It runs off the left edge and
   covers only the filler at the foot of the phone. */
.pd-stage .pd-sheet {
  position: absolute; left: -48px; bottom: var(--pd-gutter); width: 304px; height: 148px;
  padding: 0 8px 8px 0; background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04), 0 14px 32px -8px rgba(50, 50, 93, 0.24), 0 4px 10px -4px rgba(0, 0, 0, 0.1);
}
.pd-stage .pd-sheet-lines { display: block; width: 100%; height: 52px; border-right: 1px solid var(--ink); }
.pd-stage .pd-tb { display: flex; height: 88px; border: 1px solid var(--ink); border-left: 0; }
.pd-stage .pd-tb-cells { flex: 1; display: grid; gap: 1px; background: var(--ink); }
.pd-stage .pd-tb-cells span { display: flex; align-items: center; justify-content: flex-end; padding-right: 14px; background: #fff; }
.pd-stage .pd-tb-cells .pd-b { height: 6px; }
.pd-stage .pd-tb-cells span:nth-child(1) .pd-b { width: 84px; }
.pd-stage .pd-tb-cells span:nth-child(2) .pd-b { width: 56px; }
.pd-stage .pd-tb-cells span:nth-child(3) .pd-b { width: 70px; }
.pd-stage .pd-qr { position: relative; flex: none; width: 86px; padding: 10px; border-left: 1px solid var(--ink); }
.pd-stage .pd-qr svg { display: block; }
.pd-stage .pd-qr::after { content: ""; position: absolute; inset: 5px; border: 2px solid var(--gold); border-radius: 4px; opacity: 0; }

/* Tap marker, after the kit's touch cursor */
.pd-stage .pd-tap {
  position: absolute; z-index: 5; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%;
  background: rgba(118, 118, 128, 0.24); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  opacity: 0; transform: scale(0.7); pointer-events: none;
  transition: opacity 0.4s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.pd-stage .pd-tap[data-on] { opacity: 1; transform: scale(1); transition-duration: 0.14s, 0.16s; }
.pd-stage .pd-tap[data-down] { background: rgba(118, 118, 128, 0.36); transform: scale(0.82); transition-duration: 0.08s, 0.1s; }

/* Scenes. No data-scene is the poster: the file list. */
.pd-stage[data-scan] .pd-qr::after { animation: pd-pulse 0.8s ease-out 2; }
.pd-stage[data-scene="camera"] .pd-cam { opacity: 1; visibility: visible; transition-delay: 0.1s, 0s; }
.pd-stage[data-scene="camera"] .pd-row { opacity: 0; transform: translateY(8px); transition-duration: 0.25s; }
.pd-stage[data-scene="camera"] .pd-row:nth-child(1) { transition-delay: 0.14s; }
.pd-stage[data-scene="camera"] .pd-row:nth-child(2) { transition-delay: 0.07s; }
.pd-stage[data-scene="camera"] .pd-row:nth-child(3) { transition-delay: 0s; }
.pd-stage[data-lock] .pd-find { transform: scale(1); }
.pd-stage[data-lock] .pd-find i { border-color: var(--gold); }
.pd-stage[data-lock] .pd-link { opacity: 1; transform: none; transition-delay: 0.2s, 0.2s, 0s; }
.pd-stage[data-scene="plan"] .pd-list { opacity: 0; transform: translateY(8px); }
.pd-stage[data-scene="plan"] .pd-plan { opacity: 1; transform: none; }

@keyframes pd-pulse {
  from { opacity: 0.9; transform: scale(1); }
  to { opacity: 0; transform: scale(1.45); }
}

/* Compact: the phone column. The phone spans the stage and the sheet shrinks to its title block. */
@media (max-width: 37.4375rem) {
  .pd-stage {
    --pd-gutter: 16px;
    width: 358px;
    height: 500px;
    background-position: 16px 16px, 16px 16px, 0 0;
  }

  .pd-stage .pd-sheet { left: -56px; width: 256px; height: 96px; }
  .pd-stage .pd-sheet-lines { display: none; }
}
/* ponytail: zoom steps keep the 358 px design whole on narrower phones; switch to a fluid scale if a width between the steps looks cramped. */
@media (max-width: 24.3125rem) { .pd-stage { zoom: 0.91; } }
@media (max-width: 22.4375rem) { .pd-stage { zoom: 0.8; } }
