/* ==========================================================================
   Parlay Agency — custom styles & overrides
   ========================================================================== */

:root {
  --ink: #1e1e1e;
  --brand: #f36c21;
  --accent: #7cb841;
}

html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

section[id],
div[id] {
  scroll-margin-top: 96px;
}

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

/* ---------- Header ---------- */
.site-header {
  backdrop-filter: blur(12px);
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

.site-header.is-stuck {
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.55);
  background-color: rgba(30, 30, 30, 0.94);
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  height: 2px;
  width: 100%;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.nav-link:hover::after,
.nav-link.is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-link.is-active {
  color: #fff;
}

/* ---------- Mobile menu ---------- */
#mobile-menu {
  display: none;
}

#mobile-menu.is-open {
  display: block;
  animation: menu-in 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes menu-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 32s linear infinite;
}

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

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.reveal[data-delay="1"] { transition-delay: 0.1s; }
.reveal[data-delay="2"] { transition-delay: 0.2s; }
.reveal[data-delay="3"] { transition-delay: 0.3s; }
.reveal[data-delay="4"] { transition-delay: 0.4s; }
.reveal[data-delay="5"] { transition-delay: 0.5s; }

/* ---------- FAQ accordion ---------- */
.faq-item {
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.faq-item.is-open {
  border-color: rgba(243, 108, 33, 0.7);
  box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.7);
}

.faq-item.is-open .faq-icon {
  transform: rotate(45deg);
  background: var(--brand);
  color: var(--ink);
}

.faq-icon {
  transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

.faq-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.faq-panel > div {
  overflow: hidden;
}

.faq-item.is-open .faq-panel {
  grid-template-rows: 1fr;
}

/* ---------- Stat counters ---------- */
.stat-value {
  font-variant-numeric: tabular-nums;
}

/* ---------- Floating buttons ---------- */
.fab {
  transition: transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
}

.fab:hover {
  transform: translateY(-4px) scale(1.05);
}

#back-to-top {
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
}

#back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ---------- Contact form ---------- */
.field {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.field:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(243, 108, 33, 0.25);
  background-color: rgba(255, 255, 255, 0.08);
}

.field.is-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
}

.error-text {
  display: none;
}

.field.is-invalid + .error-text {
  display: block;
}

/* ---------- Offer popup (mobile) ---------- */
#offer-modal {
  display: none;
}

#offer-modal.is-open {
  display: flex;
  animation: offer-fade 0.28s ease both;
}

#offer-modal .offer-card {
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  animation: offer-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes offer-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes offer-in {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

@media (min-width: 768px) {
  #offer-modal,
  #offer-modal.is-open,
  #offer-modal .offer-card {
    display: none;
    animation: none;
  }
}

/* ---------- Misc ---------- */
.card-hover {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}

.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 60px -34px rgba(0, 0, 0, 0.7);
}

.grain {
  background-image: radial-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 22px 22px;
}

.step-line::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.2) 0 8px, transparent 8px 16px);
  z-index: 0;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
