/* ==========================================================================
   Valawa — shared styles
   Works alongside Tailwind CDN. Custom properties, keyframes and the few
   stateful patterns that are cleaner outside utility classes.
   ========================================================================== */

:root {
  --ink: #1d1d1b;
  --accent: #34d399;
  --swift: cubic-bezier(0.32, 0.72, 0, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent);
  color: var(--ink);
}

/* Eyebrow tag --------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 9999px;
  padding: 0.3rem 0.85rem;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* ==========================================================================
   Navigation — solid pill once the page scrolls
   (the id selector outweighs the Tailwind bg-white/80 utility)
   ========================================================================== */

#site-nav {
  transition: background-color 0.35s var(--swift), box-shadow 0.35s var(--swift), border-color 0.35s var(--swift);
}

#site-nav.nav-solid {
  background-color: #ffffff;
  border-color: rgba(29, 29, 27, 0.12);
  box-shadow: 0 14px 34px -20px rgba(29, 29, 27, 0.3);
}

/* ==========================================================================
   Hero tile wall — slow vertical marquee of anonymized creator tiles
   ========================================================================== */

.tile-wall {
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent);
}

.tile-track {
  will-change: transform;
  animation: tiles-up 52s linear infinite;
}

.tile-track--down {
  animation-name: tiles-down;
  animation-duration: 64s;
}

.tile-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 1rem;
}

@keyframes tiles-up {
  from { transform: translateY(0); }
  to   { transform: translateY(-50%); }
}

@keyframes tiles-down {
  from { transform: translateY(-50%); }
  to   { transform: translateY(0); }
}

.tile {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 1.25rem;
  overflow: hidden;
  flex: none;
}

/* ==========================================================================
   Mobile navigation overlay + hamburger morph
   ========================================================================== */

#nav-overlay {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s var(--swift);
}

body.nav-open #nav-overlay {
  opacity: 1;
  pointer-events: auto;
}

#nav-overlay .overlay-link {
  transform: translateY(28px);
  opacity: 0;
  transition: transform 0.6s var(--swift), opacity 0.6s var(--swift);
}

body.nav-open #nav-overlay .overlay-link        { transform: none; opacity: 1; }
body.nav-open #nav-overlay .overlay-link:nth-child(1) { transition-delay: 0.08s; }
body.nav-open #nav-overlay .overlay-link:nth-child(2) { transition-delay: 0.14s; }
body.nav-open #nav-overlay .overlay-link:nth-child(3) { transition-delay: 0.2s; }
body.nav-open #nav-overlay .overlay-link:nth-child(4) { transition-delay: 0.26s; }
body.nav-open #nav-overlay .overlay-link:nth-child(5) { transition-delay: 0.32s; }
body.nav-open #nav-overlay .overlay-link:nth-child(6) { transition-delay: 0.38s; }

body.nav-open {
  overflow: hidden;
}

.nav-line {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 1.5px;
  margin-left: -10px;
  background: currentColor;
  transition: transform 0.45s var(--swift);
}

.nav-line:nth-child(1) { transform: translateY(-4px); }
.nav-line:nth-child(2) { transform: translateY(3px); }

body.nav-open .nav-line:nth-child(1) { transform: rotate(45deg); }
body.nav-open .nav-line:nth-child(2) { transform: rotate(-45deg); }

/* ==========================================================================
   How it works — the journey
   Default layout (mobile, no JS, reduced motion): a clean vertical list.
   With JS on >=768px, main.js adds .journey--horizontal and pins the
   section while vertical scroll drives the track sideways.
   ========================================================================== */

.journey {
  padding: 1rem 0 7rem;
}

.journey-track {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  max-width: 38rem;
  margin: 0 auto;
}

.journey-card {
  background: #fff;
  border: 1px solid rgba(29, 29, 27, 0.1);
  border-radius: 2rem;
  padding: 2rem;
  transition: opacity 0.5s var(--swift), transform 0.5s var(--swift);
}

/* Horizontal mode (added by JS on desktop) */
.journey--horizontal {
  padding: 0;
  overflow: hidden;
}

.journey--horizontal .journey-viewport {
  display: flex;
  align-items: center;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.journey--horizontal .journey-track {
  flex-direction: row;
  align-items: stretch;
  gap: 2rem;
  width: max-content;
  max-width: none;
  margin: 0;
  will-change: transform;
  padding-left: max(calc((100vw - 72rem) / 2), 2.5rem);
  padding-right: 35vw;
}

.journey--horizontal .journey-card {
  width: min(430px, 44vw);
  flex: none;
  opacity: 0.45;
  transform: scale(0.985);
}

.journey--horizontal .journey-card.is-active {
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   Vertical journey timeline (live case page)
   ========================================================================== */

.tl-rail {
  position: absolute;
  left: 11px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: rgba(29, 29, 27, 0.08);
}

.tl-progress {
  position: absolute;
  left: 11px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--ink);
  transform: scaleY(0);
  transform-origin: top;
}

.tl-dot {
  position: absolute;
  left: 0;
  top: 8px;
  width: 24px;
  height: 24px;
  border-radius: 9999px;
  background: #fff;
  border: 2px solid rgba(29, 29, 27, 0.15);
  transition: border-color 0.5s var(--swift), background 0.5s var(--swift);
}

.tl-dot::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 9999px;
  background: rgba(29, 29, 27, 0.15);
  transition: background 0.5s var(--swift), transform 0.5s var(--swift);
}

.tl-item.is-active .tl-dot {
  border-color: var(--ink);
}

.tl-item.is-active .tl-dot::after {
  background: var(--accent);
  transform: scale(1.15);
}

/* Timeline items that haven't happened yet (live case): dot stays hollow,
   copy stays muted even when scrolled past. */
.tl-item--future {
  opacity: 0.55;
}

.tl-item--future.is-active .tl-dot {
  border-color: rgba(29, 29, 27, 0.2);
}

.tl-item--future.is-active .tl-dot::after {
  background: rgba(29, 29, 27, 0.15);
  transform: none;
}

/* ==========================================================================
   Funnel bars
   ========================================================================== */

.funnel-bar {
  transform-origin: left;
}

/* ==========================================================================
   Live indicator — slow pulse on the accent dot
   ========================================================================== */

.live-dot {
  animation: live-pulse 2.4s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  50%      { box-shadow: 0 0 0 5px rgba(52, 211, 153, 0); }
}

/* ==========================================================================
   Reduced motion — kill all decorative movement
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .tile-track,
  .tile-track--down {
    animation: none;
  }
  .journey-card,
  .tl-dot,
  .tl-dot::after,
  #site-nav,
  #nav-overlay,
  #nav-overlay .overlay-link {
    transition: none;
  }
  .tl-progress {
    transform: scaleY(1);
  }
  .live-dot {
    animation: none;
  }
}
