/* ==========================================================================
   Promptly Found: homepage depth layer
   Load after the site stylesheet and after site-depth.css. Every rule is
   scoped to html.pfx, a class that home-depth.js adds only when the homepage
   hero is on the page. Shared rules (header, buttons, search box, headline
   figures, crawler grid, reading path, evidence marks, footer, the motion
   tokens and the reduced-motion switch) live in site-depth.css.
   ========================================================================== */

@property --pfx-glow { syntax: "<percentage>"; inherits: false; initial-value: 0%; }

/* ---- Hero backdrop: tinted light and the dot field ---------------------- */
.pfx .pf-home-hero { position: relative; isolation: isolate; }
.pfx .pf-home-hero::before {
  content: ""; position: absolute; z-index: -2; pointer-events: none;
  top: -56px; bottom: -64px; left: calc(50% - 50vw); width: 100vw;
  background:
    radial-gradient(34% 58% at 73% 46%, var(--accent-tint), transparent 72%),
    radial-gradient(28% 46% at 10% 84%, var(--sec-ai-search-tint), transparent 70%);
  -webkit-mask-image: linear-gradient(180deg, #000 62%, transparent);
  mask-image: linear-gradient(180deg, #000 62%, transparent);
}
.pfx .pfx-field {
  position: absolute; z-index: -1; pointer-events: none;
  top: -56px; left: calc(50% - 50vw); width: 100vw; height: calc(100% + 120px);
  -webkit-mask-image: radial-gradient(75% 85% at 68% 38%, #000 35%, transparent 88%);
  mask-image: radial-gradient(75% 85% at 68% 38%, #000 35%, transparent 88%);
}

/* ---- Hero: headline, proof row, buttons, search ------------------------- */
.pfx .pfx-w { display: inline-block; clip-path: inset(-.14em -.1em -.28em); }
.pfx .pfx-w > span {
  display: inline-block; translate: 0 140%;
  transition: translate 1s var(--pfx-ease) calc(var(--pfx-i) * 60ms);
}
.pfx .pfx-go .pfx-w > span { translate: none; }

.pfx .pf-hero__proof { position: relative; border-top-color: transparent; }
.pfx .pf-hero__proof::before {
  content: ""; position: absolute; inset: -2px 0 auto; height: 2px;
  background: var(--ink); transform-origin: 0 50%;
  transition: scale 1.1s var(--pfx-ease) calc(var(--pfx-i, 0) * 70ms);
}
.pfx .pf-hero__proof[data-pfx]:not(.pfx-in)::before { scale: 0 1; }

/* The hover lift of the buttons is site-wide (site-depth.css). */
.pfx .pf-hero__cta .pf-btn:not(.pf-btn--primary) { background: color-mix(in srgb, var(--paper) 86%, transparent); }

/* ---- Hero figure: a stack of pages that tilts under the pointer --------- */
.pfx .pf-anatomy {
  position: relative;
  border: 1px solid color-mix(in srgb, var(--ink) 9%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 62%, var(--paper)), var(--panel) 55%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / .8),
    0 12px 0 -6px var(--paper), 0 12px 0 -5px color-mix(in srgb, var(--ink) 13%, var(--paper)),
    0 24px 0 -12px var(--paper), 0 24px 0 -11px color-mix(in srgb, var(--ink) 10%, var(--paper)),
    0 36px 44px -20px rgb(var(--pfx-shade) / .2), 0 80px 90px -56px rgb(var(--pfx-shade) / .34);
  transform: perspective(1500px) rotateX(var(--pfx-rx, 0deg)) rotateY(var(--pfx-ry, 0deg));
  transform-style: preserve-3d;
  transition: transform .7s var(--pfx-ease);
}
.pfx .pf-anatomy.pfx-tilt { --pfx-z: 1; transition-duration: .18s; }
.pfx .pf-anatomy__q,
.pfx .pf-anatomy__ans { transition: transform .7s var(--pfx-ease); }
.pfx .pf-anatomy__q {
  box-shadow: 0 1px 1px rgb(var(--pfx-shade) / .04), 0 8px 16px -12px rgb(var(--pfx-shade) / .25);
  transform: translateZ(calc(var(--pfx-z, 0) * 26px));
}
.pfx .pf-anatomy__sub { box-shadow: 0 1px 1px rgb(var(--pfx-shade) / .05); }
.pfx .pf-anatomy__ans {
  box-shadow: 0 18px 28px -18px rgb(var(--pfx-shade) / .7);
  transform: translateZ(calc(var(--pfx-z, 0) * 44px));
}

/* cited source <-> citation number, linked on hover */
.pfx .pf-anatomy__src { border-radius: 4px; transition: background-color .2s, box-shadow .2s, color .3s; }
.pfx .pf-anatomy__src i { transition: background-color .3s, box-shadow .3s; }
.pfx .pf-anatomy__src em { transition: opacity .4s; }
.pfx .pf-anatomy__src.pfx-hot {
  background: var(--paper);
  box-shadow: -8px 0 0 var(--paper), 8px 0 0 var(--paper);
}
.pfx .pf-anatomy__ans sup { border-radius: 2px; transition: background-color .2s, box-shadow .2s, color .2s; }
.pfx .pf-anatomy__ans sup.pfx-hot {
  background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 3px var(--accent);
}

/* the build sequence: everything waits, then arrives in pipeline order */
.pfx .pfx-seq .pf-anatomy__cols .pf-anatomy__step,
.pfx .pfx-seq .pf-anatomy__sub,
.pfx .pfx-seq .pf-anatomy__src,
.pfx .pfx-seq .pf-anatomy__ans,
.pfx .pfx-seq .pf-anatomy__foot,
.pfx .pfx-seq .pfx-t { opacity: 0; }
.pfx .pfx-seq .pf-anatomy__sub { translate: -12px 0; }
.pfx .pfx-seq .pf-anatomy__src { translate: 12px 0; }
.pfx .pfx-seq .pf-anatomy__ans { translate: 0 14px; }
.pfx .pfx-seq .pfx-on {
  opacity: 1; translate: none;
  transition: opacity .45s var(--pfx-ease), translate .6s var(--pfx-ease), background-color .2s, box-shadow .2s, color .3s;
}
.pfx .pfx-seq .pf-anatomy__src:not(.pfx-judged) { color: var(--ink-2); font-weight: 400; }
.pfx .pfx-seq .pf-anatomy__src:not(.pfx-judged) i { background: transparent; box-shadow: inset 0 0 0 1.25px var(--ink-3); }
.pfx .pfx-seq .pf-anatomy__src:not(.pfx-judged) em { opacity: 0; }
.pfx .pfx-seq .pf-anatomy__src.pfx-judged:not(.pf-anatomy__src--no) i { animation: pfx-cite .8s var(--pfx-ease); }
.pfx .pf-anatomy__q.pfx-typing::after {
  content: ""; display: inline-block; width: 2px; height: .95em; margin-left: 3px;
  vertical-align: -.12em; background: var(--accent); animation: pfx-blink .9s steps(1) infinite;
}
.pfx .pf-anatomy__q.pfx-sent { animation: pfx-sent .9s var(--pfx-ease); }
@keyframes pfx-blink { 50% { opacity: 0; } }
@keyframes pfx-sent {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); }
  100% { box-shadow: 0 0 0 12px transparent; }
}
@keyframes pfx-cite {
  0% { scale: .4; box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  55% { scale: 1.3; }
  100% { scale: 1; box-shadow: 0 0 0 10px transparent; }
}

/* ---- Findings: rules that draw, numbers that count, a wash on hover ----- */
.pfx .pf-findings-home a {
  position: relative; margin-inline: -16px; padding: 16px 16px 18px;
  border-top-color: transparent; border-radius: 0 0 8px 8px;
  background: linear-gradient(180deg, var(--accent-tint), transparent) no-repeat 0 0 / 100% 0%;
  transition: background-size .55s var(--pfx-ease);
}
.pfx .pf-findings-home a:hover { background-size: 100% 100%; }
.pfx .pf-findings-home a::before,
.pfx .pf-findings-home a::after {
  content: ""; position: absolute; top: -2px; height: 2px; transform-origin: 0 50%;
}
.pfx .pf-findings-home a::before {
  inset-inline: 16px; background: var(--ink);
  transition: scale 1.1s var(--pfx-ease) calc(var(--pfx-i, 0) * 70ms);
}
.pfx .pf-findings-home a[data-pfx]:not(.pfx-in)::before { scale: 0 1; }
.pfx .pf-findings-home a::after {
  inset-inline: 0; background: var(--accent); scale: 0 1;
  transition: scale .5s var(--pfx-ease);
}
.pfx .pf-findings-home a:hover::after { scale: 1 1; }

/* ---- Recessed bands: tools and crawlers sit in a well ------------------- */
.pfx .pfx-band { position: relative; isolation: isolate; padding-block: 88px 96px; }
.pfx .pfx-band::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  inset-block: 0; left: calc(50% - 50vw); width: 100vw;
  background: var(--panel);
  box-shadow: inset 0 1px 0 var(--line), inset 0 -1px 0 var(--line),
    inset 0 18px 26px -24px rgb(var(--pfx-shade) / .22), inset 0 -18px 26px -24px rgb(var(--pfx-shade) / .14);
}

.pfx .pfx-tools .pf-entries--cols { column-gap: 20px; }
.pfx .pfx-tools .pf-entry {
  align-content: start; padding: 24px 24px 26px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--paper);
  box-shadow: var(--pfx-lift-1);
  transition: transform .4s var(--pfx-ease), box-shadow .4s var(--pfx-ease), border-color .2s;
}
.pfx .pfx-tools .pf-entry:hover {
  transform: translateY(-5px); box-shadow: var(--pfx-lift-2);
  border-color: color-mix(in srgb, var(--ink) 24%, transparent);
}

/* ---- Six sections: lit from the pointer, lifted in their own colour ----- */
.pfx .pf-section {
  border: 1px solid color-mix(in srgb, var(--h) 16%, transparent);
  background:
    radial-gradient(300px circle at var(--pfx-mx, 82%) var(--pfx-my, 12%),
      color-mix(in srgb, var(--h) var(--pfx-glow), transparent), transparent 70%),
    linear-gradient(165deg, color-mix(in srgb, var(--t) 50%, var(--paper)), var(--t) 62%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .65), 0 1px 2px color-mix(in srgb, var(--h) 14%, transparent);
  transition: transform .45s var(--pfx-ease), box-shadow .45s var(--pfx-ease), border-color .3s, --pfx-glow .35s;
}
.pfx .pf-section:hover {
  --pfx-glow: 20%;
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--h) 40%, transparent);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .65),
    0 8px 14px -10px color-mix(in srgb, var(--h) 40%, transparent),
    0 28px 44px -26px color-mix(in srgb, var(--h) 70%, transparent);
}
.pfx .pf-section > svg { transform-origin: 70% 30%; transition: transform .6s var(--pfx-spring); }
.pfx .pf-section:hover > svg { transform: scale(1.1) rotate(-5deg); }
.pfx .pf-section[data-pfx] > svg > * {
  stroke-dasharray: var(--pfx-len, none); stroke-dashoffset: var(--pfx-len, 0);
}
.pfx .pf-section[data-pfx].pfx-in > svg > * {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.4s var(--pfx-ease) calc(var(--pfx-i, 0) * 70ms + 250ms);
}

/* ---- Recently reviewed --------------------------------------------------- */
.pfx .pf-lead__main[data-pfx]:not(.pfx-in) .pf-figstrip::before { scale: 0 1; }
.pfx .pf-lead__side a { position: relative; transition: translate .4s var(--pfx-ease); }
.pfx .pf-lead__side a::before {
  content: ""; position: absolute; left: -18px; top: 3px; bottom: 27px; width: 2px;
  background: var(--h, var(--accent)); transform-origin: 50% 0; scale: 1 0;
  transition: scale .4s var(--pfx-ease);
}
.pfx .pf-lead__side a:hover { translate: 6px 0; }
.pfx .pf-lead__side a:hover::before { scale: 1 1; }

/* ---- Scroll reveal (kept last so it wins over the hover transitions) ---- */
html.pfx [data-pfx][data-pfx] {
  transition: opacity .8s var(--pfx-ease), translate .8s var(--pfx-ease);
  transition-delay: calc(var(--pfx-i, 0) * 70ms);
}
html.pfx [data-pfx][data-pfx]:not(.pfx-in) { opacity: 0; translate: 0 22px; }
html.pfx [data-pfx="hold"][data-pfx]:not(.pfx-in) { opacity: 1; translate: none; }

@media (max-width: 900px) {
  .pfx .pfx-band { padding-block: 56px 64px; }
  .pfx .pf-home-hero::before, .pfx .pfx-field { top: -40px; }
}
