/*
 * deltaloop-marketing/three-steps - block stylesheet.
 *
 * Auto-extracted from the monolithic style.css. References
 * design tokens from assets/css/tokens.css. Loaded by
 * WordPress when the block renders (via block.json `style`).
 */

/* ─────────────────────────────────────────────────────────
   Three steps - Section 10 (the clock, minimal)
   ───────────────────────────────────────────────────────── */

.three-steps {
  padding: 180px 48px 160px;
  max-width: 1320px;
}

.steps-header {
  max-width: 820px;
  margin: 0 auto 140px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.steps-headline { margin: 0; }

/* ── Rail ── */

.hour-rail {
  position: relative;
  padding: 0 48px;
}

.rail-line {
  position: absolute;
  top: 60px;
  left: 48px; right: 48px;
  height: 1px;
  background: var(--hairline);
  pointer-events: none;
}

.rail-endcap {
  position: absolute;
  top: -28px;
  color: var(--outline);
  font-size: 10px;
  white-space: nowrap;
}

.rail-endcap--l { left: 0; }

.rail-endcap--r { right: 0; }

/* ── Moments ── */

.moments {
  position: relative;
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.moment {
  position: relative;
  padding-top: 100px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.moment-peg {
  position: absolute;
  top: 54px;
  left: 0;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.peg-ring {
  position: absolute;
  inset: -6px;
  border: 1px solid var(--hairline-accent);
  border-radius: 50%;
  animation: pegPulse 2.6s var(--ease-expo) infinite;
}

.peg-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 12px rgba(20,227,156,0.6);
}

.moment-time {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--outline);
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 16px;
}

.moment-time-num {
  font-size: 56px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text-heading);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-transform: none;
}

.moment-title {
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text-heading);
  margin: 12px 0 0;
  line-height: 1.1;
}

.moment-copy {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--on-surface-variant);
  margin: 4px 0 0;
  max-width: 32ch;
}

@media (max-width: 900px) {
  .moments { grid-template-columns: 1fr; gap: 64px; }
  .rail-line { display: none; }
  .moment { padding-top: 0; }
  .moment-peg { position: static; margin-bottom: 16px; }
}

/* THREE STEPS - moments light up along the rail */

.moment.reveal {
  opacity: 0;
  transform: translate3d(0, 40px, 0);
}

.moment.reveal .peg-dot {
  background: var(--hairline-strong);
  box-shadow: none;
  transition: background 600ms var(--ease-expo) calc(var(--reveal-delay, 0ms) + 200ms),
              box-shadow 600ms var(--ease-expo) calc(var(--reveal-delay, 0ms) + 200ms);
}

.moment.reveal.is-in {
  opacity: 1;
  transform: none;
}

.moment.reveal.is-in .peg-dot {
  background: var(--primary);
  box-shadow: 0 0 12px rgba(20,227,156,0.6);
}

/* Rail line draws as you scroll */

.hour-rail-track {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hour-rail-track-fill {
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg,
    var(--primary-container) 0%,
    var(--primary) 50%,
    var(--primary-container) 100%);
  transform-origin: left center;
  transform: scaleX(var(--rail-progress, 0));
  transition: transform 140ms linear;
  box-shadow: 0 0 8px rgba(20,227,156,0.5);
}

@media (prefers-reduced-motion: reduce) {
  .hour-rail-track-fill {
    transition: none !important;
    transform: none !important;
    filter: none !important;
    opacity: 1 !important;
    clip-path: none !important;
    -webkit-mask-image: none !important;
            mask-image: none !important;
  }
}

/* ────────────────── PHONE (< 640px) ────────────────── */

@media (max-width: 640px) {
  /* Three-steps already has 900px stacking rule */
  .three-steps { padding: 100px 20px; }
  .steps-header { margin-bottom: 72px; }
  .moment-time-num { font-size: 40px; }
}

/* Respect user's motion preference - pause the expensive stuff. */

@media (prefers-reduced-motion: reduce) {
  .peg-ring {
    animation: none !important;
  }
}

/* ============================================================
   Three-steps mobile: vertical timeline layout
   Rebuilds the section for <900px so it reads as a clock going
   top-to-bottom instead of flat stacked blocks.
   ============================================================ */

@media (max-width: 900px) {
  .three-steps { padding: 80px 24px 96px; }
  .steps-header { margin: 0 auto 56px; }
  .steps-headline { font-size: clamp(28px, 7vw, 42px); }
  .hour-rail { padding: 0; }
  .rail-line { display: none; }
  .moments {
    grid-template-columns: 1fr;
    gap: 0;
    max-width: 440px;
    margin: 0 auto;
    position: relative;
  }
  .moment {
    position: relative;
    padding: 0 0 48px 44px;
    text-align: left;
    min-height: 0;
  }
  .moment:last-child { padding-bottom: 0; }
  /* Vertical hairline rail connecting pegs */
  .moment::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 20px;
    bottom: -4px;
    width: 1px;
    background: linear-gradient(
      to bottom,
      var(--primary-container) 0%,
      var(--hairline) 40%,
      var(--hairline) 100%
    );
    opacity: 0.55;
  }
  .moment:last-child::before { display: none; }
  /* Peg sits pinned to the left edge of each moment */
  .moment-peg {
    position: absolute;
    top: 2px;
    left: 0;
    margin: 0;
    width: 14px;
    height: 14px;
  }
  .peg-ring { inset: -6px; }
  /* Typography reset for vertical layout */
  .moment-time {
    margin-top: 0;
    gap: 8px;
    font-size: 10px;
  }
  .moment-time-num {
    font-size: 34px;
    line-height: 1;
  }
  .moment-title {
    margin: 10px 0 4px;
    font-size: 20px;
  }
  .moment-copy {
    font-size: 14px;
    max-width: none;
    line-height: 1.5;
  }
}

@media (max-width: 640px) {
  .three-steps { padding: 72px 20px 88px; }
  .steps-header { margin-bottom: 48px; }
  .moment { padding-bottom: 40px; }
  .moment-time-num { font-size: 30px; }
  .moment-title { font-size: 18px; }
}
