/* ─────────────────────────────────────────────────────────
   WHY — Proof of Work / Stats grid
   ───────────────────────────────────────────────────────── */

@property --gradient-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@property --highlight-color {
  syntax: '<color>';
  initial-value: rgba(251, 140, 57, 0.14);
  inherits: false;
}

/* 5 cards × 6s each = 30s full cycle. Each card is bright during its
   own 20% slice (one full 360° sweep) then dim for the remaining 80%. */
@keyframes why-seq {
  0%    { --gradient-angle: 0deg;   --highlight-color: rgba(251, 140, 57, 0.14); }
  2%    { --gradient-angle: 36deg;  --highlight-color: #fb8c39; }
  18%   { --gradient-angle: 324deg; --highlight-color: #fb8c39; }
  20%   { --gradient-angle: 360deg; --highlight-color: rgba(251, 140, 57, 0.14); }
  100%  { --gradient-angle: 360deg; --highlight-color: rgba(251, 140, 57, 0.14); }
}

.why {
  background: #ffffff;
  padding: 96px var(--pad) 96px;
}

.why-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.why-headline {
  font-size: clamp(34px, 4.8vw, 66px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 48px;
  text-align: center;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.why-headline .accent {
  color: #f0824b;
  font-style: italic;
  font-weight: 400;
  font-family: 'Times New Roman', Times, serif;
}

.why-sub {
  font-size: 15px;
  color: var(--muted);
  max-width: 600px;
  line-height: 1.6;
  margin: 0 auto 48px;
  text-align: center;
}

.why-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
}

.why-col-equal {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.why-col-equal .why-card {
  flex: 1;
}

.why-card {
  border: 1.5px solid transparent;
  border-radius: 16px;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 260px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    conic-gradient(
      from var(--gradient-angle),
      rgba(251, 140, 57, 0.14) 0deg,
      rgba(251, 140, 57, 0.14) 150deg,
      var(--highlight-color) 180deg,
      rgba(251, 140, 57, 0.14) 210deg,
      rgba(251, 140, 57, 0.14) 360deg
    ) border-box;
  animation: why-seq 30s linear infinite;
  animation-delay: calc(var(--seq, 0) * 6s);
}

.why-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.why-card-stat {
  font-size: clamp(36px, 4vw, 56px);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.why-card-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 16px;
  line-height: 1.4;
}

.why-card-visual {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

.why-card-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  flex: 1;
  position: relative;
  overflow: hidden;
}

.why-card-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  border-radius: 2px;
  background: #f0824b;
}

.why-card-video {
  padding: 0;
  overflow: hidden;
}

.why-card-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 14.5px;
}

/* ─────────────────────────────────────────────────────────
   WHY — responsive (single column stack)
   Order: video 1 → stat → stat → stat → video 2
   ───────────────────────────────────────────────────────── */
/* Tablet — single column, portrait videos matching source aspect (9:16).
   Videos are constrained to a comfortable width so they don't dominate
   the page while staying fully visible (no crop). */
@media (max-width: 1024px) {
  .why {
    padding: 80px var(--pad);
  }

  .why-headline {
    margin-bottom: 40px;
  }

  .why-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 16px;
    max-width: 560px;
  }

  /* Reset all explicit grid placements so they flow in DOM order */
  .why-grid > * {
    grid-column: 1 !important;
    grid-row: auto !important;
  }

  /* Videos — portrait 9:16 matches source, so object-fit: cover
     doesn't crop the subject. Centered at a reasonable width. */
  .why-grid > .why-card-video {
    aspect-ratio: 9 / 16;
    min-height: 0;
    max-height: 720px;
    max-width: 440px;
    width: 100%;
    margin: 0 auto;
    justify-self: center;
  }

  /* Stat cards — compact stacked blocks */
  .why-grid > .why-card:not(.why-card-video) {
    min-height: 150px;
    padding: 28px 26px;
  }
}

/* Mobile — narrower portrait crop for phones */
@media (max-width: 700px) {
  .why {
    padding: 64px var(--pad) 72px;
  }

  .why-headline {
    font-size: clamp(30px, 8vw, 44px);
    margin-bottom: 28px;
  }

  .why-grid {
    gap: 12px;
    max-width: 560px;
  }

  .why-grid > .why-card-video {
    aspect-ratio: 4 / 5;
  }

  .why-grid > .why-card:not(.why-card-video) {
    min-height: 130px;
    padding: 24px 22px;
  }

  .why-card-stat {
    font-size: clamp(30px, 9vw, 44px);
  }

  .why-card-label {
    font-size: 12px;
    margin-top: 10px;
  }
}
