/* css/components.css */
.logo {
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-2xl);
}

/* Ensure image logo displays crisply and avoids layout shift */
.logo img {
  display: block;
  height: 28px;
  width: auto;
}

@media (min-width: 768px) {
  .logo img {
    height: 32px;
  }
}

.feature-card {
  text-align: left;
}

.feature-card img {
  width: 60%;
  height: auto;
  display: block;
  border-radius: 0.5rem;
  margin: 0 auto var(--space-lg);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.06));
  transition: transform 0.3s ease, filter 0.3s ease;
}

.feature-card:hover img,
.feature-card:focus-within img {
  transform: scale(1.02);
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
}

.feature-card h3 {
  margin-bottom: var(--space-sm);
  text-align: center;
}

.feature-card p {
  color: var(--color-text-secondary);
}

.button-group {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* Video Hero (base) */
.hero-image-wrapper {
  position: relative;
  isolation: isolate;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-background);
  /* Match page background */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 320ms ease-in-out, visibility 320ms linear;
  border: none;
  z-index: 5;
}

iframe.hero-video {
  border: none;
}

.hero-video:not(iframe) {
  object-fit: cover;
}

.hero-static-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  visibility: visible;
  transition: opacity 320ms ease-in-out, visibility 320ms linear;
}

/* Switching states: image/overlay vs video */
.hero-image-wrapper.is-video-active .hero-video {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 5;
}

.hero-image-wrapper.is-video-active .hero-video:not(iframe) {
  object-fit: contain;
}

/* Position the player over the app-screenshot region of the static image
   (3820x2144 mockup with the app window inset roughly 14% L/R, 10% T, 5% B). */
.hero-image-wrapper.is-video-active iframe.hero-video {
  top: 7.5%;
  left: 14%;
  right: auto;
  bottom: auto;
  width: 72%;
  height: 85%;
}

.hero-image-wrapper.is-video-active .hero-static-image {
  /* Image stays visible — iframe is positioned over the screenshot region. */
  pointer-events: none;
}

.hero-image-wrapper.is-video-active .play-button-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Loading/buffering state */
.hero-image-wrapper.is-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.15);
  z-index: 15;
  pointer-events: none;
}

.hero-image-wrapper.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin-left: -20px;
  margin-top: -20px;
  border: 3px solid rgba(255, 255, 255, 0.5);
  border-top-color: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  animation: hero-spinner 0.8s linear infinite;
  z-index: 16;
  pointer-events: none;
}

@keyframes hero-spinner {
  to {
    transform: rotate(360deg);
  }
}

/* Play Button Overlay (base) */
.hero-image-wrapper>.play-button-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  z-index: 10;
  transition: transform 150ms ease-in-out, filter 150ms ease-in-out, opacity 320ms ease-in-out;
  transform-origin: center center;
}

.hero-image-wrapper>.play-button-overlay .play-icon {
  display: block;
  width: 72px;
  height: 72px;
  transition: transform 100ms ease-in-out, filter 100ms ease-in-out, fill 100ms ease-in-out;
  transform-origin: center;
  transform-box: fill-box;
}

.hero-image-wrapper>.play-button-overlay:focus-visible {
  outline: none;
}

.hero-image-wrapper>.play-button-overlay:focus-visible::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 104px;
  height: 104px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  box-shadow: 0 0 0 3px var(--color-focus-ring), 0 0 0 11px rgba(59, 130, 246, 0.18);
  pointer-events: none;
  z-index: 12;
}

/* Hover states for play button */
.hero-image-wrapper>.play-button-overlay:hover .play-icon,
.hero-image-wrapper>.play-button-overlay:focus-visible .play-icon {
  transform: scale(1.12);
}

.hero-image-wrapper>.play-button-overlay:hover,
.hero-image-wrapper>.play-button-overlay:focus-visible {
  transform: scale(1.02);
  filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.18));
}

.hero-image-wrapper>.play-button-overlay:hover .play-icon circle,
.hero-image-wrapper>.play-button-overlay:focus-visible .play-icon circle {
  fill: rgba(255, 255, 255, 1);
}

@media (prefers-reduced-motion: reduce) {
  .hero-image-wrapper>.play-button-overlay .play-icon {
    transition: none;
  }
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--color-primary);
  color: var(--color-primary-text);
  padding: 8px;
  border-radius: 0 0 4px 4px;
  text-decoration: none;
  z-index: 1000;
}

.skip-link:focus {
  top: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Navigation link styles */
.nav-links a:not(.btn):not(.dropdown-toggle) {
  color: var(--color-text);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  position: relative;
  padding: 0 var(--space-sm);
  transition: color 0.2s ease-in-out;
}

.nav-links a:not(.btn):not(.dropdown-toggle):hover,
.nav-links a:not(.btn):not(.dropdown-toggle):focus-visible {
  color: var(--color-primary);
}

.nav-links a:not(.btn):not(.dropdown-toggle):hover::after,
.nav-links a:not(.btn):not(.dropdown-toggle):focus-visible::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background-color: var(--color-primary);
  transform: scaleX(1);
}

.nav-links a:not(.btn):not(.dropdown-toggle)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background-color: var(--color-primary);
  transform: scaleX(0);
  transition: transform 0.2s ease-in-out;
}

.nav-links a:not(.btn):not(.dropdown-toggle):focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}

.nav-links a:not(.btn):not(.dropdown-toggle):active {
  color: var(--color-primary-dark);
}

/* Footer navigation links */
.footer-nav a {
  color: var(--color-text-secondary);
  text-decoration: none;
  position: relative;
  transition: color 0.2s ease-in-out;
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
  color: var(--color-primary);
}

.footer-nav a:hover::after,
.footer-nav a:focus-visible::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background-color: var(--color-primary);
  transform: scaleX(1);
}

.footer-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background-color: var(--color-primary);
  transform: scaleX(0);
  transition: transform 0.2s ease-in-out;
}

.footer-nav a:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}

/* Current page navigation state (via aria-current) */
.nav-links a[aria-current="page"]:not(.dropdown-toggle):not(.btn),
.footer-nav a[aria-current="page"]:not(.btn) {
  color: var(--color-text);
  font-weight: var(--font-weight-semibold);
}

.nav-links a[aria-current="page"]:not(.dropdown-toggle):not(.btn)::after,
.footer-nav a[aria-current="page"]:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background-color: var(--color-primary);
  transform: scaleX(1);
}

/* Dropdown Navigation */
.dropdown {
  position: relative;
}

.dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--color-text);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  font-size: inherit;
  font-family: inherit;
  background: none;
  border: none;
  padding: var(--space-xs) var(--space-sm);
  border-radius: 6px;
  transition: all 0.2s ease-in-out;
  position: relative;
}

.dropdown-toggle:hover,
.dropdown-toggle:focus-visible {
  color: var(--color-primary);
  background-color: var(--color-background-subtle);
}

.dropdown-toggle:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}

.dropdown-toggle:active {
  color: var(--color-primary-dark);
}

/* Ensure dropdown toggle never gets underline */
.dropdown-toggle::after {
  display: none !important;
}

.dropdown-icon {
  transition: transform 0.2s ease-in-out;
}

.dropdown.active .dropdown-icon {
  transform: rotate(180deg);
}

.dropdown-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Desktop dropdown styles */
@media (min-width: 900px) {
  .dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    min-width: 260px;
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-xl);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.08);
    padding: var(--space-md) 0;
    margin-top: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.98);
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
      transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
      visibility 0.25s linear;
    z-index: 100;
    overflow: hidden;
    backdrop-filter: blur(8px);
  }

  /* subtle pointer */
  .dropdown-menu::before {
    content: "";
    position: absolute;
    top: -7px;
    left: 28px;
    width: 14px;
    height: 14px;
    background: var(--color-surface-elevated);
    transform: rotate(45deg);
    border-left: 1px solid var(--color-border-subtle);
    border-top: 1px solid var(--color-border-subtle);
    border-top-left-radius: 4px;
    z-index: -1;
  }

  .dropdown.active .dropdown-menu,
  .dropdown:hover .dropdown-menu,
  .dropdown:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
  }

  .dropdown-menu li {
    margin: 0;
  }

  .dropdown-menu li+li {
    margin-top: 2px;
  }

  .dropdown-menu li:first-child a {
    margin-top: var(--space-xs);
  }

  .dropdown-menu li:last-child a {
    margin-bottom: var(--space-xs);
  }

  .dropdown-menu a {
    display: flex;
    align-items: center;
    padding: var(--space-md) var(--space-lg) !important;
    margin: 0 var(--space-xs);
    min-height: 44px;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-weight: var(--font-weight-normal);
    font-size: var(--font-size-base);
    line-height: 1.5;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
    border-radius: 10px;
    justify-content: flex-start;
  }

  /* underline animation scoped to text width */
  .dropdown-menu a .menu-label {
    position: relative;
    display: inline-block;
  }

  /* prevent global nav underline from appearing on dropdown links */
  .dropdown-menu a::after {
    display: none !important;
  }

  .dropdown-menu a .menu-label::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    background-color: var(--color-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s ease-in-out;
  }

  .dropdown-menu a:hover .menu-label::after,
  .dropdown-menu a:focus-visible .menu-label::after {
    transform: scaleX(1);
  }

  .dropdown-menu a:hover,
  .dropdown-menu a:focus-visible {
    background-color: transparent;
    color: var(--color-primary);
    transform: none;
  }

  .dropdown-menu a:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
  }

  .dropdown-menu a:active {
    background-color: transparent;
    transform: none;
  }

  /* Ensure dropdown text styles match footer (higher specificity) */
  .nav-links .dropdown .dropdown-menu a {
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-normal);
  }

  /* Show underline and styling for dropdown menu items when they're the current page */
  .dropdown-menu a[aria-current="page"]:not(.btn) {
    font-weight: var(--font-weight-semibold);
    position: relative;
    color: var(--color-text);
  }

  .nav-links .dropdown .dropdown-menu a[aria-current="page"]:not(.btn) {
    color: var(--color-text);
    font-weight: var(--font-weight-semibold);
  }

  .dropdown-menu a[aria-current="page"]:not(.btn) .menu-label::after {
    transform: scaleX(1);
  }

  /* Keep underline available for hover on all items */
}

/* Centered feature note */
.feature-note-centered {
  text-align: center;
  max-width: 60ch;
  margin: var(--space-xl) auto 0;
  color: var(--color-text-secondary);
  font-style: italic;
}

/* Comparison grid styles */
.comparison-grid-spacing {
  margin-top: var(--space-xl);
}

.comparison-heading {
  font-size: var(--font-size-lg);
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.comparison-list {
  padding-left: var(--space-xl);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
}

.comparison-list-item {
  margin-bottom: var(--space-xs);
}

/* Mobile dropdown styles */
@media (max-width: 899px) {
  .dropdown-menu {
    display: none;
    padding-left: 0;
    margin-top: var(--space-md);
    padding-top: var(--space-sm);
    padding-bottom: var(--space-sm);
    width: 100%;
    text-align: center;
  }

  .dropdown.active .dropdown-menu {
    display: block;
    animation: slideDown 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }

  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-12px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .dropdown-menu li {
    margin: var(--space-sm) 0;
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .dropdown-menu a {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text);
    text-decoration: none;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    padding: var(--space-sm) 0;
    min-height: 44px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    line-height: 1.5;
    width: 100%;
    text-align: center;
  }

  .dropdown-menu a:hover,
  .dropdown-menu a:focus-visible {
    color: var(--color-primary);
  }

  .dropdown-menu a:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 4px;
    border-radius: 6px;
  }

  /* Show underline for mobile dropdown menu items when they're the current page */
  .dropdown-menu a[aria-current="page"]:not(.btn) {
    font-weight: var(--font-weight-semibold);
  }

  .dropdown-menu a[aria-current="page"]:not(.btn)::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: var(--space-md);
    width: 100%;
    height: 2px;
    background-color: var(--color-primary);
    transform: scaleX(1);
    display: block;
  }

  /* Remove underline for mobile dropdown items that aren't current */
  .dropdown-menu a:not([aria-current="page"])::after {
    display: none;
  }
}

/* Social Proof Section (Reusable) */
.social-proof-section {
  text-align: center;
  max-width: 900px;
  margin: 0 auto var(--space-4xl);
}

.social-proof-section h3 {
  font-size: var(--font-size-base);
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-xl);
}

.integration-logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-lg);
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.logo-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  width: 150px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.logo-card:not(.no-hover):hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.company-logo {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
}

@media (max-width: 480px) {
  .logo-card {
    width: 130px;
    height: 130px;
    padding: var(--space-sm);
  }

  .integration-logos {
    gap: var(--space-md);
  }
}

/* Marquee Animation */
.marquee-wrapper {
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  position: relative;
}

.marquee-track {
  display: flex !important;
  /* Override if needed, but we will use this class on the inner div */
  gap: var(--space-xl);
  width: max-content;
  animation: scroll 70s linear infinite;
  padding: var(--space-md) 0;
}

.marquee-track .logo-card {
  flex-shrink: 0;
}

.marquee-track:hover {
  animation-play-state: paused;
}

@keyframes scroll {
  0% {
    transform: translateX(0);
  }

  /* -50% alone lands half a gap before the start of the duplicate set
     (CSS `gap` goes between children, not after the last one), producing
     a visible snap on wrap. Shift by an extra gap/2 so the end of set 2
     exactly coincides with the start of set 1 visually. */
  100% {
    transform: translateX(calc(-50% - var(--space-xl) / 2));
  }
}

/* Demo video modal (landing pages — opens same embed as homepage hero) */
body.demo-modal-open {
  overflow: hidden;
}

.demo-video-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  box-sizing: border-box;
}

.demo-video-modal[hidden] {
  display: none !important;
}

.demo-video-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  cursor: pointer;
}

.demo-video-modal__panel {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  background: var(--color-background);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.demo-video-modal__close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  z-index: 2;
  padding: 0.4rem 1rem;
  font-size: var(--font-size-sm, 0.875rem);
}

.demo-video-modal__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-top: var(--space-lg);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
}

.demo-video-modal__iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
