/* ==========================================================================
   Homepage hero - a lead feed over the team it lands with.
   The video is the customer's team; the stacked notifications are what
   CyraWork delivers to them. Loaded by index.html only.
   ========================================================================== */

.hero--feed {
  --feed-green: var(--color-accent-green);
}

.hero--feed .hero__split {
  gap: var(--space-4xl);
}

.hero--feed .hero__content {
  flex: 0 0 54%;
  max-width: 54%;
}

.hero--feed .hero__heading {
  font-size: clamp(3rem, 1.6rem + 4.2vw, 4.75rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  text-wrap: balance;
  margin-bottom: var(--space-xl);
}

.hero--feed .hero__heading em {
  font-style: italic;
  white-space: nowrap;
  color: var(--feed-green);
}

.hero--feed .hero__subtitle {
  max-width: 44ch;
  margin-bottom: var(--space-2xl);
}

.hero__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 1.6rem;
  font-size: var(--text-base);
}

.hero__btn-icon {
  transition: transform 300ms var(--ease-out-expo);
}

.hero__btn:hover .hero__btn-icon {
  transform: translateX(3px);
}

.hero__link {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text-heading);
  text-decoration: underline;
  text-decoration-color: var(--color-border);
  text-underline-offset: 6px;
  text-decoration-thickness: 1.5px;
  transition: text-decoration-color 200ms;
}

.hero__link:hover {
  text-decoration-color: var(--feed-green);
}

/* ---- Stage: video + feed ---- */
.hero__stage {
  position: relative;
  flex: 1;
  min-width: 0;
}

.hero--feed .hero__video {
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: calc(100dvh - 220px);
  margin-left: auto;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.hero--feed .hero__video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 30%;
  border-radius: inherit;
}

/* warm the bottom so the feed reads over the footage */
.hero--feed .hero__video::after {
  content: "";
  position: absolute;
  inset: 45% 0 0;
  border-radius: inherit;
  background: linear-gradient(to bottom, transparent, rgba(26, 24, 22, 0.45));
  pointer-events: none;
}

.hero__live {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  border-radius: 99px;
  background: rgba(250, 248, 243, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: #1a1816;
}

.hero__live-dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2d6a4f;
}

.hero__live-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #2d6a4f;
  animation: hero-ping 2s var(--ease-out-expo) infinite;
}

@keyframes hero-ping {
  from { transform: scale(1); opacity: 0.6; }
  to { transform: scale(3); opacity: 0; }
}

/* ---- Feed ---- */
.feed {
  position: absolute;
  left: -72px;
  bottom: var(--space-xl);
  z-index: 2;
  width: min(384px, 94%);
}

.feed__head {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin: 0 0 38px;
  padding: 0 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.feed__new {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.feed__new::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7fd1a6;
}

.feed__list {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  height: 80px;
}

.feed__item {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0 0.9rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  box-shadow: 0 14px 34px -10px rgba(26, 24, 22, 0.28), 0 2px 6px rgba(26, 24, 22, 0.06);
  transform-origin: 50% 0;
  transition:
    transform 700ms var(--ease-out-expo),
    opacity 700ms var(--ease-out-expo);
}

/* stack: 0 = newest, in front; 1 and 2 tuck in behind, above it */
.feed__item[data-pos="0"] { z-index: 3; transform: none; opacity: 1; }
.feed__item[data-pos="1"] { z-index: 2; transform: translateY(-14px) scale(0.94); opacity: 0.75; }
.feed__item[data-pos="2"] { z-index: 1; transform: translateY(-26px) scale(0.88); opacity: 0.45; }
.feed__item[data-pos="in"] { z-index: 4; transform: translateY(28px) scale(1.02); opacity: 0; transition: none; }

.feed__item:not([data-pos="0"]) > * {
  opacity: 0;
  transition: opacity 300ms;
}

.feed__logo {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--color-text-heading);
  color: var(--color-bg-primary);
  font-family: var(--font-heading);
  font-size: 1.5rem;
  line-height: 1;
}

.feed__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.feed__name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed__sig {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  align-self: flex-start;
  padding: 0.15rem 0.5rem 0.15rem 0.4rem;
  border-radius: 99px;
  background: var(--color-accent-green-pale);
  color: var(--feed-green);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.feed__sig svg {
  width: 13px;
  height: 13px;
}

.feed__chips {
  position: relative;
  display: flex;
  gap: 5px;
  flex: none;
}

.feed__chip {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--color-bg-secondary);
  color: var(--color-text-body);
  box-shadow: 0 0 0 2px var(--color-bg-card);
}

.feed__chip svg {
  width: 14px;
  height: 14px;
}

.feed__chip--face {
  background: color-mix(in srgb, var(--color-accent-terracotta) 18%, var(--color-bg-card));
  color: var(--color-accent-terracotta);
  font-size: 0.6875rem;
  font-weight: 600;
}

.feed__ok {
  position: absolute;
  right: -5px;
  top: -6px;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--feed-green);
  color: #fff;
  box-shadow: 0 0 0 2px var(--color-bg-card);
}

.feed__ok svg {
  width: 10px;
  height: 10px;
  stroke-width: 3.5;
}

/* ---- Load-in: one short, ordered entrance ---- */
@media (prefers-reduced-motion: no-preference) {
  .hero--feed .hero__heading,
  .hero--feed .hero__subtitle,
  .hero--feed .hero__ctas {
    animation: hero-rise 900ms var(--ease-out-expo) both;
  }

  .hero--feed .hero__subtitle { animation-delay: 120ms; }
  .hero--feed .hero__ctas { animation-delay: 220ms; }

  .hero--feed .hero__video {
    animation: hero-fade 1100ms var(--ease-out-expo) 150ms both;
  }

  .hero--feed .feed {
    animation: hero-feed-in 900ms var(--ease-out-expo) 650ms both;
  }
}

@keyframes hero-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

@keyframes hero-fade {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes hero-feed-in {
  from { opacity: 0; transform: translate(-16px, 16px); }
  to { opacity: 1; transform: none; }
}

/* ---- Responsive ---- */
/* short laptop screens: keep the whole hero above the fold */
@media (min-width: 769px) and (max-height: 780px) {
  .hero--feed .hero__heading {
    font-size: clamp(2.75rem, 1rem + 4.6vh + 1.6vw, 4.25rem);
  }

  .hero--feed .hero__subtitle {
    margin-bottom: var(--space-xl);
  }
}

/* tall tablets: don't stretch the hero to a full portrait screen */
@media (max-width: 1024px) and (orientation: portrait) {
  .hero--feed {
    min-height: 0;
    padding-top: calc(var(--space-3xl) + 80px);
    padding-bottom: var(--space-3xl);
  }
}

@media (max-width: 1024px) {
  .hero--feed .hero__split {
    gap: var(--space-2xl);
  }

  .feed {
    left: -40px;
  }
}

@media (max-width: 768px) {
  .hero--feed .hero__content {
    flex: none;
    max-width: 100%;
  }

  .hero--feed .hero__heading {
    font-size: clamp(2.6rem, 1.4rem + 6vw, 3.5rem);
  }

  .hero__stage {
    width: 100%;
  }

  .hero--feed .hero__video {
    aspect-ratio: 5 / 4;
    max-height: none;
  }

  .feed {
    left: var(--space-md);
    right: var(--space-md);
    bottom: var(--space-md);
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .feed__item,
  .feed__item > * {
    transition: none;
  }

  .hero__live-dot::after {
    animation: none;
  }
}
