/* ==========================================================================
   Felt Jets: Merge Shooter — components
   Hero merge chain, felt patch cards, steps, store buttons, sticky CTA.
   Mobile-first: base rules target <= 768px.
   ========================================================================== */

/* --------------------------------------------------------- store buttons -- */
/* Felt patch buttons: solid block, dashed seam stitched a few pixels inside. */

.store-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.75rem 0 1.1rem;
}

.store-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  min-height: 60px;
  padding: 0.7rem 1.25rem;
  border: 0;
  border-radius: var(--radius);
  font-family: var(--font-body);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.22s var(--ease-snap), box-shadow 0.22s ease;
}

/* The stitched seam */
.store-btn::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 2px dashed currentColor;
  border-radius: 12px;
  opacity: 0.32;
  pointer-events: none;
}

.store-btn__glyph {
  display: inline-flex;
  flex-shrink: 0;
}

.store-btn__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.store-btn__label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.85;
}

.store-btn__brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Live Google Play patch — ochre on deep petrol text, 8.4:1 */
.store-btn--live {
  background: var(--ochre);
  color: var(--surface-0);
  box-shadow: 0 10px 0 -2px var(--ochre-deep), 0 16px 30px rgba(0, 0, 0, 0.35);
}
.store-btn--live:hover {
  transform: translateY(-3px);
  box-shadow: 0 13px 0 -2px var(--ochre-deep), 0 20px 36px rgba(0, 0, 0, 0.42);
}
.store-btn--live:active {
  transform: translateY(2px);
  box-shadow: 0 6px 0 -2px var(--ochre-deep), 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* Disabled App Store patch — fixed neutral grey, never brand-tinted */
.store-btn--disabled {
  background: #2a2a2a;
  color: var(--ink);
  opacity: 0.55;
  filter: grayscale(0.6);
  cursor: not-allowed;
  box-shadow: none;
}
.store-btn--disabled:hover { transform: none; }

.store-btn__tag {
  position: absolute;
  top: -9px;
  right: 12px;
  background: var(--ink);
  color: #1c1c1c;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}

/* ------------------------------------------------------------------ hero -- */

.hero {
  padding: clamp(2.25rem, 8vw, 4.5rem) 0 clamp(3rem, 10vw, 5rem);
}

.hero__inner {
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 9vw, 4rem);
}

.hero__title {
  font-size: var(--step-hero);
  margin-bottom: 1.1rem;
}

.hero__lede {
  font-size: clamp(1rem, 3.3vw, 1.15rem);
  color: var(--ink-soft);
  max-width: 34ch;
}

.hero__note {
  font-size: 0.875rem;
  color: var(--ink-mute);
  margin: 0;
}

/* Merge chain — icon + icon = banner, the core loop as a diagram */

.merge-chain {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.6rem;
  justify-items: center;
}

.merge-tile {
  margin: 0;
  position: relative;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--seam);
  padding: 0.55rem;
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}

.merge-tile img {
  width: 100%;
  border-radius: 12px;
}

.merge-tile--small { width: 100%; max-width: 132px; }

/* The merged result spans the full row beneath the two inputs */
.merge-tile--result {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 0.4rem;
  border-color: var(--sky);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), 0 0 0 4px rgba(92, 178, 236, 0.14);
}

.merge-tile__caption {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: var(--ochre);
  color: var(--surface-0);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
}

.merge-op {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--ochre);
  line-height: 1;
}

/* On mobile the equals sign sits under the pair, centred above the result */
.merge-op--equals {
  grid-column: 1 / -1;
  color: var(--sky);
  transform: rotate(90deg);
  margin: 0.3rem 0 0;
}

/* -------------------------------------------------------------- sections -- */

.section { padding: var(--section-pad) 0; }

.section--features {
  border-top: 1px dashed var(--seam-soft);
  border-bottom: 1px dashed var(--seam-soft);
}

.section__head {
  max-width: 46ch;
  margin-bottom: clamp(2rem, 7vw, 3rem);
}

.section__title {
  font-size: var(--step-h2);
  margin-bottom: 0.9rem;
}

.section__lede {
  color: var(--ink-soft);
}

/* ---------------------------------------------------------- felt patches -- */

.patch-grid {
  display: grid;
  gap: 1rem;
}

.patch {
  position: relative;
  background: var(--surface-1);
  border-radius: var(--radius);
  padding: 1.6rem 1.35rem 1.45rem;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
  transition: transform 0.25s var(--ease-snap), box-shadow 0.25s ease;
}

/* Inset stitch seam, the felt-patch signature */
.patch::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1.5px dashed var(--seam);
  border-radius: 12px;
  pointer-events: none;
}

.patch:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.36);
}

.patch__num {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--surface-0);
  background: var(--sky);
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.9rem;
}

.patch__title {
  font-size: var(--step-h3);
  margin-bottom: 0.6rem;
}

.patch__body {
  color: var(--ink-soft);
  font-size: 0.975rem;
  margin: 0;
}

/* ----------------------------------------------------------------- steps -- */

.steps {
  display: grid;
  gap: 1rem;
  counter-reset: step;
}

.step {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "mark title"
    "mark body";
  column-gap: 1rem;
  align-items: start;
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
  border-radius: var(--radius);
  border-left: 5px solid var(--ochre);
  padding: 1.35rem 1.25rem;
}

.step__mark {
  grid-area: mark;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--surface-0);
  border: 2px dashed var(--seam);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ochre);
}

.step__title {
  grid-area: title;
  font-size: var(--step-h3);
  margin-bottom: 0.35rem;
  align-self: center;
}

.step__body {
  grid-area: body;
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 0;
}

/* -------------------------------------------------------------- download -- */

.download {
  background:
    radial-gradient(circle at 50% 0%, rgba(40, 136, 215, 0.3), transparent 62%),
    linear-gradient(180deg, var(--surface-1), var(--surface-0));
  border-top: 1px dashed var(--seam-soft);
  border-bottom: 1px dashed var(--seam-soft);
  text-align: center;
}

.download__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.download__icon {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  border: 2px solid var(--seam);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.4);
  margin-bottom: 1.4rem;
}

.download__title {
  font-size: var(--step-h2);
  margin-bottom: 0.9rem;
}

.download__lede {
  color: var(--ink-soft);
  max-width: 46ch;
}

.store-row--center {
  align-items: center;
  width: 100%;
  max-width: 340px;
}

/* ----------------------------------------------------------------- about -- */

.about {
  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 7vw, 3rem);
}

.about__copy p { color: var(--ink-soft); }
.about__copy strong { color: var(--ink); }

.about__art {
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--seam);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
}

/* ------------------------------------------------------------ sticky CTA -- */

.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem var(--gutter) calc(0.6rem + env(safe-area-inset-bottom));
  background: rgba(6, 35, 47, 0.97);
  border-top: 1px solid var(--seam);
  backdrop-filter: blur(10px);
  transform: translateY(105%);
  transition: transform 0.3s var(--ease-snap);
}

.sticky-cta[hidden] { display: none; }
.sticky-cta.is-visible { transform: translateY(0); }

.sticky-cta__meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.875rem;
  font-weight: 600;
  min-width: 0;
}

.sticky-cta__meta img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
}

.sticky-cta__meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sticky-cta__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 1.1rem;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--ochre);
  color: var(--surface-0);
  font-weight: 800;
  font-size: 0.9rem;
  text-decoration: none;
}
.sticky-cta__btn:active { transform: scale(0.97); }

/* --------------------------------------------------------------- motion -- */
/* Merge-snap: elements arrive slightly shrunk and offset, then snap into place. */

.reveal {
  opacity: 0;
  transform: translateY(20px) scale(0.965);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s ease, transform 0.55s var(--ease-snap);
}

/* If JS never runs, nothing may stay invisible */
.no-js .reveal,
html:not(.js) .reveal {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal,
  .reveal.is-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .sticky-cta { transition: none; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------------------------------------------- tablet and up (>=768px) -- */

@media (min-width: 768px) {

  .store-row {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .store-btn { width: auto; min-width: 210px; }

  .store-row--center {
    justify-content: center;
    max-width: none;
  }

  .hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    align-items: center;
    gap: clamp(2rem, 5vw, 3.5rem);
  }

  .hero__lede { max-width: 38ch; }

  /* Desktop: the full merge equation reads left to right in one row */
  .merge-chain {
    grid-template-columns: auto auto auto auto minmax(0, 1.9fr);
    gap: 0.75rem;
  }

  .merge-tile--small { max-width: 96px; }

  .merge-tile--result {
    grid-column: auto;
    margin-top: 0;
  }

  .merge-op--equals {
    grid-column: auto;
    transform: none;
    margin: 0;
  }

  .patch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }

  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }

  .step {
    grid-template-columns: 1fr;
    grid-template-areas:
      "mark"
      "title"
      "body";
    row-gap: 0.85rem;
    padding: 1.6rem 1.5rem;
  }

  .download__icon { width: 96px; height: 96px; }

  .about {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: center;
  }

  /* Sticky bar is a mobile affordance only */
  .sticky-cta { display: none !important; }
}

/* --------------------------------------------- desktop and up (>=1024px) -- */

@media (min-width: 1024px) {
  .patch-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .merge-tile--small { max-width: 110px; }
}
