/* =============================================================================
   Sofia - the app in the stores
   Loaded only while a store is live (the server adds the link to <head>), so the
   rest of the site and its cache key stay untouched. The app band is night, like the
   App Store pictures, with the app's light screens in the phones (2026-11-20).
   ========================================================================== */

/* ---- badges --------------------------------------------------------------- */

/* Both stores ask for at least 40 px on screen and clear space of a quarter of the height
   (10 px at 40 px); the gap below is wider than that. Google's PNG carries its own clear
   space: --badge-scale and --trim-* (written by the server from the file) draw it taller
   and take the padding back, so its visible badge is exactly as tall as Apple's. */
.store-badge {
  --badge-h: 2.75rem;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--badge-h);
  border-radius: 0.55rem;
  text-decoration: none;
  transition: transform 0.15s ease;
}
.store-badge img {
  display: block;
  width: auto;
  max-width: none;
  height: calc(var(--badge-h) * var(--badge-scale, 1));
  margin:
    calc(var(--badge-h) * var(--trim-t, 0) * -1)
    calc(var(--badge-h) * var(--trim-r, 0) * -1)
    calc(var(--badge-h) * var(--trim-b, 0) * -1)
    calc(var(--badge-h) * var(--trim-l, 0) * -1);
  border-radius: 0;
}
/* The artwork itself is never altered (no opacity or filter), only lifted on hover. */
.store-badge:hover { transform: translateY(-1px); }
.store-badge:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* Only while the store's artwork file is missing: a plain button, never a drawn badge. */
.store-badge--text {
  padding-inline: 1.15rem;
  background: var(--ink);
  color: var(--paper);
  font-size: var(--step-1);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.hero .store-badge--text, .appband .store-badge--text { background: var(--gold-bright, #ffd27a); color: var(--ink); }

.hero__stores {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 1.5rem;
}
/* Below the price line, not straight under the button: two buttons stacked read as clutter
   (Artem, 2026-11-16). At the stores' own 44 px, quieter than the main action. */
/* On a phone the first screen keeps one action: Safari already offers the app in its own banner,
   and the badges follow in the app section and the footer. */
@media (max-width: 47.99rem) {
  .hero__stores { display: none; }
}

/* ---- beside the prices ------------------------------------------------------ */

/* Under the two plans, before the cancellation note: the same account in the app (Artem
   2026-11-20: the top of the page already says there is an app, the prices are where it counts). */
.price-apps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin: clamp(1.5rem, 1rem + 1.5vw, 2rem) 0 0;
  padding: 1.25rem clamp(1.25rem, 1rem + 1vw, 1.75rem);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius, 16px);
  background: var(--card);
}
.price-apps__text { margin: 0; max-width: 34rem; font-size: var(--step-1); color: var(--ink-soft); }
.price-apps__text strong { color: var(--ink); }
.price-apps__badges { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; }

/* ---- the section ---------------------------------------------------------- */

.appband {
  overflow: hidden;
  background: var(--night, #121a27);
  color: var(--night-text, #eef0f3);
}
.appband.band--rule { border-top-color: transparent; }
.appband h2 { color: #fff; }
.appband h2::before {
  content: "";
  display: block;
  width: 2.4rem;
  height: 3px;
  border-radius: 2px;
  background: var(--gold, #f0b45a);
  margin: 0 0 1.1rem;
}
.appband .eyebrow { color: var(--gold, #f0b45a); }
.appband a:focus-visible, .appband .store-badge:focus-visible { outline-color: var(--gold-bright, #ffd27a); }
.appband__grid {
  display: grid;
  gap: clamp(2.75rem, 2rem + 3vw, 4.5rem);
  align-items: center;
}
@media (min-width: 58rem) {
  .appband__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
}
.appband h2 { margin-bottom: 1.1rem; }
.appband__lead { max-width: var(--measure); color: var(--night-soft, #b9c0ca); }

.appband__list {
  list-style: none;
  margin: 1.75rem 0 0;
  padding: 0;
  max-width: var(--measure);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}
.appband__list li {
  position: relative;
  padding: 0.8rem 0 0.8rem 2.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--night-text, #eef0f3);
}
/* A gold tick in a ring that clears 3:1 on night. */
.appband__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.95rem;
  width: 1.25rem;
  height: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background: transparent;
}
.appband__list li::after {
  content: "";
  position: absolute;
  left: 0.44rem;
  top: 1.22rem;
  width: 0.34rem;
  height: 0.6rem;
  border: solid var(--gold-bright, #ffd27a);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.appband__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 2rem;
}
/* A store that is not live yet: the badge's size, corners and two-line rhythm, in grey and in
   our own type, without the store's logo (both stores forbid a recoloured badge). */
.store-soon {
  --badge-h: 2.75rem;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  height: var(--badge-h);
  padding-inline: 0.95rem 1.1rem;
  border: 1px solid var(--rule-strong);
  border-radius: 0.55rem;
  color: var(--ink-mute);
  line-height: 1.05;
  cursor: default;
  user-select: none;
}
.hero .store-soon, .appband .store-soon { border-color: rgba(255, 255, 255, 0.3); color: var(--night-soft, #b9c0ca); }
.store-soon__small { font-size: 0.68rem; letter-spacing: 0.02em; }
.store-soon__big { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.005em; }

/* ---- the phones ----------------------------------------------------------- */

.appband__phones {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 30rem;
  width: 100%;
  margin-inline: auto;
  padding-block: 1rem;
  isolation: isolate;
}

.phone {
  flex: 0 0 33%;
  margin: 0;
  padding: 2.6%;
  border-radius: 16% / 7.9%;
  background: #05080d;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    0 30px 60px -28px rgba(0, 0, 0, 0.8);
}
.phone__screen {
  overflow: hidden;
  aspect-ratio: 1080 / 2205;
  border-radius: 13% / 6.4%;
  background: var(--paper);
}
.phone__screen img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

@media (min-width: 58rem) { .appband__phones { max-width: 44rem; } }

/* The home screen in front, the explanation and the progress view a step behind it. */
.phone--1 { order: 2; flex-basis: 41%; z-index: 2; }
.phone--2 { order: 1; margin-right: -9%; transform: translateY(5%) rotate(-5deg); z-index: 1; }
.phone--3 { order: 3; margin-left: -9%; transform: translateY(5%) rotate(5deg); z-index: 1; }

/* ---- footer --------------------------------------------------------------- */

.footer__apps {
  margin: 1.1rem 0 0;
  font-size: var(--step-1);
  color: var(--night-soft, #b9c0ca);
}
.footer__brand .footer__apps:first-child { margin-top: 0; }

@media print {
  .hero__stores, .appband, .footer__apps, .price-apps { display: none; }
}
