/* smx.css: /semax/ only, loaded after bpc.css (build-semax.mjs, SMX_V).
   1. the hero crop, so the bottle on the desk stays in the frame at every width
   2. "Semax vs. the usual fixes": a raised blue Semax column against coffee, energy drinks,
      nicotine pouches and focus supplements. Facts only (what each one is, how you get it).
      smx.js adds .is-in when the board scrolls into view and runs the phone switch. */

/* ── 1. hero ─────────────────────────────────────────────────────────────────────────────
   The film is 16:9: the man sits between ~45% and ~80% across, the bottle at 83–89% across and
   45–83% down. Desktop: bias the crop right so a tall window never cuts the bottle. */
.smx .hero--h4x .hero__helix-media { object-position: 78% 40%; }
/* Tablet and phone: the shared hero runs the film the full height behind the copy, which would put
   the bottle under the headline. Here the film is a band at the top instead, wide enough to hold
   the man and the bottle, fading into the hero ground; the copy starts where the band fades. */
@media (max-width: 1020px) {
  .smx .hero--h4x { --smx-film: clamp(360px, 64vw, 580px); }
  .smx .hero--h4x .hero__helix { bottom: auto; height: var(--smx-film); }
  .smx .hero--h4x .hero__helix-media { object-position: 90% 50%; }
  .smx .hero--h4x .hero__helix::after {
    background: linear-gradient(180deg, rgba(10, 10, 13, 0) 0%, rgba(10, 10, 13, 0) 66%, rgba(10, 10, 13, .72) 86%, #0A0A0D 100%);
  }
  .smx .hero--h4x .hero__copy { padding-top: calc(var(--smx-film) * .9); }
}

/* ── 2. the board ─────────────────────────────────────────────────────────────────────── */
.smx-vs { max-width: 1080px; margin: clamp(32px, 4vw, 56px) auto 0; }
/* room above the grid for the raised Semax column and the bottle */
.smx-vs__scroll { padding-top: 72px; }
.smx-vs__grid {
  position: relative; display: grid;
  grid-template-columns: minmax(140px, 1.1fr) minmax(170px, 1.25fr) repeat(4, minmax(0, 1fr));
  padding: 0 24px 4px;
  background: var(--surface-card); border: 1px solid var(--line-soft); border-radius: var(--r-tile);
}
.smx-vs__row { display: contents; }
/* every cell has a fixed row and column, so the raised column (which spans all the rows) can sit
   underneath them without pushing them along */
.smx-vs__row:nth-of-type(1) > * { grid-row: 1; }
.smx-vs__row:nth-of-type(2) > * { grid-row: 2; }
.smx-vs__row:nth-of-type(3) > * { grid-row: 3; }
.smx-vs__row:nth-of-type(4) > * { grid-row: 4; }
.smx-vs__row:nth-of-type(5) > * { grid-row: 5; }
.smx-vs__row:nth-of-type(6) > * { grid-row: 6; }
.smx-vs__row:nth-of-type(7) > * { grid-row: 7; }
.smx-vs__row:nth-of-type(8) > * { grid-row: 8; }
.smx-vs__row:nth-of-type(9) > * { grid-row: 9; }
.smx-vs__c--lbl { grid-column: 1; }
.smx-vs__c--us { grid-column: 2; }
.smx-vs__c[data-c="3"] { grid-column: 3; }
.smx-vs__c[data-c="4"] { grid-column: 4; }
.smx-vs__c[data-c="5"] { grid-column: 5; }
.smx-vs__c[data-c="6"] { grid-column: 6; }

/* the Semax column: brand blue, lifted above the card and hanging below it */
.smx-vs__col {
  grid-column: 2; position: relative; z-index: 0;
  margin: -56px 6px -20px; border-radius: 22px;
  background: linear-gradient(180deg, #5A4CFF 0%, #2E1BFF 34%, #2111D6 100%);
  box-shadow: 0 28px 56px -22px rgba(46, 27, 255, .6), inset 0 1px 0 rgba(255, 255, 255, .28);
}

.smx-vs__c {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 68px; padding: 14px 12px; text-align: center;
  font-size: 14px; line-height: 1.4; color: var(--text-secondary);
  border-top: 1px solid var(--line-soft);
}
.smx-vs__c--lbl { align-items: flex-start; text-align: left; padding-left: 0; font-weight: 500; color: var(--text-primary); }
.smx-vs__c--us { color: #fff; font-weight: 500; border-top-color: rgba(255, 255, 255, .16); margin-inline: 6px; }
.smx-vs__row--text > .smx-vs__c { font-size: 13.5px; }
.smx-vs__row--text > .smx-vs__c--lbl { font-size: 14px; }

/* header row */
.smx-vs__row--head > .smx-vs__c { border-top: 0; justify-content: flex-end; padding-top: 0; padding-bottom: 18px; }
.smx-vs__name { font: 600 15px/1.2 Inter, system-ui, sans-serif; letter-spacing: -.01em; color: var(--text-primary); }
.smx-vs__c--us .smx-vs__name { font-size: 22px; letter-spacing: -.02em; color: #fff; }
/* rival names take two lines of room, so the icons line up when one name wraps */
.smx-vs__row--head > [data-c] .smx-vs__name { min-height: 2.4em; display: flex; align-items: flex-end; justify-content: center; }
.smx-vs__bottle { display: block; width: 176px; height: 176px; margin: -116px auto -12px; filter: drop-shadow(0 16px 18px rgba(8, 4, 60, .45)); }
.smx-vs__ic { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; color: var(--text-secondary); }

/* captions under a mark */
.smx-vs__s { font: 400 11px/1.4 'IBM Plex Mono', ui-monospace, monospace; letter-spacing: .02em; color: var(--text-muted); }
.smx-vs__c--us .smx-vs__s { color: rgba(255, 255, 255, .74); }

/* marks */
.smx-vs__ok, .smx-vs__no, .smx-vs__mid { display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; }
.smx-vs__ok { width: 32px; height: 32px; background: #fff; color: var(--brand-blue); box-shadow: 0 6px 14px -4px rgba(8, 4, 60, .5); }
.smx-vs__ok svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.smx-vs__no { width: 26px; height: 26px; background: var(--surface-canvas); border: 1px solid var(--line-soft); color: var(--text-muted); }
.smx-vs__no svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.smx-vs__mid { width: 26px; height: 26px; border: 1px solid var(--line-soft); background: linear-gradient(90deg, var(--line-soft) 50%, var(--surface-canvas) 50%); }

/* score row */
.smx-vs__row--score > .smx-vs__c { padding-block: 18px 22px; }
.smx-vs__score { font: 600 26px/1 Inter, system-ui, sans-serif; letter-spacing: -.03em; color: var(--text-muted); }
.smx-vs__score small { font-size: .55em; font-weight: 500; letter-spacing: 0; opacity: .75; }
.smx-vs__c--us .smx-vs__score { font-size: 40px; color: #fff; }

.smx-vs__foot {
  max-width: 780px; margin: 28px auto 0; text-align: center; color: var(--text-muted);
  font: 400 11px/1.6 'IBM Plex Mono', ui-monospace, monospace;
}

/* the phone switch only exists at 860px and below */
.smx-vs__pick { display: none; }

/* ── pop-in once the board is in view (smx.js adds .is-in; no JS, no IO or reduced motion: shown as is) ── */
.h4x-motion.bp-io .smx-vs__col { transition: opacity .7s var(--ease), transform .7s var(--ease); }
.h4x-motion.bp-io .smx-vs__bottle { transition: opacity .6s var(--ease) .25s, transform .8s cubic-bezier(.2, .9, .25, 1.25) .25s; }
.h4x-motion.bp-io .smx-vs__ok,
.h4x-motion.bp-io .smx-vs__no,
.h4x-motion.bp-io .smx-vs__mid,
.h4x-motion.bp-io .smx-vs__score {
  transition: opacity .4s var(--ease), transform .5s cubic-bezier(.2, .9, .25, 1.3);
  transition-delay: calc(.35s + var(--i, 0) * 90ms);
}
.h4x-motion.bp-io .smx-vs__no, .h4x-motion.bp-io .smx-vs__mid { transition-delay: calc(.45s + var(--i, 0) * 90ms); }
.h4x-motion.bp-io .smx-vs:not(.is-in) .smx-vs__col { opacity: 0; transform: translate3d(0, 28px, 0); }
.h4x-motion.bp-io .smx-vs:not(.is-in) .smx-vs__bottle { opacity: 0; transform: translate3d(0, 24px, 0) scale(.92); }
.h4x-motion.bp-io .smx-vs:not(.is-in) .smx-vs__ok,
.h4x-motion.bp-io .smx-vs:not(.is-in) .smx-vs__no,
.h4x-motion.bp-io .smx-vs:not(.is-in) .smx-vs__mid,
.h4x-motion.bp-io .smx-vs:not(.is-in) .smx-vs__score { opacity: 0; transform: scale(.4); }

/* ── 860px and below: Semax against one rival at a time, picked with the switch ── */
@media (max-width: 860px) {
  .smx-vs__pick {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px;
    max-width: 520px; margin: 0 auto 40px; padding: 4px;
    border-radius: 18px; background: var(--surface-canvas); border: 1px solid var(--line-soft);
  }
  .smx-vs__pick button {
    appearance: none; border: 0; border-radius: 14px; background: none; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    min-height: 58px; padding: 6px 2px;
    font: 500 11.5px/1.15 Inter, system-ui, sans-serif; color: var(--text-secondary);
    transition: background-color .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease);
  }
  .smx-vs__pi { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .smx-vs__pick button[aria-pressed="true"] { background: var(--surface-card); color: var(--brand-blue); box-shadow: 0 1px 3px rgba(17, 17, 20, .12), inset 0 0 0 1px rgba(46, 27, 255, .16); }
  .smx-vs__pick button:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }

  .smx-vs__scroll { padding-top: 64px; max-width: 600px; margin-inline: auto; }
  .smx-vs__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr) minmax(0, 1fr); padding: 0 12px 2px; }
  .smx-vs__c[data-c] { display: none; grid-column: 3; }
  .smx-vs[data-on="3"] .smx-vs__c[data-c="3"],
  .smx-vs[data-on="4"] .smx-vs__c[data-c="4"],
  .smx-vs[data-on="5"] .smx-vs__c[data-c="5"],
  .smx-vs[data-on="6"] .smx-vs__c[data-c="6"] { display: flex; animation: h4x-vs-in .35s var(--ease) both; }
  .smx-vs__c { min-height: 60px; padding: 12px 8px; font-size: 13px; }
  .smx-vs__c--lbl { padding-left: 2px; font-size: 13px; line-height: 1.3; }
  .smx-vs__row--text > .smx-vs__c { font-size: 12.5px; }
  .smx-vs__row--text > .smx-vs__c--lbl { font-size: 13px; }
  .smx-vs__col { margin: -50px 2px -16px; border-radius: 18px; }
  .smx-vs__c--us { margin-inline: 2px; }
  .smx-vs__bottle { width: 140px; height: 140px; margin: -96px auto -10px; }
  .smx-vs__row--head > [data-c] .smx-vs__name { min-height: 0; }
  .smx-vs__c--us .smx-vs__name { font-size: 18px; }
  .smx-vs__name { font-size: 14px; }
  .smx-vs__c--us .smx-vs__score { font-size: 32px; }
  .smx-vs__score { font-size: 22px; }
  .smx-vs__foot { margin-top: 22px; padding-inline: 4px; }
}
@media (max-width: 360px) {
  .smx-vs__pick button { font-size: 10.5px; }
  .smx-vs__grid { padding-inline: 8px; }
  .smx-vs__c { padding-inline: 5px; }
}

/* 340px and below: "focused work." at the shared 46px is ~303px wide and would wrap the hero
   headline to a third line mid-rotation; 42px keeps every word on its line */
@media (max-width: 340px) { .smx .hero--h4x .display-xl { font-size: 42px; } }
