/* =============================================================
   Weloop — responsive layer (mobile & tablet)
   Loaded last on every page, so it can correct the desktop-first
   rules in styles.css / modern.css / home.css without touching them.

   Contents
     1. Inline-safe list rows (the check list)
     2. Mobile navigation: burger + panel
     3. Tablet: two-up instead of one-up
     4. Phone: rhythm, type, full-width actions
     5. Touch targets & safe areas
   ============================================================= */

/* -------------------------------------------------------------
   1. Check list — `display:flex` on the row turned every inline
   <b> into a flex item, so a sentence broke into columns and
   overflowed the page. The row is a block again; the tick is
   pulled out of the text flow instead.
   ------------------------------------------------------------- */
.check-list li {
  display: block;
  position: relative;
  padding-left: 26px;
  text-wrap: pretty;
}
.check-list li .ck {
  position: absolute;
  left: 0;
  top: 0;
  line-height: inherit;
}

/* Three deployment cards: three-up only when there is room for them.
   (The page used an inline grid-template, which no media query could
   override.) */
.plat-feats-3 { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) { .plat-feats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Same failure mode, same fix, for the two other tick lists. */
.cta-band .cta-checks span { flex-wrap: nowrap; }

/* -------------------------------------------------------------
   2. Mobile navigation
   ------------------------------------------------------------- */
.nav-burger {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  margin-left: 4px;
  padding: 0;
  flex: none;
  border: 1px solid hsl(var(--border));
  border-radius: 14px;
  background: hsl(var(--card));
  cursor: pointer;
  transition: background 160ms var(--easing-standard), border-color 160ms var(--easing-standard);
}
.nav-burger span {
  position: absolute;
  left: 13px;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: hsl(var(--foreground));
  transition: transform 220ms var(--easing-standard), opacity 140ms linear, top 220ms var(--easing-standard);
}
.nav-burger span:nth-child(1) { top: 15px; }
.nav-burger span:nth-child(2) { top: 21px; }
.nav-burger span:nth-child(3) { top: 27px; }
.nav-burger[aria-expanded="true"] span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { top: 21px; transform: rotate(-45deg); }
.nav-burger:focus-visible { outline: 2px solid hsl(var(--primary)); outline-offset: 2px; }

/* Over the homepage's dark hero the header is transparent. */
.nav.at-top .nav-burger { background: hsl(0 0% 100% / .1); border-color: hsl(0 0% 100% / .22); }
.nav.at-top .nav-burger span { background: #fff; }
/* …but not once the panel is open: the header goes solid behind it. */
.nav.nav-open.at-top { background: hsl(244 100% 99% / .92); border-bottom: 1px solid hsl(var(--border)); }
.nav.nav-open.at-top .brand-logo { filter: none; }
.nav.nav-open.at-top .nav-burger { background: hsl(var(--card)); border-color: hsl(var(--border)); }
.nav.nav-open.at-top .nav-burger span { background: hsl(var(--foreground)); }

.nav-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  padding: 10px 22px calc(18px + env(safe-area-inset-bottom));
  background: hsl(var(--background));
  background-image: linear-gradient(180deg, hsl(260 100% 69% / .05), transparent 120px);
  border-bottom: 1px solid hsl(var(--border));
  box-shadow: 0 24px 48px hsl(260 100% 69% / .12);
  max-height: calc(100dvh - 72px);
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 200ms var(--easing-standard), transform 240ms var(--easing-standard);
}
.nav-panel.is-open { opacity: 1; transform: none; }
.nav-panel-links { display: flex; flex-direction: column; }
.nav-panel-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 4px 6px;
  font-size: 17px;
  font-weight: 600;
  color: hsl(var(--foreground));
  border-bottom: 1px solid hsl(var(--border));
}
.nav-panel-links a::after {
  content: "→";
  font-size: 15px;
  color: hsl(var(--muted-foreground));
  transform: translateX(-2px);
  transition: transform 160ms var(--easing-standard), color 160ms var(--easing-standard);
}
.nav-panel-links a:hover::after, .nav-panel-links a:active::after { transform: none; color: hsl(var(--primary)); }
.nav-panel-links a.active { color: hsl(var(--primary)); }
.nav-panel-links a.active::after { content: "•"; color: hsl(var(--primary)); }
.nav-panel .btn {
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin-top: 18px;
  font-size: 16px;
}
.nav-panel-sov {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 13px;
  color: hsl(var(--muted-foreground));
}
.nav-panel-sov .flags { font-size: 15px; line-height: 1; }
body.nav-locked { overflow: hidden; }

@media (max-width: 940px) {
  .nav-burger { display: block; }
  /* The pill duplicates the panel's sovereignty line and crowds the row. */
  .nav-cta .nav-sov { display: none; }
}
@media (min-width: 941px) {
  .nav-panel { display: none; }
}
/* Under 420px the header keeps the logo, one CTA and the burger only. */
@media (max-width: 419px) {
  .nav-cta .btn-primary { display: none; }
}

/* -------------------------------------------------------------
   3. Tablet — the desktop layouts collapse straight to one column
   at 900px, which wastes half the width on an iPad. Two-up reads
   far better between 700 and 999px.
   ------------------------------------------------------------- */
@media (min-width: 700px) and (max-width: 999px) {
  .trust-grid,
  .plat-feats,
  .prose-cols,
  .fail-grid,
  .benefits,
  .wl-feats,
  .wl-bens,
  .dist-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .benefits, .wl-bens { max-width: none; }
  .integration-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .price-grid { max-width: 560px; }
  /* Three cards in a two-up grid leave an orphan: let it span the row. */
  .plat-feats-3 > :last-child { grid-column: 1 / -1; }
  .team-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  /* A media panel beside prose is unreadable at this width; stack it
     but keep the visual generous rather than letterboxed. */
  .feat-row, .feat-row.flip > .feat-media { grid-template-columns: minmax(0, 1fr); order: 0; }
  .feat-media { max-width: 680px; margin: 0 auto; width: 100%; }

  .page-hero h1 { font-size: clamp(34px, 5.4vw, 46px); }
  .page-hero .lede { font-size: 17px; }
}

/* -------------------------------------------------------------
   4. Phone — the section rhythm was tuned for desktop: 88px of
   padding between blocks means a lot of scrolling past nothing.
   ------------------------------------------------------------- */
@media (max-width: 720px) {
  .section { padding: 56px 0; }
  .section-tight { padding: 44px 0; }
  .wrap, .wrap-narrow { padding: 0 20px; }
  .wl-sec { padding: 56px 20px; }

  .page-hero { padding: 44px 0 32px; }
  .page-hero h1 { font-size: clamp(30px, 8.6vw, 38px); line-height: 1.08; }
  .page-hero .lede { font-size: 16px; margin-top: 16px; }
  .breadcrumb { margin-bottom: 16px; }

  .hero { padding: 84px 0 32px; }
  /* The eyebrow pill fits one line at 390px only if it drops a size;
     otherwise the trailing flag wraps alone. */
  .wl-pill { font-size: 12px; padding: 7px 13px; gap: 8px; margin-bottom: 22px; }
  .h-section, .wl-h2 { line-height: 1.12; }
  .sec-head .lede, .wl-lede { font-size: 16px; }
  .prose h2 { font-size: clamp(22px, 6.6vw, 28px); }
  .prose p, .prose li, .check-list li { font-size: 15px; }

  /* Actions: full-width, stacked, in reading order. */
  .hero-cta, .wl-hero-actions, .solution-foot .btn-row, .cta-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
  }
  .hero-cta .btn, .wl-hero-actions .wl-btn, .cta-band .btn, .cta-actions .btn {
    display: flex;
    justify-content: center;
    width: 100%;
    min-height: 52px;
  }

  .cta-band { border-radius: 22px; padding: 36px 22px; }
  .cta-band .cta-checks { gap: 10px 18px; font-size: 12px; }
  .metric-row { border-radius: 20px; }
  .badge-strip { gap: 8px; }
  .badge-strip span { font-size: 11.5px; padding: 7px 11px; }
  .integration-grid { gap: 10px; }
  .integration { padding: 14px; }
}

@media (max-width: 520px) {
  .metric-row { grid-template-columns: minmax(0, 1fr); }
  .metric-cell { border-right: 0; border-bottom: 1px solid hsl(240 8% 18%); }
  .metric-cell:last-child { border-bottom: 0; }
  .integration-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .price-card { padding: 26px 22px; }
}

/* -------------------------------------------------------------
   5. Touch targets, tap feedback and safe areas
   ------------------------------------------------------------- */
@media (pointer: coarse) {
  .btn, .wl-btn, .nav-links a, .footer-col a, .wl-footer a { min-height: 44px; display: inline-flex; align-items: center; }
  .btn-sm { min-height: 40px; }
  a, button { -webkit-tap-highlight-color: hsl(260 100% 69% / .12); }
}

/* Long unbroken strings (URLs, ticket ids) must not push the page wide. */
@media (max-width: 720px) {
  .prose p, .prose li, .legal-prose p, .legal-prose li { overflow-wrap: anywhere; }
}
