/*
 * life.css — shared motion and "session" touches for the tool sub-pages.
 * Pairs with studio.js. The root pages carry these rules in styles.css;
 * only pages with their own standalone stylesheet should link this file.
 * Colors fall back gracefully: --accent-a → --accent → fixed brand values.
 */

/* Display type */
h1,
h2,
h3 {
  font-family: "Space Grotesk", "SF Pro Display", "Avenir Next", "Segoe UI", sans-serif;
  letter-spacing: -0.03em;
}

/* Gradient display type */
.grad-text {
  background: linear-gradient(
    115deg,
    var(--accent-a, var(--accent, #7a5cff)) 10%,
    var(--accent-c, #399aff) 90%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Section eyebrows become DAW memory-location markers */
main {
  counter-reset: section-marker;
}

.section-heading .eyebrow,
.feature-copy .eyebrow,
.status-card .eyebrow,
.download-copy .eyebrow {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  counter-increment: section-marker;
}

.section-heading .eyebrow::before,
.feature-copy .eyebrow::before,
.status-card .eyebrow::before,
.download-copy .eyebrow::before {
  content: counter(section-marker, decimal-leading-zero);
  padding: 0.22rem 0.5rem 0.18rem;
  border-radius: 8px 8px 8px 2px;
  background: linear-gradient(
    135deg,
    var(--accent-a, var(--accent, #7a5cff)),
    var(--accent-c, #399aff)
  );
  color: #fff;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  line-height: 1;
}

/* Live signal bars (hero eyebrow) */
.signal {
  display: inline-flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 0.78rem;
  margin-right: 0.55rem;
  vertical-align: -0.08em;
}

.signal i {
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(
    180deg,
    var(--accent-c, #399aff),
    var(--accent-a, var(--accent, #7a5cff))
  );
}

.signal i:nth-child(1) { height: 45%; animation-delay: 0ms; }
.signal i:nth-child(2) { height: 90%; animation-delay: 140ms; }
.signal i:nth-child(3) { height: 62%; animation-delay: 280ms; }
.signal i:nth-child(4) { height: 78%; animation-delay: 420ms; }

@keyframes signal-bounce {
  0%, 100% { height: 28%; }
  50% { height: 100%; }
}

/* Hero eyebrows on tool pages need inline-flex so the signal sits right */
.hero-copy > .eyebrow {
  display: inline-flex;
  align-items: center;
}

/* Session timecode (footer) */
.session-timecode {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.55rem 0 0;
  font-family: "SFMono-Regular", "Consolas", monospace;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--muted, #5e687a);
  cursor: pointer;
  user-select: none;
}

.session-timecode::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: #e5484d;
  box-shadow: 0 0 8px rgba(229, 72, 77, 0.65);
}

.session-timecode.is-popped {
  animation: timecode-pop 240ms ease;
}

@keyframes timecode-pop {
  35% { transform: scale(1.08); }
}

@keyframes rec-blink {
  0%, 58% { opacity: 1; }
  78% { opacity: 0.2; }
  100% { opacity: 1; }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 640ms cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 640ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

/* Cursor spotlight on cards */
.spot {
  position: relative;
}

.spot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    240px circle at var(--spot-x, 50%) var(--spot-y, 50%),
    rgba(122, 92, 255, 0.16),
    transparent 65%
  );
  opacity: 0;
  transition: opacity 240ms ease;
  pointer-events: none;
}

.spot:hover::after,
.spot:focus-within::after {
  opacity: 1;
}

/* Scroll progress as a playhead along the top edge */
.scroll-playhead {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 200;
  pointer-events: none;
}

.scroll-playhead i {
  display: block;
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--accent-a, var(--accent, #7a5cff)),
    var(--accent-c, #399aff)
  );
  transform: scaleX(0);
  transform-origin: left center;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .signal i {
    animation: signal-bounce 1.15s ease-in-out infinite;
  }

  .session-timecode::before {
    animation: rec-blink 2.2s ease-in-out infinite;
  }

  .hero-copy > * {
    opacity: 0;
    animation: rise-in 700ms cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  }

  .hero-copy > :nth-child(1) { animation-delay: 60ms; }
  .hero-copy > :nth-child(2) { animation-delay: 170ms; }
  .hero-copy > :nth-child(3) { animation-delay: 280ms; }
  .hero-copy > :nth-child(4) { animation-delay: 390ms; }
  .hero-copy > :nth-child(5) { animation-delay: 480ms; }
  .hero-copy > :nth-child(6) { animation-delay: 560ms; }

  .hero-stage {
    opacity: 0;
    animation: rise-in 820ms cubic-bezier(0.22, 0.61, 0.36, 1) 320ms forwards;
  }
}
