/* ShipHappens (templates/shiphappens.html): the sample launch story and the feature panels.
   Everything here is scoped to the page; the story's 3D is static/motion/shiphappens.js. */

.mx-app--shiphappens { --word: 10.2vw; --word-phone: 11.6vw; }

/* ---------- the story stage ---------- */
/* the chart runs left under the copy; it fades out before it reaches the text */
@media (min-width: 861px) {
  .mx-app--shiphappens .mx-story__gl {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, transparent 30%, #000 50%);
    mask-image: linear-gradient(90deg, transparent 0, transparent 30%, #000 50%);
  }
}
.mx-app--shiphappens .mx-story__glow {
  background:
    radial-gradient(30% 40% at 68% 42%, color-mix(in srgb, var(--accent) 17%, transparent), transparent 72%),
    radial-gradient(60% 26% at 70% 88%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%);
}
.mx-app--shiphappens .mx-story__hud { opacity: calc(1 - var(--out, 0) * 1.6); }
.mx-app--shiphappens .mx-story__hud b { font-size: 15px; }

.mx-app--shiphappens .shp-badges { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.mx-app--shiphappens .shp-count {
  position: absolute; z-index: 2; top: calc(var(--hdr) + 3.2vh); right: var(--gutter);
  text-align: right; opacity: 0; pointer-events: none;
}
.mx-app--shiphappens .shp-count__k b { color: var(--bone); font-weight: 650; }
.mx-app--shiphappens .shp-count__n {
  margin: 6px 0 8px; font-weight: 200; font-size: clamp(56px, 6.2vw, 108px); line-height: .86;
  letter-spacing: -.04em; font-variant-numeric: tabular-nums; color: var(--bone);
}
.mx-app--shiphappens .shp-count__note { color: var(--accent-ink); }

/* ---------- the hero ---------- */
.mx-app--shiphappens .shp-ph { display: inline-flex; margin-top: 18px; border-radius: 8px; opacity: .88; transition: opacity .2s var(--ease); }
.mx-app--shiphappens .shp-ph:hover { opacity: 1; }
.mx-app--shiphappens .shp-ph img { display: block; width: auto; height: 40px; }

/* ---------- the steps ---------- */
.mx-app--shiphappens .mx-story__step-in { max-width: 540px; }
.mx-app--shiphappens .mx-story__step h2 { font-size: clamp(38px, 4.1vw, 68px); line-height: .92; }
.mx-app--shiphappens .mx-story__fig .mx-num { font-size: clamp(72px, 8.4vw, 144px); }
.mx-app--shiphappens .mx-story__fig .mx-read { max-width: 13ch; }
.mx-app--shiphappens .mx-story__src a { text-underline-offset: 3px; }
.mx-app--shiphappens .mx-story__step .mx-actions { margin-top: 26px; }

/* the six locales */
.mx-app--shiphappens .shp-locales { margin: 22px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.mx-app--shiphappens .shp-locales li {
  display: grid; grid-template-columns: 26px 150px minmax(0, 1fr); align-items: baseline; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px;
}
.mx-app--shiphappens .shp-locales__flag { font-size: 17px; line-height: 1; }
.mx-app--shiphappens .shp-locales__name { font-weight: 600; }
.mx-app--shiphappens .shp-locales i { overflow: hidden; font-style: normal; color: var(--ash); white-space: nowrap; text-overflow: ellipsis; }
.mx-app--shiphappens .shp-locales__code { display: none; }

/* the keywords: sample ranks, lit as each one finishes its climb */
.mx-app--shiphappens .shp-kw { margin: 22px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.mx-app--shiphappens .shp-kw li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 3.4ch; align-items: baseline; gap: 14px;
  padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--bone-2);
}
.mx-app--shiphappens .shp-kw small { font-size: 13px; color: var(--ash-2); }
.mx-app--shiphappens .shp-kw b { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ash); transition: color .3s var(--ease); }
.mx-app--shiphappens .shp-kw li.is-up b { color: var(--accent-ink); }

/* the sizes */
.mx-app--shiphappens .shp-sizes { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; }
.mx-app--shiphappens .shp-sizes li { padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 14px; color: var(--bone-2); }

/* the upload */
.mx-app--shiphappens .shp-up { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 22px 0 0; padding: 0; list-style: none; }
.mx-app--shiphappens .shp-up li { display: inline-flex; align-items: center; gap: 10px; font-size: 15.5px; color: var(--ash); transition: color .3s var(--ease); }
.mx-app--shiphappens .shp-up i {
  position: relative; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-2);
  transition: background-color .3s var(--ease), border-color .3s var(--ease);
}
.mx-app--shiphappens .shp-up i::after {
  content: ""; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px;
  border: solid var(--night); border-width: 0 2px 2px 0; transform: rotate(45deg); opacity: 0;
}
.mx-app--shiphappens .shp-up li.is-done { color: var(--bone); }
.mx-app--shiphappens .shp-up li.is-done i { background: var(--live); border-color: var(--live); }
.mx-app--shiphappens .shp-up li.is-done i::after { opacity: 1; }

@media (max-width: 860px) {
  .mx-app--shiphappens .shp-count {
    top: calc(var(--hdr) + 12px); right: auto; left: var(--gutter); text-align: left;
    display: grid; grid-template-columns: auto auto; align-items: baseline; column-gap: 10px;
  }
  .mx-app--shiphappens .shp-count__n { grid-row: 1; grid-column: 1; margin: 0; font-size: 34px; }
  .mx-app--shiphappens .shp-count__k { grid-row: 1; grid-column: 2; }
  .mx-app--shiphappens .shp-count__note { grid-column: 1 / -1; margin-top: 4px; }
  .mx-app--shiphappens .mx-story__step h2 { font-size: 28px; }
  /* the live readout up top carries the number on a phone; the figure stays for screen readers */
  .mx-app--shiphappens .mx-story__fig {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .mx-app--shiphappens .mx-story__src { margin-top: 12px; font-size: 13px; }
  .mx-app--shiphappens .shp-locales { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; border: 0; }
  .mx-app--shiphappens .shp-locales li { display: inline-flex; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; }
  .mx-app--shiphappens .shp-locales__code { display: inline; font-variant-numeric: tabular-nums; color: var(--bone-2); }
  /* on a phone the 3D carries these; the names and ranks stay for screen readers */
  .mx-app--shiphappens .shp-locales__name, .mx-app--shiphappens .shp-locales i, .mx-app--shiphappens .shp-kw {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .mx-app--shiphappens .shp-sizes, .mx-app--shiphappens .shp-up { margin-top: 14px; }
  .mx-app--shiphappens .shp-ph img { height: 36px; }
}

/* ---------- the feature panels: the app's own UI, drawn ---------- */
.mx-app--shiphappens .shp-viz { gap: 14px; }
.mx-app--shiphappens .shp-viz__k { color: var(--bone-2); }

/* screenshots: the canvas with a caption selected, and its locales */
.mx-app--shiphappens .shp-art { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mx-app--shiphappens .shp-art__shot {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px;
  aspect-ratio: 9 / 13; padding: 12px 10px 0; overflow: hidden; border-radius: 12px;
  background: linear-gradient(160deg, #FBF8F3, #ECE5DA); color: #111114;
  font-weight: 800; font-size: 12.5px; line-height: 1.12; text-align: center;
}
.mx-app--shiphappens .shp-art__shot--dim { opacity: .74; }
.mx-app--shiphappens .shp-art__sel { position: relative; padding: 3px 4px; outline: 1.5px solid #3B82F6; outline-offset: 2px; }
.mx-app--shiphappens .shp-art__sel i {
  position: absolute; width: 7px; height: 7px; border: 1.5px solid #3B82F6; border-radius: 50%; background: #fff;
}
.mx-app--shiphappens .shp-art__sel i:nth-child(1) { left: -7px; top: -7px; }
.mx-app--shiphappens .shp-art__sel i:nth-child(2) { right: -7px; top: -7px; }
.mx-app--shiphappens .shp-art__sel i:nth-child(3) { left: -7px; bottom: -7px; }
.mx-app--shiphappens .shp-art__sel i:nth-child(4) { right: -7px; bottom: -7px; }
.mx-app--shiphappens .shp-art__phone {
  display: block; width: 74%; margin-top: auto; border: 4px solid #0B0B0D; border-bottom: 0; border-radius: 16px 16px 0 0;
  background: #15161A; overflow: hidden;
}
.mx-app--shiphappens .shp-art__street { fill: none; stroke: rgba(255, 255, 255, .07); stroke-width: 2; }
.mx-app--shiphappens .shp-art__route { fill: none; stroke: #FF7A45; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.mx-app--shiphappens .shp-art__phone circle { fill: #fff; }
.mx-app--shiphappens .shp-art__stats { fill: #1F2026; }
.mx-app--shiphappens .shp-art__phone text { fill: #fff; font-size: 7.5px; font-weight: 700; }
.mx-app--shiphappens .shp-art__bar { fill: #FF7A45; }
.mx-app--shiphappens .shp-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.mx-app--shiphappens .shp-pill { padding: 5px 11px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 13px; color: var(--ash); }
.mx-app--shiphappens .shp-pill--on { border-color: var(--accent-ink); color: var(--bone); }

/* localization: one listing line, four languages */
.mx-app--shiphappens .shp-layers { display: grid; gap: 8px; }
.mx-app--shiphappens .shp-layers span {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px;
  background: var(--graphite-2); font-size: 15px; color: var(--bone-2);
}
.mx-app--shiphappens .shp-layers span:nth-child(2) { margin-left: 18px; }
.mx-app--shiphappens .shp-layers span:nth-child(3) { margin-left: 36px; }
.mx-app--shiphappens .shp-layers span:nth-child(4) { margin-left: 54px; }
.mx-app--shiphappens .shp-layers b { font-weight: 400; font-size: 18px; }

/* the upload */
.mx-app--shiphappens .shp-ticks { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.mx-app--shiphappens .shp-ticks li {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px; background: var(--graphite-2); font-weight: 550;
}
.mx-app--shiphappens .shp-ticks i { position: relative; width: 20px; height: 20px; border-radius: 50%; background: var(--live); }
.mx-app--shiphappens .shp-ticks i::after {
  content: ""; position: absolute; left: 7px; top: 3.5px; width: 4.5px; height: 9px;
  border: solid var(--night); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.mx-app--shiphappens .shp-ticks span { font-size: 13px; color: var(--ash); }

/* by hand against the app */
.mx-app--shiphappens .shp-vs { display: grid; gap: 8px; }
.mx-app--shiphappens .shp-vs p { margin: 0; }
.mx-app--shiphappens .shp-vs b { font-weight: 250; font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }
.mx-app--shiphappens .shp-vs__bar { display: block; height: 8px; margin-bottom: 10px; border-radius: 4px; background: var(--graphite-2); overflow: hidden; }
.mx-app--shiphappens .shp-vs__bar i { display: block; width: var(--v); height: 100%; border-radius: 4px; background: var(--ash-2); }
.mx-app--shiphappens .shp-vs__bar--on i { background: var(--accent-ink); }

/* the keyword table */
.mx-app--shiphappens .shp-table { display: grid; }
.mx-app--shiphappens .shp-table p {
  display: grid; grid-template-columns: minmax(0, 1fr) 34px 76px; align-items: center; gap: 10px;
  margin: 0; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14.5px;
}
.mx-app--shiphappens .shp-table span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mx-app--shiphappens .shp-table b { text-align: right; font-variant-numeric: tabular-nums; }
.mx-app--shiphappens .shp-table__head { color: var(--ash-2); font-size: 12px !important; }
.mx-app--shiphappens .shp-table__head span:not(:first-child) { text-align: right; }
.mx-app--shiphappens .shp-pop {
  justify-self: end; padding: 2px 8px; border-radius: 999px; font-style: normal; font-weight: 650; font-size: 12px;
  background: rgba(52, 199, 89, .14); color: #7BE38F;
}
.mx-app--shiphappens .shp-pop--hot { background: rgba(214, 92, 214, .16); color: #EB9BEB; }

/* every app */
.mx-app--shiphappens .shp-apps { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.mx-app--shiphappens .shp-apps li {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border: 1px solid var(--line);
  border-radius: 999px; font-size: 14px; color: var(--bone-2);
}
.mx-app--shiphappens .shp-apps li.is-on { border-color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--bone); }
.mx-app--shiphappens .shp-apps img { width: 22px; height: 22px; border-radius: 6px; }

/* the downloads chart */
.mx-app--shiphappens .mx-chart .shp-ship { stroke: var(--accent-ink); stroke-dasharray: 3 4; }
.mx-app--shiphappens .shp-axis { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; margin-top: 10px; }
.mx-app--shiphappens .shp-axis span:nth-child(2) { color: var(--accent-ink); }
.mx-app--shiphappens .shp-axis span:last-child { text-align: right; }
