/* Safety net: decorative elements are deliberately positioned to bleed past
   their container edge (negative offsets, rotate() overshoot on floating
   icons); this keeps that bleed from ever causing page-level horizontal
   scroll. Only ONE of html/body gets this — setting it on both turns body
   into its own nested scroll container and breaks the sticky header
   (position: sticky then sticks to body's box instead of the viewport). */
body {
  overflow-x: hidden;
}

.app-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.6);
}
.app-modal-backdrop[hidden] {
  display: none;
}
#app-modal {
  z-index: 101;
}
.custom-checkbox {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Hero visual (replaces the original Three.js scene, which had no
   server-rendered fallback to reconstruct). A floating orb with two
   independently-spinning decorative rings, tiltable on drag. */
.hero3d-stage {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1000px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.hero3d-stage:active {
  cursor: grabbing;
}
.hero3d-object {
  width: 58%;
  height: 58%;
  object-fit: contain;
  will-change: transform;
  filter: drop-shadow(0 0 60px color-mix(in oklab, var(--primary) 50%, transparent));
}
.hero3d-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid color-mix(in oklab, var(--primary) 35%, transparent);
  pointer-events: none;
}
.hero3d-ring-1 {
  width: 76%;
  height: 76%;
  animation: hero3d-spin 18s linear infinite;
}
.hero3d-ring-2 {
  width: 92%;
  height: 92%;
  border-style: dashed;
  opacity: 0.5;
  animation: hero3d-spin 30s linear infinite reverse;
}
@keyframes hero3d-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .hero3d-ring {
    animation: none !important;
  }
}

/* Mobile nav drawer (slide-in from the right, matches the original Sheet). */
#mobile-nav-backdrop {
  z-index: 100;
}
#mobile-nav {
  z-index: 101;
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
}
#mobile-nav-backdrop:not([hidden]) #mobile-nav {
  transform: translateX(0);
}
#mobile-nav a.active {
  color: var(--primary);
}

@media (max-width: 640px) {
  [role="tablist"] [role="tab"] {
    font-size: 9px;
  }
}

/* FAQ accordion: smooth height transition + breathing room under the answer
   text (custom.js drives max-height in px, this just eases it). */
.border-b[data-orientation="vertical"] [role="region"] {
  overflow: hidden;
  transition: max-height 0.35s ease;
  /* Neutralize the original site's animate-accordion-down/up keyframes
     (they key off --radix-accordion-content-height, which nothing sets now
     that Radix's JS is gone, and were fighting our own max-height
     transition, causing a visible stutter). */
  animation: none !important;
}
.border-b[data-orientation="vertical"] [role="region"] > p {
  padding-bottom: 20px;
}

/* Scroll progress bar: thin accent line pinned to the very top of the
   viewport, above the sticky header, filling left-to-right with scroll. */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--primary);
  z-index: 60;
  transition: width 0.1s linear;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  #scroll-progress {
    transition: none;
  }
}

/* Long-label CTA buttons/links (uppercase, tracked, whitespace-nowrap) don't
   shrink to fit narrow screens and were pushing the page into horizontal
   scroll. Let them wrap instead once space runs out. */
@media (max-width: 420px) {
  .whitespace-nowrap.uppercase.tracking-\[0\.18em\],
  .whitespace-nowrap.uppercase.tracking-\[0\.16em\],
  .whitespace-nowrap.uppercase.tracking-\[0\.14em\] {
    white-space: normal;
    text-align: start;
    line-height: 1.4;
  }
}
