/* hero: the v2 hero plus a decoding lens over the helix, live readouts and a prover chip. */

/* First screen exactly as v2 (mark, helix, statement, call to action); the readouts and note start below it */
.hx .hx-first { display: flex; flex-direction: column; min-height: calc(100vh - 2 * var(--pad)); min-height: calc(100svh - 2 * var(--pad)); }

/* The stage wraps the v2 canvas so the lens can sit on top of it */
.hx .hx-stage { position: relative; z-index: 0; overflow-x: clip; margin: calc(-1 * var(--pad) - 42px) calc(-1 * var(--pad)) clamp(12px, 3vh, 32px); }
.hx .hx-stage > .field { margin: 0; width: 100%; }

/* Lens: an invisible handle over the ring the canvas draws */
.hx .hx-lens { position: absolute; left: 0; top: 0; width: 170px; height: 170px; border-radius: 50%; touch-action: none; cursor: grab; outline-offset: 18px; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.hx .hx-lens.hx-grab { cursor: grabbing; }
.hx .hx-lens:focus { outline: none; }
.hx .hx-lens:focus-visible { outline: 2px solid var(--focus); }
.hx .hx-lens.hx-ptr:focus-visible { outline: none; }   /* focused by a drag, not by the keyboard */
.hx .hx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Variant tag beside the lens */
.hx .hx-tag { position: absolute; left: 0; top: 0; background: #fff; border: 1px solid var(--line-2); border-left: 3px solid var(--signal); padding: 8px 12px 9px 11px; pointer-events: none; white-space: nowrap; opacity: 0; transition: opacity var(--t2) var(--ease); z-index: 2; }
.hx .hx-tag.on { opacity: 1; }
.hx .hx-tag b { display: block; font-weight: 500; font-size: 15px; line-height: 1.25; letter-spacing: -0.005em; }
.hx .hx-tag b em { font-style: normal; font-family: var(--mono); font-size: 13px; color: var(--signal-ink); margin-left: 6px; }
.hx .hx-tag span { display: block; font-family: var(--mono); font-size: 11px; line-height: 1.55; color: var(--muted); }
/* When the readouts flow below the first screen, the tag carries the result itself */
.hx .hx-tag .hx-tr { display: none; color: var(--ink); }
.hx.hx-flow .hx-tag .hx-tr { display: block; }

/* Prover chip, next to the call to action: a static filled square, no blinking */
.hx .hx-chip { display: inline-flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.hx .hx-chip i { width: 8px; height: 8px; background: var(--blue-900); flex: none; transform: translateY(-1px); }
.hx .hx-chip b { font-weight: 400; color: var(--ink); }
.hx .hx-chip small { font-size: 12px; }
.hx .hx-chip small:not(:empty)::before { content: "· "; }

/* Live readouts: overlaid on the empty lower right of the helix when it fits, else below the call to action */
.hx .hx-read { position: absolute; right: var(--pad); top: 0; width: clamp(380px, 29vw, 440px); z-index: 1; opacity: 0; transform: translateY(10px); transition: opacity .8s ease, transform .9s var(--ease); }
.hx.hx-live .hx-read { opacity: 1; transform: none; }
.hx.hx-flow .hx-read { position: static; width: auto; margin-top: clamp(40px, 7vh, 64px); }
/* Caption row = a sheet head: title and hint left, the core .syn-chip right */
.hx .hx-cap { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin: 0 0 10px; max-width: none; font-size: 14px; line-height: 1.3; }
.hx .hx-cap-l { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; min-width: 0; overflow: hidden; }
.hx .hx-cap-l b { font-weight: 500; }
.hx .hx-cap-l svg { width: 14px; height: 14px; margin-right: 4px; color: var(--blue-900); flex: none; }
.hx #hx-cap-t { color: var(--muted); }
/* The four cells are core .readout / .rd-cell / .meter (.meter.ph for the phenotype); the hero only sets the column count and its two special meters */
.hx .hx-cells { --n: 2; }
.hx.hx-flow .hx-cells { --n: 4; }
.hx .hx-genome { gap: 1px; }
.hx .hx-genome > i.p { background: color-mix(in srgb, var(--meter-on) 40%, #fff); }   /* chromosomes already passed */
.hx .hx-all { position: relative; background: var(--blue-500); }
.hx .hx-all > i { position: absolute; top: -3px; bottom: -3px; left: 0; width: 2px; flex: none; background: var(--ink); transition: left var(--t1) var(--ease); }
.hx .hx-fn { margin: clamp(28px, 4vh, 40px) 0 0; }
.hx .hx-fn a { color: inherit; }

@media (prefers-reduced-motion: reduce) {
  .hx .hx-read { opacity: 1; transform: none; }
  .hx .hx-tag { transition: none; }
}

@media (max-width: 1100px) {
  .hx.hx-flow .hx-cells { --n: 2; }
}
@media (max-width: 1000px) {
  /* The six tabs become a 60px bar at the bottom: end the first screen above it so the call to action and the chip stay visible */
  .hx .hx-first { min-height: calc(100vh - 2 * var(--pad) - 60px); min-height: calc(100svh - 2 * var(--pad) - 60px); }
}
@media (max-width: 760px) {
  .hx .hero-foot { row-gap: 12px; }
  .hx .hx-cap { flex-wrap: wrap; gap: 6px; font-size: 13px; }   /* caption and chip share one line down to 360px */
  .hx .hx-cap-l { gap: 5px; }
  .hx .hx-cap-l svg { margin-right: 0; }
  .hx .hx-chip, .hx .hx-chip small { font-size: 11.5px; }
  .hx .hx-tag { padding: 6px 9px 7px 8px; }
  .hx .hx-tag b { font-size: 13px; }
  .hx .hx-tag b em { font-size: 11px; margin-left: 4px; }
  .hx .hx-tag span { font-size: 9.5px; }
}

/* v5: the 3D strand (assets/js/v5/gl/hero-dna.js) sits under #field, out of the flow from the moment it is added (an
   in-flow canvas pushed #field down a line while the strand loaded); hero.js sets its box and fades it in. Where the
   canvas ends inside the page, the atoms fade into the paper instead of being cut. */
.hx .hx-stage > .field-gl { position: absolute; left: 0; top: 0; z-index: 0; opacity: 0; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 72px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 72px), transparent); }
