/* kept. marketing widgets: the five product windows from the prototype
   (jar, call, crux, honesty, coverage) plus the shared 3D motion stage and
   shrink-to-fit scaler. Built by js/widgets.js; canned data, nothing live.
   The dark cards are black regardless of page theme, so their colors are
   hard-coded like the prototype's, not theme vars. */

/* ---------------- shrink-to-fit ---------------- */
/* Renders a widget at its desktop design width and scales it down to the
   available width: identical layout on phone, just smaller. */
.fit { width: 100%; min-width: 0; max-width: 100%; }
.fit-inner { transform-origin: top left; }

/* ---------------- scroll-progress 3D stage ---------------- */
/* Each widget floats over a blurred ground shadow that slides and tightens as
   the card tilts flat, plus a faint warm ember ambience behind it. */
.fx3d { perspective: 1400px; min-width: 0; max-width: 100%; }
.fx3d-stack { position: relative; min-width: 0; }
.fx3d-glow {
  position: absolute; inset: -10% -14%; pointer-events: none; opacity: 0;
  background: radial-gradient(52% 58% at 50% 62%, rgba(226, 127, 72, 0.12), rgba(226, 127, 72, 0) 72%);
  filter: blur(4px);
}
.fx3d-body { position: relative; transform-origin: 50% 0%; transform-style: preserve-3d; will-change: transform, opacity; opacity: 0.001; }
.fx3d-ground { position: relative; height: 0; }
.fx3d-shadow {
  position: absolute; left: 7%; right: 7%; top: 22px; height: 58px; border-radius: 999px;
  background: radial-gradient(50% 100% at 50% 0%, rgba(17, 24, 39, 0.32), rgba(17, 24, 39, 0) 72%);
  filter: blur(15px); will-change: transform, opacity; pointer-events: none; opacity: 0;
}
/* The hero jar: floats in perspective like a standing artifact, breathing
   gently, and flattens to face the reader as they begin to scroll. */
.fxhero { position: relative; perspective: 1400px; }
.fxhero-glow {
  position: absolute; inset: -14% -18%; pointer-events: none;
  background: radial-gradient(50% 55% at 50% 64%, rgba(226, 127, 72, 0.14), rgba(226, 127, 72, 0) 70%);
  filter: blur(4px);
}
.fxhero-body { position: relative; transform-origin: 50% 34%; will-change: transform; }
.fxhero-shadow {
  position: absolute; left: 9%; right: 9%; top: 24px; height: 60px; border-radius: 999px;
  background: radial-gradient(50% 100% at 50% 0%, rgba(17, 24, 39, 0.30), rgba(17, 24, 39, 0) 72%);
  filter: blur(16px); will-change: transform, opacity; pointer-events: none;
}

/* ---------------- product window chrome ---------------- */
.pw {
  background: #000; border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f8fafc; box-shadow: 0 32px 80px rgba(17, 24, 39, 0.16);
}
.pw-head { display: flex; align-items: center; gap: 14px; }
.dots { display: inline-flex; gap: 6px; flex-shrink: 0; }
.dots i { width: 8px; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); display: block; }
.dots--light i { background: var(--border-2); }
.pw-tag { margin-left: auto; font-size: 10.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: #667085; }

/* the ember equalizer */
.eq { display: inline-flex; align-items: center; gap: 2.5px; }
.eq i { width: 2.5px; height: 11px; border-radius: 2px; background: var(--ember); animation: kept-eq 0.9s var(--spring) infinite; }
.eq i:nth-child(2) { animation-delay: 160ms; }
.eq i:nth-child(3) { animation-delay: 320ms; }

/* shared chat pieces */
.msg-you {
  align-self: flex-end; max-width: 84%; background: #1f1f1f; color: #f8fafc;
  padding: 11px 15px; border-radius: 18px; font-size: 14px; font-weight: 500; line-height: 1.55;
  animation: kept-part-in 320ms var(--spring) both; flex-shrink: 0;
}
.msg-kept {
  align-self: flex-start; max-width: 84%; padding: 2px 0; font-size: 14px; font-weight: 500;
  line-height: 1.55; color: rgba(248, 250, 252, 0.8);
  animation: kept-part-in 320ms var(--spring) both; flex-shrink: 0;
}
.tagpill {
  align-self: center; display: inline-flex; align-items: center; gap: 8px;
  background: #161616; border: 1px solid #343434; border-radius: 999px; padding: 6px 13px;
  font-size: 12px; font-weight: 500; animation: rise-in 420ms var(--spring) both; flex-shrink: 0;
}
.tagpill i, .wjar-toast i { width: 6px; height: 6px; border-radius: 999px; background: var(--ember); flex-shrink: 0; display: block; }
.quiet { color: rgba(248, 250, 252, 0.42); }

/* ---------------- the animated jar cell (MCell) ---------------- */
.mcell {
  border: 1px solid rgba(255, 255, 255, 0.24); background: rgba(255, 255, 255, 0.05);
  position: relative; overflow: hidden; border-radius: 3px; display: inline-block;
  transition: box-shadow 600ms var(--spring);
}
.mcell i {
  position: absolute; left: 0; right: 0; bottom: 0; height: 0; display: block;
  background: var(--ember); transition: height 560ms var(--spring);
}
.mcell.flash { box-shadow: 0 0 0 1.5px var(--ember), 0 0 14px 3px rgba(226, 127, 72, 0.16); }
.mcell b {
  position: absolute; top: 3px; right: 3px; width: 15px; height: 15px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.86); display: grid; place-items: center;
  animation: seal-pop 520ms var(--overshoot) both;
  font-weight: 700; font-size: 9.5px; letter-spacing: -0.05em; color: #f8fafc; line-height: 1;
}

/* ---------------- widget 1: the jar ---------------- */
.wjar { position: relative; padding: 34px 38px 30px; overflow: hidden; }
.wjar .pw-head { margin-bottom: 22px; }
.wjar-title { display: inline-flex; align-items: baseline; font-weight: 500; letter-spacing: -0.05em; font-size: 19px; }
.wjar-cols, .wjar-row { display: grid; grid-template-columns: 150px repeat(5, 1fr); gap: 8px; }
.wjar-cols { margin-bottom: 8px; }
.wjar-col { font-size: 9.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(248, 250, 252, 0.64); text-align: center; }
.wjar-rows { display: flex; flex-direction: column; gap: 8px; }
.wjar-row { align-items: center; }
.wjar-task { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 8px; color: rgba(248, 250, 252, 0.86); }
.wjar .mcell { width: 100%; height: 34px; }
.wjar-toast {
  position: absolute; right: 26px; bottom: 22px; display: inline-flex; align-items: center; gap: 8px;
  background: #161616; border: 1px solid #343434; border-radius: 999px; padding: 8px 15px;
  font-size: 12.5px; font-weight: 500; animation: rise-in 420ms var(--spring) both;
}

/* ---------------- widget 2: the interview ---------------- */
.wcall { padding: 26px 28px 24px; display: flex; flex-direction: column; height: 470px; }
.wcall .pw-head { margin-bottom: 18px; flex-shrink: 0; }
.wcall-brand { display: inline-flex; align-items: baseline; gap: 7px; }
.wcall-brand b { font-weight: 500; font-size: 17px; letter-spacing: -0.04em; }
.wcall-feed { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; overflow: hidden; justify-content: flex-end; }
.wcall-foot { border-top: 1px solid rgba(255, 255, 255, 0.09); margin-top: 18px; padding-top: 16px; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.wcall-foot .lbl { font-size: 10.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #667085; flex-shrink: 0; }
.wcall-strip { display: inline-flex; gap: 6px; margin-left: auto; }
.wcall-strip .mcell { width: 54px; height: 26px; }

/* ---------------- widget 3: the crux ---------------- */
.crux { display: grid; grid-template-columns: 1fr 210px 1fr; align-items: center; transform-style: preserve-3d; }
.crux-pane {
  background: #000; border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 24px 70px rgba(17, 24, 39, 0.16); padding: 24px 26px; color: #f8fafc;
  height: 370px; overflow: hidden; display: flex; flex-direction: column;
  opacity: 0.72; will-change: transform;
  transition: transform 500ms var(--spring), opacity 500ms var(--spring), border-color 500ms var(--spring), box-shadow 500ms var(--spring);
}
.crux-pane--l { transform: rotateY(7deg) scale(0.975); }
.crux-pane--r { transform: rotateY(-7deg) scale(0.975); }
.crux-pane.on { opacity: 1; border-color: var(--ember); box-shadow: 0 24px 70px rgba(17, 24, 39, 0.22), 0 0 0 4px rgba(226, 127, 72, 0.10); }
.crux-pane--l.on { transform: rotateY(7deg) scale(1); }
.crux-pane--r.on { transform: rotateY(-7deg) scale(1); }
.crux-pane:hover { opacity: 1; transform: rotateY(0deg) scale(1.03); }
.crux-pane .pw-head { gap: 12px; margin-bottom: 14px; flex-shrink: 0; }
.crux-label { margin-left: auto; font-size: 10.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #667085; transition: color 400ms ease; }
.crux-pane.on .crux-label { color: var(--ember); }
.crux-feed { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; justify-content: flex-end; overflow: hidden; }
.crux .msg-you { max-width: 88%; padding: 12px 16px; font-size: 15px; line-height: 1.5; animation-duration: 300ms; }
.crux-think { display: inline-flex; align-items: baseline; gap: 6px; flex-shrink: 0; }
.crux-think b { font-weight: 500; font-size: 14px; letter-spacing: -0.04em; }
.crux-think .eq i { height: 10px; }
.crux-a { align-self: flex-start; max-width: 96%; animation: kept-part-in 300ms var(--spring) both; flex-shrink: 0; }
.crux-a p { font-size: 15px; font-weight: 500; line-height: 1.6; color: rgba(248, 250, 252, 0.9); margin: 0; }
.crux-cite { margin-top: 8px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ember); }
/* the connector: an ember light travels to whichever side is asking */
.crux-rail { position: relative; height: 2px; background: rgba(17, 24, 39, 0.14); border-radius: 999px; z-index: 2; }
.crux-light {
  position: absolute; top: -1px; bottom: -1px; width: 76px; border-radius: 999px; left: 2px;
  background: linear-gradient(90deg, rgba(226, 127, 72, 0.15), var(--ember), rgba(226, 127, 72, 0.15));
  box-shadow: 0 0 10px 2px rgba(226, 127, 72, 0.3);
  transition: left 1000ms var(--spring), top 1000ms var(--spring), box-shadow 500ms ease;
}
.crux[data-active="me"] .crux-light { left: calc(100% - 78px); }
.crux-light.flash { box-shadow: 0 0 18px 4px rgba(226, 127, 72, 0.5); }

/* ---------------- widget 4: honesty ---------------- */
.whon { padding: 22px 28px 26px; height: 440px; display: flex; flex-direction: column; }
.whon .pw-head { margin-bottom: 8px; flex-shrink: 0; }
.whon-feed { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; justify-content: flex-end; overflow: hidden; }
.whon .msg-you { max-width: 82%; animation-duration: 300ms; }
.msg-a { align-self: flex-start; max-width: 94%; animation: kept-part-in 300ms var(--spring) both; flex-shrink: 0; }
.msg-a p { font-size: 14px; font-weight: 500; line-height: 1.6; color: rgba(248, 250, 252, 0.88); margin: 0; }
.msg-a .cited { margin-top: 6px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ember); }
.msg-ev {
  align-self: flex-start; max-width: 88%; padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.24);
  animation: kept-part-in 300ms var(--spring) both; flex-shrink: 0;
}
.msg-ev .quote { font-size: 13px; font-weight: 500; font-style: italic; color: #98a2b3; line-height: 1.5; margin: 0; }
.msg-ev .src { font-size: 10.5px; font-weight: 500; color: #667085; }

/* ---------------- widget 5: coverage ---------------- */
.wcov {
  background: var(--surface); border-radius: 16px; border: 1px solid var(--border);
  padding: 26px 28px; box-shadow: 0 24px 60px rgba(17, 24, 39, 0.08); color: var(--text);
}
.wcov .pw-head { margin-bottom: 20px; }
.wcov-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.wcov .pw-tag { letter-spacing: 0.14em; color: var(--stone); }
.wcov-rows { display: flex; flex-direction: column; gap: 16px; }
.wcov-row { display: grid; grid-template-columns: 150px 1fr 74px; gap: 14px; align-items: center; }
.wcov-name { display: inline-flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 600; }
.wcov-name i { width: 9px; height: 9px; border-radius: 999px; flex-shrink: 0; display: block; }
.wcov-track { height: 8px; border-radius: 999px; background: var(--border-faint); overflow: hidden; display: block; }
.wcov-fill { display: block; height: 100%; border-radius: 999px; background: var(--text-faint); width: 0; transition: width 1400ms var(--spring); }
.wcov-fill--hot { background: var(--ember); }
.wcov-val { font-size: 12.5px; font-weight: 600; color: var(--text-muted); text-align: right; font-variant-numeric: tabular-nums; }
.wcov-val--hot { color: var(--ember-deep); }
.wcov-note { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; margin: 20px 0 0; }

/* ---------------- stacked crux on phones ---------------- */
@media (max-width: 720px) {
  .crux { display: flex; flex-direction: column; align-items: stretch; }
  .crux-pane, .crux-pane.on, .crux-pane:hover { transform: none; }
  .crux-rail { width: 2px; height: 60px; margin: 0 auto; }
  .crux-light {
    width: auto; left: -1px; right: -1px; height: 28px; top: 2px; bottom: auto;
    background: linear-gradient(180deg, rgba(226, 127, 72, 0.15), var(--ember), rgba(226, 127, 72, 0.15));
  }
  .crux[data-active="me"] .crux-light { left: -1px; top: calc(100% - 30px); }
}

/* ---------------- reduced motion: settle everything, hide nothing ---------------- */
@media (prefers-reduced-motion: reduce) {
  .mcell, .mcell i, .wcov-fill, .crux-pane, .crux-light, .crux-label { transition: none; }
  .msg-you, .msg-kept, .msg-a, .msg-ev, .tagpill, .wjar-toast, .crux-a, .mcell b { animation: none; }
  .eq i { animation: none; }
  .fx3d-body { opacity: 1; transform: none !important; }
  .fx3d-glow { opacity: 0.9; }
  .fx3d-shadow { opacity: 0.85; }
  .fxhero-body { transform: none !important; }
  .crux-pane--l, .crux-pane--r, .crux-pane:hover { transform: none; }
}
