/* =============================================================================
   Pep Research V3 -- Research Modules (modules.html and modules/*.html; named
   Vela Stack, then Pep Stack, until 2026-10-06), CEO direction 2026-10-01: a
   focused, minimal research-vial module experience.
   Navy foundation, glass panels, compact technical type, the locked palette.

   The vial stage is the shared dark specimen stage (css/v3.css section 15,
   .v3-vstage) holding the master vials. Prices are filled in by
   js/v3-stack.js from the live catalog: 10% (two vials) or 20% (three vials)
   off their current prices (js/vela-stacks.js); the pages never carry a price.
   ============================================================================= */

/* ---- the stage: three master vials, the middle one in front ---- */
.v3-vstage { position: relative; isolation: isolate; overflow: hidden; display: block; border-radius: 12px; }
.v3-vstage img {
  position: absolute;
  bottom: 12%;
  width: auto;
  max-width: none;
  transform: translate3d(-50%, 0, 0);
  -webkit-box-reflect: below 1px linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0) 92%, rgba(255, 255, 255, 0.18) 100%);
  transition: transform 700ms var(--v3-ease-out);
}
.v3-vtrio--l { left: 27%; height: 62%; z-index: 1; }
.v3-vtrio--c { left: 50%; height: 74%; z-index: 2; }
.v3-vtrio--r { left: 73%; height: 62%; z-index: 1; }

/* ---- hero ---- */
.v3-stack-hero .v3-scene { opacity: 0.6; }
.v3-stack-hero { padding-bottom: 48px; }

/* ---- curated stack cards ---- */
.v3-stacks { padding-top: 48px; }
.v3-scard-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.v3-scard {
  display: flex;
  flex-direction: column;
  padding: 10px 10px 18px;
  border-radius: var(--v3-radius-card);
  background: var(--v3-glass-card);
  border: 1px solid var(--v3-card-line);
  box-shadow: var(--v3-card-shadow);
  transition: border-color 400ms var(--v3-ease-out), box-shadow 600ms var(--v3-ease-out), transform 600ms var(--v3-ease-out);
}
.v3-scard:hover { transform: translate3d(0, -4px, 0); border-color: var(--v3-card-line-hover); box-shadow: var(--v3-card-shadow-hover); }
.v3-scard .v3-vstage { --v3-specimen-h: 260px; }
.v3-scard:hover .v3-vtrio--c { transform: translate3d(-50%, -4px, 0); }
.v3-scard-body { display: flex; flex-direction: column; flex: 1; gap: 8px; padding: 16px 8px 0; }
.v3-scard-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.v3-save {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(118, 191, 230, 0.12);
  border: 1px solid rgba(118, 191, 230, 0.3);
  color: var(--pv-cyan);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.v3-scard h3 { font-size: 20px; line-height: 26px; font-weight: 600; letter-spacing: -0.02em; color: var(--v3-on-dark); }
.v3-scard h3 a { color: inherit; text-decoration: none; }
.v3-scard-theme { font-size: 13px; line-height: 20px; color: var(--v3-on-dark-muted); min-height: 40px; }
.v3-scard-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 14px; }
.v3-scard-actions .v3-btn { flex: 1 1 0; justify-content: center; }

/* ---- prices: individual value, the stack price ---- */
.v3-sprice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin: 6px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--v3-line-dark);
}
.v3-sprice dt { font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--v3-on-dark-soft); }
.v3-sprice dd { margin: 3px 0 0; font-size: 16px; line-height: 22px; font-weight: 600; color: var(--v3-on-dark-muted); font-variant-numeric: tabular-nums; }
.v3-sprice .is-stack dd { font-size: 22px; line-height: 28px; color: var(--v3-on-dark); }
.v3-sprice--builder, .v3-sprice--detail { grid-template-columns: 1fr; gap: 0; }
.v3-sprice--builder > div, .v3-sprice--detail > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 7px 0; }
.v3-sprice--builder dd, .v3-sprice--detail dd { margin: 0; }
.v3-sprice--builder .is-stack, .v3-sprice--detail .is-stack { border-top: 1px solid var(--v3-line-dark); margin-top: 4px; padding-top: 10px; }

/* ---- custom builder ---- */
.v3-builder { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 20px; align-items: stretch; }
.v3-vstage--builder { --v3-specimen-h: 440px; }
.v3-bslot { position: absolute; bottom: 12%; display: block; width: 23%; transform: translate3d(-50%, 0, 0); }
.v3-bslot--l { left: 25%; height: 60%; }
.v3-bslot--c { left: 50%; height: 70%; }
.v3-bslot--r { left: 75%; height: 60%; }
.v3-bslot-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(194, 195, 244, 0.32);
  border-radius: 14px;
  background: rgba(8, 3, 39, 0.35);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--v3-on-dark-soft);
}
.v3-vstage .v3-bslot img { position: relative; left: 50%; bottom: auto; height: 100%; }
.v3-bslot img[hidden] { display: none; }
.v3-bslot.is-filled .v3-bslot-empty { display: none; }
.v3-bslot.is-filled img { animation: v3-bslot-in 700ms var(--v3-ease-out) both; }
.v3-builder-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  border-radius: var(--v3-radius-card);
  background: var(--v3-glass-card);
  border: 1px solid var(--v3-card-line);
}
.v3-bfields { display: grid; gap: 10px; }
.v3-bfield { display: grid; gap: 6px; }
.v3-bfield > span { font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--v3-on-dark-soft); }
.v3-bfield select {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  padding: 11px 38px 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--v3-line-dark-strong);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C2C3F4' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 12px center / 16px 16px no-repeat, rgba(8, 3, 39, 0.6);
  color: var(--v3-on-dark);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.v3-bfield select:focus-visible { outline: 2px solid var(--v3-focus); outline-offset: 2px; }
.v3-bfield option { background: var(--pv-night); color: var(--v3-on-dark); }
.v3-builder-note { font-size: 12.5px; line-height: 19px; color: var(--v3-on-dark-soft); }
.v3-builder-form .v3-btn { justify-content: center; }
.v3-builder-form .v3-btn:disabled { opacity: 0.45; cursor: not-allowed; }
/* Build Your Module with 2 vials: the third slot is out of use and the two in
   use stand centred on the stage */
.v3-bfield[hidden], .v3-bslot[hidden] { display: none; }
.v3-vstage--builder.is-two .v3-bslot--l { left: 37.5%; height: 64%; }
.v3-vstage--builder.is-two .v3-bslot--c { left: 62.5%; height: 64%; }

/* ---- stack detail: hero ---- */
.v3-sdetail-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-top: calc(-1 * var(--v3-header-h));
  padding: calc(var(--v3-header-h) + 28px) 0 56px;
  color: var(--v3-on-dark);
}
.v3-sdetail-hero .v3-scene { opacity: 0.5; }
.v3-sdetail-hero .v3-scene-shade {
  background:
    radial-gradient(42% 60% at 30% 56%, rgba(1, 2, 27, 0.6) 0%, rgba(1, 2, 27, 0) 100%),
    linear-gradient(180deg, rgba(1, 2, 27, 0.6) 0%, rgba(1, 2, 27, 0) 24%, rgba(1, 2, 27, 0) 70%, rgba(1, 2, 27, 1) 100%);
}
.v3-sdetail { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 28px; align-items: center; margin-top: 18px; }
.v3-vstage--hero { --v3-specimen-h: 520px; box-shadow: var(--v3-card-shadow); }
.v3-vstage--hero .v3-vtrio--c { height: 76%; }
.v3-vstage--hero .v3-vtrio--l, .v3-vstage--hero .v3-vtrio--r { height: 64%; }
.v3-sdetail-panel {
  padding: 28px;
  border-radius: var(--v3-radius-card);
  background: var(--v3-glass-strong);
  border: 1px solid var(--v3-card-line);
  box-shadow: var(--v3-card-shadow);
}
.v3-sdetail-panel h1 { margin-top: 12px; font-size: 40px; line-height: 46px; font-weight: 600; letter-spacing: -0.025em; color: var(--v3-on-dark); }
.v3-sdetail-focus { margin-top: 10px; font-size: 15px; line-height: 24px; color: var(--v3-on-dark-muted); }
.v3-sdetail-panel .v3-sprice { margin-top: 18px; }
.v3-sdetail-add { width: 100%; justify-content: center; margin-top: 18px; }
.v3-sdetail-note { margin-top: 10px; font-size: 12px; line-height: 18px; color: var(--v3-on-dark-soft); }

/* ---- stack detail: the three compounds ---- */
.v3-ccards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.v3-ccard {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  padding: 10px;
  border-radius: var(--v3-radius-card);
  background: var(--v3-glass-card);
  border: 1px solid var(--v3-card-line);
  transition: border-color 400ms var(--v3-ease-out);
}
.v3-ccard:hover { border-color: var(--v3-card-line-hover); }
.v3-vstage--mini { --v3-specimen-h: 168px; }
.v3-vstage--mini img { left: 50%; height: 76%; }
.v3-ccard-body { display: flex; flex-direction: column; gap: 6px; padding: 8px 6px 6px 0; }
.v3-ccard h3 { font-size: 16px; line-height: 22px; font-weight: 600; letter-spacing: -0.01em; color: var(--v3-on-dark); }
.v3-ccard-strength { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--pv-periwinkle); }
.v3-ccard-formula { font-size: 13px; line-height: 20px; color: var(--v3-on-dark); font-variant-numeric: tabular-nums; }
.v3-ccard-formula span { display: block; font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--v3-on-dark-soft); }
.v3-ccard-formula sub { font-size: 0.72em; line-height: 0; }
.v3-ccard-role { font-size: 13px; line-height: 20px; color: var(--v3-on-dark-muted); }
.v3-ccard .v3-link { margin-top: auto; }

/* ---- stack detail: why these three, the pathway ---- */
.v3-why { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 32px; align-items: center; }
.v3-why-text { display: flex; flex-direction: column; gap: 12px; }
.v3-why-text h2 { font-size: var(--t-h2); line-height: var(--t-h2-lh); font-weight: 600; letter-spacing: -0.02em; color: var(--v3-on-dark); }
.v3-why-text p:last-child { font-size: 15px; line-height: 25px; color: var(--v3-on-dark-muted); max-width: 34rem; }
.v3-why-figure {
  margin: 0;
  padding: 22px 18px 16px;
  border-radius: var(--v3-radius-card);
  background: var(--v3-glass-card);
  border: 1px solid var(--v3-card-line);
}
.v3-why-figure figcaption { margin-top: 8px; text-align: center; font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--v3-on-dark-soft); }
.v3-pathway { display: block; width: 100%; height: auto; }
.v3-pw-link { fill: none; stroke: rgba(155, 154, 240, 0.5); stroke-width: 1.5; stroke-dasharray: 3 7; animation: v3-pw-flow 9s linear infinite; }
.v3-pw-node circle { fill: rgba(89, 52, 207, 0.18); stroke: rgba(194, 195, 244, 0.55); stroke-width: 1.25; }
.v3-pw-node .v3-pw-core { fill: var(--pv-cyan); stroke: none; }
.v3-pw-label { fill: var(--pv-lavender); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; }
.v3-pw-name { fill: var(--pv-text-light); font-size: 14px; font-weight: 600; }

/* ---- stack detail: add, documentation ---- */
.v3-sdetail-end { padding-top: 24px; }
.v3-sdetail-endrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  padding: 22px 24px;
  border-radius: var(--v3-radius-card);
  background: var(--v3-glass-card);
  border: 1px solid var(--v3-card-line);
}
.v3-sdetail-endprice { display: flex; align-items: baseline; gap: 12px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.v3-sdetail-endprice > span:first-child { font-size: 26px; font-weight: 600; color: var(--v3-on-dark); }
.v3-sdetail-endprice s { font-size: 15px; color: var(--v3-on-dark-soft); }
.v3-sdocs ul { margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.v3-sdetail-endact { display: flex; align-items: center; gap: 18px; }

/* ---- keyframes (slow, no overshoot) ---- */
@keyframes v3-bslot-in {
  from { opacity: 0; transform: translate3d(-50%, 18px, 0); }
  to { opacity: 1; transform: translate3d(-50%, 0, 0); }
}
@keyframes v3-pw-flow { to { stroke-dashoffset: -60; } }

/* ---- responsive ---- */
@media (max-width: 1023px) {
  .v3-scard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v3-builder, .v3-sdetail, .v3-why { grid-template-columns: minmax(0, 1fr); }
  .v3-vstage--builder { --v3-specimen-h: 340px; }
  .v3-vstage--hero { --v3-specimen-h: 420px; }
  .v3-ccards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 639px) {
  .v3-scard-grid { grid-template-columns: minmax(0, 1fr); }
  .v3-vstage--builder { --v3-specimen-h: 300px; }
  .v3-vstage--hero { --v3-specimen-h: 340px; }
  .v3-sdetail-panel { padding: 22px 18px; }
  .v3-sdetail-panel h1 { font-size: 30px; line-height: 36px; }
  .v3-sdetail-endact { width: 100%; justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  .v3-scard:hover { transform: none; }
  .v3-scard:hover .v3-vtrio--c { transform: translate3d(-50%, 0, 0); }
  .v3-bslot.is-filled img, .v3-pw-link { animation: none; }
}
