/* ───────────────────────────────────────────────────────────────────────────
   perk-up.css — the cinematic feature flythrough. Apple-product-page scroll-reveal
   choreography rendered entirely in AdPerch's own skin (cream/terracotta/charcoal,
   Playfair). Reuses /styles.css design tokens; everything else self-contained.
   ─────────────────────────────────────────────────────────────────────────── */

.pk { margin: 0; background: var(--bg-primary); color: var(--text-primary); font-family: var(--font-sans); overflow-x: clip; }
.pk main { display: block; }

/* per-accent --acc (drives the mockup hero gradients, mirrors the app) */
.acc-terracotta { --acc: #c65a36; } .acc-sage { --acc: #7d9471; }
.acc-indigo { --acc: #5a6b8a; } .acc-rose { --acc: #b06a72; }

/* ── Percy guide (fixed, rides the corner) + scroll progress ── */
/* Floating AdPerch logo pill — light backdrop so the black "A" mark reads on dark AND light scenes. */
.pk-guide { position: fixed; top: 18px; left: 22px; z-index: 50; display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; padding: 6px 14px 6px 8px; border-radius: 999px;
  background: rgba(245,242,237,.92); box-shadow: 0 2px 12px rgba(0,0,0,.16); }
@supports (backdrop-filter: blur(6px)) { .pk-guide { background: rgba(245,242,237,.78); backdrop-filter: blur(8px); } }
.pk-guide img { width: 24px; height: 24px; display: block; }
.pk-guide span { font-family: var(--font-serif); font-weight: 700; font-size: 16px; color: var(--accent-charcoal); }
.pk-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 60; background: var(--accent-terracotta);
  transition: width .1s linear; }
@media (max-width: 640px) { .pk-guide { top: 16px; left: 18px; padding: 6px; } .pk-guide span { display: none; } }

/* ── Scene scaffolding ── */
.pk-scene { position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 96px 32px; box-sizing: border-box; }
/* Percy's perch (the bar under his head) is charcoal — invisible on dark scenes; make it cream there. */
.bg-dark .hero-percy-mark .hpm-perch, .pk-dark .hero-percy-mark .hpm-perch { fill: #f5f2ed; }
.pk-scene.bg-dark, .pk-dark { background: var(--bg-tertiary); color: var(--text-on-dark); }
.pk-light { background: var(--bg-primary); }
.pk-tint { background: var(--bg-secondary); }
.pk-inner { max-width: 820px; text-align: center; }
/* Final-scene fine print: pinned to the BOTTOM of the scene (absolute, out of the centered flex flow so
   it can't float beside the headline). The .pk-close section is position:relative (via .pk-scene). On
   phones it drops into normal flow below the content (column) so it can never overlap the sig/CTAs. */
.pk-fineprint { position: absolute; left: 0; right: 0; bottom: 20px; margin: 0 auto; max-width: 560px;
  padding: 0 22px; text-align: center; color: rgba(239,233,223,.42);
  font: 400 12px/1.5 system-ui,-apple-system,sans-serif; }
@media (max-width: 640px) {
  .pk-close { flex-direction: column; }
  .pk-fineprint { position: static; margin-top: 30px; }
}
.pk-stage { width: 100%; max-width: 1080px; display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 5vw, 72px); align-items: center; }

/* ── Cold open + close (big serif) ── */
.pk-eyebrow { display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-mono); font-size: 11.5px;
  letter-spacing: .26em; color: var(--accent-terracotta); margin-bottom: 22px; }
.pk-eyebrow .hero-percy-mark { height: 13px; }
.pk-hero { font-family: var(--font-serif); font-weight: 600; font-size: clamp(46px, 9vw, 92px); line-height: 1.02;
  letter-spacing: -.025em; margin: 0; }
/* On the dark scenes the big serif washed out — brighten to near-white + a touch heavier. */
.bg-dark .pk-hero, .pk-dark .pk-hero { color: #fdfbf7; font-weight: 700; }
.pk-hero-sub { font-family: var(--font-serif); font-style: italic; font-size: clamp(18px, 3.2vw, 25px);
  color: #e4dccf; margin: 22px auto 0; max-width: 30ch; line-height: 1.4; }
.pk-cue { margin-top: 54px; display: inline-flex; flex-direction: column; align-items: center; gap: 8px; color: #8a7e72;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; }
.pk-cue svg { width: 16px; height: 22px; animation: pkBob 1.8s ease-in-out infinite; }
@keyframes pkBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* close CTA */
.pk-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 38px 0 0; }
.pk-btn { display: inline-block; font-family: var(--font-sans); font-weight: 600; font-size: 15px; text-decoration: none;
  padding: 14px 26px; border-radius: 10px; border: 0; cursor: pointer; transition: transform .14s ease, filter .14s ease, background .14s ease; }
.pk-btn:hover { transform: translateY(-1px); }
.pk-btn-gold { background: var(--accent-gold); color: var(--accent-charcoal); }
.pk-btn-gold:hover { filter: brightness(1.06); }
.pk-btn-ghost { color: #f5f2ed; border: 1px solid rgba(245,242,237,.4); }
.pk-btn-ghost:hover { background: rgba(245,242,237,.08); }
.pk-sig { margin: 30px 0 0; font-family: var(--font-mono); font-size: 12.5px; color: #a89f93; }

/* ── Scene copy column ── */
.pk-copy .pk-num { font-family: var(--font-mono); font-size: 13px; letter-spacing: .1em; color: var(--accent-terracotta); }
.pk-h { font-family: var(--font-serif); font-weight: 600; font-size: clamp(30px, 5vw, 50px); line-height: 1.08;
  letter-spacing: -.02em; margin: 12px 0 0; }
.bg-dark .pk-h, .pk-dark .pk-h { color: #fdfbf7; } /* white headings on dark scenes (e.g. "Then — the hunt") */
.pk-say { font-size: clamp(16px, 2.2vw, 19px); line-height: 1.6; color: var(--text-secondary); margin: 20px 0 0; max-width: 42ch; }
.pk-dark .pk-say { color: #cfc6b9; }
.pk-scene[data-scene="2"] .pk-say { max-width: 58ch; text-wrap: balance; } /* fit on 2 even lines, no orphaned "work." */
.pk-say em { font-style: italic; color: var(--accent-terracotta); }

/* ── Reveal choreography (Apple-style: rise + fade; art also scales in) ── */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.pk-art.reveal { transform: translateY(44px) scale(.965); transition-duration: .85s; }
.pk-scene.in .reveal { opacity: 1; transform: none; }
.pk-scene.in .pk-art.reveal { transition-delay: .08s; }

/* ════════ Crafted mockups (faithful to the real app components) ════════ */

/* Perch broadsheet (Snapshot) */
.m-perch { background: #fff; border: 1px solid var(--border-subtle); border-radius: 16px; overflow: hidden;
  box-shadow: 0 30px 70px rgba(45,37,32,.16); max-width: 460px; margin: 0 auto; }
.m-perch-hero { position: relative; min-height: 188px; padding: 22px 26px 20px; display: flex; flex-direction: column;
  justify-content: flex-end; color: #f6f0e6;
  background: radial-gradient(120% 150% at 80% 0%, var(--acc), #15110d 78%); }
.m-perch-grain { position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px); background-size: 20px 20px; }
.m-perch-ov { position: relative; }
.m-eyebrow { font-family: var(--font-mono); font-size: 10px; letter-spacing: .2em; color: rgba(245,240,230,.82); margin-bottom: 9px; }
.m-name { font-family: var(--font-serif); font-weight: 600; font-size: 30px; line-height: 1; letter-spacing: -.02em; }
.m-quote { font-family: var(--font-serif); font-size: 15px; line-height: 1.4; color: #e3dacb; margin: 10px 0 0; }
.m-perch-body { padding: 18px 26px 22px; }
.m-sub { font-size: 13px; color: var(--text-secondary); }
.m-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 13px 0 0; }
.m-tags span, .m-sq-foot span:first-child { font-family: var(--font-mono); font-size: 10px; letter-spacing: .03em;
  color: var(--text-secondary); background: var(--bg-secondary); border-radius: 999px; padding: 4px 10px; }
.m-stat { margin: 18px 0 0; display: flex; align-items: baseline; gap: 8px; }
.m-stat-n { font-family: var(--font-serif); font-size: 26px; font-weight: 600; color: var(--accent-terracotta); }
.m-stat-l { font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-tertiary); }

/* Town Square feed (mini-Snapshots) */
.m-square { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 480px; margin: 0 auto; }
.m-sq-card { background: #fff; border: 1px solid var(--border-subtle); border-radius: 13px; overflow: hidden;
  box-shadow: 0 16px 40px rgba(45,37,32,.10); }
.m-sq-hero { position: relative; min-height: 92px; padding: 13px 15px; display: flex; align-items: flex-end; color: #f6f0e6;
  background: radial-gradient(120% 150% at 78% 0%, var(--acc), #15110d 80%); }
.m-sq-ov { position: relative; }
.m-sq-ov .m-eyebrow { margin-bottom: 5px; }
.m-sq-name { font-family: var(--font-serif); font-weight: 600; font-size: 18px; line-height: 1; }
.m-sq-foot { display: flex; align-items: center; justify-content: space-between; padding: 11px 15px 13px; gap: 8px; }
.m-sq-stat { font-family: var(--font-mono); font-size: 11px; color: var(--accent-terracotta); white-space: nowrap; }

/* Co-founder match (two complementary cards bridged) */
.m-cf { display: flex; align-items: center; justify-content: center; gap: 6px; max-width: 520px; margin: 0 auto; }
.m-cf-card { flex: 1 1 0; background: #fff; border: 1px solid var(--border-subtle); border-radius: 14px; padding: 18px 16px;
  box-shadow: 0 18px 44px rgba(45,37,32,.11); text-align: center; }
.m-cf-rings svg { width: 50px; height: 28px; }
.m-cf-name { font-family: var(--font-serif); font-weight: 600; font-size: 18px; margin: 6px 0 0; }
.m-cf-pills { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 11px 0 0; }
.m-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 11px 4px 4px; border-radius: 999px; }
.m-pill i { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 999px;
  font-style: normal; font-size: 9px; font-weight: 700; color: #fff; }
.m-pill-1 { background: rgba(198,90,54,.1); color: var(--accent-terracotta); } .m-pill-1 i { background: var(--accent-terracotta); }
.m-pill-2 { background: rgba(125,148,113,.14); color: var(--accent-sage); } .m-pill-2 i { background: var(--accent-sage); }
.m-cf-seek { font-size: 12px; color: var(--text-secondary); margin: 11px 0 0; }
.m-cf-bridge { flex: 0 0 60px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.m-cf-bridge svg { width: 56px; height: 16px; }
.m-cf-bridge span { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-tertiary); }

/* ── The Playground cinematic stage (scene 3) ── */
.pk-stage-play { grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr); }
.pk-play-art { width: 100%; }
#pg-stage { position: relative; width: 100%; height: clamp(360px, 56vh, 580px); border-radius: 16px; overflow: hidden;
  background: #15120f; box-shadow: 0 30px 80px rgba(0,0,0,.4); }
#pg-canvas { display: block; width: 100%; height: 100%; }

/* ── Responsive ── */
@media (max-width: 860px) {
  .pk-stage, .pk-stage-play { grid-template-columns: 1fr; gap: 30px; }
  .pk-copy { text-align: center; }
  .pk-say { margin-left: auto; margin-right: auto; }
  .pk-scene { padding: 84px 22px; }
  #pg-stage { height: clamp(320px, 52vh, 460px); }
}
@media (max-width: 460px) {
  .m-square { grid-template-columns: 1fr; max-width: 320px; }
  .m-cf { flex-direction: column; }
  .m-cf-bridge { flex-basis: auto; }
  .m-cf-bridge svg { transform: rotate(90deg); }
}

/* ── "Show" scenes: copy centered on top, the real surface centered below ── */
/* ── Mobile overflow guard (2026-07-18). .pk-real is a flex ITEM under .pk-show/.pk-art, so it
      sizes to its mock's content and is NOT capped by the container — a 420px panel or an 850px
      kanban grows past a phone viewport and `.pk { overflow-x: clip }` silently chops both edges.
      Cap it at the container everywhere; the board's existing overflow-x:auto then finally engages,
      giving the kanban sideways scroll on mobile instead of clipping. Desktop unchanged (content
      already fits, the cap never binds). Applies to BOTH perky pages — same grammar, same bug. ── */
.pk-show .pk-real, .pk-art .pk-real { min-width: 0; max-width: 100%; }
.pk-real .board { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.pk-show { width: 100%; max-width: 1000px; display: flex; flex-direction: column; align-items: center; gap: clamp(28px, 4vw, 46px); }
.pk-show .pk-copy { text-align: center; max-width: 640px; }
.pk-show .pk-say { margin-left: auto; margin-right: auto; }
.pk-art { width: 100%; display: flex; justify-content: center; }

/* surface sizing — the real components, full-size, floated on the scene */
.pk-art .perch { max-width: 580px; width: 100%; border-radius: 16px; overflow: hidden; box-shadow: 0 34px 90px rgba(0,0,0,.34); }
.pk-art .app-doc { width: 100%; max-width: 660px; background: #fff; border: 1px solid var(--border-subtle); border-radius: 18px;
  padding: clamp(24px, 4vw, 40px); box-shadow: 0 24px 60px rgba(45,37,32,.12); text-align: left; }
.pk-art .msg-thread { width: 100%; max-width: 520px; }
.pk-art-wide { width: 100%; }
.pk-art-wide .board { max-width: 1000px; margin: 0 auto; width: 100%; }
.pk-art-duo { display: flex; gap: 28px; justify-content: center; align-items: center; flex-wrap: wrap; }
.pk-art-duo > .pk-real { flex: 0 1 auto; }
.pk-play-art #pg-stage { box-shadow: 0 34px 90px rgba(0,0,0,.46); }
/* Replay control — quiet overlay, bottom-right of the playground stage. */
.pg-replay { position: absolute; bottom: 14px; right: 14px; z-index: 2; display: inline-flex; align-items: center; gap: 6px;
  font: 600 12px/1 var(--font-mono, ui-monospace,Menlo,monospace); letter-spacing: .04em; color: #e9e1d4;
  background: rgba(16,12,9,.55); border: 1px solid rgba(239,233,223,.22); border-radius: 999px; padding: 8px 13px;
  cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: background .18s ease, border-color .18s ease, opacity .18s ease; }
.pg-replay:hover { background: rgba(16,12,9,.78); border-color: rgba(239,233,223,.4); }
.pg-replay svg { width: 14px; height: 14px; }
@media (max-width: 700px) {
  .pk-art .app-doc { padding: 22px 18px; }
}

/* ── Co-founder scene: deck on top, then [match moment + iso coffee meet] side by side ── */
.pk-cf { display: flex; flex-direction: column; align-items: center; gap: 30px; width: 100%; }
.pk-cf-meet { display: flex; gap: 26px; justify-content: center; align-items: center; flex-wrap: wrap; }
.pk-cf-meet > .pk-real { flex: 0 1 auto; }

/* the isometric coffee-shop meet vignette (two co-founders walk in + meet) */
.pk-iso-cafe { width: min(340px, 100%); }
.pk-iso-cafe svg { width: 100%; height: auto; display: block; }
.iso-fig, .iso-bubble, .iso-table { transform-box: fill-box; }
.iso-fig-a { transform: translateX(-130px); opacity: 0; }
.iso-fig-b { transform: translateX(130px); opacity: 0; }
.iso-bubble { opacity: 0; transform: translateY(8px) scale(.92); transform-origin: center bottom; }
.iso-table { opacity: 0; transform: translateY(6px) scale(.96); transform-origin: center; }
.pk-scene.in .iso-fig-a { animation: isoWalkA 1.5s cubic-bezier(.32,.72,.3,1) .25s both; }
.pk-scene.in .iso-fig-b { animation: isoWalkB 1.5s cubic-bezier(.32,.72,.3,1) .25s both; }
.pk-scene.in .iso-table { animation: isoBubble .6s ease-out 1.25s both; }       /* table settles after they sit */
.pk-scene.in .iso-bubble-a { animation: isoBubble .5s ease-out 1.85s both; }    /* "Nice to finally meet you!" */
.pk-scene.in .iso-bubble-b { animation: isoBubble .5s ease-out 2.65s both; }    /* then "What're we building today?" */
@keyframes isoWalkA { 0% { transform: translateX(-130px); opacity: 0; } 45% { opacity: 1; } 100% { transform: translateX(0); opacity: 1; } }
@keyframes isoWalkB { 0% { transform: translateX(130px); opacity: 0; } 45% { opacity: 1; } 100% { transform: translateX(0); opacity: 1; } }
@keyframes isoBubble { from { opacity: 0; transform: translateY(8px) scale(.92); } to { opacity: 1; transform: none; } }

/* ── Reduced motion: no transforms, just show ── */
@media (prefers-reduced-motion: reduce) {
  .reveal, .pk-art.reveal { opacity: 1; transform: none; transition: none; }
  .pk-cue svg { animation: none; }
  .iso-fig-a, .iso-fig-b, .iso-bubble, .iso-table { opacity: 1; transform: none; animation: none; }
}
