/* =====================================================================
   I Need Help! — mobile polish
   Loaded after inh-story.css. Covers: no sideways scroll, the header +
   hamburger button, the slide-in drawer, and small-screen fixes.
   Palette: navy #102b68, blue #2563eb, yellow #f5b800/#ffd84d,
   pastels sky #bfe0fb, mint #b7ebc9, butter #fde68a, pink #ffc9d6,
   lavender #dcd6ff.
   ===================================================================== */

/* ---------- 1. Never scroll sideways ---------- */
/* The off-canvas drawer is parked just outside the right edge; on phones
   that made the page wider than the screen. `clip` (unlike `hidden`)
   keeps position:sticky working for the header. */
html,
body {
  overflow-x: clip;
}

body:has(.offcanvas__info.info-open) {
  overflow: hidden;
}

/* ---------- 2. Hamburger button ---------- */
.st-burger {
  --burger-line: #102b68;
  position: relative;
  display: none;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 2px solid #d3e4fb;
  border-radius: 15px;
  background: linear-gradient(180deg, #ffffff 0%, #eef5ff 100%);
  box-shadow: 0 3px 0 #d3e4fb;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.st-burger__bars {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  padding-left: 11px;
}

.st-burger__bars span {
  display: block;
  height: 3px;
  width: 20px;
  border-radius: 3px;
  background: var(--burger-line);
  transition: width 0.25s ease, transform 0.25s ease;
}

/* the short yellow middle bar is the "playful" bit */
.st-burger__bars span:nth-child(2) {
  width: 12px;
  background: #f5b800;
}

.st-burger:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 #d3e4fb;
}

.st-burger:hover .st-burger__bars span:nth-child(2),
.st-burger:focus-visible .st-burger__bars span:nth-child(2) {
  width: 20px;
}

.st-burger:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 3px;
}

/* ---------- 3. Header on phones / tablets ---------- */
@media (max-width: 991px) {
  .st-header {
    background: rgba(255, 255, 255, 0.98);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border-bottom: 1px solid #e3edfb;
    box-shadow: 0 6px 18px rgba(16, 43, 104, 0.06);
  }

  .st-header__inner {
    height: 66px;
    gap: 12px;
  }

  .st-header__logo img {
    height: 40px;
  }

  .st-burger {
    display: block;
  }
}

@media (max-width: 380px) {
  .st-header__logo img {
    height: 36px;
  }
}

/* ---------- 4. Drawer ---------- */
.offcanvas__info.st-drawer {
  width: min(88vw, 380px);
  height: 100%;
  height: 100dvh;
  background: #fff;
  border-left: 0;
  box-shadow: -24px 0 60px rgba(16, 43, 104, 0.28);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  /* fully parked off-screen + hidden, so it can never add page width */
  transform: translateX(104%);
  visibility: hidden;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.45s;
}

.offcanvas__info.st-drawer.info-open {
  transform: translateX(0);
  visibility: visible;
  transition-delay: 0s, 0s;
}

.st-drawer .offcanvas__wrapper {
  height: auto;
  min-height: 100%;
  padding: 0;
  background: linear-gradient(180deg, #eaf4ff 0%, #ffffff 34%);
}

.st-drawer .offcanvas__wrapper .offcanvas__content.st-drawer__content {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding: 18px 20px calc(24px + env(safe-area-inset-bottom));
  overflow: hidden;
}

.st-drawer__content > * {
  position: relative;
  z-index: 1;
}

.st-drawer__content > .st-drawer__blob {
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
}

.st-drawer__blob--a {
  width: 190px;
  height: 190px;
  right: -70px;
  top: 150px;
  background: #fde68a;
  opacity: 0.45;
}

.st-drawer__blob--b {
  width: 150px;
  height: 150px;
  left: -60px;
  bottom: 120px;
  background: #ffc9d6;
  opacity: 0.45;
}

.st-drawer__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.st-drawer__logo img {
  display: block;
  width: auto;
  height: 42px;
}

/* close button — twin of the hamburger */
.st-drawer .offcanvas__wrapper .offcanvas__content .st-drawer__close {
  position: relative;
  width: 46px;
  height: 46px;
  line-height: 1;
  padding: 0;
  border: 2px solid #d3e4fb;
  border-radius: 15px;
  background: linear-gradient(180deg, #ffffff 0%, #eef5ff 100%);
  box-shadow: 0 3px 0 #d3e4fb;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.st-drawer__close:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 #d3e4fb;
}

.st-drawer__close:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 3px;
}

.st-drawer__x::before,
.st-drawer__x::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 3px;
  margin: -1.5px 0 0 -10px;
  border-radius: 3px;
  background: #102b68;
}

.st-drawer__x::before { transform: rotate(45deg); }
.st-drawer__x::after { transform: rotate(-45deg); background: #f5b800; }

/* main links */
.st-drawer__nav {
  display: grid;
  gap: 10px;
}

.st-drawer__link {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  padding: 10px 16px 10px 12px;
  border-radius: 20px;
  background: #fff;
  border: 2px solid #e3edfb;
  box-shadow: 0 4px 0 #e3edfb;
  color: #102b68;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.2s ease;
}

.st-drawer__link:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #e3edfb;
}

.st-drawer__link:focus-visible,
.st-drawer__chip:focus-visible,
.st-drawer__card:focus-visible,
.st-drawer__help:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 3px;
}

.st-drawer__ico {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  font-size: 17px;
  color: #102b68;
}

.st-drawer__ico--sky { background: #bfe0fb; }
.st-drawer__ico--butter { background: #fde68a; }

.st-drawer__txt {
  flex: 1 1 auto;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}

.st-drawer__chev {
  flex: 0 0 auto;
  font-size: 13px;
  color: #102b68;
  opacity: 0.35;
}

/* section labels */
.st-drawer .st-drawer__label {
  margin: 26px 2px 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #1597ed;
}

/* chapter chips */
.st-drawer__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.st-drawer__chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 800;
  color: #102b68;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.st-drawer__chip--sky { background: #bfe0fb; }
.st-drawer__chip--mint { background: #b7ebc9; }
.st-drawer__chip--butter { background: #fde68a; }
.st-drawer__chip--pink { background: #ffc9d6; }
.st-drawer__chip--lav { background: #dcd6ff; }

.st-drawer__chip:active { transform: scale(0.96); }

/* contact cards */
.st-drawer__contact {
  display: grid;
  gap: 10px;
}

.st-drawer__card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  color: #102b68;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.st-drawer__card--mail { background: #dbeafc; }
.st-drawer__card--fb { background: #fdf1d3; }

.st-drawer__cardico {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  font-size: 17px;
  color: #102b68;
}

.st-drawer__card--fb .st-drawer__cardico {
  background: #1877f2;
  color: #fff;
}

.st-drawer__cardtxt {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
  text-transform: none;
}

.st-drawer__cardtxt b {
  font-size: 15px;
  font-weight: 800;
}

.st-drawer__cardtxt small {
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 600;
  color: #3b4b7a;
  overflow-wrap: anywhere;
}

/* footer of the drawer */
.st-drawer__foot {
  margin-top: auto;
  padding-top: 24px;
  text-align: center;
}

.st-drawer .st-drawer__help {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 18px 24px;
  font-size: 19px;
  letter-spacing: 0.02em;
}

.st-drawer .st-drawer__tag {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #102b68;
  opacity: 0.6;
}

.st-drawer__mascot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  text-align: left;
}

.st-drawer__mascot img {
  flex: 0 0 auto;
  width: 84px;
  height: auto;
  display: block;
}

.st-drawer .st-drawer__say {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
  color: #102b68;
}

.st-drawer .st-drawer__say small {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  font-weight: 600;
  color: #3b4b7a;
}

/* staggered entrance when the drawer opens */
.st-drawer__link,
.st-drawer__label,
.st-drawer__chip,
.st-drawer__card,
.st-drawer__foot {
  opacity: 0;
  translate: 0 12px;
  transition: opacity 0.35s ease, translate 0.45s cubic-bezier(0.22, 1, 0.36, 1), transform 0.15s ease, box-shadow 0.15s ease;
}

.st-drawer.info-open .st-drawer__link,
.st-drawer.info-open .st-drawer__label,
.st-drawer.info-open .st-drawer__chip,
.st-drawer.info-open .st-drawer__card,
.st-drawer.info-open .st-drawer__foot {
  opacity: 1;
  translate: 0 0;
  transition-delay: calc(var(--i, 0) * 45ms + 140ms), calc(var(--i, 0) * 45ms + 140ms), 0s, 0s;
}

/* backdrop */
.offcanvas__overlay {
  background: rgba(16, 43, 104, 0.5);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}

.offcanvas__overlay.overlay-open {
  opacity: 1;
  transition-delay: 0s;
}

@media (prefers-reduced-motion: reduce) {
  .offcanvas__info.st-drawer,
  .offcanvas__overlay,
  .st-drawer__link,
  .st-drawer__label,
  .st-drawer__chip,
  .st-drawer__card,
  .st-drawer__foot {
    transition: none !important;
    translate: none;
  }
}

/* ---------- 5. Small-screen fixes ---------- */
/* Contact banner: the <br>s are hidden on phones so keep a real space */
.cus-br { display: inline; }

@media (max-width: 760px) {
  .cus-br { display: none; }
}

/* Floating buttons: keep them tidy and out of each other's way */
@media (max-width: 767px) {
  .back-to-top {
    right: 16px;
    bottom: 16px;
    width: 46px;
    height: 46px;
    line-height: 46px;
    font-size: 16px;
  }

  .st-help-fab {
    right: 16px;
    bottom: 74px;
  }
}

/* ---------- 6. Hero must fit the screen ---------- */
/* A grid column defaults to min-content width, so the hero text column was
   growing to ~410px on a 390px phone (logo, button row, phones), which
   forced sideways scrolling. Let the column shrink, and size the logo
   from the real viewport width. */
@media (max-width: 991px) {
  .st-hero__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .st-hero__grid > * {
    min-width: 0;
  }

  .st-brand {
    --e: min(19px, calc((100vw - 40px) / 34.5));
  }
}

@media (max-width: 575px) {
  .st-hero .st-btn-row {
    gap: 10px;
  }

  .st-hero .st-btn-row .st-btn {
    padding: 14px 20px;
    font-size: 15px;
  }
}

/* Older browsers without overflow:clip (iOS < 16) fall back to hidden */
@supports not (overflow: clip) {
  html,
  body {
    overflow-x: hidden;
  }
}

/* ---------- 7. Section spacing + compact cards on phones ---------- */
@media (max-width: 991px) {
  .st-head + .st-features,
  .st-head + .st-split,
  .st-head + .st-envs {
    margin-top: 30px;
  }

  .st-hero__note {
    margin-top: 12px;
  }
}

@media (max-width: 575px) {
  /* "How it all started" heading text reflows narrower on phones and
     collides with this decorative star; it's purely visual, so hide it. */
  .st-deco-spark--story-head {
    display: none;
  }

  /* Chapter 02: four tall cards -> four short rows */
  .st-features {
    gap: 12px;
  }

  .st-feature {
    display: grid;
    grid-template-columns: 56px 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 16px;
    row-gap: 2px;
    padding: 16px 18px;
    text-align: left;
    border-radius: 22px;
  }

  .st-feature__icon {
    grid-row: 1 / span 2;
    width: 56px;
    height: 56px;
    margin: 0;
    font-size: 22px;
    border-radius: 18px;
  }

  .st-feature__title {
    align-self: end;
    margin: 0;
    font-size: 13.5px;
  }

  .st-feature__text {
    align-self: start;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
  }

  /* Chapter 03: three tall photos -> swipeable row */
  .st-envs {
    display: flex;
    gap: 14px;
    margin: 0 -20px;
    padding: 4px 20px 18px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 20px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .st-envs::-webkit-scrollbar {
    display: none;
  }

  .st-env {
    flex: 0 0 80%;
    scroll-snap-align: center;
  }

  .st-env img {
    aspect-ratio: 4 / 3;
  }

  /* Contact banner */
  .cus-wrap .cus-mail,
  .cus-wrap .cus-fb {
    width: 100% !important;
    max-width: 320px;
    box-sizing: border-box;
  }

  .cus-wrap .cus-copyright {
    line-height: 1.5 !important;
  }
}

/* Very small phones (<=360px) */
@media (max-width: 360px) {
  .st-wrap {
    padding-left: 16px;
    padding-right: 16px;
  }

  .st-h2 {
    font-size: 27px;
  }

  .st-envs {
    margin: 0 -16px;
    padding-left: 16px;
    padding-right: 16px;
    scroll-padding-inline: 16px;
  }
}

@media (max-width: 575px) {
  .st-section {
    padding: 46px 0;
  }
}

/* Anchor jumps (drawer chips, logo letters) should stop below the sticky header */
html {
  scroll-padding-top: 78px;
}

@media (max-width: 340px) {
  .st-drawer__cardtxt small {
    font-size: 11.5px;
  }
}
