/* ============================================================================
   Intro flow — hero + thesis, Daylight-style layered scroll depth.
   Loads AFTER site.css; everything here is namespaced intro-* / ph / pw so the
   scroll-world engine, the .reveal observer, and the radar wiring in
   world.config.js are untouched. Placeholder figures (.ph) stand in for the
   paper-miniature renders; each label describes the shot to generate.
   ========================================================================== */

/* ------------------------- placeholder figures ---------------------------- */
/* A .ph is a to-be-generated image. Dashed brass frame + shot label so it
   reads as an intentional frame, not a broken asset. Swap for <img> later:
   keep the outer class, drop the inner label. */
.ph {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: 18px;
  border: 1px dashed color-mix(in srgb, var(--gold-300) 45%, transparent);
  background:
    linear-gradient(155deg,
      color-mix(in srgb, var(--violet-700) 55%, var(--violet-950)) 0%,
      var(--violet-950) 62%),
    var(--violet-900);
  box-shadow: 0 18px 44px rgba(10, 4, 14, 0.45);
}
.ph::after {
  /* faint paper-grain sheen so empty boxes still have surface */
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 18% 0%,
      color-mix(in srgb, var(--gold-300) 9%, transparent), transparent 58%);
  pointer-events: none;
}
.ph__tag {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-300);
  background: color-mix(in srgb, var(--violet-950) 78%, transparent);
  border: 1px solid color-mix(in srgb, var(--gold-300) 35%, transparent);
}
.ph__label {
  position: absolute; inset: auto 12px 12px 12px; z-index: 2;
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  line-height: 1.45;
  color: color-mix(in srgb, var(--violet-200) 82%, transparent);
}

/* ------------------------- parallax primitives ---------------------------- */
/* [data-depth] elements are translated by intro-motion.js; give them the
   compositing hint. The window (.pw) is a masked frame whose inner media is
   oversized and slides within it — the classic slow-scroll image band. */
[data-depth] { will-change: transform; }

.pw {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
}
.pw__media {
  position: absolute;
  left: 0; right: 0;
  top: -16%; height: 132%;
  border-radius: 0;         /* the window masks; inner corners would double up */
  border-left: 0; border-right: 0;
}
.pw__media { margin: 0; }
.pw__media img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
}

/* Shot tag + label ride the oversized media and slide out of the mask —
   re-anchor them to the window itself. */
.pw > .ph__tag { position: absolute; z-index: 5; }
.pw > .ph__label { position: absolute; z-index: 5; }

/* ------------------------------- hero ------------------------------------- */
/* Copy left, collage right. The band's flex centering is replaced by a grid;
   the copy keeps its measure but loses the auto-centering margin. */
.intro-hero {
  position: relative; overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: clamp(24px, 4vw, 72px);
  align-items: center;
}
.intro-hero .band__inner {
  position: relative; z-index: 3;
  margin: 0;
  max-width: 58ch;
  justify-self: end;
}

/* The collage stage — cards fly in from off-screen right/top/bottom, settle
   into an overlapping pile, then drift on their wrappers' scroll depths. */
.intro-hero__collage {
  position: relative;
  height: min(80vh, 780px);
  pointer-events: none;
}
.collage__item { position: absolute; }
.collage__card {
  width: var(--w, 220px);
  aspect-ratio: var(--ar, 3 / 4);
  rotate: var(--r, 0deg);
  animation: intro-fly-in 1.05s cubic-bezier(0.18, 0.72, 0.24, 1.04) var(--d, 0s) both;
}
@keyframes intro-fly-in {
  from {
    opacity: 0;
    transform: translate(var(--fx, 40vw), var(--fy, 0vh)) rotate(var(--fr, 15deg)) scale(0.9);
  }
  55% { opacity: 1; }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .collage__card { animation: none; }
}
@media (max-width: 1099px) {
  .intro-hero { grid-template-columns: 1fr; }
  .intro-hero .band__inner { justify-self: stretch; }
  .intro-hero__collage { display: none; }
}

/* -- The chat card: the fluent, agreeable answer, rendered for real ---------
   White ChatGPT-like mock inside one collage card. It is a built element,
   not an image placeholder — no dashed frame, no violet sheen. */
.ph--chat,
.ph--search,
.ph--thread,
.ph--slide {
  background: #ffffff;
  border: 1px solid var(--neutral-200);
}
.ph--chat::after,
.ph--search::after,
.ph--thread::after,
.ph--slide::after { display: none; }
.chat {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  gap: 10px;
  padding: 12px 14px 14px;
  font-family: var(--font-sans);
  text-align: left;
}
.chat__bar { display: flex; gap: 5px; }
.chat__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--neutral-200);
}
.chat__msg {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--neutral-900);
}
.chat__msg--user {
  align-self: flex-end;
  max-width: 82%;
  padding: 6px 12px;
  border-radius: 14px 14px 4px 14px;
  background: var(--neutral-100);
}
.chat__row {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: auto;
}
.chat__avatar {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: #10a37f;
  color: #fff;
  font-size: 11px; line-height: 1;
}
.chat__msg--ai { padding-top: 2px; }
.chat__caret {
  display: inline-block;
  width: 7px; height: 13px;
  margin-left: 3px;
  vertical-align: -2px;
  background: var(--neutral-900);
  animation: chat-caret 1.1s steps(1) infinite;
}
@keyframes chat-caret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .chat__caret { animation: none; } }

/* -- The search card: where the question actually gets asked ---------------
   Unbranded Google-like results page in one collage card. */
.srch {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  gap: 9px;
  padding: 12px 14px 14px;
  font-family: var(--font-sans);
  text-align: left;
}
.srch__bar {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--neutral-300);
  border-radius: 18px;
  box-shadow: 0 1px 5px rgba(20, 19, 24, 0.09);
}
.srch__icon {
  flex: none;
  position: relative;
  width: 11px; height: 11px;
  margin-top: 2px;
  border: 1.6px solid var(--neutral-500);
  border-radius: 50%;
}
.srch__icon::after {
  content: "";
  position: absolute;
  width: 1.6px; height: 5px;
  right: -2px; bottom: -3.5px;
  rotate: -45deg;
  background: var(--neutral-500);
  border-radius: 1px;
}
.srch__q {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--neutral-900);
}
.srch__results {
  display: flex; flex-direction: column;
  gap: 6px;
  margin: 2px 0 0 4px;
}
.srch__results .srch__line--url { margin-top: 6px; }
.srch__line {
  display: block;
  width: var(--lw, 100%);
  height: 7px;
  border-radius: 4px;
  background: var(--neutral-100);
}
.srch__line--title { height: 8px; background: var(--blue-200); }
.srch__line--url { height: 5px; background: var(--green-200); }

/* -- The slide card: the output built on the stale figure ------------------- */
.slide {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  gap: 9px;
  padding: 12px 14px 14px;
  font-family: var(--font-sans);
  text-align: left;
}
.slide__crumb {
  margin: 0;
  font-size: 9.5px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--neutral-600);
}
.slide__canvas {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 9px;
  padding: 14px;
  border: 1px solid var(--neutral-200);
  border-radius: 8px;
  box-shadow: 0 1px 5px rgba(20, 19, 24, 0.07);
}
.slide__fig {
  font-family: var(--font-display);
  font-size: clamp(26px, 2.4vw, 34px);
  font-weight: var(--weight-bold);
  color: var(--neutral-900);
  letter-spacing: -0.01em;
}
.slide__bars { display: flex; align-items: flex-end; gap: 5px; margin-top: 2px; }
.slide__bars i {
  display: block;
  width: 13px;
  border-radius: 2px 2px 0 0;
  background: var(--blue-200);
}
.slide__meta {
  margin: 0;
  display: flex; align-items: center; gap: 6px;
  font-size: 10px;
  font-weight: var(--weight-semibold);
  color: var(--amber-600);
}
.slide__clock {
  flex: none;
  position: relative;
  width: 10px; height: 10px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}
.slide__clock::after {
  content: "";
  position: absolute;
  left: calc(50% - 0.75px); bottom: 50%;
  width: 1.5px; height: 3.5px;
  background: currentColor;
  transform-origin: bottom;
  rotate: 40deg;
}

/* -- The thread card: asking the team ---------------------------------------
   Slack-like thread in one collage card; ends on a typing indicator so the
   question visibly never resolves. */
.thread {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  gap: 10px;
  padding: 12px 13px 14px;
  font-family: var(--font-sans);
  text-align: left;
}
.thread__msg { display: flex; align-items: flex-start; gap: 7px; }
.thread__avatar {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 19px; height: 19px;
  border-radius: 5px;
  background: var(--av, var(--neutral-500));
  color: #fff;
  font-size: 8px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.02em;
}
.thread__name {
  display: block;
  margin-bottom: 1px;
  font-size: 9px;
  font-weight: var(--weight-semibold);
  color: var(--neutral-600);
}
.thread__body p {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--neutral-900);
}
.thread__typing {
  margin-top: auto;
  display: flex; gap: 3px;
  padding-left: 26px;
}
.thread__typing i {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--neutral-300);
  animation: thread-typing 1.2s ease-in-out infinite;
}
.thread__typing i:nth-child(2) { animation-delay: 0.15s; }
.thread__typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes thread-typing {
  0%, 60%, 100% { opacity: 0.4; transform: none; }
  30% { opacity: 1; transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) { .thread__typing i { animation: none; } }

/* -- The sticky note: the retrieval system that actually works -------------- */
.ph--sticky {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #fdea7d 0%, #f7d95d 100%);
  border: 0;
  border-radius: 2px;
  box-shadow: 0 16px 34px rgba(10, 4, 14, 0.5);
}
.ph--sticky::after {
  /* adhesive strip instead of the violet sheen */
  inset: 0 0 auto 0;
  height: 20%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.32), transparent);
}
.sticky__text {
  font-family: "Caveat", cursive;
  font-size: clamp(24px, 2.3vw, 32px);
  font-weight: 600;
  color: #453e2b;
  rotate: -3deg;
}

/* ------------------------- full-bleed breather ---------------------------- */
/* The world engine paints a fixed stage inside #world (z-index 1); every
   static band above it must sit at the bands' plane (site.css .band uses 10). */
.intro-thesis { position: relative; z-index: 10; }

/* ------------------------------ thesis flow -------------------------------- */
.intro-thesis { padding: 0; display: block; background: var(--violet-950); overflow: clip; }

.intro-panel {
  position: relative;
  padding: clamp(80px, 13vh, 150px) clamp(20px, 6vw, 72px);
}

/* -- The premise: copy beside a pair of offset, depth-separated frames ----- */
.intro-panel--split {
  display: grid;
  grid-template-columns: minmax(0, 58ch) minmax(280px, 1fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
}
.intro-panel__media {
  position: relative;
  display: grid;
  gap: 24px;
  justify-items: end;
}
.intro-panel__media .ph:first-child {
  width: min(78%, 340px);
  aspect-ratio: 3 / 4;
  justify-self: start;
  rotate: -2.5deg;
}
.intro-panel__media .ph:last-child {
  width: min(70%, 300px);
  aspect-ratio: 4 / 5;
  margin-top: -18%;
  rotate: 2deg;
}
/* The premise answer card is a compact chat window, not a portrait frame. */
.intro-panel__media .ph--chat:last-child {
  width: min(82%, 330px);
  aspect-ratio: 4 / 3;
  margin-top: -12%;
}
@media (max-width: 960px) {
  .intro-panel--split { grid-template-columns: 1fr; }
  .intro-panel__media { justify-items: start; margin-top: 8px; }
  .intro-panel__media .ph:last-child { justify-self: end; margin-top: -12%; }
}

/* -- Knowledge health: radar on the left, vital-sign reader on the right --- */
.intro-panel--health { text-align: center; }
.intro-panel--health .intro-panel__inner {
  position: relative; z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
}
.intro-panel--health .eyebrow { margin-bottom: 18px; }
.intro-health-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: clamp(24px, 3.5vw, 48px);
  align-items: stretch;
  margin-top: 34px;
  text-align: left;
}
.intro-health-frame,
.intro-health-detail {
  padding: clamp(18px, 3vw, 40px);
  border-radius: 26px;
  border: 1px solid color-mix(in srgb, var(--gold-300) 22%, transparent);
  background:
    radial-gradient(90% 70% at 50% 0%,
      color-mix(in srgb, var(--violet-700) 38%, transparent), transparent 70%),
    color-mix(in srgb, var(--violet-900) 55%, var(--violet-950));
  box-shadow: 0 24px 70px rgba(10, 4, 14, 0.5);
}

/* The reader: idles as the book-beat pulse, fills with a definition on click. */
.intro-health-detail {
  display: flex;
  align-items: center;
  justify-content: center;
}
.hd-ekg { width: 100%; text-align: center; }
.hd-ekg svg { display: block; width: 100%; height: auto; overflow: visible; }
.hd-ekg__base {
  fill: none;
  stroke: color-mix(in srgb, var(--violet-400) 34%, transparent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hd-ekg__trace {
  fill: none;
  stroke: var(--gold-300);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 140 860;
  stroke-dashoffset: 140;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--gold-300) 55%, transparent));
  animation: hd-ekg-sweep 3.2s linear infinite;
}
@keyframes hd-ekg-sweep {
  from { stroke-dashoffset: 140; }
  to   { stroke-dashoffset: -860; }
}
.hd-ekg__hint {
  margin: 22px 0 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  color: var(--violet-300);
}
.hd-def strong {
  display: block;
  margin-bottom: 10px;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--gold-300);
}
.hd-def p {
  margin: 0;
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: #e6ceec;
}
.hd-def__back {
  margin-top: 20px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  color: var(--violet-300);
}
.hd-def__back:hover { color: var(--gold-300); }

@media (max-width: 960px) {
  .intro-health-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .hd-ekg__trace { animation: none; stroke-dasharray: none; }
}

/* -- The barrier: copy left, the answer clip right (answer-transition.js) --
   The clip AUTOPLAYS (muted, once, time-based choreography) when the band
   scrolls into view: push in, save The Answer, a frozen beat while the pings
   stack, the head hits the desk, the pings fade, the last frame holds.
   Scrolling away and back replays it. */
.intro-panel--barrier .body { color: var(--violet-100); }
/* The film is the argument here — give it at least the copy's share: a wider
   stage than the default 1280 panel, a tighter copy column, and the rest of
   the row to the clip. */
.intro-panel--barrier {
  max-width: 1512px;
  grid-template-columns: minmax(0, 48ch) minmax(320px, 1fr);
  gap: clamp(32px, 4.5vw, 72px);
}
.barrier-media { position: relative; }
.ar-seo {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip-path: inset(50%); margin: 0;
}
.ar-frame {
  position: relative; margin: 0;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
}
.ar-frame video,
.ar-poster {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 42%;
}
.ar-frame video { z-index: 1; opacity: 0; }
.ar-frame.has-clip video { opacity: 1; }
.ar-play {
  position: absolute; z-index: 6;
  left: 50%; top: 9%;
  width: clamp(180px, 15vw, 230px);
  /* anchored from the top, not centred: the bubbles stack DOWNWARD so the
     dialog card never pushes up past the frame's clipped top edge */
  transform: translateX(-50%);
  opacity: 0;
  font-family: var(--font-sans);
  pointer-events: none;
  transition: opacity .45s ease;
}
.ar-play.is-on { opacity: 1; }
.ar-play.is-done { opacity: 0; }

/* ------------------------------ motion ------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  [data-depth] { transform: none !important; }
  .pw__media { top: -16%; }
}
