/* /stroybattle/ — page for the СтройБаттл app.
   Two design codes on one page:
   - site shell + content sections: einhell.kz (Montserrat, --brand-red, white/grey sections);
   - hero + final call (.sb-app): the app's «Pocket Arena» (guru_app DESIGN.md / src/app/globals.css):
     cream brick wall, Oswald display, Golos Text body, 14/20/24 px radii, hard bottom shadows in deep red.
   The app tokens below mirror guru_app's globals.css; change them there first if the app's palette changes. */

.sb-page {
  --sb-red: var(--brand-red);
  --sb-red-deep: #a50918;
  --sb-ink: #1a1a1a;
  --sb-text: #333333;
  --sb-muted: #555555;
  --sb-cream: #fff4e4;
  --sb-mortar: #ece4d6;
  --sb-radius-control: 14px;
  --sb-radius-panel: 20px;
  --sb-radius-hero: 24px;
  --sb-store-height: 64px;
}

.sb-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.sb-main {
  color: var(--sb-text);
  overflow: hidden;
}

/* ---------- App design code ---------- */

.sb-app {
  font-family: "Golos Text", "Montserrat", sans-serif;
}

.sb-hero {
  background-color: var(--sb-cream);
  /* Brick courses: 80×40 bricks, every second course offset by half a brick (same wall as the app's promo). */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='80'%3E%3Cg fill='none' stroke='%23ece4d6' stroke-width='3'%3E%3Cpath d='M0 1.5H160M0 41.5H160M1.5 0V40M81.5 0V40M41.5 40V80M121.5 40V80'/%3E%3C/g%3E%3C/svg%3E");
  padding: clamp(40px, 6vw, 80px) 0 0;
  overflow: hidden;
}

.sb-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
}

.sb-hero__copy {
  min-width: 0;
  padding-bottom: clamp(40px, 6vw, 80px);
}

.sb-appid {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.sb-appid__icon {
  flex: none;
  width: 72px;
  height: 72px;
  border-radius: 18px;
  box-shadow: 0 5px 0 var(--sb-red-deep);
}

.sb-appid__text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.sb-appid__name {
  font-family: "Oswald", sans-serif;
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--sb-ink);
}

.sb-appid__meta {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--sb-red);
}

.sb-display {
  margin: 0;
  font-family: "Oswald", sans-serif;
  font-size: clamp(2.6rem, 5.4vw, 4.6rem);
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  color: var(--sb-ink);
  overflow-wrap: break-word;
}

.sb-display--light {
  color: #fff;
}

.sb-lead {
  max-width: 36rem;
  margin: 20px 0 32px;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--sb-muted);
}

/* Store buttons: three equal columns — the widest label sets every button's width ("find the max"),
   one shared height so the row never staggers. */
.sb-stores {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 40rem;
  margin: 0;
  padding: 0 0 6px;
  list-style: none;
}

.sb-stores li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

/* QR codes (static SVGs in assets/images/stroybattle/qr-*.svg, one per link): for desktop visitors who
   want the app on their phone. Same box for all three whatever the QR's module count. Hidden on phones. */
.sb-qr {
  display: block;
  width: 100%;
  max-width: 160px;
  height: auto;
  aspect-ratio: 1 / 1;
  padding: 10px;
  border: 1px solid var(--sb-mortar);
  border-radius: var(--sb-radius-control);
  background: #fff;
  box-shadow: 0 4px 0 var(--sb-mortar);
}

.sb-qr-hint {
  margin: 14px 0 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--sb-text);
}

.sb-store {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: var(--sb-store-height);
  padding: 10px 16px;
  border-radius: var(--sb-radius-control);
  background: var(--sb-red);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 5px 0 var(--sb-red-deep);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.2s ease;
}

.sb-store:hover {
  background: #c00b1c;
}

.sb-store:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--sb-red-deep);
}

.sb-store:focus-visible {
  outline: 3px solid var(--sb-ink);
  outline-offset: 3px;
}

.sb-store__icon {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.sb-store__label {
  display: grid;
  min-width: 0;
  line-height: 1.15;
}

.sb-store__label small {
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.85;
}

.sb-store__label strong {
  font-size: 1.0625rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-note {
  margin: 18px 0 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--sb-muted);
}

/* Phones: both mockups share one grid cell; the back one is shifted with a transform, not positioned. */
.sb-hero__visual {
  align-self: end;
  min-width: 0;
}

.sb-phones {
  display: grid;
  justify-items: center;
  max-width: 460px;
  margin: 0 auto;
}

.sb-phone {
  grid-area: 1 / 1;
  width: min(62%, 270px);
  /* The phone runs off the bottom of the hero: only its lower part is cut, never the screen's sides. */
  max-height: 480px;
  margin: 0;
  padding: 10px 10px 0;
  border-radius: 30px 30px 0 0;
  background: var(--sb-ink);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.sb-phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 20px 20px 0 0;
}

.sb-phone--back {
  transform: translate(34%, 8%) rotate(6deg);
  opacity: 0.96;
}

.sb-phone--front {
  transform: translateX(-18%);
}

/* ---------- Website design code ---------- */

.sb-section {
  padding: clamp(48px, 7vw, 92px) 0;
  font-family: "Montserrat", sans-serif;
}

.sb-section--gray {
  background: #f3f3f3;
}

.sb-section__head {
  max-width: 52rem;
  margin: 0 auto clamp(28px, 4vw, 48px);
  text-align: center;
}

.sb-eyebrow {
  margin: 0 0 8px;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-red);
}

.sb-title {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  line-height: 1.2;
  color: #161616;
}

/* Steps: equal-height cards (grid stretch), screenshots pinned to the bottom with margin-top:auto,
   so every phone sits on the same baseline whatever the text length. */
.sb-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sb-step {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 24px 24px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.sb-step__num {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--brand-red);
  color: #fff;
  font-size: 1.125rem;
  font-weight: 800;
}

.sb-step__title {
  margin: 0 0 6px;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
  color: #161616;
  overflow-wrap: break-word;
}

.sb-step__text {
  margin: 0 0 20px;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-body);
}

.sb-shot {
  margin: auto 0 0;
  padding: 8px 8px 0;
  border-radius: 26px 26px 0 0;
  background: var(--sb-ink);
}

.sb-shot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1.35;
  object-fit: cover;
  object-position: top center;
  border-radius: 19px 19px 0 0;
}

.sb-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sb-feature {
  min-width: 0;
  padding: 24px;
  border-left: 4px solid var(--brand-red);
  border-radius: var(--radius);
  background: #fff;
}

.sb-feature__title {
  margin: 0 0 6px;
  font-size: 1.0625rem;
  font-weight: 700;
  color: #161616;
}

.sb-feature p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-body);
  overflow-wrap: break-word;
}

/* ---------- Final call: the app's red arena panel ---------- */

.sb-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 48px);
  padding: clamp(28px, 4vw, 48px);
  border-radius: var(--sb-radius-hero);
  background-color: var(--sb-red);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='80'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.08' stroke-width='3'%3E%3Cpath d='M0 1.5H160M0 41.5H160M1.5 0V40M81.5 0V40M41.5 40V80M121.5 40V80'/%3E%3C/g%3E%3C/svg%3E");
  box-shadow: 0 8px 0 var(--sb-red-deep);
  color: #fff;
}

.sb-cta__copy {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.sb-cta__icon {
  flex: none;
  width: 88px;
  height: 88px;
  border-radius: 22px;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9), 0 6px 0 3px var(--sb-red-deep);
}

.sb-cta__copy p {
  margin: 8px 0 0;
  font-size: 1.0625rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
}

.sb-stores--light {
  max-width: none;
}

.sb-stores--light .sb-store {
  background: #fff;
  color: var(--sb-red);
  box-shadow: 0 5px 0 var(--sb-red-deep);
}

.sb-stores--light .sb-store:hover {
  background: #fff0f2;
}

.sb-stores--light .sb-store__label small {
  color: var(--sb-muted);
  opacity: 1;
}

.sb-stores--light .sb-store:focus-visible {
  outline-color: #fff;
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .sb-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sb-cta {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .sb-hero__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .sb-hero__copy {
    padding-bottom: 8px;
  }

  .sb-phones {
    max-width: 380px;
  }

  .sb-features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .sb-stores {
    grid-template-columns: minmax(0, 1fr);
  }

  .sb-qr,
  .sb-qr-hint {
    display: none;
  }

  .sb-steps,
  .sb-features {
    grid-template-columns: minmax(0, 1fr);
  }

  .sb-step {
    padding: 20px 20px 0;
  }

  .sb-shot {
    width: min(100%, 300px);
    margin-right: auto;
    margin-left: auto;
  }

  .sb-cta__copy {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sb-store {
    transition: none;
  }

  .sb-store:active {
    transform: none;
  }
}
