/* ==========================================================
   VyaaparPe — Custom stylesheet
   "Obsidian Emerald" design system + interaction states.
   Tailwind (via CDN, configured in index.html) covers layout
   utility classes; this file carries what Tailwind's utility
   set can't: keyframe animations, focus rings, the requirement
   form's success state, and the WhatsApp/mobile-menu overlays.
   ========================================================== */

:root {
  --color-primary: #47e262;
  --color-on-primary: #00390e;
  --color-surface: #121414;
  --color-surface-container-lowest: #0d0f0f;
}

/* Fixed navbar is h-20 (80px). Every in-page scroll target needs this
   offset so scrollIntoView() (used by nav links and goToRequirementForm)
   doesn't land the section's top edge underneath the fixed nav. */
section[id] {
  scroll-margin-top: 96px;
}

/* Skip link — visible only on keyboard focus */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 200;
  background: var(--color-primary);
  color: var(--color-on-primary);
  padding: 12px 20px;
  border-radius: 0 0 8px 0;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
}

/* Visible focus states everywhere (accessibility requirement) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}
.fill-icon {
  font-variation-settings: "FILL" 1;
}

/* Accordion transitions */
.accordion-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 300ms ease-out;
}
.accordion-content.open {
  grid-template-rows: 1fr;
}
.accordion-inner {
  overflow: hidden;
}
.chevron {
  transition: transform 300ms ease-out;
}
.open .chevron {
  transform: rotate(180deg);
}

/* Briefly highlight a section the user was navigated to */
.destination-highlight {
  animation: destinationPulse 1.6s ease-out;
}
@keyframes destinationPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(71, 226, 98, 0.55);
  }
  100% {
    box-shadow: 0 0 0 24px rgba(71, 226, 98, 0);
  }
}

.glow-hover:hover {
  box-shadow: 0px 10px 30px rgba(0, 75, 28, 0.2);
  border-color: rgba(71, 226, 98, 0.3);
}

/* Custom scrollbar for dark theme */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #121414;
}
::-webkit-scrollbar-thumb {
  background: #333535;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #47e262;
}

/* ----------------------------------------------------------
   Hero "live wallpaper" — cinematic slideshow.
   6 images, each visible ~6s (5s solid hold + shares a 1s
   crossfade with its neighbor on each side, so transitions
   overlap smoothly rather than cutting to black between
   images), followed by a genuine ~2s black interval, then the
   whole 39s cycle repeats indefinitely. Includes a subtle
   Ken Burns zoom for a premium, cinematic feel.
   ---------------------------------------------------------- */
@keyframes liveWallpaper {
  0% {
    opacity: 0;
    transform: scale(1) translate(0, 0);
  }
  2.564% {
    opacity: 1;
    transform: scale(1.01) translate(-0.1%, -0.1%);
    animation-timing-function: ease-in-out;
  }
  15.385% {
    opacity: 1;
    transform: scale(1.045) translate(-0.6%, -0.6%);
    animation-timing-function: ease-in-out;
  }
  17.949% {
    opacity: 0;
    transform: scale(1.06) translate(-0.8%, -0.8%);
  }
  100% {
    opacity: 0;
    transform: scale(1.06) translate(-0.8%, -0.8%);
  }
}

.bg-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
  opacity: 0;
  animation: liveWallpaper 39s infinite linear;
}
.bg-slide:nth-child(1) { animation-delay: 0s; }
.bg-slide:nth-child(2) { animation-delay: 6s; }
.bg-slide:nth-child(3) { animation-delay: 12s; }
.bg-slide:nth-child(4) { animation-delay: 18s; }
.bg-slide:nth-child(5) { animation-delay: 24s; }
.bg-slide:nth-child(6) { animation-delay: 30s; }

/* Mobile menu transitions */
#mobile-menu-wrapper {
  transition: visibility 0.3s, opacity 0.3s;
}
#mobile-menu-backdrop {
  transition: opacity 0.3s ease-out;
}
#mobile-menu-panel {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease-out;
  transform: scale(0.95) translateY(10px);
  opacity: 0;
}
#mobile-menu-wrapper:not(.opacity-0) #mobile-menu-panel {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* ----------------------------------------------------------
   3D founder-name flip animation — preserved from the original
   ---------------------------------------------------------- */
.founder-stage {
  perspective: 1000px;
  width: 100%;
  height: 80px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.founder-rotator {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  animation: flipFounder 6s cubic-bezier(0.25, 1, 0.25, 1) infinite;
}
.founder-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}
.founder-face.back {
  transform: rotateY(180deg);
}

@keyframes flipFounder {
  0%, 30% {
    transform: rotateY(0deg) scale(1);
    text-shadow: 0 0 0 rgba(71, 226, 98, 0);
  }
  40% {
    transform: rotateY(90deg) scale(0.96);
    text-shadow: 0 0 20px rgba(71, 226, 98, 0.4);
  }
  50%, 80% {
    transform: rotateY(180deg) scale(1);
    text-shadow: 0 0 0 rgba(71, 226, 98, 0);
  }
  90% {
    transform: rotateY(270deg) scale(0.96);
    text-shadow: 0 0 20px rgba(71, 226, 98, 0.4);
  }
  100% {
    transform: rotateY(360deg) scale(1);
    text-shadow: 0 0 0 rgba(71, 226, 98, 0);
  }
}

.founder-name {
  font-size: 1.25rem;
  text-align: center;
}
@media (min-width: 768px) {
  .founder-name {
    font-size: 1.875rem;
  }
}
@media (min-width: 1024px) {
  .founder-name {
    font-size: 2.25rem;
  }
}
.founder-separator {
  font-weight: 300;
  opacity: 0.85;
  margin: 0 0.05em;
}

@media (prefers-reduced-motion: reduce) {
  .founder-rotator {
    animation: none;
  }
  .bg-slide {
    animation: none;
    opacity: 1;
  }
  .bg-slide:not(:first-child) {
    display: none;
  }
  * {
    scroll-behavior: auto !important;
  }
}

/* ----------------------------------------------------------
   WhatsApp contact-picker modal
   ---------------------------------------------------------- */
#whatsapp-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#whatsapp-modal.hidden {
  display: none;
}
#whatsapp-modal .modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.25s ease-out;
}
#whatsapp-modal .modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  transform: scale(0.95) translateY(10px);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease-out;
}
#whatsapp-modal.is-open .modal-backdrop {
  opacity: 1;
}
#whatsapp-modal.is-open .modal-panel {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Two identical cards, side-by-side on desktop/tablet, stacked on mobile
   (see the grid-cols-1 sm:grid-cols-2 wrapper in index.html). */
.whatsapp-contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  padding: 24px 16px;
  border-radius: 12px;
  border: 1px solid rgba(61, 74, 59, 0.4);
  background: #1a1c1c;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.whatsapp-contact-card:hover,
.whatsapp-contact-card:focus-visible {
  border-color: rgba(71, 226, 98, 0.5);
  background: #1e2020;
  transform: translateY(-1px);
}

/* ----------------------------------------------------------
   Requirement form — validation + submit states
   ---------------------------------------------------------- */
.form-field.has-error input,
.form-field.has-error textarea {
  border-color: #ffb4ab !important;
}
.field-error {
  color: #ffb4ab;
  font-size: 12px;
  margin-top: 4px;
}

.requirement-submit-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 200px;
  transition: background-color 0.3s ease, opacity 0.3s ease;
}
.requirement-submit-btn:disabled {
  cursor: not-allowed;
}
.requirement-submit-btn.is-success {
  background-color: #2c3b30 !important;
  color: #92d698 !important;
  box-shadow: none !important;
}
.submit-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(0, 57, 14, 0.35);
  border-top-color: #00390e;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .submit-spinner {
    animation: none;
  }
}

.form-status {
  font-size: 14px;
  min-height: 20px;
}

/* Honeypot field — hidden from sighted users and kept out of the tab order,
   but still present in the DOM for simple bots to fall into. */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
