/*
 * Flywheeler design system
 */

html {
  scroll-behavior: smooth;
}

/* Offset anchor targets for fixed nav (~72px tall) */
[id] {
  scroll-margin-top: 72px;
}

/* ── Base typography ── */
body {
  font-family: 'Chakra Petch', sans-serif;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Chakra Petch', sans-serif;
}

:root {
  --fw-dark:   13 13 11;
  --fw-light:  245 242 236;
  --fw-accent: 224 122 61;
}

/* ── Reveal scroll animations ── */
[data-controller~="reveal"] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

[data-controller~="reveal"].revealed {
  opacity: 1;
  transform: translateY(0);
}

.rd1 { transition-delay: 0.10s; }
.rd2 { transition-delay: 0.20s; }
.rd3 { transition-delay: 0.30s; }
.rd4 { transition-delay: 0.40s; }

/* ── Hero fade-up ── */
@keyframes hero-fade-up {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-fade {
  animation: hero-fade-up 1.4s ease forwards;
  opacity: 0;
}

.hero-d1 { animation-delay: 0.15s; }
.hero-d2 { animation-delay: 1.25s; }
.hero-d3 { animation-delay: 2.25s; }
.hero-d4 { animation-delay: 4.00s; }

/* ── CRM signal column reveal (table) ── */
.crm-col-shrink {
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-width 0.6s cubic-bezier(0.4,0,0.2,1), opacity 0.5s ease 0.15s;
  white-space: nowrap;
  padding: 0 !important;
}
.crm-col-shrink.crm-col-open {
  max-width: 220px;
  opacity: 1;
}

/* ── CRM signal row reveal (card grid) ── */
.crm-row-hidden {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.5s cubic-bezier(0.4,0,0.2,1), opacity 0.4s ease 0.1s;
}
.crm-row-hidden.crm-col-open {
  max-height: 48px;
  opacity: 1;
}

/* ── CRM text stage swap animation ── */
@keyframes crm-text-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.crm-text-animate {
  animation: crm-text-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ── CRM row slide-in animation ── */
@keyframes crm-slide {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Calendar meeting pop animation ── */
@keyframes cal-pop {
  from { opacity: 0; transform: translateY(-6px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Activity log row animation ── */
@keyframes log-in {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}

.log-animate {
  opacity: 0;
  animation: log-in 0.5s ease forwards;
}

/* ── FAQ panel (two-column fixed-height) ── */
.faq-panel-active {
  color: rgb(var(--ld-dark));
  opacity: 1;
}
.faq-panel-active .faq-panel-num {
  color: rgb(0 68 255);
}

/* ── FAQ accordion ── */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  padding-bottom: 0;
  transition: max-height 0.4s ease, padding-bottom 0.4s ease;
}

.faq-answer.open {
  max-height: 400px;
  padding-bottom: 1.25rem;
}

/* ── Tool marquee ── */
@keyframes mq-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.mq-track {
  display: flex;
  width: max-content;
  animation: mq-scroll 40s linear infinite;
}

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

/* ── Button slide hover ── */
.btn-slide {
  position: relative;
  overflow: hidden;
  display: inline-block;
  transition: opacity 0.2s ease;
}

.btn-slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.10);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.btn-slide:hover::after {
  transform: translateX(0);
}

/* ── Pipeline graph animation ── */
@keyframes draw-graph {
  from { stroke-dashoffset: 1800; }
  to   { stroke-dashoffset: 0; }
}

.graph-line {
  stroke-dasharray: 1800;
  stroke-dashoffset: 1800;
}

.graph-line-animate {
  animation: draw-graph 1.8s ease forwards;
}

/* ── Timeline (HOW IT WORKS style) ── */
.tl-fill { transition: height .3s cubic-bezier(.4,0,.2,1); }
.tl-dot-inner { transition: width .4s cubic-bezier(.16,1,.3,1), height .4s cubic-bezier(.16,1,.3,1), background .3s ease; }
.tl-step.active .tl-dot-inner { width: 48px; height: 48px; background: rgb(0 68 255); }
.tl-dot-num { opacity: 0; transition: opacity .3s ease .15s; }
.tl-step.active .tl-dot-num { opacity: 1; color: #fff; }
.tl-step-title { opacity: .15; transition: opacity .5s ease; }
.tl-step.active .tl-step-title { opacity: 1; }
.tl-detail { opacity: 0; visibility: hidden; transition: opacity .4s ease, visibility .4s ease; padding: 12px 0 40px; }
.tl-step.active .tl-detail { opacity: 1; visibility: visible; }
.tl-step.final.active .tl-step-title { color: inherit; }

@media (max-width: 768px) {
  .tl-step.active .tl-dot-inner { width: 36px; height: 36px; }

  /* Cards — smaller text + tighter padding */
  .tl-detail .px-5 { padding-left: 0.75rem; padding-right: 0.75rem; }
  .tl-detail .px-7 { padding-left: 0.75rem; padding-right: 0.75rem; }
  .tl-detail .py-4 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
  .tl-detail .py-3 { padding-top: 0.4rem; padding-bottom: 0.4rem; }
  .tl-detail .py-2 { padding-top: 0.3rem; padding-bottom: 0.3rem; }
  .tl-detail .p-7 { padding: 0.75rem; }
  .tl-detail .text-sm { font-size: 0.7rem; line-height: 1.15rem; }
  .tl-detail .text-base { font-size: 0.75rem; line-height: 1.15rem; }
  .tl-detail .gap-2 { gap: 0.35rem; }
  .tl-detail .gap-3 { gap: 0.5rem; }
  .tl-detail .space-y-3 > * + * { margin-top: 0.5rem; }

  /* All steps open on mobile — no scroll-reveal */
  .tl-step { min-height: auto !important; padding-top: 3rem; }
  .tl-dot-num { opacity: 1; color: #fff; }
  .tl-step .tl-dot-inner { width: 36px; height: 36px; background: rgb(0 68 255); }
  .tl-step-title { opacity: 1; }
  .tl-detail { opacity: 1; visibility: visible; }
}

/* ── Nav scrolled state ── */
.nav-scrolled {
  background: rgba(36,36,36,0.92) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding-top: 0.75rem !important;
  padding-bottom: 0.75rem !important;
}

/* ── Modal ── */
#lead-modal input:focus,
#lead-modal textarea:focus {
  border-color: rgba(0, 68, 255, 0.6);
  outline: none;
}

.modal-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='rgba(210,210,210,0.35)' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.modal-select:focus {
  border-color: rgba(0, 68, 255, 0.6);
  outline: none;
}

/* ── Flash notifications ── */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(20px); }
}

.animate-flash-enter { animation: slideUp 0.3s ease-out forwards; }
.animate-flash-leave { animation: slideDown 0.3s ease-in forwards; }

/* ── Nav ── */
.fw-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(13,13,11,0.85);
  border-bottom: 1px solid rgba(245,242,236,0.06);
}
