/* ============================================================
   Container — shared responsive layout constraint
   Provides 1024px max content width with responsive side padding.
   Import this in any component that uses the .container class.
   ============================================================ */

.container {
  position:  relative;
  width:     1024px;
  max-width: calc(100% - 160px); /* 80px × 2 — desktop */
  margin:    0 auto;
}

/* Tablet (≤991px): 60px × 2 = 120px */
@media (max-width: 991px) {
  .container {
    max-width: calc(100% - 120px);
  }
}

/* Landscape mobile (≤767px): 2rem × 2 = 4rem */
@media (max-width: 767px) {
  .container {
    max-width: calc(100% - 4rem);
  }
}



/* ============================================================
   Wide container — 1360px content + 48px side padding
   Used for full-bleed section content blocks (slider, big cards)
   that need to be wider than the standard 1024px text container.
   ============================================================ */

.container-wide {
  width:      100%;
  max-width:  calc(1360px + 96px);   /* 1360px content + 48px × 2 */
  padding:    0 3rem;                /* 48px sides */
  margin:     0 auto;
  box-sizing: border-box;
}

/* Tablet + landscape mobile (≤991px) */
@media (max-width: 991px) {
  .container-wide {
    padding: 0 2rem;
  }

  .container-wide > * {
    margin-left:  -1rem;
    width:        calc(100% + 2rem) !important;
  }
}


/* ============================================================
   Shared homepage section patterns
   Import in any section component that uses the sticky badge rail.

   Provides: .hp-section shell, .hp-rail sticky rail,
   .hp-badge pill, .hp-heading, .hp-body
   ============================================================ */


/* ---- Section shell ----------------------------------------
   Background-color is intentionally omitted — each section
   sets its own via a single-rule override. */

.hp-section {
  position:       relative;
  display:        flex;
  flex-direction: column;
  align-items:    center;
  gap:            4rem;      /* 64px */
  padding:        8rem 0;   /* 128px top + bottom */
  font-family:    var(--font-family-default);
  width:          100%;
  box-sizing:     border-box;
}

/* Tablet (≤991px) */
@media (max-width: 991px) {
  .hp-section {
    padding: 6rem 0;
    gap:     3rem;
  }
}

/* Mobile (≤767px) */
@media (max-width: 767px) {
  .hp-section {
    padding: 4rem 0;
    gap:     2rem;
  }
}


/* ---- Sticky badge rail ------------------------------------
   Absolutely positioned inside the first .container, pushed
   left via right: 100%.  .container has position: relative so
   the rail is bounded to the container's height — badge stops
   when the container ends.
   Width = gutter between container (1024px) and container-wide
   (1360px): (1360 − 1024) / 2 = 168px.
   Shown only at ≥1488px — when the gutter is a fixed, predictable size. */

.hp-rail {
  display:        none;
  position:       absolute;
  right:          100%;
  top:            0;
  bottom:         0;
  width:          calc((1360px - 1024px) / 2);   /* 168px */
  pointer-events: none;
}

.hp-rail__sticky {
  position:        sticky;
  top:             8rem;
  display:         flex;
  justify-content: flex-end;
  align-items:     flex-start;
  padding-right:   12px;   /* 12px gap from the container's left edge */
}

@media (min-width: 1488px) {
  .hp-rail {
    display:         flex;
    justify-content: flex-start;
    align-items:     flex-start;
  }
}


/* ---- Badge pill -------------------------------------------
   Base pill used in the sticky rail and as the inline badge.
   .hp-badge--inline controls visibility relative to breakpoint. */

.hp-badge {
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  gap:             6px;
  height:          26px;
  padding:         0 var(--spacing-3);
  background:      var(--card);
  border-radius:   var(--radius-full);
  font-size:       var(--font-size-xs);
  font-weight:     var(--font-weight-medium);
  line-height:     var(--line-height-xs);
  color:           var(--foreground);
  white-space:     nowrap;
}

/* Inline variant — shown below 1488px, hidden at and above
   (matches the rail breakpoint so there is never a gap where
   neither badge is shown) */
.hp-badge--inline {
  margin-bottom: var(--spacing-6);
}

@media (min-width: 1488px) {
  .hp-badge--inline {
    display: none;
  }
}

@media (max-width: 767px) {
  .hp-badge--inline {
    margin-bottom: 1rem;
  }
}

/* Live indicator dot (DemoSection "Live demo" badge) */
.hp-badge__dot {
  display:          block;
  width:            6px;
  height:           6px;
  border-radius:    var(--radius-full);
  background-color: var(--primary);
  flex-shrink:      0;
}


/* ---- Section heading --------------------------------------
   36px regular weight; <strong> inside uses bold. */

.hp-heading {
  margin:      0;
  font-size:   2.25rem;
  font-weight: var(--font-weight-regular);
  line-height: 2.5rem;
  color:       var(--foreground);
}

.hp-heading strong {
  font-weight: var(--font-weight-bold);
}


/* ---- Section body text ------------------------------------
   20px regular — used in header intro blocks. */

.hp-body {
  margin:      0;
  font-size:   1.25rem;
  font-weight: var(--font-weight-regular);
  line-height: 1.75rem;
  color:       var(--foreground);
}

.hp-body strong {
  font-weight: var(--font-weight-bold);
}

@media (max-width: 767px) {
  .hp-heading {
    font-size:   1.875rem;  /* 30px */
    line-height: 2.25rem;   /* 36px */
  }

  .hp-body {
    font-size:   1.125rem;  /* 18px */
    line-height: 1.75rem;   /* 28px */
  }
}


/* ---- Shared card shell ------------------------------------
   Secondary background + hairline border + 12px radius.
   Use alongside component class for layout-specific rules. */

.card-secondary {
  background:    var(--secondary);
  border:        0.5px solid var(--border);
  border-radius: 12px;
  box-sizing:    border-box;
}


/* ---- 26px number pill -------------------------------------
   Circular badge used for step numbers.
   Color (background) set per-component. */

.num-pill {
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  width:           26px;
  height:          26px;
  flex-shrink:     0;
  border-radius:   var(--radius-full);
  font-size:       var(--font-size-xs);
  font-weight:     var(--font-weight-medium);
  line-height:     1;
  color:           var(--foreground);
}


/* ---- Card typography --------------------------------------
   Base/bold title and base/regular muted body.
   Color overrides applied per-component as needed. */

.card-title {
  margin:      0;
  font-size:   var(--font-size-base);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-base);
}

.card-body {
  margin:      0;
  font-size:   var(--font-size-base);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-base);
  color:       var(--muted-foreground);
}

/* ============================================================
   ProblemSection — Homepage "The problem" section
   Shared section shell, rail, badge, heading → src/section.css
   ============================================================ */

.problem-section { background-color: var(--accent); }


/* ============================================================
   Single container — heading + cards with 64px gap
   ============================================================ */

.problem-section__container {
  display:        flex;
  flex-direction: column;
  align-items:    flex-start;
  gap:            64px;
}

.problem-section__header {
  display:        flex;
  flex-direction: column;
  align-items:    flex-start;
}

.problem-section__heading {
  max-width: 800px;
}


/* ============================================================
   Cards row
   ============================================================ */

.problem-section__cards {
  display:               grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows:        auto;
  gap:                   var(--spacing-4);   /* 16px */
  width:                 100%;
}


/* ============================================================
   Individual card
   ============================================================ */

.problem-card {
  position:       relative;
  display:        flex;
  flex-direction: column;
  min-width:      0;
  background:     var(--card);
  border:         0.5px solid var(--border);
  border-radius:  var(--radius-lg);     /* 24px */
  padding:        var(--spacing-3);     /* 12px */
  box-sizing:     border-box;
  overflow:       hidden;
}


/* ---- Illustration wrap ---- */

.problem-card__img-wrap {
  display:             grid;
  grid-template-rows:  1fr;
  border:              0.5px solid var(--border);
  border-radius:       12px;
  background:          var(--secondary);
  flex-shrink:         0;
  overflow:            hidden;
  box-sizing:          border-box;
  transition: grid-template-rows  0.45s cubic-bezier(0.4, 0, 0.2, 1),
              border-color        0.45s cubic-bezier(0.4, 0, 0.2, 1),
              background-color    0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.problem-card:hover .problem-card__img-wrap,
.problem-card:focus-visible .problem-card__img-wrap {
  grid-template-rows: 0fr;
  border-color:       transparent;
  background-color:   transparent;
}


.problem-card__illustration {
  display:      block;
  aspect-ratio: 220 / 223;
  width:        100%;
  min-height:   0;   /* allows the grid row to compress it */
  object-fit:   cover;
}

/* ---- Body block (title row + description) ---- */

.problem-card__body {
  position: relative;   /* description positions against this */
  display:  flex;
  flex-direction: column;
}


/* ---- Title row ---- */

.problem-card__title-row {
  display:     flex;
  align-items: flex-start;
  gap:         var(--spacing-3);   /* 12px */
  padding:     var(--spacing-3) 0 0 var(--spacing-3);
}

.problem-card__title {
  flex:           1;
  padding-bottom: var(--spacing-3);
  color:          var(--foreground);
}

/* ---- Toggle icon ---- */

.problem-card__toggle {
  display:    flex;   /* num-pill sets inline-flex; override to flex */
  background: transparent;
  transform:  rotate(180deg);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              opacity   0.35s ease;
}

.problem-card:focus-visible {
  outline:        2px solid var(--ring);
  outline-offset: 2px;
}

.problem-card:hover .problem-card__toggle,
.problem-card:focus-visible .problem-card__toggle {
  transform: rotate(0deg);
}

/* ---- Description — wrapper in flow (zero height), text absolutely positioned ---- */

.problem-card__description {
  position: relative;   /* anchor for the absolute text */
}

.problem-card__description-text {
  position:       absolute;
  top:            0;
  left:           var(--spacing-3);
  right:          var(--spacing-3);
  opacity:        0;
  pointer-events: none;
  transition:     opacity 0.35s ease;
  padding-bottom: var(--spacing-3);
}

.problem-card:hover .problem-card__description-text,
.problem-card:focus-visible .problem-card__description-text {
  opacity:        1;
  pointer-events: auto;
}


/* ============================================================
   Small desktop (≤1280px) — let card shrink to content
   ============================================================ */

@media (max-width: 1280px) {
  .problem-card {
    min-height: 0;
  }
}


/* ============================================================
   Tablet (≤991px) — 2×2 grid
   ============================================================ */

@media (max-width: 991px) {
  .problem-section__cards {
grid-template-columns: repeat(2, auto);
  }
}


/* ============================================================
   Mobile (≤767px)
   ============================================================ */

@media (max-width: 767px) {
  .problem-section__container {
    gap: 32px;
  }

  .problem-section__cards {
    width:       calc(100% + 32px);
    margin-left: -16px;
  }

  .problem-card__toggle { display: none; }

  .problem-card__title-row {
    padding: 12px 12px 8px 12px;
  }

  .problem-card__title {
    padding-bottom: 0;
  }

  .problem-card__description {
    display: none;
  }

  /* Suppress all hover/focus-driven state changes on touch screens */
  .problem-card:hover .problem-card__img-wrap,
  .problem-card:focus-visible .problem-card__img-wrap       { grid-template-rows: 1fr; border-color: var(--border); background-color: var(--secondary); }
  .problem-card:hover .problem-card__description-text,
  .problem-card:focus-visible .problem-card__description-text { opacity: 0; pointer-events: none; }
}



