/* ============================================================================
   QuantaLearn landing hero product card (app/ui/landing-hero.js).

   A white tool card: tab strip on top, a "Circuit" pane on the left, a "Result"
   pane on the right, a one-line engine note at the bottom. Everything is scoped
   under .lph / .lph-*; the palette is defined locally (same values as the
   landing spec) so this file does not depend on any other stylesheet.

   Flat and standard: one brand blue, 1px grey borders, the single soft hero
   shadow on the card itself, no gradients, no glow. IBM Plex Mono is used ONLY
   for circuit and number text; Inter everywhere else. Motion is transform and
   opacity only; prefers-reduced-motion shows final states with no animation.
   ========================================================================== */

.lph {
  --lph-bg: #FFFFFF;
  --lph-soft: #F5F7FA;
  --lph-ink: #0B1220;
  --lph-ink-2: #3B4557;
  --lph-muted: #667085;
  --lph-line: #E4E7EC;
  --lph-line-2: #D0D5DD;
  --lph-brand: #1D59F9;
  --lph-brand-600: #1547D4;
  --lph-brand-50: #EEF3FF;
  --lph-ok: #12B76A;
  --lph-ease: cubic-bezier(.2, .7, .2, 1);
  --lph-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  container-type: inline-size;
  position: relative;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  box-sizing: border-box;
  background: var(--lph-bg);
  color: var(--lph-ink);
  border: 1px solid var(--lph-line);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(11, 18, 32, .06), 0 8px 24px rgba(11, 18, 32, .06);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  text-align: left;
  overflow: hidden;
}
.lph *, .lph *::before, .lph *::after { box-sizing: border-box; }
:where(.lph) button, :where(.lph) input, :where(.lph) select { font: inherit; color: inherit; }
:where(.lph) p { margin: 0; }

/* ----------------------------------------------------------------- tabs */
.lph-tabs {
  position: relative;
  display: flex;
  gap: 4px;
  padding: 0 16px;
  border-bottom: 1px solid var(--lph-line);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.lph-tabs::-webkit-scrollbar { display: none; }
.lph-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  padding: 0 18px;
  background: none;
  border: 0;
  border-radius: 8px 8px 0 0;
  color: var(--lph-muted);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: color .2s, background-color .2s;
}
.lph-tab:first-child { margin-left: auto; }
.lph-tab:last-of-type { margin-right: auto; }
.lph-tab:hover { color: var(--lph-ink); background: var(--lph-soft); }
.lph-tab.is-on, .lph-tab.is-on:hover { color: var(--lph-brand); background: none; }
.lph-ico { flex: none; }
.lph-indicator {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--lph-brand);
  border-radius: 2px 2px 0 0;
  transition: transform .32s var(--lph-ease), width .32s var(--lph-ease);
  pointer-events: none;
}

/* ----------------------------------------------------------------- body */
.lph-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 384px;
}
.lph-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 28px 32px 28px;
}
.lph-left { border-right: 1px solid var(--lph-line); }
.lph-pane-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.lph-kicker {
  color: var(--lph-brand);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.lph-sub { color: var(--lph-muted); font-size: 13px; }
.lph-blurb {
  min-height: 46px;
  margin-bottom: 20px;
  color: var(--lph-ink-2);
  font-size: 14px;
  line-height: 1.6;
  text-wrap: balance;
}

/* ------------------------------------------------------------- circuit */
.lph-circuit-host {
  --lph-c: clamp(28px, calc((100cqw / 2 - 132px) / 9), 44px);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 168px;
  margin-bottom: 20px;
  padding: 14px 12px;
  background: var(--lph-soft);
  border: 1px solid var(--lph-line);
  border-radius: 12px;
  overflow-x: auto;
}
.lph-circuit {
  --lph-row: 56px;
  position: relative;
  display: grid;
  grid-template-columns: 28px repeat(var(--cols), var(--lph-c)) 8px;
  grid-template-rows: repeat(var(--rows), var(--lph-row));
  width: max-content;
  margin: 0 auto;
  font-family: var(--lph-mono);
}
.lph-wire {
  grid-row: var(--row);
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
}
.lph-qlabel { flex: none; width: 28px; color: var(--lph-muted); font-size: 12px; font-weight: 500; }
.lph-line { flex: 1; height: 1.5px; background: var(--lph-muted); }
.lph-op {
  position: relative;
  z-index: 1;
  grid-column: var(--col);
  grid-row: var(--r0) / span var(--span);
  display: flex;
  justify-content: center;
}
.lph-box {
  display: grid;
  place-items: center;
  width: min(40px, calc(var(--lph-c) - 6px));
  height: 40px;
  margin-top: 8px;
  background: var(--lph-brand-50);
  border: 1.5px solid var(--lph-brand);
  border-radius: 8px;
  color: var(--lph-brand);
  font-size: 14px;
  font-weight: 600;
}
.lph-vline {
  position: absolute;
  top: 28px;
  left: calc(50% - .75px);
  width: 1.5px;
  height: calc((var(--span) - 1) * var(--lph-row));
  background: var(--lph-brand);
}
.lph-dot, .lph-target {
  position: absolute;
  left: 50%;
  top: calc(var(--y) * var(--lph-row) + 28px);
}
.lph-dot { width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--lph-brand); }
.lph-target {
  width: 26px; height: 26px; margin: -13px 0 0 -13px;
  border: 1.5px solid var(--lph-brand); border-radius: 50%; background: var(--lph-bg);
}
.lph-target::before, .lph-target::after {
  content: ''; position: absolute; background: var(--lph-brand);
}
.lph-target::before { left: 50%; top: 4px; bottom: 4px; width: 1.5px; margin-left: -.75px; }
.lph-target::after { top: 50%; left: 4px; right: 4px; height: 1.5px; margin-top: -.75px; }

/* -------------------------------------------------------------- control */
.lph-control { margin-top: auto; min-height: 76px; display: flex; flex-direction: column; justify-content: flex-end; }
.lph-ctl-label { display: block; margin-bottom: 8px; color: var(--lph-ink); font-size: 14px; font-weight: 600; }
.lph-ctl-row { display: flex; align-items: center; gap: 16px; }
.lph-ctl-toggle .lph-ctl-label { margin: 0; cursor: pointer; }
.lph-out {
  flex: none; min-width: 52px; text-align: right;
  font-family: var(--lph-mono); font-size: 14px; font-weight: 600; color: var(--lph-brand);
}
.lph-range {
  --fill: 50%;
  flex: 1;
  min-width: 0;
  height: 44px;
  margin: 0;
  background: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.lph-range::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px;
  background: linear-gradient(to right, var(--lph-brand) var(--fill), var(--lph-line-2) var(--fill));
}
.lph-range::-moz-range-track { height: 6px; border-radius: 3px; background: var(--lph-line-2); }
.lph-range::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--lph-brand); }
.lph-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; margin-top: -8px;
  background: var(--lph-bg); border: 2px solid var(--lph-brand); border-radius: 50%;
  box-shadow: 0 1px 2px rgba(11, 18, 32, .15);
}
.lph-range::-moz-range-thumb {
  width: 18px; height: 18px;
  background: var(--lph-bg); border: 2px solid var(--lph-brand); border-radius: 50%;
}
.lph-switch {
  position: relative; flex: none;
  width: 44px; height: 26px; padding: 0;
  background: var(--lph-line-2); border: 0; border-radius: 999px;
  cursor: pointer;
  transition: background-color .2s;
}
.lph-switch[aria-checked="true"] { background: var(--lph-brand); }
.lph-knob {
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  transition: transform .22s var(--lph-ease);
}
.lph-switch[aria-checked="true"] .lph-knob { transform: translateX(18px); }
.lph-select {
  width: 100%; max-width: 220px; height: 44px; padding: 0 12px;
  background: var(--lph-bg); border: 1px solid var(--lph-line-2); border-radius: 8px;
  font-family: var(--lph-mono); font-size: 14px; font-weight: 600;
  cursor: pointer;
}

/* -------------------------------------------------------------- results */
.lph-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 16px;
  margin: 0 0 20px;
  padding: 30px 4px 0;
}
.lph-col {
  flex: 1 1 0;
  max-width: 104px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
  font-family: var(--lph-mono);
}
.lph-val {
  position: absolute; left: 0; right: 0; bottom: 0;
  font-size: 14px; font-weight: 600; line-height: 1; color: var(--lph-ink);
  transform: translateY(calc(var(--p, 0) * -140px - 8px));
  transition: transform .7s var(--lph-ease), opacity .4s .25s;
}
.lph[data-phase="live"] .lph-val { transition-duration: .26s, .4s; }
.lph-col:not(.is-set) .lph-val { opacity: 0; }
.lph-track {
  position: relative;
  height: 140px;
  border-bottom: 1.5px solid var(--lph-ink-2);
}
.lph-bar {
  position: absolute;
  inset: 0;
  background: var(--lph-brand);
  border-radius: 6px 6px 0 0;
  transform: scaleY(var(--p, 0));
  transform-origin: 50% 100%;
  transition: transform .7s var(--lph-ease);
}
.lph-obs {
  position: absolute;
  left: -4px;
  right: -4px;
  bottom: 0;
  height: 2px;
  background: var(--lph-ink);
  opacity: 0;
  transform: translateY(calc(var(--f, 0) * -140px));
  transition: transform .5s var(--lph-ease), opacity .3s;
}
.lph-obs.on { opacity: 1; }
.lph-ket { margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--lph-ink); }
.lph-count { margin-top: 2px; font-size: 12px; color: var(--lph-muted); min-height: 18px; }

.lph-runrow { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.lph-run {
  flex: none;
  height: 44px;
  padding: 0 24px;
  background: var(--lph-brand);
  border: 0;
  border-radius: 999px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .2s, transform .2s;
}
.lph-run:hover { background: var(--lph-brand-600); transform: translateY(-1px); }
.lph-run:active { transform: none; }
.lph-shots { flex: 1; min-width: 0; color: var(--lph-muted); font-size: 13px; line-height: 1.4; }
.lph-caption {
  min-height: 48px;
  margin-top: 16px;
  color: var(--lph-ink-2);
  font-size: 14px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  text-wrap: balance;
}

/* ---------------------------------------------------------------- footer */
.lph-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
  padding: 14px 32px;
  background: var(--lph-soft);
  border-top: 1px solid var(--lph-line);
  color: var(--lph-muted);
  font-size: 13px;
}
.lph-foot-t { display: inline-flex; align-items: center; gap: 8px; }
.lph-live-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--lph-ok); }
.lph-link {
  min-height: 32px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 6px;
  color: var(--lph-brand);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.lph-link:hover { color: var(--lph-brand-600); text-decoration: underline; text-underline-offset: 3px; }

.lph-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------- focus */
.lph button:focus-visible, .lph select:focus-visible {
  outline: 2px solid var(--lph-brand);
  outline-offset: 1px;
  box-shadow: 0 0 0 4px var(--lph-brand-50);
}
.lph-tab:focus-visible { outline-offset: -3px; border-radius: 8px; box-shadow: none; }
.lph-range:focus-visible { outline: none; }
.lph-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--lph-brand-50), 0 0 0 5px var(--lph-brand); }
.lph-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--lph-brand-50), 0 0 0 5px var(--lph-brand); }

/* --------------------------------------------------------------- motion */
@keyframes lph-drop {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes lph-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.lph[data-phase="pre"] .lph-op { opacity: 0; transform: translateY(-8px); }
.lph[data-phase="intro"] .lph-op {
  animation: lph-drop .34s var(--lph-ease) both;
  animation-delay: calc(var(--i) * 140ms);
}
.lph[data-phase="swap"] .lph-op {
  animation: lph-drop .28s var(--lph-ease) both;
  animation-delay: calc(var(--i) * 60ms);
}
.lph[data-phase="live"] .lph-bar { transition-duration: .26s; }
.lph-swap .lph-blurb, .lph-swap .lph-circuit-host, .lph-swap .lph-control, .lph-swap .lph-caption {
  animation: lph-fade .25s ease both;
}

@media (prefers-reduced-motion: reduce) {
  .lph *, .lph *::before, .lph *::after { animation: none !important; transition: none !important; }
  .lph .lph-op { opacity: 1 !important; transform: none !important; }
  .lph .lph-col .lph-val { opacity: 1 !important; }
}

/* ----------------------------------------------------------- responsive */
@container (max-width: 820px) {
  .lph-body { grid-template-columns: 1fr; min-height: 0; }
  .lph-left { border-right: 0; border-bottom: 1px solid var(--lph-line); }
  .lph-circuit-host { --lph-c: clamp(28px, calc((100cqw - 92px - 28px) / 9), 44px); }
  .lph-pane { padding: 24px; }
  .lph-foot { padding: 14px 24px; }
}
@container (max-width: 520px) {
  .lph-tabs { padding: 0 8px; }
  .lph-tab { height: 52px; padding: 0 14px; }
  .lph-pane { padding: 20px 16px; }
  .lph-foot { padding: 14px 16px; }
  .lph-circuit-host { padding: 12px 8px; --lph-c: clamp(26px, calc((100cqw - 32px - 16px - 2px - 28px - 8px) / 9), 44px); }
  .lph-circuit { grid-template-columns: 24px repeat(var(--cols), var(--lph-c)) 4px; }
  .lph-qlabel { width: 24px; }
  .lph-bars { gap: 10px; }
  .lph-track { height: 120px; }
  .lph-val { transform: translateY(calc(var(--p, 0) * -120px - 8px)); }
  .lph-obs { transform: translateY(calc(var(--f, 0) * -120px)); }
  .lph-shots { flex-basis: 100%; min-height: 18px; margin-top: -4px; }
  .lph-caption { min-height: 72px; }
}
