/* ============================================================================
   THE PROMO STRIP: the code Onflow Ads advertises, on every public page.
   static/promo-strip.js draws it and asks for this sheet; this file only says
   how it looks.

   NOTHING HERE IS LOADED UNTIL THERE IS AN OFFER. A page names this file in
   <link rel="ofa-promo-strip"> (a rel the browser ignores, so the address is
   stamped with this file's own version like every other asset), and the script
   turns it into a stylesheet only once the server has answered with an offer.
   While no code is advertised a public page loads none of this.

   ONE LOOK, EVERY PAGE FAMILY. The home page loads no shared sheet, the "lux"
   pages load lux.css, the engine pages and Onflow Studio's pages load
   styles.css. So this sheet reads no token of theirs and leans on no reset of
   theirs: every colour and size is said here, every rule starts at the strip's
   own class (two classes deep, so a page's "section p" or ":focus-visible"
   never wins), and the strip is built from div, span, b, a, button and svg
   only, the elements a page styles least.

   IT ARRIVES A MOMENT AFTER THE PAGE, so it opens instead of appearing: its
   height grows from nothing (a grid row from 0fr to 1fr) while the card fades
   up, and what is under it glides down rather than jumping. The space above
   and below it is inside the part that grows. A reader who asks for reduced
   motion gets it in place at once.

   WHERE IT SITS is the page's choice: the page puts
   <div data-promo-strip hidden></div> where the strip belongs, and may say
   "start" (hugs the side the text starts on) or "wide" (the whole row). The
   few places that need their own spacing are at the foot of this file, one
   rule each.
   ============================================================================ */

.ofps[data-promo-strip] {
  --ofps-green: #34D399;        /* the offer's accent: the site's own success green */
  --ofps-green-hi: #6EE7B7;
  --ofps-ink: #04261B;          /* the label on the green button (9:1) */
  --ofps-above: 28px;           /* the room it opens above itself */
  --ofps-below: 0px;            /* ... and below */
  --ofps-pull: 0px;             /* how far it moves up into room the page already left */
  --ofps-max: 800px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 0fr;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: var(--ofps-max);
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: none;
  color: #CCCED6;
  font-size: 15px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: normal;
  text-align: left;
  text-indent: 0;
  text-transform: none;
  text-shadow: none;
  white-space: normal;
  word-spacing: normal;
  overflow-wrap: normal;
  container-type: inline-size;
  transition: grid-template-rows .5s cubic-bezier(.33, 0, .2, 1), margin-top .5s cubic-bezier(.33, 0, .2, 1);
}
.ofps[data-promo-strip][hidden] { display: none; }
.ofps[data-promo-strip].ofps--in { grid-template-rows: 1fr; margin-top: var(--ofps-pull); }
.ofps[data-promo-strip].ofps--start { margin-inline: 0 auto; }
.ofps[data-promo-strip].ofps--wide { --ofps-max: none; }
.ofps[data-promo-strip].ofps--flush { --ofps-above: 0px; }

.ofps *, .ofps *::before, .ofps *::after { box-sizing: border-box; }

/* The part that grows. Clipped only while it opens, so the card's shadow and a
   keyboard ring are whole once it is in place. */
.ofps .ofps__clip { min-width: 0; min-height: 0; margin: 0; padding: 0; overflow: hidden; }
.ofps.ofps--open .ofps__clip { overflow: visible; }

/* ---- the card ------------------------------------------------------------
   As wide as what it says and no wider (fit-content), up to the room it has. */
.ofps .ofps__card {
  position: relative;
  display: block;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  margin: var(--ofps-above) auto var(--ofps-below);
  padding: 12px 14px;
  border: 1px solid rgba(52, 211, 153, .3);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(52, 211, 153, .14), rgba(52, 211, 153, .04) 48%, rgba(255, 255, 255, .03)),
    rgba(7, 11, 11, .74);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  backdrop-filter: blur(16px) saturate(120%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 20px 46px -26px rgba(0, 0, 0, .8);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .36s ease .16s, transform .5s cubic-bezier(.22, 1, .36, 1) .12s;
}
.ofps.ofps--in .ofps__card { opacity: 1; transform: none; }
.ofps.ofps--start .ofps__card { margin-inline: 0 auto; }
.ofps.ofps--wide .ofps__card { width: 100%; }

/* The mark, the words with the code, the action: one row. */
.ofps .ofps__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 14px;
  min-width: 0;
  margin: 0;
  padding: 0;
}

.ofps .ofps__ico {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0;
  border-radius: 12px;
  background: rgba(52, 211, 153, .14);
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, .24);
  color: var(--ofps-green);
}
.ofps .ofps__ico svg { display: block; width: 20px; height: 20px; max-width: none; fill: none; }

/* What it says, and under it the code: two short rows, so the card is only as
   wide as the longer of them and the action sits beside both. On a whole-row
   strip ("wide") there is room for one line, and the code moves under the
   words only where there is not. */
.ofps .ofps__body {
  flex: 1 1 180px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px 10px;
  min-width: 0;
  margin: 0;
  padding: 0;
}
.ofps.ofps--wide .ofps__body { flex-direction: row; flex-wrap: wrap; align-items: center; }
.ofps .ofps__txt {
  flex: 0 1 auto;
  display: block;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 0;
  color: #CCCED6;
  font: inherit;
  overflow-wrap: break-word;
  text-wrap: pretty;
}
.ofps .ofps__lead { color: #A5DEC5; font-weight: 500; }
.ofps .ofps__head { color: #FFFFFF; font-weight: 700; }
.ofps .ofps__use {
  flex: 0 1 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 0;
}
.ofps .ofps__pair { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.ofps .ofps__with { flex: 0 0 auto; color: #B6B9C5; font-weight: 400; white-space: nowrap; }
/* "with code" is written twice: beside the code here, after the words on a phone (below). */
.ofps .ofps__with--txt { display: none; }

/* The code: a button that copies it. Dashed, as a coupon is. */
.ofps .ofps__code {
  -webkit-appearance: none;
  appearance: none;
  flex: 0 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  min-height: 34px;
  margin: 0;
  padding: 3px 11px 3px 12px;
  border: 1px dashed rgba(52, 211, 153, .62);
  border-radius: 10px;
  background: rgba(52, 211, 153, .09);
  box-shadow: none;
  color: var(--ofps-green);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .06em;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: copy;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.ofps .ofps__code:hover { background: rgba(52, 211, 153, .17); border-color: rgba(52, 211, 153, .85); color: var(--ofps-green-hi); }
.ofps .ofps__code:active { background: rgba(52, 211, 153, .24); }
.ofps .ofps__code.is-copied { border-style: solid; border-color: rgba(52, 211, 153, .85); background: rgba(52, 211, 153, .2); color: var(--ofps-green-hi); letter-spacing: .02em; cursor: default; }
.ofps .ofps__code svg { flex: 0 0 auto; display: block; width: 15px; height: 15px; max-width: none; fill: none; opacity: .9; }
.ofps .ofps__code .ofps__i-done { display: none; }
.ofps .ofps__code.is-copied .ofps__i-copy { display: none; }
.ofps .ofps__code.is-copied .ofps__i-done { display: block; }

/* "Details": opens what the code gives and where it stops, in the server's own words. */
.ofps .ofps__more-btn {
  -webkit-appearance: none;
  appearance: none;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 34px;
  margin: 0;
  padding: 0 4px;
  border: 0;
  border-radius: 8px;
  background: none;
  box-shadow: none;
  color: #B6B9C5;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: normal;
  text-decoration: underline;
  text-decoration-color: rgba(182, 185, 197, .45);
  text-underline-offset: 3px;
  text-transform: none;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color .18s ease;
}
.ofps .ofps__more-btn:hover { color: #FFFFFF; text-decoration-color: currentColor; }
.ofps .ofps__more-btn svg { flex: 0 0 auto; display: block; width: 14px; height: 14px; max-width: none; fill: none; transition: transform .2s ease; }
.ofps .ofps__more-btn[aria-expanded="true"] svg { transform: rotate(180deg); }

/* The action. Green on a site whose own buttons are red: it belongs to the offer. */
.ofps .ofps__go {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 8px 15px 8px 17px;
  border: 0;
  border-radius: 11px;
  background: var(--ofps-green);
  box-shadow: 0 8px 22px -12px rgba(52, 211, 153, .8), inset 0 1px 0 rgba(255, 255, 255, .28);
  color: var(--ofps-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: normal;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .18s ease, box-shadow .18s ease;
}
.ofps .ofps__go:hover, .ofps .ofps__go:active { background: var(--ofps-green-hi); color: var(--ofps-ink); text-decoration: none; }
.ofps .ofps__go svg { flex: 0 0 auto; display: block; width: 16px; height: 16px; max-width: none; fill: none; transition: transform .2s ease; }
.ofps .ofps__go:hover svg { transform: translateX(2px); }
.ofps.ofps--wide .ofps__go { margin-inline-start: auto; }

/* A keyboard user's ring: the offer's green, outside the control, on all three. */
.ofps .ofps__code:focus-visible, .ofps .ofps__more-btn:focus-visible, .ofps .ofps__go:focus-visible {
  outline: 2px solid var(--ofps-green-hi);
  outline-offset: 2px;
}
.ofps .ofps__code:focus-visible { border-radius: 10px; box-shadow: none; }
.ofps .ofps__more-btn:focus-visible { border-radius: 8px; box-shadow: none; }
.ofps .ofps__go:focus-visible { border-radius: 11px; box-shadow: 0 0 0 2px #050609; }

/* The details, when asked for: under the row. They take the card's width and
   never set it (no width of their own, then at least the whole of the
   card's), so opening them cannot make a short card wide. */
.ofps .ofps__more {
  display: block;
  width: 0;
  min-width: 100%;
  margin: 12px 0 0;
  padding: 10px 2px 2px;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, .09);
  color: #BFC6CD;
  font: inherit;
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: break-word;
  text-wrap: pretty;
}
.ofps .ofps__more[hidden] { display: none; }

/* Read aloud, never drawn: the "Copied" a screen reader hears. */
.ofps .ofps__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The field an old browser copies from (static/promo-strip.js, legacyCopy):
   on the page for one turn, never seen, and 16px so a phone does not zoom. */
.ofps__ghost {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  font-size: 16px;
  pointer-events: none;
}

/* ---- a finger -------------------------------------------------------------- */
@media (pointer: coarse) {
  .ofps .ofps__code, .ofps .ofps__more-btn, .ofps .ofps__go { min-height: 44px; }
  .ofps .ofps__more-btn { padding-inline: 8px; }
}

/* ---- a narrow place ----------------------------------------------------------
   Judged by the room the strip has (a container query), and by the window as
   well for a browser that has no container queries: the words beside the mark,
   the code on its own row, the action on a row of its own under both. Every
   control keeps to the side the text starts on, as wide as its words: the
   round Onflow AI launcher holds a phone's bottom-right corner, and a button
   that reached the right-hand edge sat under it whenever the strip was at the
   foot of the screen, which on the engine pages is where it first appears.
   So "with code" ends the words, the code and "Details" share a short row,
   and the action stops short of that corner. */
@media (max-width: 640px) {
  .ofps[data-promo-strip] { font-size: 14.5px; }
  .ofps .ofps__card { width: 100%; padding: 13px 14px 14px; border-radius: 16px; }
  .ofps .ofps__row { gap: 10px 12px; }
  .ofps .ofps__body { display: contents; }
  .ofps .ofps__txt { flex: 1 1 0; }
  .ofps .ofps__with--txt { display: inline; }
  .ofps .ofps__with--pair { display: none; }
  .ofps .ofps__use { flex: 1 1 100%; }
  .ofps .ofps__go { flex: 0 1 auto; min-height: 44px; white-space: normal; }
  .ofps.ofps--wide .ofps__go { margin-inline-start: 0; }
}
@container (max-width: 600px) {
  .ofps .ofps__card { width: 100%; padding: 13px 14px 14px; border-radius: 16px; }
  .ofps .ofps__row { gap: 10px 12px; }
  .ofps .ofps__body { display: contents; }
  .ofps .ofps__txt { flex: 1 1 0; }
  .ofps .ofps__with--txt { display: inline; }
  .ofps .ofps__with--pair { display: none; }
  .ofps .ofps__use { flex: 1 1 100%; }
  .ofps .ofps__go { flex: 0 1 auto; min-height: 44px; white-space: normal; }
  .ofps.ofps--wide .ofps__go { margin-inline-start: 0; }
}
@container (max-width: 280px) {
  .ofps .ofps__ico { width: 34px; height: 34px; border-radius: 10px; }
}

/* ---- no motion asked for ------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .ofps[data-promo-strip], .ofps .ofps__card, .ofps .ofps__code, .ofps .ofps__go, .ofps .ofps__go svg,
  .ofps .ofps__more-btn, .ofps .ofps__more-btn svg { transition: none !important; }
  .ofps .ofps__card { transform: none; }
  .ofps .ofps__go:hover svg { transform: none; }
}

/* ---- a browser that draws its own colours (Windows contrast themes) ------ */
@media (forced-colors: active) {
  .ofps .ofps__card, .ofps .ofps__code, .ofps .ofps__go { border: 1px solid CanvasText; }
  .ofps .ofps__code { border-style: dashed; }
}

@media print { .ofps[data-promo-strip] { display: none !important; } }

/* ============================================================================
   WHERE IT SITS. One rule for each place whose spacing is its own; every other
   page takes the default (28px above, nothing below, centred).
   ============================================================================ */

/* The home page: between the hero's buttons and its three figures. The row of
   buttons already leaves 54px under itself, so the strip moves up into it. */
.ofps[data-promo-strip].ofps--home { --ofps-above: 0px; --ofps-below: 44px; --ofps-pull: -24px; }
@media (max-width: 640px) {
  .ofps[data-promo-strip].ofps--home { --ofps-below: 36px; --ofps-pull: -30px; }
}

/* Onflow Studio's pages: the whole row between a page's opening and what
   follows it. The opening leaves 48px under itself (40px on a phone); the
   strip takes a little of that and leaves the same room under itself. */
.ofps[data-promo-strip].ofps--studio { --ofps-above: 0px; --ofps-below: 36px; --ofps-pull: -12px; }
@media (max-width: 640px) {
  .ofps[data-promo-strip].ofps--studio { --ofps-below: 30px; --ofps-pull: -10px; }
}

/* The role page's side panel: the panel washes everything in it with a glow
   drawn over its content; the strip stands in front of that, as on every page. */
.auth__aside .ofps[data-promo-strip] { position: relative; z-index: 1; }
