
/* Shared motion layer — scroll reveals, count-up support, gallery, card hover.
   Loaded by every page after styles.css. Hidden states only apply once
   html.js-motion is present (added by motion.js), so content stays fully
   visible if JS fails or is disabled — never move this gating into
   styles.css or a page's own <style> block. */

html.js-motion [data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

html.js-motion [data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* .module-item's own border/shadow hover values already live in
   index.html's page-local <style> (see CLAUDE.md's override-only-what-
   differs rule) — this just adds the lift, guarded so a tap never sticks. */
@media (hover: hover) and (pointer: fine) {
  .module-item:hover {
    transform: translateY(-4px);
  }
}

.gallery-body {
  position: relative;
}

.gallery-body .gallery-media {
  position: absolute;
  top: 14px;
  left: 14px;
  width: calc(100% - 28px);
  height: calc(100% - 28px);
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.gallery-body .gallery-media.active {
  opacity: 1;
  pointer-events: auto;
  cursor: zoom-in;
}

/* Video/phone slot keeps the full box — no inset — since the phone bezel
   already provides its own visual margin; the 14px inset above is only
   meant to give screenshots breathing room against the frame edge. */
.gallery-body .gallery-media.gallery-phone {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.gallery-body .gallery-media.gallery-placeholder-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  background: var(--bg-secondary);
  cursor: default;
}

.gallery-body .gallery-media.gallery-placeholder-slot p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.gallery-body .gallery-media.gallery-phone.active {
  cursor: default;
}

/* Intro empty-state — shown instead of any screenshot until the visitor
   clicks a step for the first time, so it's obvious the timeline is
   interactive rather than a passive list. Hidden by default (and always,
   without JS) so the no-JS fallback still shows step 1's real screenshot
   immediately; motion.js adds .is-engaged to .cycle-screen the first time
   any .cstep is activated, which is what reveals the real gallery. */
.cycle-intro {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-align: center;
  padding: 1.5rem;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  z-index: 2;
}

.cycle-intro svg {
  width: 22px;
  height: 22px;
  stroke: var(--green);
}

.cycle-intro p {
  font-size: 14px;
  font-weight: 400;
  max-width: 220px;
}

html.js-motion .cycle-screen:not(.is-engaged) .cycle-intro {
  display: flex;
}

html.js-motion .cycle-screen:not(.is-engaged) .gallery-body .gallery-media.active {
  opacity: 0;
}

html.js-motion .cycle-screen:not(.is-engaged) .gallery-tabs,
html.js-motion .cycle-screen:not(.is-engaged) .gallery-caption {
  visibility: hidden;
}

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  background: rgba(0, 0, 0, 0.85);
}

.lightbox.is-open {
  display: flex;
}

.lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
}

.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lightbox-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.gallery-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin: 0 0 0.8rem;
  padding: 4px;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  background: var(--bg-secondary);
  border: 0.5px solid var(--border-mid);
  border-radius: 999px;
}

.gallery-tab {
  white-space: nowrap;
  padding: 7px 16px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.gallery-tab.active {
  background: var(--green);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.gallery-tab:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html.js-motion [data-reveal] {
    transition: none;
  }
  .module-item {
    transition: none;
  }
  .module-item:hover {
    transform: none;
  }
  .gallery-body .gallery-media {
    transition: none;
  }
  .gallery-tab {
    transition: none;
  }
}
